Quantcast

pdf form: how to send a line break

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

pdf form: how to send a line break

Cristina Moura
Hi!

I have a PDF form that I need to fill.
Some of the text-fields are large, so I need to send a line break with my
text.

How can I do that?

This is the code I’m using:

-----------------------------------------------------------------------

  Dim pdfTemplate As String = Server.MapPath("TEMPLATE.pdf")
        Dim newFile As String = Server.MapPath("Certificado.PDF")

        'password

        Dim password() As Byte
        Dim Upassword() As Byte
        password = System.Text.Encoding.ASCII.GetBytes("teste")
        Upassword = System.Text.Encoding.ASCII.GetBytes("")

        'Dim pdfwriter As PdfWriter

        Dim pdfReader As New PdfReader(pdfTemplate, password)
        Dim pdfStamper As New PdfStamper(pdfReader, New FileStream(newFile,
FileMode.Create))

        pdfStamper.SetEncryption(Upassword, password,
PdfWriter.AllowPrinting, PdfWriter.STANDARD_ENCRYPTION_128)

        Dim pdfFormFields As AcroFields = pdfStamper.AcroFields

        pdfFormFields.SetField("DESCRIPTION1", "blablablablablalalabalalala
<need line break here> balblblablbalabl")

        pdfStamper.FormFlattening = True

        pdfStamper.Close()
-----------------------------------------------------------------------


Thanks in advance

Regards,

Cristina



------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: pdf form: how to send a line break

Paulo Soares-3
If the field is multiline just put a Chr(10) to break the line.

Paulo

-----Original Message-----
From: Cristina Moura [mailto:[hidden email]]
Sent: Wednesday, April 20, 2011 10:39 AM
To: [hidden email]
Subject: [iText-questions] pdf form: how to send a line break
Importance: High

Hi!

I have a PDF form that I need to fill.
Some of the text-fields are large, so I need to send a line break with my
text.

How can I do that?

This is the code I’m using:

-----------------------------------------------------------------------

  Dim pdfTemplate As String = Server.MapPath("TEMPLATE.pdf")
        Dim newFile As String = Server.MapPath("Certificado.PDF")

        'password

        Dim password() As Byte
        Dim Upassword() As Byte
        password = System.Text.Encoding.ASCII.GetBytes("teste")
        Upassword = System.Text.Encoding.ASCII.GetBytes("")

        'Dim pdfwriter As PdfWriter

        Dim pdfReader As New PdfReader(pdfTemplate, password)
        Dim pdfStamper As New PdfStamper(pdfReader, New FileStream(newFile,
FileMode.Create))

        pdfStamper.SetEncryption(Upassword, password,
PdfWriter.AllowPrinting, PdfWriter.STANDARD_ENCRYPTION_128)

        Dim pdfFormFields As AcroFields = pdfStamper.AcroFields

        pdfFormFields.SetField("DESCRIPTION1", "blablablablablalalabalalala
<need line break here> balblblablbalabl")

        pdfStamper.FormFlattening = True

        pdfStamper.Close()
-----------------------------------------------------------------------


Thanks in advance

Regards,

Cristina



------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
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


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.

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: pdf form: how to send a line break

Cristina Moura

Hi! The field is multiline and I'm doing this:

pdfFormFields.SetField("DESCRIPTION1", "blablablabla Chr(10) blablablabla")

But in the created pdf the Chr(10) appears in the text and no line break is
made.

Regards.
 
Cristina Moura

 

-----Mensagem original-----
De: Paulo Soares [mailto:[hidden email]]
Enviada: quarta-feira, 20 de Abril de 2011 10:48
Para: Post all your questions about iText here
Assunto: Re: [iText-questions] pdf form: how to send a line break

If the field is multiline just put a Chr(10) to break the line.

Paulo

-----Original Message-----
From: Cristina Moura [mailto:[hidden email]]
Sent: Wednesday, April 20, 2011 10:39 AM
To: [hidden email]
Subject: [iText-questions] pdf form: how to send a line break
Importance: High

Hi!

I have a PDF form that I need to fill.
Some of the text-fields are large, so I need to send a line break with my
text.

How can I do that?

This is the code I’m using:

-----------------------------------------------------------------------

  Dim pdfTemplate As String = Server.MapPath("TEMPLATE.pdf")
        Dim newFile As String = Server.MapPath("Certificado.PDF")

        'password

        Dim password() As Byte
        Dim Upassword() As Byte
        password = System.Text.Encoding.ASCII.GetBytes("teste")
        Upassword = System.Text.Encoding.ASCII.GetBytes("")

        'Dim pdfwriter As PdfWriter

        Dim pdfReader As New PdfReader(pdfTemplate, password)
        Dim pdfStamper As New PdfStamper(pdfReader, New FileStream(newFile,
FileMode.Create))

        pdfStamper.SetEncryption(Upassword, password,
PdfWriter.AllowPrinting, PdfWriter.STANDARD_ENCRYPTION_128)

        Dim pdfFormFields As AcroFields = pdfStamper.AcroFields

        pdfFormFields.SetField("DESCRIPTION1", "blablablablablalalabalalala
<need line break here> balblblablbalabl")

        pdfStamper.FormFlattening = True

        pdfStamper.Close()
-----------------------------------------------------------------------


Thanks in advance

Regards,

Cristina



----------------------------------------------------------------------------
--
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
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


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.

----------------------------------------------------------------------------
--
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
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


------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: pdf form: how to send a line break

Balder
On 20/04/2011 12:08, Cristina Moura wrote:
Hi! The field is multiline and I'm doing this:

pdfFormFields.SetField("DESCRIPTION1", "blablablabla Chr(10) blablablabla")

I don't know much of Microsoft languages but it seems logical that Chr(10) is printed in your PDF
Shouldn't it be someting like:
pdfFormFields.SetField("DESCRIPTION1", "blablablabla"+ Chr(10)+" blablablabla")


But in the created pdf the Chr(10) appears in the text and no line break is
made.

Regards.
 
Cristina Moura

 

-----Mensagem original-----
De: Paulo Soares [[hidden email]] 
Enviada: quarta-feira, 20 de Abril de 2011 10:48
Para: Post all your questions about iText here
Assunto: Re: [iText-questions] pdf form: how to send a line break

If the field is multiline just put a Chr(10) to break the line.

Paulo

-----Original Message-----
From: Cristina Moura [[hidden email]] 
Sent: Wednesday, April 20, 2011 10:39 AM
To: [hidden email]
Subject: [iText-questions] pdf form: how to send a line break
Importance: High

Hi!

I have a PDF form that I need to fill. 
Some of the text-fields are large, so I need to send a line break with my
text.

How can I do that?

This is the code I’m using:

-----------------------------------------------------------------------

  Dim pdfTemplate As String = Server.MapPath("TEMPLATE.pdf")
        Dim newFile As String = Server.MapPath("Certificado.PDF")

        'password

        Dim password() As Byte
        Dim Upassword() As Byte
        password = System.Text.Encoding.ASCII.GetBytes("teste")
        Upassword = System.Text.Encoding.ASCII.GetBytes("")

        'Dim pdfwriter As PdfWriter

        Dim pdfReader As New PdfReader(pdfTemplate, password)
        Dim pdfStamper As New PdfStamper(pdfReader, New FileStream(newFile,
FileMode.Create))

        pdfStamper.SetEncryption(Upassword, password,
PdfWriter.AllowPrinting, PdfWriter.STANDARD_ENCRYPTION_128)

        Dim pdfFormFields As AcroFields = pdfStamper.AcroFields

        pdfFormFields.SetField("DESCRIPTION1", "blablablablablalalabalalala
<need line break here> balblblablbalabl")

        pdfStamper.FormFlattening = True

        pdfStamper.Close()
-----------------------------------------------------------------------


Thanks in advance

Regards,

Cristina





----------------------------------------------------------------------------
--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
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


------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
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


--

Kind Regards
Balder


learn to walk before to run
redlab-log
@redlabbe

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: pdf form: how to send a line break

Cristina Moura

Thanks! It’s working! ;-)

 


De: Balder [mailto:[hidden email]]
Enviada: quarta-feira, 20 de Abril de 2011 11:16
Para: [hidden email]
Assunto: Re: [iText-questions] pdf form: how to send a line break

 

On 20/04/2011 12:08, Cristina Moura wrote:

 
Hi! The field is multiline and I'm doing this:
 
pdfFormFields.SetField("DESCRIPTION1", "blablablabla Chr(10) blablablabla")


I don't know much of Microsoft languages but it seems logical that Chr(10) is printed in your PDF
Shouldn't it be someting like:

pdfFormFields.SetField("DESCRIPTION1", "blablablabla"+ Chr(10)+" blablablabla")




 
But in the created pdf the Chr(10) appears in the text and no line break is
made.
 
Regards.
 
Cristina Moura
 
 
 
-----Mensagem original-----
De: Paulo Soares [[hidden email]] 
Enviada: quarta-feira, 20 de Abril de 2011 10:48
Para: Post all your questions about iText here
Assunto: Re: [iText-questions] pdf form: how to send a line break
 
If the field is multiline just put a Chr(10) to break the line.
 
Paulo
 
-----Original Message-----
From: Cristina Moura [[hidden email]] 
Sent: Wednesday, April 20, 2011 10:39 AM
To: [hidden email]
Subject: [iText-questions] pdf form: how to send a line break
Importance: High
 
Hi!
 
I have a PDF form that I need to fill. 
Some of the text-fields are large, so I need to send a line break with my
text.
 
How can I do that?
 
This is the code I’m using:
 
-----------------------------------------------------------------------
 
  Dim pdfTemplate As String = Server.MapPath("TEMPLATE.pdf")
        Dim newFile As String = Server.MapPath("Certificado.PDF")
 
        'password
 
        Dim password() As Byte
        Dim Upassword() As Byte
        password = System.Text.Encoding.ASCII.GetBytes("teste")
        Upassword = System.Text.Encoding.ASCII.GetBytes("")
 
        'Dim pdfwriter As PdfWriter
 
        Dim pdfReader As New PdfReader(pdfTemplate, password)
        Dim pdfStamper As New PdfStamper(pdfReader, New FileStream(newFile,
FileMode.Create))
 
        pdfStamper.SetEncryption(Upassword, password,
PdfWriter.AllowPrinting, PdfWriter.STANDARD_ENCRYPTION_128)
 
        Dim pdfFormFields As AcroFields = pdfStamper.AcroFields
 
        pdfFormFields.SetField("DESCRIPTION1", "blablablablablalalabalalala
<need line break here> balblblablbalabl")
 
        pdfStamper.FormFlattening = True
 
        pdfStamper.Close()
-----------------------------------------------------------------------
 
 
Thanks in advance
 
Regards,
 
Cristina
 
 
 
 
 
----------------------------------------------------------------------------
--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
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
 
 
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
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

 

--

Kind Regards
Balder


learn to walk before to run
redlab-log
@redlabbe


------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
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
Loading...