Hi,
I have a pdf page that has a line annotation with an image on the annotation. The image appears to be added on the annotation when a comment was added to the annotation.
The Image appears to be a comment icon.
When I open the PDF document in Adobe I can see the image on the line annotation.
When I open the PDF document with the PDFEditorDemo, the image is not shown on the annotation.
Is there a way to display the image?
I will send the document to your support address and reference this post.
Thanks
Harlan
Image on annotation not shown in viewer.
Moderator: Alex
-
- Posts: 85
- Joined: Fri Jan 24, 2020 3:37 am
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: Image on annotation not shown in viewer.
Hi Harlan,
Thank you for information and test PDF document. We reproduced the problem and need some time to analyze the situation. I will contact you shortly.
Best regards, Alexander
Thank you for information and test PDF document. We reproduced the problem and need some time to analyze the situation. I will contact you shortly.
Best regards, Alexander
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: Image on annotation not shown in viewer.
Hi Harlan,
We tested your PDF document and have found that only Adobe displays icon image on the line annotation. Foxit and other PDF viewers do not do this. Also we have found that line annotation does not have any information, which defines icon image. These facts say that this is special feature of Adobe.
In next minor version (10.0.5.1) we will add the ability to draw decorations on annotation. I will notify you when new functionality will be available.
Best regards, Alexander
We tested your PDF document and have found that only Adobe displays icon image on the line annotation. Foxit and other PDF viewers do not do this. Also we have found that line annotation does not have any information, which defines icon image. These facts say that this is special feature of Adobe.
In next minor version (10.0.5.1) we will add the ability to draw decorations on annotation. I will notify you when new functionality will be available.
Best regards, Alexander
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: Image on annotation not shown in viewer.
Hi Harlan,
In version 10.0.5.1 we have added overridable DrawCommentSourceDecorations method to the CommentVisualTool visual tool. The method allows to draw custom graphics on annotation that has comment.
Here is code of custom CommentVisualTool that draws yellow rectangle on annotaions, which have comment:
For using MyCommentVisualTool class in PdfEditorDemo project please change line:
to the following line:
Best regards, Alexander
In version 10.0.5.1 we have added overridable DrawCommentSourceDecorations method to the CommentVisualTool visual tool. The method allows to draw custom graphics on annotation that has comment.
Here is code of custom CommentVisualTool that draws yellow rectangle on annotaions, which have comment:
Code: Select all
public class MyCommentVisualTool: CommentVisualTool
{
public MyCommentVisualTool(ImageViewerCommentController commentController, ICommentControlFactory commentControlFactory)
: base(commentController, commentControlFactory)
{
}
protected override void DrawCommentSourceDecorations(PaintEventArgs paintArgs, Comment comment, Rectangle commentSourceBoundingBox)
{
if (!string.IsNullOrEmpty(comment.Text))
{
SizeF size = new SizeF(10, 10);
PointF location = new PointF(
commentSourceBoundingBox.X + commentSourceBoundingBox.Width / 2 - size.Width / 2,
commentSourceBoundingBox.Y + commentSourceBoundingBox.Height / 2 - size.Height / 2);
paintArgs.Graphics.FillRectangle(Brushes.Yellow, new RectangleF(location, size));
}
}
}
Code: Select all
_commentTool = new CommentVisualTool(commentController, new CommentControlFactory());
Code: Select all
_commentTool = new MyCommentVisualTool(commentController, new CommentControlFactory());