Hello,
I have created one plug-in which should scaling the content to 5 or 10%.
I have taken cos object of content and applying transformation. This works fine.
According to scaling am setting annotation coordinates.
But the problem is I have hightext text as annot.
In code it is considering highlight text as a annot but it's not at all moving to new coordinates.
What could be the problem.
I want to move annotations( links, text highlight ) with scaling.
Please some one help me to solve this issue.
Thanks,
Sow
Hello Irosenth,
I am not using "Rect" key in my coding.
For content scaling i have done as shown below.
CosObj currentCosStream = CosDictGetKeyString(currentCosObj, "Contents");
CString csMsg;
csMsg.Format( _T( "q 1 0 0 1 %d %d cm"),x, y);
// Applying transformation matrix here streamPre = ASMemStmRdOpen(txtPre, strlen(txtPre));
attrDictPre = CosNewDict(cosDoc, false, 1); CosDictPut(attrDictPre, ASAtomFromString("Length"), CosNewInteger(cosDoc, false
for
( int
annotIndex = 0; annotIndex < PDPageGetNumAnnots(currentPDPage); annotIndex++ )
// Create the attributes dictionary for the tranform footer
attrDictPost = CosNewDict(cosDoc, false, 1);
strcpy(txtPost, streamPost = ASMemStmRdOpen(txtPost, strlen(txtPost));
cosArray = CosNewArray(cosDoc, true, 3); // Put all 3 CosStreams into a CosArray (Transform Header, Contents, Transform Footer) CosArrayPut(cosArray, 0, cosStreamPre); CosArrayPut(cosArray, 1, currentCosStream); CosArrayPut(cosArray, 2, cosStreamPost); // Replace the contents of the page with the new CosArray including the transform PDPageAddCosContents(pdPage, cosArray); //Here am taking annots
for {
pdAnnot = PDPageGetAnnot(currentPDPage, annotIndex);
AWidth = (Ax2-Ax1)*(iPercentage/100.0)/2.0; AHeight = (Ay2-Ay1)*(iPercentage/100.0)/2.0; //According to percentage value am resetting annot using PDAnnotSetRect(pdAnnot, &calRect); } This works fine for links. but this is not working text highlight. Please let me know what mistake i have done here or shall i do scaling taking keywords as "Annots" Please let me know. Thanks, Sow
Thanks for reply Irosenth.
The PDF content appearance shows fine after scaling. Links rectangle appearance works fine after scaling. Only the problem is Text highlight appearance is not changing. It remains the same position.
What could be the reason.
Please help me to solve this issue.
Thanks,
Sow
North America
Europe, Middle East and Africa
Asia Pacific