Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Count number of pages in PDF file

former_member355261
Participant
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

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

0 Kudos

Is there a function module to count number of EPs in the OTF data ?

0 Kudos

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

michael_kozlowski
Active Contributor
0 Kudos

Former Member
0 Kudos

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