Hi;
my bellow code is genarate the pdf file at runtime and it's working good,
but it's only show dialog box if the user want to open or save the pdf file
in his computer.
I also want to save a copy from this PDF in my own folder, which it's in the
server, I found one user used this code
PdfWriter.getInstance(document, new FileOutputStream(<path>));
but i'm not using PdfWriter document.
my code is bellow, could you help me please
'add content to existing PDF document with PdfStamper
Dim ps As PdfStamper = Nothing
Try
' read existing PDF document
' optimize memory usage
Dim r As New PdfReader(New
RandomAccessFileOrArray(Request.MapPath("1.pdf")), Nothing)
ps = New PdfStamper(r, Response.OutputStream)
' retrieve properties of PDF form w/AcroFields object
Dim af As AcroFields = ps.AcroFields
' fill in PDF fields by parameter:
' 1. field name
' 2. text to insert
'arabtype
Dim bf As BaseFont =
BaseFont.CreateFont("c:\windows\fonts\times.ttf", BaseFont.IDENTITY_H, True)
Dim f2 As New Font(bf, 12, iTextSharp.text.Font.NORMAL,
iTextSharp.text.Color.BLACK)
af.AddSubstitutionFont(bf)
af.SetField("P_Name", Label1.Text)
af.SetField("P_Rank", Label2.Text)
af.SetField("P_Work", Label3.Text)
af.SetField("P_militry_num", Label7.Text)
af.SetField("Visit_Date", Label4.Text)
af.SetField("P_MR", Label6.Text)
af.SetField("P_Sex", Label12.Text)
af.SetField("P_Nationalty", Label10.Text) '
af.SetField("Next_App_Date", Label5.Text)
af.SetField("P_Partner", Label8.Text) '
af.SetField("Code_No", Label11.Text)
af.SetField("Sys_Date", Label9.Text)
af.SetField("Visit_Date2", Label13.Text)
af.SetField("Next_App_Date2", Label14.Text)
' make resultant PDF read-only for end-user
ps.FormFlattening = False
'ps.add
' forget to close() PdfStamper, you end up with
' a corrupted file!
ps.Close()
Response.AddHeader("content-disposition", "attachment; filename=
" + Label11.Text + ".pdf") ' To Change the pdf name
Catch
Finally
If ps IsNot Nothing Then
ps.Close()
End If
End Try
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/Save-PdfStamper-to-server-tp3914570p3914570.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Ciosco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
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