I’m generating a preview image of a PDF using PngDevice. Adobe Reader X documents are not showing the preview correctly. It just renders a view saying Reader X is required.
MemoryStream stream = new MemoryStream();
Document pdfDocument = new Document(sourceFileInfo.FullFilePath);<span style="color: rgb(43, 145, 175); ">Page</span> firstPage = pdfDocument.Pages.Cast<<span style="color: rgb(43, 145, 175); ">Page</span>>().First(); <span style="color: rgb(43, 145, 175); ">PngDevice</span> pngDevice = <span style="color: blue; ">new</span> <span style="color: rgb(43, 145, 175); ">PngDevice</span>((<span style="color: blue; ">int</span>)firstPage.MediaBox.Width, (<span style="color: blue; ">int</span>)firstPage.MediaBox.Height); pngDevice.Process(firstPage, stream);</pre><pre style="font-family: Consolas; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><br></pre><pre style="font-family: Consolas; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><br></pre></div>