[poppler] Direct Poppler access without frontend allowed?

Andreas Butti andreasbutti at gmail.com
Thu May 12 11:57:33 PDT 2011


OK, I read both mails.

> There is a patch to poppler-glib bindings to add write/edit  metadata
> in bugzilla. The patch is not ready yet, but help with that would be
> appreciated I think.
I don't now what "not ready" means, but so I can use this patch an may
get it complete working if it's not already complete working.


I'll write now the additional defintions which I would create for the
GLib API. (I know, the implementation is in background)

// creates a new empty poppler document
PopplerDocument * poppler_document_new_empty();

// append a page to the poppler document (The page will be copied),
return the new created page
PopplerPage * poppler_document_add_page(PopplerDocument * doc,
PopplerPage * page);

// append the page <src> on top of <page>, src will be copied, return
the new created page
PopplerPage * poppler_document_add_page_on_top(PopplerDocument * doc,
PopplerPage * src, PopplerPage * page);

and methods to add bookmarks, something like
... poppler_document_add_outline(PopplerDocument * doc, const char *
name, int level, ... action ...);

would this be OK for you?


How does it work with the maintenance of the code, I have to create a
bugreport (featurerequest) and attach a patch, and then? Does somebody
testing it?

Do I have to write unittest or something like this? (are there reviews,
or what's the criteria for the path to get into the poppler library?)

If there are bugs (within the implementation) does the poppler team
matain the code or is this in my responsibility because I may currently
the only one who is using this API?



Andreas


Am 12.05.2011 20:31, schrieb jose.aliste at gmail.com:
> Hi,
>
> On Thu, May 12, 2011 at 12:36 AM, Andreas Butti <andreasbutti at gmail.com> wrote:
>> 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.)
> There is a patch to poppler-glib bindings to add write/edit  metadata
> in bugzilla. The patch is not ready yet, but help with that would be
> appreciated I think.
>
>> 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.
> So I guess it makes sense to use the glib frontend as you are using
> GTK. If there are things that the glib frontend does not support, then
> you should feel free to file bugs and attach patches to implement the
> api you are missing. Normally, you need to divide your patches in two
> parts, first, a core part if the functionality you want to add is not
> already present in the core poppler, and two the glib part that gives
> you access to this functionality from the glib frontend.
>
>>
>> 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
> as I pointed above, the best thing is to submit bugs/attach patches to
> poppler-core/ and poppler-glib to make this happen. As Albert pointed
> out, you don't really need a new frontend, but instead to add some API
> to the poppler-glib one. For instance, the poppler-glib frontend
> already supports adding annotations, and as I mentioned, there is a
> patch to support editing the metadata.
>
> Greetings,
>
> José
>
>> 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
>> http://lists.freedesktop.org/mailman/listinfo/poppler
>>
>> _______________________________________________
>> poppler mailing list
>> poppler at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/poppler
>>
>> _______________________________________________
>> poppler mailing list
>> poppler at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/poppler
>>
>>



More information about the poppler mailing list