I open evince (simple document viewer on Ubuntu), than I press Ctrl+P and Print. My djvu file has 158 pages. Gstoraster converts it to 3210 format more than 15 minutes. It does not matter which djvu file to print. My patch still solves the problem, execution is very fast. I try to put "-dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792" and it also works, but I don`t want to "hardcode" this values. I want to take this values dynamically."if (ppd)" is still present in your code, I just put it as you did.
-- You received this bug notification because you are a member of Desktop Packages, which is subscribed to cups-filters in Ubuntu. https://bugs.launchpad.net/bugs/1920730 Title: gstoraster: Ghostscript runs to long while converting djvu files to Xerox`s 3210 format Status in cups-filters package in Ubuntu: Incomplete Bug description: My OS: Description: Ubuntu 20.04.2 LTS Release: 20.04 Package version: cups-filters version 1.27.4-1 When I try to print djvu files on my Xerox WorkCentre 3210 gstoraster filter, which calls ghostscript inside runs to long while converting djvu files to Xerox`s 3210 format. E.x.: For 155 pages of djvu files, it runs more then 15 minutes. I found a solution by adding -dDEVICEWIDTHPOINTS -dDEVICEHEIGHTPOINTS params to ghostscript command inside gstoraster filter. Now the time of converting the same file is about 30 seconds. I`ve made patch which solves this problem. --- a/filter/gstoraster.c +++ b/filter/gstoraster.c @@ -733,8 +733,17 @@ char output[31] = ""; int pagecount; size_t bytes; - snprintf(gscommand, 65536, "%s -q -dNOPAUSE -dBATCH -sDEVICE=bbox %s 2>&1 | grep -c HiResBoundingBox", - CUPS_GHOSTSCRIPT, filename); + // Ghostscript runs to long while converting djvu files to Xerox`s 3210 format + // Using -dDEVICEWIDTHPOINTS -dDEVICEHEIGHTPOINTS params solves the problem + if (ppd) { + cupsRasterInterpretPPD(&h,ppd,num_options,options,0); + snprintf(gscommand, 65536, "%s -q -dNOPAUSE -dBATCH -dDEVICEWIDTHPOINTS=%d -dDEVICEHEIGHTPOINTS=%d -sDEVICE=bbox %s 2>&1 | grep -c HiResBoundingBox", + CUPS_GHOSTSCRIPT, h.PageSize[0], h.PageSize[1], filename); + } + else { + snprintf(gscommand, 65536, "%s -q -dNOPAUSE -dBATCH -sDEVICE=bbox %s 2>&1 | grep -c HiResBoundingBox", + CUPS_GHOSTSCRIPT, filename); + } FILE *pd = popen(gscommand, "r"); if (!pd) { To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/1920730/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : [email protected] Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp

