We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Show WidgetAnnotation by default

I have some PDFs with signatures in them. Their info is included in the document as a WidgetAnnotation. Now I want this annotation’s visual representation in the PDF to be shown by default when the document is opened. I’m aware this is not working with the test version of Aspose, but I was hoping you could tell me whether it was possible at all.

Until now I have not found a conclusive way to make e.g. a border show even when the mouse is not hovering over the signature field. A WidgetAnnotation does not have .Open as a property, which seems to be the way it is done with other annotation types.

Hi Sorin,


Thanks for contacting support.

Can you please share the input PDF file with WidgetAnnotation and an image file showing desired behavior, so that we can test the scenario in our environment.

Here is the file I’m working with. I have screencapped it opened in
Adobe Reader, where there is a border around the signature part when
hovered over. What I would like is for the border to show at all times,
for example [another option might be to change the background colour].

Hi Sorin,


Thanks for sharing the details and resource files.

In order to draw border around Annotation, the border property can be used. However I have observed that when using following code snippet, border does not render around WidgetAnnotation. For
the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-39152. We
will investigate this issue in details and will keep you updated on the status
of a correction.

We apologize for your inconvenience.


[C#]

// Open document

Document pdfDocument = new Document("c:/pdftest/15-07-29+Schreiben+an+Frau+Volkmann+(2+Signaturen).pdf");

// Instantiate DefaultAppearance object

Aspose.Pdf.InteractiveFeatures.DefaultAppearance default_appearance = new Aspose.Pdf.InteractiveFeatures.DefaultAppearance("Arial", 28, System.Drawing.Color.Red);

Aspose.Pdf.InteractiveFeatures.Annotations.WidgetAnnotation annotation = (Aspose.Pdf.InteractiveFeatures.Annotations.WidgetAnnotation)pdfDocument.Pages[1].Annotations[2];

// Loop through all the annotations

//foreach (Aspose.Pdf.InteractiveFeatures.Annotations.WidgetAnnotation annotation in pdfDocument.Pages[1].Annotations)

{

Console.WriteLine(annotation.Name);

Console.WriteLine(annotation.Rect.Height );

//annotation.DefaultAppearance = default_appearance;

Border border = new Border(annotation);

border.Width = 5;

border.Dash = new Dash(1, 1);

annotation.Border = border;

}

pdfDocument.Save("c:/pdftest/FormatingUpdated.pdf");