We are currently evaluating Aspose.Words and .PDF component to integrate with our CRM solution for our customers. I have run different use cases on Aspose.Words and its working fine but I have issues with Aspose.PDF.
Our customers use PDFs to communicate with customers and when PDFs are sent to Print house, files have to be tagged with annotations.
We use freetext annotation, when I tried the example code it does place a annotation but first it does not show automatically in the PDF, then you click at that specific place and the annotation appears. I also need to set the border and border color but that is also not working. I have to present the solution asap and we have to decide on products, it will be really helpful if you can guide me following is the code I am using.I tried many different things but nothing seems to work, also tried opacity but still when I open the PDF it does not show.
- Show the freetext annotation when open PDF
- Border color
- Solid border.
Thanks
// Saves the document to disk.
string pdfFile1 = dataDir + “Merge_OrderLines Result Out” + i.ToString() + “.pdf”;
docCover.Save(pdfFile1);
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(pdfFile1);
// instantiate DefaultAppearance object
Aspose.Pdf.InteractiveFeatures.DefaultAppearance default_appearance = new DefaultAppearance(“Arial”, 12, System.Drawing.Color.Red);
//create annotation
Aspose.Pdf.Rectangle pageDimensions = pdfDocument.Pages[1].GetPageRect(true);
FreeTextAnnotation freetext = new FreeTextAnnotation(pdfDocument.Pages[1], new Aspose.Pdf.Rectangle(0, 20, 40, 0), default_appearance);
Aspose.Pdf.InteractiveFeatures.Annotations.Border border = new Aspose.Pdf.InteractiveFeatures.Annotations.Border(freetext);
border.Style = BorderStyle.Solid;
border.EffectIntensity = 2;
freetext.Opacity = 10f;
freetext.Characteristics.Border = Color.Red;
freetext.Border = border;
freetext.Contents = “Free Text”;
/*freetext.Characteristics.Background = Color.Yellow;
freetext.Characteristics.Border = Color.Red;
freetext.TextStyle.Color = Color.Red;
//freetext.Opacity = 1f;
// specify the contents of annotation
freetext.Contents = “Free Text”;
*/
// add anootation to annotations collection of page
pdfDocument.Pages[1].Annotations.Add(freetext);
pdfDocument.Save(pdfFile1);