Topic Options
#40084 - 07/16/12 07:11 AM Not printing document through PP image.
Mikew Offline
OL Newbie

Registered: 07/04/11
Posts: 30
I'm generating an invoice through PlanetPress design. Because the invoice has a variable amount of pages, I'm working out what the last page is as I generate, and then I am using Stopjob to terminate the document at the right page.

This works fine when I'm generating it as a PDF and then printing it using passthrough. However, when I try to generate the PDF via Image it does not work. It seems as if the Stopjob command is stopping image from completing generation. Does Image have a problem with Stopjob?

Top
#40086 - 07/16/12 09:59 AM Re: Not printing document through PP image. [Re: Mikew]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 3631
Loc: Objectif Lune Montreal
Mikew,

I've tested the stopjob command, and it does appear to work in PlanetPress Image. I've made a loop to display a page 100 times, but after the 10th page, it throws a stopjob to stop the job. The result is a 10 pages pdf, as expected.

With that said, I am not sure how this command would behave in a more complex document. This command forces the job to stop, no matter what it was doing. This may work fine with a simple PressTalk loop, but if there's a more complex PressTalk, many objects and layouts, it might not be a safe command to use to "break" in the middle of processing.

I would suggest to avoid using stopjob() and try a different approach to break. For example, you could simply put a condition on your page that will check whatever it needs to check to see if it's the last page or not, and then have the condition be false if it's beyond the last page. This way, you'd obtain a similar result, but you won't force the job to stop.

Regards,
Raphaël Lalonde Lefebvre

Top
#40101 - 07/17/12 06:00 AM Re: Not printing document through PP image. [Re: Raphael Lalonde Lefebvre]
Mikew Offline
OL Newbie

Registered: 07/04/11
Posts: 30
I've just tried using a page condition instead of Stopjob, and now it works fine. Thank-you very much.

Top