Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Nov 09, 2015 8:19 pm

Hi Support,

I am evaluating the PDF\Office Product but I cant seem to get Form fields that have been populated to display when saved as image.

I am able to create the fields and set the text value, but they dont display, untill I open the PDF in adobe and save?

am I doing something wrong? should I be saving the field values somewhere before I close the file?

Code: Select all
                    Dim page As PdfPageBase = pdf.Pages(p - 1)
                    'page.Canvas.DrawString(value, font, brush, x, y)
                    Dim textbox As New PdfTextBoxField(page, Fieldkey)
                    textbox.Bounds = New RectangleF(x1, y1, w1, h1)
                    textbox.BorderWidth = 0.75F
                    textbox.BorderStyle = PdfBorderStyle.Solid
                    textbox.Font = font
                    textbox.Text = value
                    textbox.Visible = True
                    pdf.Form.Fields.Add(textbox)

                End If
            Next

            pdf.Close()

Tjunas
 
Posts: 18
Joined: Thu Nov 05, 2015 6:40 am

Tue Nov 10, 2015 3:48 am

Hi,

Thanks for your interests in our products.
Yes, please first save pdf document before converting it to image.
Welcome to write to us again for further problems.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Tue Nov 10, 2015 7:37 am

Hi Amy,

When I save the document the same applies, the fields dont update, untill I open it in Adobe and click save there,

I need the fields to update without having to open the document with adobe.

Regards
Tjunas

Tjunas
 
Posts: 18
Joined: Thu Nov 05, 2015 6:40 am

Tue Nov 10, 2015 8:16 am

Hi Tjunas,

It is no need to open the document with adobe to update the fields.
Please try this solution:
Code: Select all
Dim textbox As New PdfTextBoxField(page, "textbox1")
textbox.Bounds = New RectangleF(20, 20, 40, 50)
textbox.BorderWidth = 0.75F
textbox.BorderStyle = PdfBorderStyle.Solid
textbox.Text = "1233454"
textbox.Visible = True
pdf.Form.Fields.Add(textbox)
Dim ms As New MemoryStream()
pdf.SaveToStream(ms)
Dim image As Image = pdf.SaveAsImage(0)
image.Save("1.png", ImageFormat.Png)
pdf.Close()


Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Fri Nov 13, 2015 8:10 am

Hi,

Has your issue been resolved?
Thanks for your feedback.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Fri Nov 13, 2015 8:29 pm

Hi Amy,

Thank you, the code provided resolved the issue.

Regards
Tjunas

Tjunas
 
Posts: 18
Joined: Thu Nov 05, 2015 6:40 am

Mon Nov 16, 2015 3:01 am

Hi Tjunas,

Thanks for your feedback.
Welcome to write to us again if you have further problems.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF

cron