PDF doesn't have embedded SVG - but if you're familiar with SVG, the problem
with doing this with SVG is conceptually equivalent to what you'd have to do
with PDF...
Consider the follow (pseudo-coded) SVG:
<svg>
<path>
<group>
<path>
<text>
<image>
</group>
<text>
<path>
<image>
<svg>
Now, how would you go about rasterizing the paths while keeping the text in the
same Z-ordering with respect to the rest of the content? And that's even
assuming no transparency or filter effects in place.
You suggested the user just open this up in an editor (an SVG editor, in this
case). That might be OK if I had access to all the same fonts that the author
did (assuming I am not the original author of the document) - but what if I
don't? There would be no way for to "reauthor the content" and ensure that
things did NOT reflow or relayout - let alone change the appearance.
Leonard
-----Original Message-----
From: Mike Marchywka [mailto:[email protected]]
Sent: Thursday, March 26, 2009 9:22 AM
To: [email protected]
Subject: Re: [iText-questions] How to duplicate PDF text but rasterize graphics
>
> You just like arguing ;).
No, I was just trying to do my taxes. LOL.
>
> I don't think you are understanding the problem that the person is having.
> It's not about simply finding already rastered images and replacing them with
> alternate versions - that's pretty simple and there is an example of using
> iText for doing just that. The problem is a need to convert/rasterize all
> vector artwork on the page into one or more raster images WITHOUT impacting
> the text AND WITHOUT changing any visual appearance of the content of the
> page. In the process, you will probably want to optimize the output.
Well, I have to admit the vector art has more information content than
the rasterized version but it seems like this is just a matter of extracting
the the "SVG" component from the PDF, feeding it to a renderer, and reinserting
the BMP/JPEG into the pdf. The text is fixed or unrelated (no?) so I would
imagine the big issue is z-ordering or getting transparent pixels in the right
places. At worst then this come down to the same "typesetting" or "reflow"
issues that always come up. Its not unreasonable to expect someone to
buy or otherwise obtain an opensource typsetting/formatting package.
So the complexity depends on quality? It would depend on what you want to
replace the SVG stuff- best quality for the size or something like
a placeholder.
I guess I would like to get some idea of the model storage capabilities
too- if you can store more complicated information in a usable ( by
something other than canned proprietary apps) that would be great.
>
> Actually, this problem is difficult with HTML too. Consider an HTML page that
> uses CSS for absolute or relative positioning of content, so that there is an
> opportunity for multiple objects to overlay & intersect with each other. Your
> task is to reduce that to the smallest number of objects that produce the
> same visual result with all text kept intact.
>
> Now, add to that all the complexities of the PDF rendering model -
> overlapping (Z-ordered) objects, color management, rich transparency model,
> etc. And these are all things that are being considered for HTML5 - so that
> the same problems would now manifest themselves in that environment as well.
If I have some SVG interspersed with "normal stuff" I'm not sure
how or if this would differ.
>
> So again, this has nothing to do with structured/tagged PDF - it's a
> completely unrelated problem/issue.
>
I'm not claiming the specification is all that limiting, just trying
to get some idea of what the end products can and can not do. I'll postpone
the witch-hunt until I have some better direction :)
> Leonard
>
_________________________________________________________________
Express your personality in color! Preview and select themes for Hotmail(r).
http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=TXT_MSGTX_WL_HM_express_032009#colortheme
------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php