op.annots.setProps

From Tracker Software PDF SDK
Jump to: navigation, search


Overview

The operation allows to set properties of the given annotations.

Parameters

Name Type Description
Input Array Array of IUnknown-based objects containing the IPXC_Annotation objects which will have their properties modified. Note that all of the annotations must belong to one document.
Output Array Not yet implemented.
Options Dictionary Dictionary with options of the operation.

Sample

//C#
private void SetAnnotationsProperties(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst)
{
	PDFXEdit.IPXS_Inst pSInt = (PDFXEdit.IPXS_Inst)Inst.GetExtension("PXS");
	uint nWidgetAtom = pSInt.StrToAtom("Widget");
	int nID = Inst.Str2ID("op.annots.setProps", false);
	PDFXEdit.IOperation Op = Inst.CreateOp(nID);
	PDFXEdit.ICabNode input = Op.Params.Root["Input"];
	//Get widget annotations from the first page
	PDFXEdit.IPXC_Page page = 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; // widgets will be modified
	Op.Do();
}