PDFsharp & MigraDoc Foundation

Optimize PDF Thumbnail for Windows Thumbnail Cache
Page 1 of 1

Author:  sfm [ Thu Sep 21, 2017 2:29 am ]
Post subject:  Optimize PDF Thumbnail for Windows Thumbnail Cache

Is there any way to provide a thumbnail/preview for a given PdfDocument in PdfSharp? I'm trying to figure out how to help out the "Windows Thumbnail Cache Factory" for a given file, or prevent Windows from building a thumbnail for a specific file.

I am generating PDF files using PdfSharp, but as soon as I write them out to the Desktop folder, I can see the process "dllhost.exe" with description "COM Surrogate" spin up my CPU fan and use ~1.2 GB of RAM for a few seconds. I have other scenarios with larger PDF files where "dllhost.exe" will use up all of my remaining RAM ~8GB and/or crash with the message "Your computer is low on memory".

I'm assuming this is because the PDF files I'm creating are a grid of large-resolution PNG images which takes some effort to load. To reproduce this on your machine, simply download this 1.5MB pdf document and Copy/Paste it on your desktop. Each time you paste, you should see "COM Surrogate" increase your CPU and RAM in Task Manager (for a few seconds) while windows attempts to build an icon cache for this file.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group