Page 1 of 1

Add text Programmatically

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

Re: Add text Programmatically

Posted: Wed Feb 24, 2021 8:12 am
by zarkogajic
Hi,

For this you need to look at:

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

-┼żarko

Re: Add text Programmatically

Posted: Wed Feb 24, 2021 8:53 am
by Sasha - Tracker Dev Team
Hello zarkogajic,

Thanks for the assistance :)

Cheers,
Alex