[pdftex] Bug in 1.10a: \pdfximage with pdf file and width
Hartmut Henkel
hartmut_henkel at gmx.de
Sun Feb 23 12:46:32 CET 2003
I guess the decimal_digits parameter should ONLY affect linear x/y
placement values; the basic idea of decimal_digits might be that it
keeps the PDF file size small and rendering quick by short numbers (e.
g. when you set decimal_digits to zero, you still get a good
approximation of the page).
But using the same precision also for factors within a transformation
matrix should NOT be done: It multiplicatively affects things, so a
rounding error is scaled by the image size (with current teTeX pdftex
the scale numbers are clipped to max. 4 digits after the decimal point).
As images anyway are a large data amount in comparison to the 2 or three
digits spared by cutting such transform matrix values, nothing can
really be spared by short numbers there. Transformation matrix factors
(and any other multiplicative things) should be written out always with
the best resolution possible; pdfTeX is a precision tool, anyway :-)
Below is a suggestion for patching pdftex.ch, factors with 6 digits
after the decimal point. Including scaled 4 m size pdf images seems
still to work :-) The images have right size even with decimal_digits =
0. Did I miss any overall scaling stuff there?
Greetings Hartmut
------------------------------------------------------------------------
@@ -8277,11 +8277,11 @@
pdf_print_bp(pdf_y(cur_v));
end
else begin
- pdf_print_bp(ext_xn_over_d(pdf_width(p),
- one_bp, image_width(image)));
+ pdf_print_real(ext_xn_over_d(pdf_width(p),
+ 1000000, image_width(image)), 6);
pdf_print(" 0 0 ");
- pdf_print_bp(ext_xn_over_d(pdf_height(p) + pdf_depth(p),
- one_bp, image_height(image)));
+ pdf_print_real(ext_xn_over_d(pdf_height(p) + pdf_depth(p),
+ 1000000, image_height(image)), 6);
pdf_out(" ");
pdf_print_bp(pdf_x(cur_h) -
ext_xn_over_d(pdf_width(p), epdf_orig_x(image),
------------------------------------------------------------------------
On Mon, 10 Feb 2003, Heiko Oberdiek wrote:
> On Sat, Feb 08, 2003 at 07:03:46PM +0100, Heiko Oberdiek wrote:
> > On Sat, Feb 08, 2003 at 04:37:38AM +0100, Heiko Oberdiek wrote:
> > The scenario is not complete, the bug is triggered, if "pk_resolution"
> > is missing in the configuration file "pdftex.cfg".
> > > pdf files are not correctly embedded, they are not scaled,
> > > if width is given explicitly in opposite to former behaviour
> > > and other file types.
> > [...]
>
> No, it has nothing to do pk_resolution, but with an unset
> decimal_digits. The default is then zero.
>
> With "decimal_digits 3":
>
> % page of png case
> q
> 468 0 0 662.279 72 107.611 cm
> /Im1 Do
> Q
>
> % page of pdf case
> q
> 0.787 0 0 0.787 72 107.611 cm
> /Im2 Do
> Q
>
> 0.787 rounded to zero decimal digits yields 1 (unscaled).
>
> Thus I suggest a larger default value for decimal_digits
> (at least 2, better 3 or 4).
More information about the pdftex
mailing list