Insert a Page Using Scripting

Avatar

Avatar
Level 3
_Michael_Feicht
Level 3

Likes

0 likes

Total Posts

35 posts

Correct reply

0 solutions
View profile

Avatar
Level 3
_Michael_Feicht
Level 3

Likes

0 likes

Total Posts

35 posts

Correct reply

0 solutions
View profile
_Michael_Feicht
Level 3

27-05-2008

Hi,



I've wondered if there is a possibility to insert a certain page when rendering the PDF using JavaScript.



I've a table that contains n records. If the table reaches for example page five, I want to insert a page (cover sheet) because the following pages should be packed into a separate envelope and then continue with the table.



I solved the problem partially using conditional breaks on table rows when a certain number of rows has been reached. This solution works only when all rows have the same height. If the heights vary the result is not as good as expected.



Can I create nodes and append them to the document-tree?



thanks in advance

Michael

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

27-05-2008

Could you not cause a conditional break when you reach the end of page 5. In the conditional break section you could test to see which page you are on and then if you are on page 5 see where the x,y coordinates are on the row you have added. If you are too close to the bottom of the page force the break.

Avatar

Avatar
Level 3
_Michael_Feicht
Level 3

Likes

0 likes

Total Posts

35 posts

Correct reply

0 solutions
View profile

Avatar
Level 3
_Michael_Feicht
Level 3

Likes

0 likes

Total Posts

35 posts

Correct reply

0 solutions
View profile
_Michael_Feicht
Level 3

27-05-2008

Hi Paul,



thanks for your quick answer.



The page number is always -1 and x is "0in". I think the positioning will be done after generating the table rows and cell. The conditional breaks code is called before the layout ready events.



Maybe I should mention, that there is no user interaction. We have the PDF template and XML data. The render PDF operation creates the final document.



I've just tested it with PreviewPDF. I'm going to test it with a real process.



thanks in advance

Michael

Avatar

Avatar
Level 3
_Michael_Feicht
Level 3

Likes

0 likes

Total Posts

35 posts

Correct reply

0 solutions
View profile

Avatar
Level 3
_Michael_Feicht
Level 3

Likes

0 likes

Total Posts

35 posts

Correct reply

0 solutions
View profile
_Michael_Feicht
Level 3

28-05-2008

Hello Paul,



I've used the renderPDF operation to merge the PDF template with data. The x-value is always "0in".



kind regards

Michael

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

28-05-2008

I see .....I do not think you will get the info I request until after the script completes (the objects don't really exist until then that is why you are getting the rsult you mentioned). I do not see how you can do this today.