Not sure if i missed it but looking at the api the only available related to dictionary is an appearance dictionary and this is not what i need.
Hi Chit,
HI tilal. i posted inquiries regarding creating LineDimension and PolygonDimension (which i have done) annotations and not working when resized and you said you will log an issue # for them.
Hi Chit,
The issues you have found earlier (filed as PDFNET-41609) have been fixed in Aspose.Pdf for .NET 17.5.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(3)
Hi,
Document doc = new Document();
Page asposePage = doc.Pages.Add();
Rectangle location = new Rectangle(100, 100, 600, 600);
PolygonAnnotation polyAnnot = new PolygonAnnotation(asposePage, location,
new Point[] {new Point(200, 200), new Point(400, 400), new Point(200, 400)});
polyAnnot.Color = Color.Red;
polyAnnot.StartingStyle = LineEnding.OpenArrow;
polyAnnot.EndingStyle = LineEnding.OpenArrow;
polyAnnot.Contents = “133 mm”;
polyAnnot.Measure = new Measure(polyAnnot);
polyAnnot.Measure.DistanceFormat = new Measure.NumberFormatList(polyAnnot.Measure);
polyAnnot.Measure.DistanceFormat.Add(new Measure.NumberFormat(polyAnnot.Measure));
polyAnnot.Measure.DistanceFormat[1].UnitLabel = “mm”;
polyAnnot.Measure.DistanceFormat[1].FractionSeparator = “.”;
polyAnnot.Measure.DistanceFormat[1].ConvresionFactor = 1;
polyAnnot.Measure.AreaFormat = new Measure.NumberFormatList(polyAnnot.Measure);
polyAnnot.Measure.AreaFormat.Add(new Measure.NumberFormat(polyAnnot.Measure));
polyAnnot.Measure.AreaFormat[1].UnitLabel = “mm”;
polyAnnot.Measure.AreaFormat[1].FractionSeparator = “.”;
polyAnnot.Measure.AreaFormat[1].ConvresionFactor = 1;
polyAnnot.Measure.XFormat = new Measure.NumberFormatList(polyAnnot.Measure);
polyAnnot.Measure.XFormat.Add(new Measure.NumberFormat(polyAnnot.Measure));
polyAnnot.Measure.XFormat[1].UnitLabel = “mm”;
polyAnnot.Measure.XFormat[1].FractionSeparator = “.”;
polyAnnot.Measure.XFormat[1].ConvresionFa
Hi, the line annotation distance measurement does not work. when i resize it, it does not recalculate. i already have this code
chitgoks:Hi, the line annotation distance measurement does not work. when i resize it, it does not recalculate. i already have this codecan you please confirm if i do not use license key, then it won’t resize? or will it? because this may be the problem. need verification from youHi,Thanks for contacting support.I have again tested the scenario in trail as well as licensed mode and I am unable to notice any issue. As per my observations, when resizing the PolygonAnnotation annotation is properly recalculating. For your reference, I have also attached the output files generated with Aspose.Pdf for .NET 17.5 when using following code snippet.Please try using following code snippet.chitgoks:also, can you please provide a working sample?[C#]Document doc = new
Document();Page asposePage = doc.Pages.Add();
Aspose.Pdf.Rectangle
location = new Aspose.Pdf.Rectangle(100, 100, 600, 600);Aspose.Pdf.Annotations.PolygonAnnotation
polyAnnot = new Aspose.Pdf.Annotations.PolygonAnnotation(asposePage, location,new Aspose.Pdf.Point[]
{new Aspose.Pdf.Point(200,
200), new Aspose.Pdf.Point(400,
400), new Aspose.Pdf.Point(200,
400)});polyAnnot.Color = Aspose.Pdf.Color.Red;
polyAnnot.StartingStyle = Aspose.Pdf.Annotations.LineEnding.OpenArrow;
polyAnnot.EndingStyle = Aspose.Pdf.Annotations.LineEnding.OpenArrow;
polyAnnot.Contents = “133
mm”;polyAnnot.Measure = new
Aspose.Pdf.Annotations.Measure(polyAnnot);polyAnnot.Measure.DistanceFormat = new Aspose.Pdf.Annotations.Measure.NumberFormatList(polyAnnot.Measure);
polyAnnot.Measure.DistanceFormat.Add(new Aspose.Pdf.Annotations.Measure.NumberFormat(polyAnnot.Measure));
polyAnnot.Measure.DistanceFormat[1].UnitLabel = “mm”;
polyAnnot.Measure.DistanceFormat[1].FractionSeparator
= “.”;polyAnnot.Measure.DistanceFormat[1].ConvresionFactor
= 1;polyAnnot.Measure.AreaFormat = new Aspose.Pdf.Annotations.Measure.NumberFormatList(polyAnnot.Measure);
polyAnnot.Measure.AreaFormat.Add(new Aspose.Pdf.Annotations.Measure.NumberFormat(polyAnnot.Measure));
polyAnnot.Measure.AreaFormat[1].UnitLabel = “mm”;
polyAnnot.Measure.AreaFormat[1].FractionSeparator =
“.”;polyAnnot.Measure.AreaFormat[1].ConvresionFactor =
1;polyAnnot.Measure.XFormat = new Aspose.Pdf.Annotations.Measure.NumberFormatList(polyAnnot.Measure);
polyAnnot.Measure.XFormat.Add(new Aspose.Pdf.Annotations.Measure.NumberFormat(polyAnnot.Measure));
polyAnnot.Measure.XFormat[1].UnitLabel = “mm”;
polyAnnot.Measure.XFormat[1].FractionSeparator = “.”;
polyAnnot.Measure.XFormat[1].ConvresionFactor = 1;
polyAnnot.Measure.ScaleRatio = “1 mm = 1 mm”;
polyAnnot.Intent = Aspose.Pdf.Annotations.PolyIntent.PolygonDimension;
asposePage.Annotations.Add(polyAnnot);
doc.ExportAnnotationsToXfdf(“c:/pdftest/data.xfdf”);
doc.Save(“c:/pdftest/out-1.pdf”);
Document doc1 = new
Document();doc1.Pages.Add();
doc1.ImportAnnotationsFromXfdf(“c:/pdftest/data.xfdf”);
doc1.Save(“c:/pdftest/out-2.pdf”);I have managed to notice the same issue. For the sake of correction, I have logged it as PDFJAVA-36785 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time. We are sorry for your inconvenience.chitgoks:PolygonAnnotation does not have getMeasure() (Only LineAnnotation). i am using Aspose PDF Java 17.4.
hi nayyer. appreciate the response.
Hi,
The reasons .NET code was shared is because the earlier reported issues was under Aspose.Pdf for .NET project. However as shared in my last comments, the PolygonAnnotation class is missing getMeasure(…) so the equivalent code cannot be executed. As soon as the problem is resolved, we will share the required code snippet. We are sorry for this confusion and inconvenience.
great! i’ll wait for the java lib. then i’ll do both testing in java and c#.
Hi Chit,
Hi Chit,
hi nayer. ive tried your code in .net for 17.5 and it worked
Hi Chit,
Hi,
Thanks for contacting support.
I have tried executing your code but I am afraid the method MeasureTool is currently not defined. Can you please share complete code snippet so that we can test the scenario in our environment. We are sorry for your inconvenience.
[C#]
Document doc = new Document();
Page asposePage = doc.Pages.Add();
Aspose.Pdf.Annotations.LineAnnotation lineAnnot = new Aspose.Pdf.Annotations.LineAnnotation(asposePage,new Aspose.Pdf.Rectangle(10,10,50,50), new Aspose.Pdf.Point(10,10), new Aspose.Pdf.Point(100,100));
lineAnnot.Title = firstComment.Username;
lineAnnot.Contents = firstComment.CommentText;
lineAnnot.Modified = firstComment.DateModified;
lineAnnot.Color = Aspose.Pdf.Color.FromRgb(Util.Hex2Rgb(annotation.Color).ToRgb());
lineAnnot.EndingStyle = Aspose.Pdf.Annotations.LineEnding.OpenArrow;
lineAnnot.Contents = MeasureTool.ConvertToInch(
MeasureTool.GetMeasurementFromPixels(annotation.MeasurementType,
MeasureTool.GetDistance(start.X, start.Y, end.X, end.Y)),
annotation.MeasurementType);
lineAnnot.StartingStyle = Aspose.Pdf.Annotations.LineEnding.OpenArrow;
lineAnnot.Intent = Aspose.Pdf.Annotations.LineIntent.LineDimension;
lineAnnot.Measure = new Aspose.Pdf.Annotations.Measure(lineAnnot);
lineAnnot.Measure.DistanceFormat = new Aspose.Pdf.Annotations.Measure.NumberFormatList(lineAnnot.Measure);
lineAnnot.Measure.DistanceFormat.Add(new Aspose.Pdf.Annotations.Measure.NumberFormat(lineAnnot.Measure));
lineAnnot.Measure.DistanceFormat[1].UnitLabel = MeasureTool.GetMeasurementUnitInString(annotation.MeasurementType);
lineAnnot.Measure.DistanceFormat[1].FractionSeparator = ".";
lineAnnot.Measure.DistanceFormat[1].ConvresionFactor = 1;
lineAnnot.ShowCaption = true;
lineAnnot.CaptionPosition = Aspose.Pdf.Annotations.CaptionPosition.Top;
asposePage.Annotations.Add(lineAnnot);
hi nayer, apologies
Hi Chit,
Thanks for the acknowledgement.
I have tested the scenario using following code snippet but I am afraid I am unable to observe the issue when resizing the LineAnnotation in resultant PDF file. Can you please share some further details which can help us in understanding the problem. We are sorry for this inconvenience.
[C#]
Document doc = new Document();
Page asposePage = doc.Pages.Add();
Aspose.Pdf.Annotations.LineAnnotation lineAnnot = new Aspose.Pdf.Annotations.LineAnnotation(asposePage, new Aspose.Pdf.Rectangle(10, 10, 50, 50), new Aspose.Pdf.Point(10, 10), new Aspose.Pdf.Point(100, 100));
lineAnnot.Title = "firstComment.Username";
lineAnnot.Contents = "firstComment.CommentText";
//lineAnnot.Modified = "firstComment.DateModified";
lineAnnot.Color = Aspose.Pdf.Color.Aqua;
lineAnnot.EndingStyle = Aspose.Pdf.Annotations.LineEnding.OpenArrow;
lineAnnot.Contents = "Sample Content";
lineAnnot.StartingStyle = Aspose.Pdf.Annotations.LineEnding.OpenArrow;
lineAnnot.Intent = Aspose.Pdf.Annotations.LineIntent.LineDimension;
lineAnnot.Measure = new Aspose.Pdf.Annotations.Measure(lineAnnot);
lineAnnot.Measure.DistanceFormat = new Aspose.Pdf.Annotations.Measure.NumberFormatList(lineAnnot.Measure);
lineAnnot.Measure.DistanceFormat.Add(new Aspose.Pdf.Annotations.Measure.NumberFormat(lineAnnot.Measure));
lineAnnot.Measure.DistanceFormat[1].UnitLabel = "Unit Label";// MeasureTool.GetMeasurementUnitInString(annotation.MeasurementType);
lineAnnot.Measure.DistanceFormat[1].FractionSeparator = ".";
lineAnnot.Measure.DistanceFormat[1].ConvresionFactor = 1;
lineAnnot.ShowCaption = true;
lineAnnot.CaptionPosition = Aspose.Pdf.Annotations.CaptionPosition.Top;
asposePage.Annotations.Add(lineAnnot);
doc.Save(“c:/pdftest/AnnotationResize.pdf”);
hi codewarrior