I also add that while creating a render in PoDoFo is certainly
possible, based on my experience creating a clean and maintainable
code for such a task using the current PoDoFo core functionalities may
be problematic and lot of components that should help for the job have
insufficient functionalities. A couple of examples (but there are more
pitfalls): PdfContentsTokenizer can traverse a content stream of a
PdfPage or PdfXObject, but will not take care of iterating the
multiple content streams when /Contents is an array (which happens in
pages), which if makes it impossibile to write an abstract tokenizer
that takes a PdfCanvas (a base class of both PdfPage and PdfXObject)
without substantial refactoring. Also: a lot of past and current PDFs
relies on Standard14 fonts or other non embedded fonts which have to
be supplied or found on the system for correct rendering. That's why
my current approach towards PDF rendering (something that is my radar)
is to create first more powerful core functionalities, rather than
brutally attempt to write a renderer using the primitive API. I can
provide some substantial technical details on the above topics and
others, but I will do it later on towards the end of December/begin of
January (together with an announce) since the code I'm talking about
doesn't pertain anymore to the use of the upstream PoDoFo API.



On Fri, 10 Dec 2021 at 07:24, zyx <z...@gmx.us> wrote:
>
> On Fri, 2021-12-10 at 00:05 +0300, Alexander Salieff via Podofo-users
> wrote:
> > Can I rasterize a PDF document page to a file or to a
> > memory buffer using PoDoFo?
>
>         Hi,
> you can use low-level APIs to do literally anything with the PDF file.
>
> It depends what you think with the 'rasterize', my first impression is
> to garble the page content to be unreadable, like to make large pixels
> from small pixels, something like that. If you mean to draw the page
> content into some canvas/HDC/whatever, then it's not part of the PoDoFo
> library, but you can still interpret the page content yourself using
> PdfContentsTokenizer. When you search the sources for it then you'll
> find an example 'pdfcontentsgraph' and 'podofocolor' with
> 'podofotxtextract' tools using it.
>         Bye,
>         zyx
>
>
> _______________________________________________
> Podofo-users mailing list
> Podofo-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/podofo-users


_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to