Good day all.
I am developing an application using C# WinForms and Telerik 2020.1.218.40 that needs to take pre-filled PDF forms and display the page images as static documents. I have been able to read the PDFs and split the documents into individual pages, which when viewed using Microsoft Edge's PDF rendering, displays the forms with data, but when loaded into a RadPdfViewer, only displays the form image without any of the completed data.
Any help in displaying the form data is appreciated.
private static readonly string uploadPath = "H:\\TEMP\\DMSUpload\\";
string splitNameTemplate = Path.Combine(uploadPath, "SplitPage-{0}.pdf");
using (FileStream fs = new FileStream(uploadPath + "TEMP.PDF", FileMode.OpenOrCreate))
{
RadFixedDocument document = new PdfFormatProvider().Import(fs);
using (FileStream writeStream = new FileStream(uploadPath + "FOO.PDF", FileMode.OpenOrCreate))
{
PdfFormatProvider provider = new PdfFormatProvider();
provider.Export(document, writeStream);
using (PdfFileSource fileSource = new PdfFileSource(writeStream))
{
for (int i = 0; i < fileSource.Pages.Length; i++)
{
using (PdfStreamWriter fileWriter = new PdfStreamWriter(File.OpenWrite(string.Format(splitNameTemplate, i + 1))))
{
PdfPageSource pageSource = fileSource.Pages[i];
fileWriter.WritePage(pageSource);
}
}
}
}
}
pdfViewer.LoadDocument(uploadPath + "SplitPage-1.pdf");