Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdftops - add support for custom pagesize #2744

Closed
michaelrsweet opened this issue Mar 7, 2008 · 4 comments

Comments

Projects
None yet
1 participant
@michaelrsweet
Copy link
Collaborator

commented Mar 7, 2008

Version: 1.4-current
CUPS.org User: martin.pitt.canonical

In http://bugs.debian.org/469730, Alban Browaey submitted a patch for the current pdftops from 1.4 svn head:

Firefox 3 beta 3 use custom pagesize (there is a hack to try to get near
standard pages in most cases in pre beta 4 but it won't work in all
cases).
First thank you for th new pdftops filter that works with poppler-utils.

This patch check if there is a custom pagesize defined before feeding
ppdPageSize with NULL. (btw the doc does not state what null is supposed
to do ...).

I believe other application may be affected in fact any that renders pdf
and use custom pagesize.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 8, 2008

CUPS.org User: mike

The patch isn't valid - custom page sizes are already set in the cupsMarkOptions() call.

Passing NULL for the size name returns the currently marked size - will add documentation for that.

What options are being passed to the filter?

(a debug error_log file will show the options...)

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 10, 2008

CUPS.org User: martin.pitt.canonical

I asked the original reporter in the Debian bug, thank you.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 10, 2008

CUPS.org User: martin.pitt.canonical

Ah, the original reporter answered. Seems this can be closed.

------ 8< ---------

I found the real problem . This patch was not needed . The issue is that
with locale that have comma as the decimal separator and the patch we
have that cast width and length to int the value for paperw and paperl
ended up as 0 - http://cups.org/str.php?L2716 . With one of my patch for
gtk cups print backend Custom papersize string builder
http://bugzilla.gnome.org/show_bug.cgi?id=521548 the issue is gone.
Hem ... btw do you know which one of the patch is correct ? Should
Custom width and height be integer or could they be float (even though
only float with dot as the decimal separator ?)
Because if they could be float my patch works but there are other issues
to fix (http://cups.org/str.php?L2716 cast to integers thus lose
precision and foomatic-rip handle flaot with decimal separator but seems
to have glitches with them )

------ 8< ---------

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 12, 2008

"pdftops_filter_supportforcustompagesize.diff":

--- pdftops.c.old 2008-03-06 19:59:25.000000000 +0100
+++ pdftops.c 2008-03-06 19:53:41.000000000 +0100
@@ -178,7 +178,10 @@
* Set output page size...
*/

  • size = ppdPageSize(ppd, NULL);
  • if ((val = cupsGetOption("PageSize", num_options, options)) != NULL)
  •  size = ppdPageSize(ppd, val);
    
  • else
  •  size = ppdPageSize(ppd, NULL);
    
    if (size)
    {
    /*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.