this is my code,
------------------------------------------------
reader = new PdfReader(this.TEMPLATE_NAME);
file = new FileStream(CREAT_TEMP_FILE_PATH + sname,
FileMode.OpenOrCreate);
stamp = new PdfStamper(reader, file);
BaseFont baseFont = this.getFont();
AcroFields form = stamp.AcroFields;
//添加值
for (int i = 0; i < fields_name.Length; i++)
{
form.SetFieldProperty(fields_name[i], F_FLAG,
PdfFormField.FF_READ_ONLY, null);
form.SetFieldProperty(fields_name[i], T_FONT, baseFont,
null);
form.SetField(fields_name[i], fields_values[i]);
}
stamp.FormFlattening = true;
stamp.SetFullCompression();
stamp.Close();
flag = true;
----------------------------------------------------
template(bmdjb2013_v2.pdf 448KB) and create pdf 4.96 MB
------------------ Original ------------------
From: "iText Info [via iText -
General]"<[email protected]>;
Date: Tue, Nov 27, 2012 03:47 PM
To: "youyi1997"<[email protected]>;
Subject: Re: Why my itextsharp creat pdf file very large?
On 27/11/2012 7:09, youyi1997 wrote:
> Dear All, I create pdf from a template pdf,and this pdf with many
> pdfformfield. In my program i fill the data in the formfield of the
> pdf,and set them readonly.But at last I found that the created pdf
> file by iTextShrp was very large,template(248kB) and the created pdf
> 5000KB,no large image,only text string,no enbedded font in the pdf.how
> can i reduce the pdf file.
Maybe you're adding a huge font,
maybe you're using PdfCopy instead of PdfSmartCopy to combine forms,
maybe you're decompressing some resource,
...
How can we know if you're not more specific?
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php
If you reply to this email, your message will be added to the discussion
below:
http://itext-general.2136553.n4.nabble.com/Why-my-itextsharp-creat-pdf-file-very-large-tp4656998p4656999.html
To unsubscribe from Why my itextsharp creat pdf file very large?, click here.
NAML
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/Why-my-itextsharp-creat-pdf-file-very-large-tp4656998p4657000.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php