Insert and write on new page

Technical support for Spire.PDF

Moderator: iceblue support

Insert and write on new page

Postby maf40 » Sun Jul 30, 2017 5:20 pm

Hi

I want to insert a new page and write on that new page. I have the code below but it doesnt insert the written text, only a blank page. Can someone help please?

Dim doc1 = New PdfDocument()
doc1.LoadFromFile("T:\maf.pdf")
Dim page = doc1.Pages(0)
Dim size = page.Size

Dim newPage = doc1.Pages.Insert(1, Size)
newPage.Canvas.DrawTemplate(page.CreateTemplate(), New PointF(0, 0))
newPage.Canvas.DrawString("Hello World.", New PdfFont(PdfFontFamily.Helvetica, 30.0F), New PdfSolidBrush(Color.Black), 10, 10)
doc1.SaveToFile("t:\result1.pdf")
maf40
 
Posts: 1
Joined: Sat Jul 29, 2017 8:05 pm

Re: Insert and write on new page

Postby Betsy.jiang » Mon Jul 31, 2017 2:42 am

Dear maf40,

Thanks for your inquiry.
I have tested the code with the latest Spire.PDF Pack(Hot Fix) Version:3.9.226, it works fine on my side. Please try to use this version. If the issue still exists, please provide the input file for testing.

Thanks,
Betsy
E-iceblue support team
User avatar
Betsy.jiang
 
Posts: 1629
Joined: Tue Sep 06, 2016 8:30 am

Re: Insert and write on new page

Postby Betsy.jiang » Wed Aug 02, 2017 8:04 am

Dear maf40,

How is the issue now ?
Could you please give us some feedback at your convenience ?

Thanks,
Betsy
E-iceblue support team
User avatar
Betsy.jiang
 
Posts: 1629
Joined: Tue Sep 06, 2016 8:30 am


Return to Spire.PDF

Who is online

Users browsing this forum: No registered users and 0 guests