logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Mikhael  
#1 Posted : Monday, January 17, 2022 4:05:26 AM(UTC)
Mikhael

Rank: Newbie

Groups: Registered
Joined: 4/7/2021(UTC)
Posts: 5
Russian Federation

Hello,

It seems, that Pdfium if unable to finish GenerateContent() function if I try add text object to PDF file I attached.
My code snippet is below.

Please let me know if you are able to fix this issue.

Mikhael

landscape_orientation.PDF (548kb) downloaded 0 time(s).

Dim srcPDF = "D:\In\landscape_orientation.PDF"
Dim dstPDF = "D:\out\123.pdf"
Dim sLabelText = "My test watermark"

Using pdfFile = PdfDocument.Load(srcPDF, New PdfForms())
For Each pdfiumPage In pdfFile.Pages

Dim font = PdfFont.CreateStock(pdfiumPage.Document, FontStockNames.Arial)
Dim fillColor = New FS_COLOR(128, 255, 0, 0)

Dim wmTextObject As PdfTextObject = PdfTextObject.Create(sLabelText, pdfiumPage.Width / 2, pdfiumPage.Height / 2, font, 20)
wmTextObject.FillColor = fillColor

pdfiumPage.PageObjects.Add(wmTextObject)

pdfiumPage.GenerateContent()
Next

pdfFile.Save(dstPDF, SaveFlags.NoIncremental)
End Using
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.