current print page

Hi,

I couldn’t find an answer to my problem in the how-tos or forum, so here it goes:

I have an input pdf with an invisible text on every page, which specifies the print properties. There is for example a payment slip on a preprinted paper, which should be drawn from tray 3 on the targeted printer. There are records with payment slips and others without these in the data stream.

I have put these print properties into a detail-table in the data mapper, and this worked ok. But how can I design the template to change the media accordingly to the values of the detail table…

In the old designer, I would go to the document properties and say “if (paymentSlip) then inputslot 3”…

greets

-i.

You will need to control the Print Sections via script. Take a look at this post. I think it can help you.

https://learn.objectiflune.com/discourse/t/how-to-set-conditions-to-print-sections/475/1

There is an easier way. In the online documentation search for “Dynamically changing the Media.”

Thanks Sergio,

It was a good point, but I still don’t have an idea, how to get the current page and match it to my detail table for the current record…

best

-i.

Could you provide me with a sample template and datamapper so I can check it out?

I can not currently provide any data, because I’ll have to anonymize them, and that’ll cost a lot of time… But my question is still not answered. How do I get the current print page in the designer and use it further (in a script)?

Sections can be controlled via script (script control). Take a look at this documentation:

[http://help.objectiflune.com/EN/planetpress-connect-user-guide/1.4/#designer/Scripting/Control_Scripts.htm?Highlight=control script](http://help.objectiflune.com/EN/planetpress-connect-user-guide/1.4/#designer/Scripting/Control_Scripts.htm?Highlight=control script)

I will answer my own question.

It is not possible to get the current print page in the connect release. There is a possible workaround with switching sections for my problem, which fully would work in the next release.

Best

-ivan