Bad news.  They are indeed drawing a white box (among other things...
yuck) on their background.

Here's the first line of that content stream, broken down by individual
operators:
%% Push the state, pop the state... that was helpful.
q Q
%% clip the page to its own media box.  More help.
q 0 0 595 842 re W n
%% set the colorspace to a resource and set it to "white?"
/Cs1 cs 1 sc
%% draw a rectangle over the media box and fill it
0 0 595 842 re f 
%% ditto.  How very helpful.
0 0 595 842 re f 
%% set the color to... black?  Presumably so, given the rest of the doc.
0 sc
%% push the graphic state again.  This time it might actually come in
handy.
q 

So it would appear that the mac PDF converter for Quartz was assembled
by drunken Bonobo monkeys, more interested in drinking their own urine
than in rendering decent PDF.

OTOH, in the context of a "generic interface for drawing that is writing
to a PDF", the clipping and at least one background fill make sense.
Yep.  The next instruction flips the page "upside down", and then flips
the text "upside down" again so it'll appear right side up... a common
trick when drawing 0,0-is-the-upper-right-corner graphics to PDFs
0,0-is-the-lower-left-corner coordinate system.

Our own PdfGraphics2D output tends to look Quite Similar (in other
words: none too pretty with some extra cruft that doesn't really need to
be there)... up to and including the double coordinate flip thing.



--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
 

> -----Original Message-----
> From: Paul Russell [mailto:[email protected]]
> Sent: Monday, July 19, 2010 1:56 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Problems with super-imposing one PDF
> onanother: White background?
> 
> Hi,
> 
> Thanks very much for your help with this :)
> 
> On Mon, Jul 19, 2010 at 8:34 AM, 1T3XT info <[email protected]> wrote:
> > Can you post a PDF so that we can see which hypothesis is correct?
> > If it's one of my guesses, it will be easy to solve your problem.
> > If it's indeed the white background problem, we'll have to be more
> > creative to find a solution.
> 
> The following PDFs demonstrate the issue (all hosted on dropbox to
> avoid clogging up peoples' e-mail):
> * Letter (i.e. the 'overlay'):
> http://dl.dropbox.com/u/723910/PR/example-letter.pdf
> * Stationary (i.e. the 'underlay'):
> http://dl.dropbox.com/u/723910/PR/deadsimple-stationary.pdf
> * Result after the code in my previous note is executed:
> http://dl.dropbox.com/u/723910/PR/electronic.pdf
> 
> I just tried one other thing that occurred to me prior to uploading
> these, which I've got a nasty feeling confirms the hypothesis that
> it's a white background problem... If I open the 'result' PDF in
> Preview on the mac, and then search for 'Example' (which is one of two
> words on the stationary), then despite the fact that I can't see the
> text, it throws a highlight exactly where the word /would/ have
> been...
> 
> Assuming that is indeed the case (here's hoping it's not!), then any
> pointers as to what to try next? I assume I'd have to somehow try and
> 'find' the white rectangle and remove it from the PDF? Sounds a bit...
> scary! Any other options worth investigating?
> 
> Thanks again,
> 
> 
> Paul
> 
>
------------------------------------------------------------------------
--
> ----
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Buy the iText book: http://www.itextpdf.com/book/
> Check the site with examples before you ask questions:
> http://www.1t3xt.info/examples/
> You can also search the keywords list:
> http://1t3xt.info/tutorials/keywords/
> 
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.839 / Virus Database: 271.1.1/3009 - Release Date:
07/18/10
> 23:36:00

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to