https://bugzilla.wikimedia.org/show_bug.cgi?id=22194

Andrew Caldwell <and...@ajcaldwell.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |and...@ajcaldwell.co.uk

--- Comment #9 from Andrew Caldwell <and...@ajcaldwell.co.uk> 2010-09-30 
12:54:59 UTC ---
(In reply to comment #8)
> This is not an MW/extension bug. Problem is that PdfHandler gets the PDF page
> dimension with a call to the pdfinfo command (an Xpdf tool). But pdfinfo
> returns the *physical* page dimension, not the *displayed* page dimension 
> (i.e.
> it does not take into account the page rotation parameter; not really a bug,
> just a design choice).
> 
> Solutions are: 1) use something else and not pdfinfo 2) apply the following
> patch to pdfinfo.
> 
> Since development of Xpdf looks a bit stuck and this is not something that may
> justify a new release, I'm posting the following patch here (referred to 
> v3.02,
> any patch level).
> 
> Tested working. Have fun.
> 
> Danilo
> 
> --- xpdf/pdfinfo.cc.old 2010-07-08 11:31:52.000000000 +0200
> +++ xpdf/pdfinfo.cc     2010-07-08 13:20:51.000000000 +0200
> @@ -92,6 +92,8 @@
>    int exitCode;
>    int pg, i;
>    GBool multiPage;
> +  int r;
> +  double xchg;
> 
>    exitCode = 99;
> 
> @@ -194,6 +196,10 @@
>    for (pg = firstPage; pg <= lastPage; ++pg) {
>      w = doc->getPageCropWidth(pg);
>      h = doc->getPageCropHeight(pg);
> +    r = doc->getPageRotate(pg);
> +    if ((r != 0) && ((r % 180) != 0)) {
> +      xchg = h; h = w; w = xchg;
> +    }
>      if (multiPage) {
>        printf("Page %4d size: %g x %g pts", pg, w, h);
>      } else {

Thanks for the info, where should this extra code be put?
Also, you mentioned to use an alternative to pdfinfo, can you suggest one?

Thanks a lot.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to