Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

line breaks in pdf

Posted on 2004-09-29
6
Medium Priority
?
3,816 Views
Last Modified: 2011-07-08
is there any specific tag for line breaks in pdf suchs as <br> in html
0
Comment
Question by:sandeepaher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12179645
Depends ...

Where (and why) do you want to create a line break? Is it in a form field, or "real" PDF content?
0
 

Author Comment

by:sandeepaher
ID: 12179706
actuallly i am using a php library called EzPdf to create PDF documents. so when i supply some text from a TEXTAREA field the function which i use to out put  text "addTextWrap($text)" does not maintain the line breaks formatting.
so i was thinking of replacing "\n" in $text with the pdf tag for line break.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12179796
OK, you are talking about PDF content. There is no line break in PDF. A line break is simulated by advancing the cursor's vertical position by the line distance. If you read the PDF spec, you will notice that  there are not even lines in a PDF file: All text is organized in "text runs". A text run can be one character, one word, part of one word, a collection of words, ... There is no requirement that a text run is one line either. How text is actually organized depends on the program you use to create the PDF content - in your case this would be EzPdf, something I'm not familiar with (not yet :-). So, you need to look in the EzPdf documentation for information about how to force a line break. There is nothing that you can put into the PDF content (that is, if the EzPdf environment is not filtering the string and forcing the text to a new line behind the scenes) that would be interpreted as a line break by Acrobat.

What if you put your individual lines (or paragraphs) into separate addTextWrap() calls?
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 2000 total points
ID: 12179964
I took a brief look at the EzPdf package, and it looks like you can insert line breaks if you use the ezText() function. But again: This is not something that actually ends up in the PDF file, the ezText() function will parse the text and break it up into lines.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the questions I get asked again and again is how to validate a field value in an AcroForm with a custom validation script. Adobe provided a lot of infrastructure to do that with just a simple script. Let’s take a look at how to do that wit…
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe In a previous Experts Exchange article, How To Rename-Move a Batch of PDF Files Based on Contents of the Files (http://www.experts-exchan…
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question