[poppler] Direct Poppler access without frontend allowed?

Leonard Rosenthol lrosenth at adobe.com
Sun May 15 07:34:33 PDT 2011


The problem you are facing is that Poppler does not have any high level primitives for such operations.  Poppler does one thing well - rendering - and also text extraction (as a fallout of rendering).  It's NOT a PDF manipulation library.

That means that you WILL NEED to become a PDF specialist OR find a secondary PDF library that DOES offer what you want/need.   There are many other libraries to choose from - iText, PoDoFo, etc.

Leonard

From: Andreas Butti [mailto:andreasbutti at gmail.com]
Sent: Sunday, May 15, 2011 7:25 AM
To: Leonard Rosenthol
Cc: Albert Astals Cid; poppler at lists.freedesktop.org
Subject: Re: [poppler] Direct Poppler access without frontend allowed?

I don't understand what you're meaning.

I have two PDF files, one with a background PDF and one with a foreground PDF, and I try to merge one PDF to the top of the other PDF and export this result as a single PDF.

It should also be possible to merge more than one PDF together to one PDF.

You think I should export this as Form XObjects?

What is the advantage?

Sorry if I'm wrong, I'm not a PDF specialist...




Andreas


Am 15.05.2011 16:14, schrieb Leonard Rosenthol:
Form XObjects (ISO 32000-1, 8.10) are an encapsulation method of PDF content.  It is a well defined transformation from PDF page (32000-1, 7.7.3.3) to Form XObject.

Leonard

From: Andreas Butti [mailto:andreasbutti at gmail.com]
Sent: Sunday, May 15, 2011 7:06 AM
To: Leonard Rosenthol
Cc: Albert Astals Cid; poppler at lists.freedesktop.org<mailto:poppler at lists.freedesktop.org>
Subject: Re: [poppler] Direct Poppler access without frontend allowed?

Am 15.05.2011 16:01, schrieb Leonard Rosenthol:
The method you are using is REALLY BROKEN!

Are you also copying all the resources over all well?   How do you handle resources used by Form XObjects or Patterns?

The correct way to do this is to simply turn one of the pages into a Form XObject for the other page and then draw it.

I don't understand what you're meaning.

Is there an simpler way to merge the PDFs together?



Andreas





Leonard

From: poppler-bounces+leonardr=adobe.com at lists.freedesktop.org<mailto:poppler-bounces+leonardr=adobe.com at lists.freedesktop.org> [mailto:poppler-bounces+leonardr=adobe.com at lists.freedesktop.org] On Behalf Of Andreas Butti
Sent: Wednesday, May 11, 2011 11:36 PM
To: Albert Astals Cid; poppler at lists.freedesktop.org<mailto:poppler at lists.freedesktop.org>
Subject: Re: [poppler] Direct Poppler access without frontend allowed?

Ok, I can provide my code, but I need some help to complete integrate with Poppler.

What I did now:
I have two PDFs, one for background and one for the foreground, like two slides on a overhead projector, the second slide is on top of the first slide. Sometimes there are two pages, 1 foreground and one background, sometimes there is only one PDF.
Not all source PDFs are used always, and sometimes PDF Pages are used twice.


My code does the following:

 *   Extract the contents stream of the pages
 *   Append the stream from one page to the other page
    *   update all references, e.g. images and fonts, because /F1 in one document is may not the same font than /F1 in the other document
 *   Write outlines to the document (they have to be created by the application, because if there are pages inserted / deleted, I cannot use the original outlines)
 *   Write metadata (Creator, Autor, Creationdate etc.)
 *   Writeout the document to a file
    *   Create new XREF table
    *   compress the contents of the pages with GZ


My application is mostly written in C++, but I use GTK (no discussion about this combination;-)).

So I first used the GLib frontend, but there I had problems with searching, and I cannot access the underlying poppler objects.


The Question is now which frontend I should use.


In my opinion, the best solution is may to create a new frontend, e.g. a PDF-editing frontend?

Because then it's possible to change some behaviour, and add other things, like:

 *   Edit text within PDF documents (not add, add is no problem with merging)
 *   Delete objects from a PDF (e.g. select a rectangle and delete all objects within this rectangle)
 *   Copy objects
Currently there is no easy to use application which support these 3 operations for Linux.

If poppler would have such a frontend I'll may append this functionality to Xournal++ (in the future, not now).


What do you think about this?




Andreas

Am 11.05.2011 21:43, schrieb Albert Astals Cid:

A Wednesday, May 11, 2011, Andreas Butti va escriure:

Hello everybody



Hi





I'm working on a new Xournal version (Xournal++, not yet present on a

webpage, only in the SVN).



I used Poppler to display PDF and also for PDF export, to implement the

PDF export (merging two PDFs together) I access Poppler without any

frontend.



I'm working on Ubuntu, which contain all necessary headers, but other

distributions don't.



Now there is a discussion if it's allowed to access Poppler without

frontend, or not.



I thought it should be allowed, because on the poppler Wiki are also two

projects listed which access poppler without frontent,



But now I need a clear answer if it's allowed or not, and if not if

there is another way for me to implement this without breaking any rules.



It is not encouraged since we reserve the right to change the API (and do so)

at any release (minor versions included) while our API in the frontends is

much more stable.



If you tell us what you are missing from the public frontend API we might add

it, or you might even contribute the code you have that uses the internal API

so we add it to our frontend ;-)



Albert





Thank you for the answer.





Andreas



_______________________________________________

poppler mailing list

poppler at lists.freedesktop.org<mailto:poppler at lists.freedesktop.org>

http://lists.freedesktop.org/mailman/listinfo/poppler

_______________________________________________

poppler mailing list

poppler at lists.freedesktop.org<mailto:poppler at lists.freedesktop.org>

http://lists.freedesktop.org/mailman/listinfo/poppler


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20110515/17771b39/attachment.htm>


More information about the poppler mailing list