Page 2 of 2 < 1 2
Topic Options
#58073 - 06/23/21 09:36 AM Re: Inserting PDF Page Range [Re: ontheroaderic]
Shift Offline
OL Newbie

Registered: 03/27/18
Posts: 5
Thanks for the help.

It seems to be working fine with the SQL query, which is great.

PAGE_NR(True) doesn't seem to work however. I think it is treating each copy as a new record, so only ever print out that many copies of page 1.

Again, thanks for the macro, however i think is an issue with it.

The Macro is printing the first document fine, and page 1 of the second document fine, but then all the pages return a blank.

I noticed that when creating the expression, each change I made changes the "Expression result:". Just pressing Ctrl A or adding a space adds to the result.

I'm happy the SQL query is working, it has saved me having to create hundreds of layouts.

Again, thanks for your help.

Top
#58074 - 06/23/21 10:08 AM Re: Inserting PDF Page Range [Re: ontheroaderic]
Sander vd Berg Offline
OL Expert

Registered: 06/10/08
Posts: 207
Loc: Objectif Lune NL
Looking over the macro I suppose if the function is called again with the same combination of values (record and pages) it should return a cached result instead of adding to the total again.

I can't explain why PAGE_NR(True) didn't work. According to the documentation it should reset after each record. If it resets after each layout copy that would be a nasty bug.

Anyway, glad the SQL worked for you!

Top
#58113 - 9 minutes 10 seconds ago Re: Inserting PDF Page Range [Re: Shift]
sellis Online   content
OL Newbie

Registered: 07/11/07
Posts: 21
Yes you can bring in a PDF dynamically.
Attach the data file which has the filename, page count and name. Also drag and drop the first PDF into the main layout.

Add further layouts to the 'layout list' to accommodate the highest PDF page count in the list of PDF files.
Set the image name by right clicking on the image in layout 1 and edit expression for image 1. Now drop the field in that contains the PDF name making sure there is the file extension '.pdf' on the end. (If the image doesn't appear, make sure the 'Image Folder' in the properties list points to the directory where the PDF files are.).

Now edit expression for each layout 'image x' dropping the PDF field name in. Now edit the 'Image x.Page number for each image in each layout and set the page number to expression 'LAYOUT_NR()' this will make sure all PDF pages are printed for each PDF.

Last part...

Edit condition for each layout to 'IF(LAYOUT_NR()<=VAL([FIELD WITH PAGE COUNT]),Print,Skip). This will stop printing the layouts that will exceed the PDF page count.

Hope that helps.

Top
Page 2 of 2 < 1 2