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
#44086 - 07/05/13 08:30 AM reorder 1 print job
.Patrick Offline
OL Toddler

Registered: 02/14/13
Posts: 31
Loc: The Netherlands
Hi all,

I want to reorder the pages from an print job. So lets say I got 5 pages.

page 1 must become page 3
page 2 to 1
page 3 to 5
page 4 to 2
page 5 to 4

is this possible??

Top
#44088 - 07/05/13 09:18 AM Re: reorder 1 print job [Re: .Patrick]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
Patrick,

What kind of print job are we talking about? What kind of data are you working with?

There are ways this can be done, but it depends on what type of data and job you are working with. For example, if you are working with a PDF data, you could use the PDF Api and a small script to reorder the pages of the incoming pdf file. If not, then you can do it with Metadata. You use a Create Metadata, and then either use the available metadata tools to try and reorder the pages, and if it doesn't work, then you can use a script and the Metadata API to reorder the pages via the metadata.

However, before we can go further with this, you'll have to give us more information about those print jobs.

Regards,
Raphaël Lalonde Lefebvre

Top
#44100 - 07/05/13 03:14 PM Re: reorder 1 print job [Re: .Patrick]
.Patrick Offline
OL Toddler

Registered: 02/14/13
Posts: 31
Loc: The Netherlands
Raphael,

The original print job is captured from the printer queue and then stored inside a folder on the server. After that another process picks it up again and then we need to rearrange the page order. When it picks it up again its an PDF file so we can work with an PDF file (And I guess thats the best way to do that??)

But with what api should it be done; and what little script is needed to do that. Can I do for example check for some text in a particular area and then give it a page number?? Or how does it work?

The pages itself:
All the pages have print information on it say:
"locBRD" (from location; and the city Breda) so we know it must be printed with information of Breda. On the pages there are distinct information so we know what page should go where. BUT there are also pages (sometimes 2, sometimes 5) that are tiff images included into the PDF and those images need to be relocated to another page order but all kept together.

Do you need more information?

And above all, thx in advance!

Top
#44101 - 07/05/13 04:32 PM Re: reorder 1 print job [Re: .Patrick]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
Patrick,

The PDF API can be used to change the order of the pages in a PDF. If you've never used it, you'll find basic information and command reference here:

http://help.objectiflune.com/en/planetpress-workflow-user-guide/Default_CSH.html#/5719.html

Also, here's an example vbscript that you can use in a Run Script action to get you started:

Code:
dim oPDF

set oPDF = Watch.GetPDFEditObject
oPDF.Open Watch.GetJobFileName, False
oPDF.Pages.Move 0, 1, 1
oPDF.Save False
oPDF.Close

oPDF = null



This script creates a PDF object, open the current job file(which is assumed to be a pdf), then use the "Move" command of the PDF API to swap the position of page 1 and 2. (refer to the documentation that I've linked for a reference on Move and it's parameters)

You can use as many Move commands as you want, so you can reorder the pages however you want. You will need to figure out how you want to reorder your pages, and it's possible some extra logic will be required, but the example script and the PDF API reference guide should help you getting started.

Regards,
Raphaël Lalonde Lefebvre

Top
#44103 - 07/06/13 02:43 AM Re: reorder 1 print job [Re: .Patrick]
.Patrick Offline
OL Toddler

Registered: 02/14/13
Posts: 31
Loc: The Netherlands
Ok I figured something out and I am testing now however I get an error on this part:

set Pages = GetMeta(SelectedPageCount[0], 11, Job)

It says it misses an ")" Column 38 (Thats before the [0]) But what is wrong with the above code??

And I get an "SelectedPageCount type mismatch" with this code:
Code:
Dim Pages, Count
set oPDF = Watch.GetPDFEditObject
Count = "0"

oPDF.Open Watch.GetJobFileName, False

If GetMeta(SelectedPageCount(0), 11, Job) <> 0 Then


And last; with this library can duplicate pages??


Edited by .Patrick (07/06/13 04:50 AM)

Top