In one of the application, we are using Telerik Pdf Processing library to convert docx template into pdf. For a few docx templates, exported PDFs are not identical to docx templates.
I've attached both files - template and generated pdf. In the generated pdf, a table is moved into right side and a few portion of right side is cut (Can't see complete table in pdf).
Template: https://drive.google.com/file/d/1u0geoIkSzT3iRAg3xJaSlNsOmC00_078/view?usp=sharing
Generated PDF Output: https://drive.google.com/file/d/1ceNyE4vUxxafaVOZr7zSwDfUm111eu2L/view?usp=sharing
Following code, we are using to generate pdf from docx
Can anybody tell us what is missing here in code?
Why a table is cut from right side in the generated pdf? Are there any ways to fix this issue?
It would be a great help if anyone could help to fix this issue.
[TestMethod]
public void TelerikPdfConversionTest()
{
string templatePath = Path.Combine(_telerikTemplateDirectory, $@"DependentNearing19.docx");
byte[] data = File.ReadAllBytes(templatePath);
var provider = new DocxFormatProvider();
RadFlowDocument doc = provider.Import(data);
string templateName = Path.GetFileNameWithoutExtension(templatePath);
string pdfPath = Path.Combine(_telerikTemplateDirectory, $@"{templateName}-output.pdf");
if (File.Exists(pdfPath))
{
File.Delete(pdfPath);
}
var pdfProvider = new PdfFormatProvider();
using (Stream output = File.OpenWrite(pdfPath))
{
pdfProvider.Export(doc, output);
}
Assert.IsTrue(File.Exists(pdfPath));
}