xslTNG icon indicating copy to clipboard operation
xslTNG copied to clipboard

Use intrinsic image resolution in PDF

Open tgraham-antenna opened this issue 2 years ago • 6 comments

Antenna House Formatter implements image-resolution from the last GCPM WD that had it:

  • https://www.antenna.co.jp/AHF/help/en/ahf-ext.html#axf.image-resolution
  • https://www.w3.org/TR/2010/WD-css3-gcpm-20100608/#image-resolution

Prince implements image-resolution with different syntax but also supports -prince-image-resolution:

  • https://www.princexml.com/doc/graphics/#image-size

tgraham-antenna avatar May 21 '23 17:05 tgraham-antenna

I'm not sure what you're suggesting. Are you proposing image-resolution: from-image, or something else?

ndw avatar May 23 '23 09:05 ndw

Assuming that there's a parameter to enable using intrinsic resolution (plus a parameter for fallback resolution), enabling it would include something like this in the CSS:

  -prince-image-resolution: auto, var(--fallback-resolution);
  -ah-image-resolution: from-image var(--falback-resolution);
  image-resolution: from-image var(--fallback-resolution);

tgraham-antenna avatar May 23 '23 09:05 tgraham-antenna

Actually, using intrinsic resolution and what override/fallback resolution to use could be separate decisions for every image. Not sure how you'd manage that.

tgraham-antenna avatar May 23 '23 09:05 tgraham-antenna

Is the absence of these properties causing formatting issues?

ndw avatar May 23 '23 11:05 ndw

Not for me, but only because I have the Antenna House Formatter property in my local CSS.

Images for print typically have a higher resolution than do images for the screen. Images meant for high resolution output that are rendered at 96dpi take up too much space and, for the part that fits on the page, look too grainy.

I regularly edit screenshots to be, say, 150dpi or 200dpi so that they don't take up too much space and so that they have a consistent scale, rather than larger screenshots being arbitrarily scaled down to fit the width of a page.

tgraham-antenna avatar May 23 '23 11:05 tgraham-antenna

What would a reasonable value be for the intrinsic and fallback resolutions?

I've worked out a method for adding style attributes to arbitrary elements.

ndw avatar Jun 02 '23 15:06 ndw