Skip navigation
Currently Being Moderated

How to Manage Text In PDF

May 9, 2012 6:17 AM

Hi everyone.

 

I am pretty new to PDF programming world and for study PDF ,I am prefering PDF specification.

I can manage Printing text on my page but when my text length goes out to the page range it get crop

..so my requirement is how to justified that text line on next line

please suggest how to manage this problem.

currently I am tackling this prob by

 

T*[()] TJ

 

but I have to do it manually..

 

 

thanks in advance.

 
Replies
  • Currently Being Moderated
    May 9, 2012 6:29 AM   in reply to jay.ant

    You will need to write a text layout engine and then using the layout information that you’ve produced, output the necessary PDF constructs.

     

    In order to do that, of course, you will need the font metrics.

     

    And at some point you will need to learn about font embedding, and then subsetting, and then encodings, and then ….

     

     

    Now you can see why we recommend that you use an existing PDF library instead of writing your own. You are just wasting your time…

     
    |
    Mark as:
  • Currently Being Moderated
    May 9, 2012 6:30 AM   in reply to jay.ant

    You have to do this manually. That is just one reason why it's in general a

    bad idea to create PDF files from scratch: You have to process all the font

    metrics yourself and find out how wide your text will be, and then position

    it accordingly on the page. When you use a PDF library or framework, that

    is usually done for you (or at least there are ways to get to that

    information in a much more user/programmer friendly way).

     

    Karl Heinz Kremer

    PDF Acrobatics Without a Net

     

    khk@khk.net

    http://www.khkonsulting.com

     
    |
    Mark as:
  • Currently Being Moderated
    May 9, 2012 6:57 AM   in reply to jay.ant

    Details on Font Metrics are in the PDF standard as well as the various specs for each font format.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points