Posted by a ceTe Software moderator
Hello,
Yes, you can add page border to the converted PDF using our DynamicPDF Merger for .NET product. You will need to convert the other file types to PDF using Converter and then add page border to it using Merger product. Below is the sample code for it.
ConversionOptions options = new ConversionOptions(ceTe.DynamicPDF.Conversion.PageSize.Letter, ceTe.DynamicPDF.Conversion.PageOrientation.Portrait, 50);
byte[] byteData = Converter.Convert(@"C:\Temp\Test.txt", options);
//Adding page border to the PDF using merger.
PdfDocument pdf = new PdfDocument(byteData);
MergeDocument document = new MergeDocument();
document.Append(pdf);
//Looping through the pages in the document for adding page border using Rectangle page element.
for (int i = 0; i < document.Pages.Count; i++)
{
Page page = document.Pages[i];
float width = page.Dimensions.Body.Width - (100);
float height = page.Dimensions.Body.Height - (100); ;
Rectangle rectangle = new Rectangle(50, 50, width, height);
page.Elements.Add(rectangle);
}
document.Draw(@"C:\Temp\MyDocument.pdf");
Thanks,
ceTe Software Support Team.