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
#57500 - 05/21/20 12:42 PM Using showPDF if PDF available
ashoe Offline
OL Newbie

Registered: 01/12/12
Posts: 12
Is there a way to use showPDF but if no PDF is available have it continue on? Currently I use showPDF to select labels based on a filename derived from the input but in the event the workflow can not find a filename using the input it fails to complete the print process.

Thanks!

Top
#57501 - 05/21/20 12:49 PM Re: Using showPDF if PDF available [Re: ashoe]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
You can check if the file is valid (and therefore if it exists) by using pdfpagecount() before using showpdf().

Something like this:
Code:
if(pdfpagecount('mypdf.pdf')>0)
        showpdf('mypdf.pdf',1,8.5,11)
endif()
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#57502 - 05/21/20 12:52 PM Re: Using showPDF if PDF available [Re: ashoe]
jouberto Offline
OL Toddler

Registered: 04/18/18
Posts: 50
Hi ashoe,

You can first create an IF statement to validate the resource type of the file path and name. If the resource type = 6, it found your PDF and you can call it. IF it is not 6, skip the showpdf command.

documentation on how to use resourcetype:

https://help.objectiflune.com/en/planetpress-design-user-guide/7.6/Default_CSH.html#/3020.html

would look something like this:
if(resourcetype('filepathandnamehere')=6)
showpdf('filepathandnamehere',1)
endif()

Top
#57503 - 05/21/20 01:22 PM Re: Using showPDF if PDF available [Re: ashoe]
ashoe Offline
OL Newbie

Registered: 01/12/12
Posts: 12
Thank you both for the quick replies. I will add one of these if statements and see if that resolves the failed print jobs.

ashoe

Top