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

Notification

Icon
Error

Options
Go to last post Go to first unread
Stokara  
#1 Posted : Wednesday, January 6, 2016 12:33:44 PM(UTC)
Stokara

Rank: Newbie

Groups: Registered
Joined: 1/6/2016(UTC)
Posts: 2
United States
Location: ?New Jersey

The PdfTextObject does not have a setter - how do I accomplish this

Edited by user Wednesday, January 6, 2016 2:11:18 PM(UTC)  | Reason: Not specified

Paul Rayman  
#2 Posted : Wednesday, January 6, 2016 5:02:36 PM(UTC)
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)
Please look at example below:

Code:

//Create new text object with stock font
var to = PdfTextObject.Create();
to.Font = PdfFont.CreateStock(pdfViewer1.Document, FontStockNames.Arial);
//Set text to TextObject
to.TextUnicode = "Sample text";
//Scale text object with scale factor = 50
to.Transform(50, 0, 0, 50, 0, 0);
//Set object location in page coordinates
to.Location = new PointF(100, 100);
//Set object color
to.StrokeColor = Color.Black;
//Insert object to a page
Document.Pages[0].PageObjects.InsertObject(to);


Please take a note, the pdfium is more a viewer than an editor and original engine has no functionality for working with text objects.
Unfortunately at the moment we can't save changes made in the text objects to the file, but the changes will be seen in the viewer, and they can be sended to the printer.
Paul Rayman  
#3 Posted : Tuesday, August 7, 2018 10:04:27 PM(UTC)
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)
Over the years, the SDK has moved far ahead. Now this task is easily solved. An example can be found here.
https://forum.patagames....F-document--using-Pdfium
Users browsing this topic
Guest (2)
Similar Topics
Very slow GenerateContent() if I add text to PDF pages (Bug Report & Technical Support)
by Mikhael 1/17/2022 1:05:26 AM(UTC)
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.