If you are referring to the javascript field formating it's not supported.
However, if you know the formating you can apply it with:
AcroFields.SetField(fieldname, fieldvalue, fielddisplay)
For example SetField("amount", 35, "$35.00").
Paulo
________________________________
From: John Polley [jpol...@ujafed.org]
Sent: Thursday, April 08, 2010 3:14 PM
To: Paulo Soares
Subject: FW: [iText-questions] Question about merging pdf documents
Paulo,
If you have a minute to let me know about the formatting question I would
greatly appreciate it.
From: John Polley [mailto:jpol...@ujafed.org]
Sent: Wednesday, April 07, 2010 9:53 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Question about merging pdf documents
Thanks for all of the feedback… I’ve got things working (more or less) the way
that I want. One additional question… in designing my pdf form document I am
accessing the properties of several form fields and setting the format to the
way that I want the values to appear. My resulting pdf document (created with
pdfstamper) is ignoring the formatting. I read one post that indicated the
solution to this problem was to set formflattening to false (and then write
protect the document with some java script)?
Is this the way to do it or is there some other option that I am overlooking?
Thanks again for your help!
From: Paulo Soares [mailto:psoa...@glintt.com]
Sent: Monday, April 05, 2010 4:38 PM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Question about merging pdf documents
See http://1t3xt.info/examples/browse/?page=example&id=35. The idea is to
create the individual files with PdfStamper and then combine them with PdfCopy.
Paulo
----- Original Message -----
From: John Polley<mailto:jpol...@ujafed.org>
To: Post all your questions about iText
here<mailto:itext-questions@lists.sourceforge.net>
Sent: Monday, April 05, 2010 9:12 PM
Subject: Re: [iText-questions] Question about merging pdf documents
Paulo,
Thanks for the quick response. I’ve tried to find an example or some
documentation as to what you mean but can’t come up with anything. Would you
please tell me exactly how to reload the pdf written by the stamper. Also, I’d
really like to be creating the stamper documents in memory… do I do this just
by changing the os used when creating the stamper?
Thanks again for your help!
From: Paulo Soares [mailto:psoa...@glintt.com]
Sent: Monday, April 05, 2010 3:48 PM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Question about merging pdf documents
After closing stamper you'll have to reload the pdf written by stamper.
Paulo
----- Original Message -----
From: John Polley<mailto:jpol...@ujafed.org>
To:
itext-questions@lists.sourceforge.net<mailto:itext-questions@lists.sourceforge.net>
Sent: Monday, April 05, 2010 8:40 PM
Subject: [iText-questions] Question about merging pdf documents
Hi,
I’ve been trying to get this to work for several days now and am pretty close
but, it appears that I am overlooking something. I am writing a comclass using
VS2005 and the itext class. The comclass reads from records from a database and
then, using a pdf document with form fields, creates a separate page (i.e.,
document) for each record in the table. My comclass works just fine if I write
each resulting pdf out to separate file but I’d like to merge the individual
documents into a single pdf. Here is the code that I am using:
Dim out As New System.IO.FileStream(Me._CreateDocumentPath &
Me._CreateDocumentName, FileMode.Create)
Dim document As New Document()
Dim writer As PdfWriter = PdfWriter.GetInstance(document, out)
document.Open()
Dim page As PdfImportedPage
Dim fieldvalue As String = ""
Using connection As SqlConnection = New
SqlConnection(builder.ConnectionString)
Try
connection.Open()
Catch exception1 As SqlException
ProjectData.SetProjectError(exception1)
Dim exception As SqlException = exception1
Interaction.MsgBox((Conversions.ToString(exception.ErrorCode) &
" " & exception.Message), MsgBoxStyle.OkOnly, Nothing)
Dim str3 As String = ("Error: on database connection: " &
Conversions.ToString(exception.ErrorCode) & " " & exception.Message)
ProjectData.ClearProjectError()
Return str3
End Try
Using command As SqlCommand = New SqlCommand("SELECT * FROM
##PDFFormValues", connection)
Using reader2 As SqlDataReader = command.ExecuteReader
Dim pagecount As Integer = 1
Dim fieldCount As Integer = reader2.FieldCount
Dim num3 As Integer = (fieldCount - 1)
Do While reader2.Read
Dim reader As New PdfReader(filename)
Dim stamper As New PdfStamper(reader, New
FileStream("h:\temp" & pagecount & ".pdf", FileMode.Create)) ' New
FileStream(path, FileMode.Create))
Dim acroFields As AcroFields = stamper.AcroFields
Dim i As Integer = 0
Do While (i <= num3)
If IsDBNull(reader2.GetValue(i)) Then
fieldvalue = ""
Else
fieldvalue = reader2.GetValue(i)
End If
acroFields.SetField(reader2.GetName(i),
Conversions.ToString(fieldvalue))
i += 1
Loop
stamper.FormFlattening = True
stamper.Close()
page = writer.GetImportedPage(reader, 1) 'This gives
blank forms if stamper.close is commented out, otherwise, i get error 14
document.NewPage()
writer.DirectContent.AddTemplate(page, 0, 0)
pagecount += 1
Loop
reader2.Close()
End Using
End Using
End Using
The closest that I have gotten is a document with the correct number of pages
(ie. One for each record in my table) but with none of the form fields showing.
I’d really appreciate it if you could point out what I have done wrong or an
missing.
Regards.
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.
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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/