Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print page range of an existing PDF file

Status
Not open for further replies.

ljzagorac

Programmer
Oct 20, 2009
7
US
Hi experts,

I can use the following to get total number of pages in a PDF file:

lcStr = filetostr(getfile('pdf'))

lnPOS = At("/Count",lcStr)
If lnPOS > 0
lcPageCount = alltrim(substr(lcStr, lnPOS, 9))
lnPageCount = VAL(STRTRAN(lcPageCount,'/Count',''))
?lnPageCount
endif

Anybody knows how to print page range say first 3 and last 4 pages?

Thanks guys!
 
Since what you want to control is the printing of an existing PDF document - your best bet would be to find a PDF Reader that allows you to control it from a VFP application via ActiveX controls.

Do a Google search for pdf reader activex and you will find quite a few listed.

Perhaps a PDF Printer with ActiveX controls would also work.

Good Luck,
JRB-Bldr
 
You might also try to check Glyph & Cog's XPDF suite of products. Maybe their XPDFPrint will do for you what you need.
(I, personally, used their XPDFViewer in 2003-2007) - and was quite happy with it!

Regards,

Ilya
 
I didn't find any good activex to go together with Adobe Reader 9 which is supposed to do hard copy printout of large PDF files.
Resolved so I use pdftk command line to burst large PDF file into as many files as the PDF has, then printing each page within specified range.

Anyway, thanks both JRB-Bldr and Ilya.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top