pdftemplate special block name

Modified on Thu, Aug 3, 2023 at 6:58 PM

A block named ‘pdftemplate’ will be treated differently. The value must return a list of pages to print or empty for all pages. Ideally, a dropdown list would be the best command to use it with. Use the ‘label’ command to change the displayed block name. Duplicate pages can be used.

 

Syntax

Display1::::Pages1::::PriceSetID1;Display2::::Pages2::::PriceSetID2

‘Display’: any text to be displayed to the customer, like Page 1 or Pages 1 and 2
‘Pages’: the actual page number or list of numbers used by the pdf engine like 1 or 1,2
 ‘PriceSetID’ a valid integer that corresponds to an actual Price Set.

 

Example 1

Block Name: pdftemplate

Commands

label:     Select Template

dropdown: Single Sided::::1;Double Sided::::1,2

The above will print the first page only if the user selects Single Sided and two pages when the user selects Double Sided

Example 2

Block Name: pdftemplate

Commands

label:     Select Template

dropdown: Template 1::::1,3,4,5;Template 2::::1,2,5,6;Template 3::::

Template 1 prints pages 1, 3, 4 and 5

Template 2 prints pages 1, 2, 5 and 6

Template 3 prints all the pages

 

IMPORTANT NOTE: The expected values are list of page numbers separated by commas. Use the dropdown command feature format of Displayed Value:::Actual Value syntax to achieve this. Leave the list empty for all pages (default). It is recommended to still add the 4 colons after the displayed value even if it’s empty, just like Template 3 above: Use Template 3:::: rather than just Template 3.

 

 

 

Example 3

Block Name: pdftemplate

Commands

label:     Select Template

dropdown: Portrait::::1;Landscape::::2

Both options will result in a one page document. One portrait and the other landscape (provided the pdf is set as such).

 

Example 4 

Block Name: pdftemplate

Commands

label:     Select Template

dropdown: 1;1,2;1,2,3,4

Numbers here are displayed as such to the user. Works but not recommended in most cases.

 

Example 5 – using paragraph command

  1. BlockName: Select Template

Commands

dropdown: 1;1,2;1,2,3,4

  1. Block Name: pdftemplate

Commands

paragraph: {Select Template}

The above examples uses a textflow block with a paragraph command that returns a list of page numbers. It is important to note that the pdftemplate named block should be the one returning the page list.

 

Example 6 – Additional price per template

Block Name: pdftemplate

Commands

label:     Select Template

dropdown: Page 1::::1::::101;Pages 1 and 2::::1,2::::105; Pages 1 to 4:::: 1,2,3,4::::110

 

Displays a dropdown of

  • Page 1
  • Pages 1 and 2
  • Pages 1 to 4

 

The first selection will add a price calculated from PriceSetID = 101 (based on Qty)


Simple example


Label: Add Backside

 

Dropdown command: No::::1;Yes::::1,2::::1346


If yes has been chosen then price set id 1346 will be added to the price for the second page.




 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article