Skip to content

print: add auto-scale api - #1940

Open
lbaudin wants to merge 1 commit into
flatpak:mainfrom
lbaudin:auto-scale-api
Open

print: add auto-scale api#1940
lbaudin wants to merge 1 commit into
flatpak:mainfrom
lbaudin:auto-scale-api

Conversation

@lbaudin

@lbaudin lbaudin commented Mar 19, 2026

Copy link
Copy Markdown

Add an auto-scale api so as apps can scale to the printable area. This is commonly used when printing, either for images, or for documents that have different paper size (such as printing slides to A4 paper).

See papers#564 for instance.

Related to https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/merge_requests/256

@lbaudin
lbaudin force-pushed the auto-scale-api branch 4 times, most recently from 9da4654 to 8a3b682 Compare March 20, 2026 08:55
@lbaudin

lbaudin commented Apr 28, 2026

Copy link
Copy Markdown
Author

ping? @Sodivad @matthiasclasen

@jadahl

jadahl commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Cc: @tillkamppeter

@lbaudin

lbaudin commented Jun 18, 2026

Copy link
Copy Markdown
Author

Updated with latest repository structure, still up for review :)


The scale in percent.

* ``auto-scale`` (``s``)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best is to allow here the settings possible for the IPP attribute print-scaling: auto, auto-fit, fill, fit, none. Or what is actually reported back from the printer (can be sub-set).

@tillkamppeter

Copy link
Copy Markdown

I do not know exactly what is needed to add a parameter to a porta API, but it makes all sense to add this parameter so that the print dialog displays the option on how to scale a document for being printed into the output page frame, and displays the option only if the print job can actually get scaled, cropped, and padded.

@lbaudin

lbaudin commented Jun 22, 2026

Copy link
Copy Markdown
Author

Thanks @tillkamppeter. Do you think that scaling should only be done by the printer then? Or should it be done by the app in case the printer does not support it? (I guess the answer is that it should be done by the app if the printer does not support it, but I have no idea whether it happens in practice.)

@karlrelton

Copy link
Copy Markdown

Thanks @tillkamppeter. Do you think that scaling should only be done by the printer then? Or should it be done by the app in case the printer does not support it? (I guess the answer is that it should be done by the app if the printer does not support it, but I have no idea whether it happens in practice.)

I would argue that scaling should be performed by the App, because:

  • the App may not be sending direct to the physical printer, but could instead be sending to a layer such a Cups which would apply its own processing before sending the job to the physical printer (meaning you get the Cups implementation rather than the physical device implementation)
  • it gives the App control over the eventual layout, enabling it to do as seems best for the App developers (e.g. an image viewer may have different needs to a document viewer)
  • when number-up is also in play, it becomes even more useful for the App to determine what to do with the scaling/rotating/tiling ... rather than relying on the printer implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants