Create a PDF with image, text, and a border

Hi,

I am trying to create a PDF from a Word document. ~The code creates a PDF document, creates a paragraph and loads the image into it. The next paragraph is created and reads the text from a streamreader into it. However, I cannot work out how to add a border to the page. I read the topic on page 4 of the forum about creating a rectangle with text into it, however the solution provided there only works with a PDFDocument. To get the Section functionality needed for paragraphs, I have made my document using the PDFLogicDocument. Is there any way of creating a border with this?

Any help gratefully appreciated, I have attached my code.



Mat.Test.WinApp.zip

3 Replies

AD Administrator Syncfusion Team November 23, 2006 11:24 PM UTC

Hi Mat,

Thank you for your interest in essential PDF. It is possible to add a border to page with the help of Canvas. We can add a canvas and give size that we want. Once the canvas is added, its border will be displayed on the page.

// Add a canvas.
ICanvas canvas = paragraph.AppendCanvas(new SizeF(565,810));

Here is the sample for your reference.
PageBorder.zip


Could you please take a look at this and let me know if you have any other queries.

Regards,
Prakash


AD Administrator Syncfusion Team November 24, 2006 09:39 AM UTC

Hi Prakash,

that works perfectly thanks! Just needs a bit of sorting to get the borders the right size, etc but that wont take long.
Thanks for your help

Mat


AD Administrator Syncfusion Team November 28, 2006 04:35 PM UTC

Hi Mat,

Glad to know that it works fine.Thanks for your update!

Regards,
Prakash

Loader.
Up arrow icon