Generating Consecutive Numbers in Dynamic Documents

23 views
Skip to first unread message

Johan Cyprich

unread,
Jun 28, 2024, 7:11:12 PM (5 days ago) Jun 28
to XMPie Interest Group
Hi. I'm trying to generate consecutive numbers to populate a dynamic document. The client is to enter a start and finish number which will be populated in the print ready file.

The only way to do this now is by the client uploading a recipient list with the numbers, which is difficult to do for people who aren't tech savvy.

Is it possible to write code to populate a PDF with a range of numbers that the client defines?

Thanks!

west-digital.fr

unread,
Jun 29, 2024, 1:50:47 AM (5 days ago) Jun 29
to XMPie Interest Group
Hello,

You did not specify, where your client is supposed to enter such values; I will guess it is in uStore 17.2.

I am not particularly proud of the following idea (which is not necessarily environment friendly), but should somebody ask me to have it work in, say, the next five minutes, I would give it a try anyway.

First, I would negotiate with the client, what would be the lowest and highest values. Say 1 and 1 million respectively.
Then, I would create a data source-bound document with either a Counter or an real data source such as Excel. The values would be in a column named "Index", per instance.
I would demonstrate to myself that everything works fine from uStore, and that the document correctly produces 1 million personalized pages.

Then, I would create 2 Dial variables ("Start" and "Finish" respectively) and a fictitious Content Object ("Skipper").
The uStore Customization Wizard would let the client enter his own values in the Dial variables (whose settings could try to prevent the client to enter unsupported values).

The Content Object would avoid composing with the data source "wrong values" thanks to the "Skip" function, based on some QLingo like (not tested):

/* Optional code, as the uStore Customization Wizard is capable of doing the same
If ( @{Start} < 1 Or @{Finish} > 1000000 ) {
ReportMessage( "Out of supported range! (Start=" & @{Start} & ", Finish=" & @{Finish} & ")" );
Abort
} Else
*/
If ( @{Start} > @{Finish} ) {
ReportMessage( "Unordered values! (Start=" & @{Start} & ", Finish=" & @{Finish} & ")" );
Abort
} Else
If ( |->[Index] < @{Start} Or |->[Index] > @{Finish}  ) {
Skip
}

Reply all
Reply to author
Forward
0 new messages