michaelrsweet / pappl

PAPPL - Printer Application Framework
https://www.msweet.org/pappl
Apache License 2.0
309 stars 49 forks source link

Query about margin #344

Closed szlt5 closed 8 months ago

szlt5 commented 8 months ago

Is your feature request related to a problem? Please describe. Pappl does not allow registering individual margins per-page-size. All the page sizes share the margin stored in the structure pappl_pr_driver_data_s.left_right and pappl_pr_driver_data_s.bottom_top.

But for some vendor, each paper has its own margin setting, such as the PPD file posted in the https://github.com/michaelrsweet/pappl/issues/268: A4's margin is 5mm, 13x19's margin is 12.6mm.

Print 13x19 by using legacy-printer-app (pappl-retrofit), the printed image is cropped on all sides. Details of the printing as below: System Information:

Describe the solution you'd like Will pappl support registering individual margins per-page-size in future or is there a better idea to solve this problem?

michaelrsweet commented 8 months ago

I currently have no plans of adding support for varying margin values.

Margins are informative for IPP Clients to know where they can place content that will be marked on a page. Raster content is still imaged for a full-bleed page so a PAPPL-based driver can simply ignore data that lies outside the printable area of a given media sheet. In the case of pappl-retrofit, I would recommend reporting the worst-case margins in the left_right and bottom_top members and then use the PPD-supplied imageable area when processing the raster data.