Add text Programmatically

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
MH_BODS
User
Posts: 1
Joined: Wed Feb 24, 2021 3:35 am

Add text Programmatically

Post by MH_BODS »

Hi,

I understand that I could use the code below to let user add text.

pdfctrl.Inst.ExecUICmd2(pdfctrl.Inst.Str2ID("cmd.tool.addText"))

However, I would like to programmatically add text in specific location.

I have tried using FreeText to add.

Dim sInst As PDFXEdit.IPXS_Inst
sInst = CType(pdfctrl.Inst.GetExtension("PXS"), PDFXEdit.IPXS_Inst)

Dim freeTextBoxId As UInteger
freeTextBoxId = sInst.StrToAtom("FreeText")

Dim page As PDFXEdit.IPXC_Page
page = docPreview.Doc.CoreDoc.Pages(CUInt(pageNr))


It is working but the text appeared as annotation, can be resize and move which is different from the result of

pdfctrl.Inst.ExecUICmd2(pdfctrl.Inst.Str2ID("cmd.tool.addText"))

How can I achieve it ?


Thank you.
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Add text Programmatically

Post by zarkogajic »

Hi,

For this you need to look at:

https://github.com/tracker-software/PDFCoreSDKExamples/blob/master/CSharp/CoreAPIDemo/Content.cs

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Add text Programmatically

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Thanks for the assistance :)

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply