Yes, I can confirm that. If I remove the calls to GetImportedPage, the size
does not grow that much. But I need to call this, to get the size of the
current page to position my stamp-text.
I really hope there is a solution for this!
Thank you!
Seung Hyun Park-2 wrote:
>
> I found the source of this problem.
>
> The source of this problem may be the PDFStamper.GetImportedPage function.
>
> Below code makes the PDF file which size is almost twice of original PDF
> file nevertheless calling SetFullCompression.
>
> Dim reader As New PdfReader("src.pdf")
>
> Dim stamper As New PdfStamper(reader, New
> FileStream("output1.pdf",
> FileMode.Create))
>
> stamper.GetImportedPage(reader, 1)
>
> stamper.SetFullCompression()
>
> stamper.Close()
> reader.Close()
>
> If calling GetImportedPage is omitted, the size of output PDF file is
> reduced to half.
>
> I don't know why it happens but I see how to fix my problem.
>
>
> I have tried with latest iTextSharp and VS.NET 2003.
>
>
> Best regards,
>
> S. H. Park
>
> 2007/11/20, dark <[EMAIL PROTECTED]>:
>>
>> Indeed, I have encountered the same problem with iTextSharp for a long
>> times.
>>
>> The PDFStamper of iTextSharp generates almost double sized PDF from
>> original
>> PDF file at my program, too.
>>
>> I have used several versions of iTextSharp including latest version but
>> this
>> problem always occurred.
>>
>>
>> The code of my program is similar to jamesblast's code.
>> I think that jamesblast's code may follow the tutorial of iText honestly
>> and
>> my code may be as same.
>>
>> It is certain that the unnecessary data exists in the output PDF file
>> from
>> PDFStamper because the size of output PDF file can be reduced to the
>> almost
>> size of original PDF file when I optimize it using Acrobat.
>>
>> I think that it may be related to the duplication of embedded fonts.
>> Several
>> CJK fonts with IDENTITY_H are created and embedded at my code. It also
>> may
>> be related to the optimization of output PDF file from PDFStamper.
>>
>> But, my real problem is that I have no idea how I can fix.
>>
>> I must use CJK fonts and IDENTITY_H encoding and embed all CJK fonts for
>> foreigners that will show my PDF files.
>> Moreover, almost PDF rendering libraries and viewers cannot display CJK
>> characters if used font does not be embedded.
>>
>>
>> I am making a sample code for reporting them.
>> I'll post it if I finish it.
>>
>>
>> Best regards,
>>
>> S. H. Park
>>
>>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
>
>
--
View this message in context:
http://www.nabble.com/PDFStamper-doubles-filesize-tf4820268.html#a13946042
Sent from the iText - General mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/