Skip to Content

Count number of pages in PDF file

Hello,

I'm working on an ABAP program that gets a PDF file as a table of type TLINE to make some treatment on it.

Our requirement is to count the number of pages of the PDF file (basically using the TLINE table)

I searched a lot in the community, but nothing found !

Please give me any suggestions to solve this problem.

Thanks in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 22, 2015 at 05:44 PM

    If its an OTF format you can count the number of "EP"s in the OTF data. EP is the representation of end of page.

    Thanks

    Thrinath

    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      can't you just use the page counter of the spool request? An OTF job should have as many EP OTF commands as the page count of the spool request itself says...

      The page count of a spool request is stored in table field TSP01-RQAPPRULE.

      Regards,

        Alex

  • Oct 23, 2015 at 09:15 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 23, 2015 at 10:00 AM

    Hi,

    If you open any PDF in notepad/textpad/notepad++ you should see a line starts with "/Count" which actually gives you the no of pages for pdf. Not sure how you are generating the PDF, but  if you read the PDF in ASCII mode and do a search on "/Count" you should get the no of pages after a space after the string "/Count". Please see the screenshot below(Highlighted in yellow). This may be one of the option.

    R


    Capture.PNG (3.7 kB)
    Add comment
    10|10000 characters needed characters exceeded