Solved

line breaks in pdf

Posted on 2004-09-29
6
3,719 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
  • 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 500 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe A recent question here at Experts Exchange piqued my interest, so I decided to provide a thorough solution and publ…
Power PDF (http://www.nuance.com/for-business/document-imaging-and-scanning/power-pdf-converter/index.htm) is the newest product from the Document Imaging division of Nuance Communications (http://www.nuance.com/). It is available in two editions — …
In this first video of the three-part Xpdf series, we introduce and describe Xpdf, a library containing nine command line utilities that perform various functions on PDF files. We show where the library is located and how to download it, discuss its…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now