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

Notification

Icon
Error

New Topic Post Reply
Options
Go to last post Go to first unread
matt.smokeball  
#1 Posted : Friday, June 22, 2018 2:07:28 AM(UTC)
Quote
matt.smokeball

Rank: Member

Groups: Registered
Joined: 4/15/2018(UTC)
Posts: 24
Man
Australia
Location: Sydney

Thanks: 2 times
Hi

We're trying to create some text and insert it into a document, which is displayed in the WPF viewer.

I've been able to create a text string and add it to the document at the X, Y. But it doesn't persist in the document. If you scroll a few pages away the come back, it disappears. It also doesn't get saved with the document.

I've been looking through past posts and there doesn't seem to be much I can find to help with this. Could you please provide some assistance in how we can get this to happen? Trying to add annotations similar to what is accomplished in Acrobat. The text should be persisted over any viewer, I'm hoping.

The code below is what I've done that seems to add the text in (still not sure about the Viewer.Invalidate* methods either, is this correct?).

Thanks for your help!

Code:


var obj = PdfTextObject.Create(Text, X, Y, Font, FontSize);
obj.FillColor = Color.BlueViolet;
obj.StrokeColor = Color.BlueViolet;

Page.PageObjects.Add(obj);
Viewer.InvalidateMeasure();
Viewer.InvalidateVisual();
Viewer.UpdateDocLayout();

Paul Rayman  
#2 Posted : Tuesday, June 26, 2018 8:23:58 AM(UTC)
Quote
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
Hi,

You should call page.GenerateContent();
Please look at this example
https://forum.patagames....F-document--using-Pdfium
thanks 1 user thanked Paul Rayman for this useful post.
matt.smokeball on 6/27/2018(UTC)
Quick Reply Show Quick Reply
Users browsing this topic
Guest
New Topic Post Reply
Forum Jump  
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.