________________________________
> From: [email protected]
> To: [email protected]
> Date: Tue, 25 May 2010 18:37:45 -0400
> Subject: Re: [iText-questions] Blank PDF after it is transfered through SMTP
>
>
>
>
>
>
>
>
> Thank you for pointing out "shave bytes".
>
> In fact, this time it is "inflated bytes". Comparing the pdf file generated 
> directly and the one transferred through SMTP using 
> "content-transfer-encoding: quoted-printable", all 0A is inflated to 0D 0A 
> and all 0D is also inflated to 0D 0A. There is no other difference. Just this 
> minor inflation blows up acrobat reader and it shows up as blank pdf. (There 
> is no such inflation if base64 is used as content-transfer-encoding.)


What exactly are these characters? Why might this make sense with some data 
types?

>
> So the pdf generated by iText contains either 0A or 0D but not 0D 0A 
> together. Is this by design? Or is it configurable?

I guess if it did this consistently, you could use dos2unix or sed to fix the 
file.

>
> P.S.: all test is on Windows platform. Attached page_numbers.pdf is generated 
> directly and test.pdf is received through email as described above using 
> "quoted-printable" encoding.

See this for example, learn to use ietf for these types of issues or other 
standard
groups, 
http://tools.ietf.org/rfc/rfc2045.txt

6.6.  Canonical Encoding Model

   There was some confusion, in the previous versions of this RFC,
   regarding the model for when email data was to be converted to
   canonical form and encoded, and in particular how this process would
   affect the treatment of CRLFs, given that the representation of
   newlines varies greatly from system to system, and the relationship
   between content-transfer-encodings and character sets.  A canonical
   model for encoding is presented in RFC 2049 for this reason.

6.7.  Quoted-Printable Content-Transfer-Encoding

   The Quoted-Printable encoding is intended to represent data that
   largely consists of octets that correspond to printable characters in
   the US-ASCII character set.  It encodes the data in such a way that
   the resulting octets are unlikely to be modified by mail transport.
   If the data being encoded are mostly US-ASCII text, the encoded form
   of the data remains largely recognizable by humans.  A body which is
   entirely US-ASCII may also be encoded in Quoted-Printable to ensure
   the integrity of the data should the message pass through a
   character-translating, and/or line-wrapping gateway.

>
>
>> Date: Mon, 24 May 2010 18:00:38 +0200
>> From: [email protected]
>> To: [email protected]
>> Subject: Re: [iText-questions] Blank PDF after it is transfered through SMTP
>>
>> Jiangang Song wrote:
>>> Or is there anything wrong with my usage of Java mail?
>>
>> The "blank page problem" is (as documented in the book) caused by the
>> fact that some applications (such as Java mail?) "shave bytes".
>>
>> PDF is a binary file format. You need to transfer it as a binary file.
>> If you open up the PDF with the "shaved bytes" in a text editor, you'll
>> see that there are lots of question marks. Those are bytes that have
>> lost a bit due to the way you've transferred them.
>>
>> You need to make sure that you transfer the file as a binary file.
>> --
>> This answer is provided by 1T3XT BVBA
>> http://www.1t3xt.com/ - http://www.1t3xt.info
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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/
>
> ________________________________
> The New Busy is not the old busy. Search, chat and e-mail from your inbox. 
> Get started.
                                          
_________________________________________________________________
The New Busy is not the old busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3
------------------------------------------------------------------------------

_______________________________________________
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