#1 2023-06-26 18:12:03

surfzone
Member
Registered: 2023-06-25
Posts: 7

How to change the icon and the format of an Annotation?

I create an annotation with this code

  var an := Pdf.CreateAnnotation(asTextNotes, PdfRect(40, 40, 80, 80));
  an.AddItem('Contents', TPdfText.Create('Contents example text');
  an.AddItem('S', TPdfText.Create('S'));
  an.AddItem('Open', TPdfBoolean.Create(true));

This creates a ballon that shows the text, but I like to change the icon and format that text... (I like to simulate a "hint" into the PDF).

Note: There are any documentation about annotations? I copied this 3 lines from searching "CreateAnnotation(asTextNotes" on Google...

Offline

#2 2023-06-26 19:35:45

surfzone
Member
Registered: 2023-06-25
Posts: 7

Re: How to change the icon and the format of an Annotation?

The icon is solved, added this types in synPDF.pas (there's only defined asTextNotes and asLink)

  /// The annotation types determines the valid annotation subtype of TPdfDoc
  TPdfAnnotationSubType = (
    asTextNotes, asLink, asSound, asFreeText, asStamp, asSquare, asCircle,
    asStrikeOut, asHighlight, asUnderline, asInk, asFileAttachment, asPopup);

changed with

  var an := Pdf.CreateAnnotation(asSquare, PdfRect(40, 40, 80, 80, abInset, 0));
  an.AddItem('Contents', TPdfText.Create('Contents example text');
  an.AddItem('Open', TPdfBoolean.Create(true));

The internal code for news type are OK, but the type was not defined...

Now, I like to change the design of the annotation text

Offline

Board footer

Powered by FluxBB