Step by step - Learn how to use callas productscallas pdfToolboxPlace contentPlace any content: Simple example placing content in the upper left

Place any content: Simple example placing content in the upper left

This example uses the HTMLTemplate in folder 09. So-called “absolute positioning” is used in this case. The PDF document in which the content will be placed is in DIN A3 format.

A look at index.html and styles.css

First, we open the folder in the “Sublime Text” text editor. (Other text editors can also be used.)

The file index.html contains, among other things, an instruction to place the text “What nice penguins!”.

The file styles.css specifies the text size of 50 pt and the position.

This is a case of absolute positioning with a 0 mm offset from the top left.

The code in detail:

#MyText {
font-size: 50pt;
display: inline;
position: absolute;
top: 0mm;
left: 0mm;
} 

Setting 1 in pdfToolbox: Relative to “Top-left corner” of “CropBox”

The placement of the HTMLTemplate is specified as follows, within pdfToolbox, in the “Place content on page” Fixup:

  1. Relative to: “Top-left corner”
  2. of: “CropBox”

The result when applied to a PDF document (here in DIN A3 format plus first cut and info area) is as follows:

The 50 pt text is located at the top left within a PDF document created at the default size of DIN A4 (green dotted line added here for clarity.)

This entire construct is placed within the page on the open PDF document (DIN A3, as already mentioned) in the top left relative to the CropBox (the mask space.)

Setting 2 in pdfToolbox: Relative to “Top-right corner” of “TrimBox”

In this example, the placement is configured within pdfToolbox as follows:

  1. Relative to: “Top-right corner”
  2. of: “TrimBox”

The result with these settings on a page in DIN A3 format:

The 50 pt text is again located at the top left within a PDF document created at the default size of DIN A4 (green dotted line added here for clarity.)

This entire construct is placed within the page on the open PDF document at the top right relative to the TrimBox (the trimmed size space.)