Thank you for your answers.
I tried it with the default Helvetica and WINANSI, but the size gets doubled
anyway.

There are no images or stuff like that in the source PDF. 
Example: A small file (about 25kb) generated by a PDF-printer component gets
about 50KB.
If I use Word 2007 to generate the PDF (51KB)  it gets 100KB after executing
the menthod.

If I have a 1,5MB PDF it gets about 3MB after executing this function.

This is very strange.
I hope you can help me on that!
Thank you!



Paulo Soares wrote:
> 
> IDENTITY-H fonts are always embedded.
> 
> Paulo 
> 
>> -----Original Message-----
>> From: [EMAIL PROTECTED] 
>> [mailto:[EMAIL PROTECTED] On 
>> Behalf Of jamesblast
>> Sent: Friday, November 16, 2007 10:07 AM
>> To: [email protected]
>> Subject: [iText-questions] PDFStamper doubles filesize
>> 
>> 
>> Hello,
>> 
>> I currently use the following small code to stamp PDF-files with a
>> customtext.
>> My problem is, that the outputfile is about double the size 
>> of the original.
>> I can imagine it will get a bit bigger, but double?
>> 
>> Please see my code if there is anything wrong with it. Thank you very
>> mutch!!
>> 
>> Regards,
>> james
>> 
>> code:
>> PdfReader reader = new PdfReader(fileName);
>>                      reader.RemoveUnusedObjects();
>>                      using (FileStream fs = new 
>> FileStream(fileName + "1", FileMode.Create))
>>                      {
>>                              PdfStamper stamp = new 
>> PdfStamper(reader, fs);
>>                              int n = reader.NumberOfPages;
>>                              System.Windows.Size dimensions;
>>                              //fontpath ie. 
>> c:\windows\fonts\arial.ttf
>>                              BaseFont bf = 
>> BaseFont.CreateFont(fontPath, BaseFont.IDENTITY_H,
>> BaseFont.NOT_EMBEDDED); 
>>                              iTextSharp.text.Color iColor = new
>> iTextSharp.text.Color(color.ToArgb());
>>                              for (int index = 1; index <= n; index++)
>>                              {
>>                                      dimensions = new 
>> System.Windows.Size(stamp.GetImportedPage(reader,
>> index).Width, stamp.GetImportedPage(reader, index).Height);
>>                                      PdfContentByte cb = 
>> stamp.GetOverContent(index);
>>                                      // change the content 
>> on top of page 1
>>                                      cb.BeginText();
>>                                      cb.SetFontAndSize(bf, fontSize);
>>                                      cb.SetColorFill(iColor);
>>                                      
>> cb.ShowTextAligned(PdfContentByte.ALIGN_LEFT, text, (float)horzPos,
>> (float)dimensions.Height - vertPos, orientation);
>>                                      cb.EndText();
>>                              }
>>                              stamp.Close();
>>                              reader.Close();
>>                      }
> 
> 
> Aviso Legal:
> 
> Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
> informação confidencial ou legalmente protegida. A incorrecta transmissão
> desta mensagem não significa a perca de confidencialidade. Se esta
> mensagem for recebida por engano, por favor envie-a de volta para o
> remetente e apague-a do seu sistema de imediato. É proibido a qualquer
> pessoa que não o destinatário de usar, revelar ou distribuir qualquer
> parte desta mensagem. 
> 
> 
> 
> Disclaimer:
> 
> This message is destined exclusively to the intended receiver. It may
> contain confidential or legally protected information. The incorrect
> transmission of this message does not mean the loss of its
> confidentiality. If this message is received by mistake, please send it
> back to the sender and delete it from your system immediately. It is
> forbidden to any person who is not the intended receiver to use,
> distribute or copy any part of this message.
> 
> 
> 
> 
> -------------------------------------------------------------------------
> 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#a13796372
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/

Reply via email to