IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#47887 - 05/14/14 04:41 AM Resource not a PDF
Dee Offline
OL Toddler

Registered: 10/04/13
Posts: 31
Hi,

I'm trying to create a document that adds external PDFs into it, I have it doing this via the showPDF in the document design.
I have created the document design and if I run it via the PlantPress Image within my watch process it generates fine. But when I run it through the Printer Queue Output get the following error "PTK0098: resource is not a PDF "W-BEN_FAQ_3.0.pdf" in showPDF with line showPDF(&gspdfname, & gnpdfpage, 0, 0)
Any ideas as to why I'm getting this error?
Thanks,
Dee.

Top
#47889 - 05/14/14 06:33 AM Re: Resource not a PDF [Re: Dee]
Dee Offline
OL Toddler

Registered: 10/04/13
Posts: 31
I've resolved this issue. I was initalising my variable for file path in the incorrect place in the document design.

Top
#57205 - 08/29/19 10:44 AM Re: Resource not a PDF [Re: Dee]
411 Offline
OL Newbie

Registered: 08/21/19
Posts: 1
I know this post is old, but what exactly did you do to resolve this issue?

Top
#57207 - 08/30/19 04:31 PM Re: Resource not a PDF [Re: Dee]
Sami786 Offline
OL Expert

Registered: 01/29/14
Posts: 400
Loc: Home
Hi Dee,

One way to add your external images on your document is that on the PressTalk After window add below code.

you can reference the number of pages you want to print. For example if you have 7 pages this code will print from page 1 to page 3 or you can say 1,7 to print all the pages.

@IncludePDF('image name here', true, 1, 3, false)


Option number two:
you could dynamically add your images by below code, this works for me:

Create on page and add below press talk on your page


define(&i,integer,0)
define(&j,integer,0)
for(&i,1,1,1)


&imagename:= trim(@(1,1,15))
&sPDFInvoiceName:='\\C:\\Test\\'+ &imagename + '.pdf'

if(ResourceType(&sPDFInvoiceName)>0)
for(&iPDFPageNo,1,1,pdfpagecount(&sPDFInvoiceName))
$PDF_Invoice
showpage
endfor
else
% $RouterNotFound
% showpage
endif
endfor

then add second page and add image object then change it to Overlay

open the setting in the image box type: =&sPDFInvoiceName
in the Page box type: =&iPDFPageNo

this will merge your dynamic images

I hope this helps

THANKS




Edited by Raphael Lalonde Lefebvre (09/03/19 01:46 PM)
Edit Reason: Removed some comments at poster's request.

Top
#57208 - 08/30/19 04:33 PM Re: Resource not a PDF [Re: Dee]
Sami786 Offline
OL Expert

Registered: 01/29/14
Posts: 400
Loc: Home
also add below global function

function @IncludePDF(&filename:string, &condition:boolean, &from:integer, &to:integer, &after:boolean)
if(&condition)
if(&to = 0)
&to := pdfpagecount(&filename)
endif()
define(&i,integer,0)
for(&i,&from,1,&to)
if(&after)
showPDF(&filename, &i, 8.5, 11.0)
showpage()
else()
showpage()
showPDF(&filename, &i, 8.5, 11.0)
endif()
endfor()
endif()
endfunction()
_________________________
Peace

Top