Hi Xavier,
Thank you very much for your patches!
I have a problem when I try to apply the cidfont.patch
ominik@domeeepc:~/Desktop/Programming/podofo$ vi cidfont.patch
dominik@domeeepc:~/Desktop/Programming/podofo$ patch -p0 < cidfont.patch
patching file src/doc/PdfFontMetricsObject.h
Hunk #1 succeeded at 229 with fuzz 2.
patching file src/doc/PdfFontMetricsObject.cpp
Hunk #3 succeeded at 150 with fuzz 2.
patch: **** malformed patch at line 118: Index: src/doc/PdfFontCID.cpp
Could you please send an updated patch file for the cidfonts?
I commited the patch fixing the object streams and th the one for the multiple
streams. Thank you very much. Very good fixes.
Best regards,
Dom
On Thursday, March 10, 2011 10:23:27 am Xavier Trochu wrote:
> Hello everyone,
>
> I have recently been using podofo for a tool that we use internally. The
> idea of the tool is to parse the first page of a PDF to find its
> "bounding box" of text so that it can add a line of text at the bottom
> of the page without writing over something else.
>
> Because we have various sources of PDF, this has been what I think is a
> important test of the PdfParser implementation and it has uncovered a
> few bugs that I have fixed here. I'm happy to share those fixes here.
>
> The first bugs has already been described on podofo's mantis here :
> http://sourceforge.net/apps/mantisbt/podofo/view.php?id=5
>
> When the content of a page is composed of multiple streams, each
> preceding stream will be re-parsed when a new stream is appended. The
> patch attached to the bug proposes to fix by correctly keeping the
> current offset in the tokenizer. I have chosen another solution, which
> is not to keep concatenating to a buffer that would contain the whole
> stream, but simply to forget the already parsed content and start over
> from a new buffer for each stream part. But there is another issue
> related to multiple streams. We had a example of a PDF where the streams
> were split inside an expression. The implementation of GetNextToken in
> PdfTokenizer is not aware of multiple streams and thus would return an
> error at the end of a stream, instead of jumping to parsing the next one.
>
> The patch multiple-streams.patch attached to this message fixes both
> these issues.
>
> Next issue is related to objects declared in stream, for PDF that have
> multiple revisions. If a later revision contain an object stream that
> redefine an object that was contained in a object stream from an earlier
> revision, then the final object that will actually be read by PoDoFo
> depends on the respective object numbers of the two object streams.
> Let's take an example:
>
> Imagine we have a PDF that has two revisions. Revision 1 contains an
> object stream (with id 113) for objects 72,75,76 and 77. Revision 2
> contains another object stream (with id 140) for object 72 and 75.
> PoDoFo load objects in the order of their id. If they are contained in
> an object stream, then the stream will be fully loaded at the time the
> first object within is loaded. In our example, it means that when PoDoFo
> tries to load object 72 (the first one) it will read the stream 140 and
> initialize object 72 and 75. But when it tries to load 76, it will load
> stream 113 and that will override 72 and 75 from stream 140, which is
> not something that we want.
>
> The patch object-streams.patch attached fixes this issue by generating a
> list of object ids that are valid for the object stream as it is loaded.
>
> Finally, I have implemented PdfFontMetricsObject support for
> CIDFontType0 and CIDFontType2. I also removed some parts of PdfFontCID
> that was breaking font information when trying to instantiate a CID font
> from a PDF. Theses fixes are in cidfont.patch
>
> Greetings, and thanks for this excellent library.
>
> Xavier Trochu
> EDP Sciences
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users