[Qt-interest] Merging / printing multiple pdf's
Christopher Rasch-Olsen Raa
christopher at technophile.info
Sun Aug 9 21:36:53 CEST 2009
Hi again,
A few final thoughts before closing this thread.
So, after fiddling a bit more with Poppler I achieved the result I was after,
and as it turns out Poppler is pretty good at what it does.
I did end up creating images of the pages and then writing them to a QPrinter
as first described here. After tweaking the parameters a bit more I was able to
reproduce the pages exactly as they were in their original files. Well, almost.
There is some pixel-hinting going on (my guess is from resizing the image),
but I don't think it'll bother anyone else but me.
And as to your question about using Ghostscript; I do not know sufficiently
about Ghostscript to really be able to make much use of it as of now. Also, I
wanted some fairly lightweight solution and Poppler seemed to offer just that.
However; if for some strange reason Poppler turns out to be something I can
not use then I should most definitly have a look at Ghostscript.
Thanks for the tip. :)
--
Christopher
Lørdag 08 august 2009 22:12:27 skrev Oliver Demetz :
> Is there any need to do this in Qt?
> If not then there are plenty of perfect packages out there that do your
> job perfectly, eg Ghostscript.
> Regards,
> Oliver
>
> hristopher Rasch-Olsen Raa schrieb:
> > Hi,
> >
> > In an application I'm writing I have a situation where I have to take X
> > number of different pdf's and send them to a printer. The way it is
> > solved today is that the application opens each and every one of the
> > pdf's using QDesktopServices and then the user have to press 'Print' from
> > whichever pdf- reader they use. This however is not an optimal solution.
> > Try opening a couple of hundred singlepage pdf's at the same time and
> > experience some _real_ lag.
> >
> > What I'd like to do is to take all the different pdfs that need printing
> > and merge them into one, and then open them using QDesktopServices OR
> > just do some behind the scenes magic and send it all directly to a
> > printer without opening an external application.
> >
> > A while pack I approached this list with almost the same question, and
> > some helpful person pointed me to the 'poppler'-library as featured in Qt
> > Quarterly. I looked into that but got the impression that it was only
> > meant for viewing pdf's, not really manipulating them. Am I mistaken?
> >
> > I did a small experiment where I rendered the pages from the different
> > pdf into an array of QImages (using poppler), created a QPrinter and
> > QPainter and painted all of the images to pages. This worked ok, with one
> > small exception; the content of the pdfs did not have the same positions
> > as when I printed them by themselves using an external pdf-reader. These
> > are forms, so the content really should be placed where it is supposed to
> > be. :p
> >
> > Have anyone tried to do, or have done, anything similar to this? If so,
> > what have worked for you? Do any of you have any other pointers for me?
More information about the Qt-interest-old
mailing list