Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

a need for these features #1

Open
ghost opened this issue May 29, 2013 · 5 comments
Open

a need for these features #1

ghost opened this issue May 29, 2013 · 5 comments

Comments

@ghost
Copy link

ghost commented May 29, 2013

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!

@xiangxw
Copy link
Owner

xiangxw commented May 29, 2013

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

@roniemartinez
Copy link
Collaborator

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.

@xiangxw
Copy link
Owner

xiangxw commented May 31, 2013

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

@xiangxw
Copy link
Owner

xiangxw commented May 31, 2013

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

@xiangxw
Copy link
Owner

xiangxw commented Jul 2, 2013

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants