mupdf-qt icon indicating copy to clipboard operation
mupdf-qt copied to clipboard

a need for these features

Open ghost opened this issue 11 years ago • 5 comments

Hello, I am interested in your library wrapper to use in my application: https://launchpad.net/equalx since it muPDF is very small, fast and EqualX uses Qt. However, I hope mupdf-qt solves 4 major problems I have with poppler-qt4 (and can not be solved easily or at all):

  • I need a transparent page when rendering to image with the pdf library (if the pdf document doesn't already specify a color for the page)
  • possibility to get/set the page color (including alpha channel)
  • possibility to connect mupdf to use QPainter in order for me to save draw/save to SVG using Qt libs.
  • possibility to crop a pdf and save it to another pdf (like pdfcrop application) - and/or a function to get the bounding box of all elements in the page.

With these features, EqualX will look great and can drop the need for 2 applications: pdfcrop and pdf2svg (which also require ghostscript) Thanks!

ghost avatar May 29 '13 11:05 ghost

I think it's great. what do you think @Code-ReaQtor

xiangxw avatar May 29 '13 11:05 xiangxw

I think this is a good idea... But MuPDF, AFAIK, doesn't expose any API for editing a PDF file. (Or I just missed it).

pdfcrop is possible by cropping the resulting QImage and saving it using QPrinter::PdfFormat. Possibility of pdf2svg is very small since QImage is a "raster" format. I can't find any complete "documentation" of MuPDF aside from their examples.

But for the record, I tried both Poppler-Qt4 and MuPDF [in windows], and I observed that rendering a page in Poppler-Qt4 is very slow. For me, MuPDF is better.

roniemartinez avatar May 31 '13 07:05 roniemartinez

Yes, that's right. Editing a PDF file using MuPDF seems impossiable nowadays.

xiangxw avatar May 31 '13 08:05 xiangxw

Other features seems possiable. So we'll work on these.

xiangxw avatar May 31 '13 08:05 xiangxw

Following features have been added. Please checkout the dev branch and try. Thanks. @qquark

  1. transparent rendering.
  2. set background color. This does not modify conent of your PDF file. It's for page rendering only. We don't provide get background color function, because it's define by you, and we can't get this from your PDF file.
  3. QPainter. You can use QPainter::drawImage(), so we do not provide a API for this.
  4. crop. This can't be done with MuPDF right now.
  5. function to get the bounding box of all elements in the page. This is not finished yet. We'll do this later.

xiangxw avatar Jul 02 '13 05:07 xiangxw