Hi Alex,
I am using Editor SDK and C# as development language.
Could you please help me to do these:
1. How to get rotation of the text field from an opened document.
2. How can I rotate a newly added text field.
Can you provide me some sample code using the Editor SDK to perform these operations in C# or VB.NET?
Regards,
Usman
How can I rotate a newly added text field
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
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.
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.
-
- User
- Posts: 18
- Joined: Wed Feb 24, 2016 6:51 pm
-
- Site Admin
- Posts: 6815
- Joined: Mon Oct 15, 2012 9:21 pm
Re: How can I rotate a newly added text field
Hi Usman,
I've moved your post to a new topic, as you're using a different SDK to the OP and the question differs from theirs. Please make sure that you post a new topic in the appropriate forum, in the future, unless your post specifically relates to the OP's.
Thanks, will pass your question to the Dev. Team.
I've moved your post to a new topic, as you're using a different SDK to the OP and the question differs from theirs. Please make sure that you post a new topic in the appropriate forum, in the future, unless your post specifically relates to the OP's.
Thanks, will pass your question to the Dev. Team.
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.
Best regards
Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Thank you.
Best regards
Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: How can I rotate a newly added text field
Hello ,
This is how you can do the content rotation of the text fields on the page:
And here's how to get the current widget's rotation:
HTH,
Alex
This is how you can do the content rotation of the text fields on the page:
Code: Select all
private void rotateFiledsToolStripMenuItem_Click(object sender, EventArgs e)
{
PDFXEdit.IPXS_Inst pSInt = (PDFXEdit.IPXS_Inst)pdfCtl.Inst.GetExtension("PXS");
uint nWidgetAtom = pSInt.StrToAtom("Widget");
int nID = pdfCtl.Inst.Str2ID("op.annots.setProps", false);
PDFXEdit.IOperation Op = pdfCtl.Inst.CreateOp(nID);
PDFXEdit.ICabNode input = Op.Params.Root["Input"];
//Get widget annotations from the first page
PDFXEdit.IPXC_Page page = pdfCtl.Doc.CoreDoc.Pages[0];
uint nPageCount = page.GetAnnotsCount();
for (uint i = 0; i < nPageCount; i++)
{
PDFXEdit.IPXC_Annotation annot = page.GetAnnot(i);
if (annot.Type == nWidgetAtom)
{
if ((annot.Field != null) && (annot.Field.Type == PDFXEdit.PXC_FormFieldType.FFT_Text))
input.Add().v = annot;
}
}
if (input.Count == 0)
return;
PDFXEdit.ICabNode options = Op.Params.Root["Options"];
options["ContentRotation"].v = 90;
options["MaskEx"].v = 0x00000400;
Op.Do();
}
Code: Select all
PDFXEdit.IPXC_AnnotData_Widget WData = (PDFXEdit.IPXC_AnnotData_Widget)annot.Data;
double rot = WData.Rotation;
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 18
- Joined: Wed Feb 24, 2016 6:51 pm
Re: How can I rotate a newly added text field
Hi,
Thanks Alex.
I am able to rotate the textfield with the help of code provided by you. But I am unable to get the rotation of a text field of an opened document.
I am using following code to get rotation:
I am also attaching a pdf file. I am trying to get rotating of text fields of this pdf document.
Regards,
Usman Akhtar.
Thanks Alex.
I am able to rotate the textfield with the help of code provided by you. But I am unable to get the rotation of a text field of an opened document.
I am using following code to get rotation:
Code: Select all
PDFXEdit.IPXC_FormField field = pdfEditor.Doc.CoreDoc.AcroForm.GetFieldByName(FieldName);
PDFXEdit.IPXC_Annotation annotation = field.get_Widget(0);
PDFXEdit.IPXC_AnnotData_Widget WData = (PDFXEdit.IPXC_AnnotData_Widget)annotation.Data;
Rotation = WData.Rotation;
Regards,
Usman Akhtar.
You do not have the required permissions to view the files attached to this post.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: How can I rotate a newly added text field
Hello ,
The needed functionality was not in the interfaces. We've updated the code and this will be available from the next build (317):
HTH,
Alex
The needed functionality was not in the interfaces. We've updated the code and this will be available from the next build (317):
Code: Select all
Rotation = WData.ContentRotation;
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ