Hi!
I’m new in Aspose.Pdf for .NET so sorry if my question is obvious.
I need to draw a rectangle on some pages with specified dimensions, fill and border color.
I cannot figure out how to accomplish such task.
Daniel
Hi Daniel,
Thanks for your inquiry. Please check the following code to add a floating box in an existing PDF document. Hopefully, it will help you accomplish the task.
Document pdfDocument11 = new Aspose.Pdf.Document(myDir + "HelloWorld.pdf");
Aspose.Pdf.FloatingBox fb = new Aspose.Pdf.FloatingBox();
fb.Top = 10.0f;
fb.Left = 10.0f;
pdfDocument11.Pages[1].Paragraphs.Add(fb);
fb.Width = 100.0f;
fb.Height = 100.0f;
fb.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 1, Aspose.Pdf.Color.Black);
// Add the Text into paragraphs collection of FloatingBox
fb.Paragraphs.Add(new TextFragment("This is test Text added in FloatingBox using Aspose.Pdf"));
pdfDocument11.Save(myDir + "Rectangle-fb.pdf");
Please feel free to contact us for any further assistance.
Best Regards,
Hi!
Thanks for Your reply. This really works :).
Now I’m trying to make this box a little bit transparent.
I’ve search forum and documentation for this feature, but with no result
Is there any support for transparent objects?
Best regards
alientresor:
Hi!
Thanks for Your reply. This really works :).
Now I'm trying to make this box a little bit transparent.
I've search forum and documentation for this feature, but with no result
Is there any support for transparent objects?
Hi Daniel,