Confused about "types" and page sizes

Confused about "types" and page sizes

by Dan Roddy -
Number of replies: 1
I'm setting up a new certificate type and I'm a bit puzzled by the paper sizes.

If I choose Portrait type and print a certificate the resulting print out features a box that is off centre and smaller than the A4 paper I am using - I would hazard just about the right size for, say, Letter format paper.

If, on the other hand, I choose Portrait (Letter) as my type the resulting copy fills the page neatly and is centred properly.

What's going on here? Where are the page size parameters in all this?
Average of ratings: -
In reply to Dan Roddy

Re: Confused about "types" and page sizes

by Raymond Fürst -
The page size is defined in type/mytype/certificate.php
There is a line $pdf = new PDF or TCPDF that gets "A4" or "letter" as a parameter.
This sets up the page size of the resulting pdf.

However, each line of text has its own positioning coordinates, and all lines must fit to the paper size in question.

Some functions come in two forms, e.g. draw_frame and draw_frame_letter.

Do you create a new type from scratch or do you evolve the standard types delivered with the module?

Compare the standard letter_portrait with unicode_portrait. You see that all lines have 20+ on their x-coordinates.