Add text Programmatically

PDF-XChange Editor SDK for Developers

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

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 » Wed Feb 24, 2021 3:43 am

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: 931
Joined: Thu Sep 05, 2019 12:35 pm

Re: Add text Programmatically

Post by zarkogajic » Wed Feb 24, 2021 8:12 am

Hi,

For this you need to look at:

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

-žarko

User avatar
Sasha - Tracker Dev Team
User
Posts: 5381
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Add text Programmatically

Post by Sasha - Tracker Dev Team » Wed Feb 24, 2021 8:53 am

Hello zarkogajic,

Thanks for the assistance :)

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

Post Reply