【发布时间】:2012-02-26 03:34:20
【问题描述】:
我需要在 WPF 表单中显示 PDF 文档的PdfPage。我正在使用Docotic.pdf.dll 并想坚持下去。 PdfPage.Thumbnail 也给我所有 PDF 的 null。
【问题讨论】:
我需要在 WPF 表单中显示 PDF 文档的PdfPage。我正在使用Docotic.pdf.dll 并想坚持下去。 PdfPage.Thumbnail 也给我所有 PDF 的 null。
【问题讨论】:
刚刚从 Bit Miracle 确认,Docotic.Pdf 3.4 (available on their site) 中已添加此功能,目前处于测试阶段。
下面是从 Pdf 中保存图像的代码。
using (PdfDocument pdf = new PdfDocument("your_file.pdf"))
{
PdfDrawOptions options = PdfDrawOptions.CreateZoom(150);
options.BackgroundColor = new PdfRgbColor(255, 255, 255); // white background, transparent by default
options.Format = PdfDrawFormat.Jpeg;
pdf.Pages[0].Save("result.jpg", options);
}
还有可能值得研究的Draw and print PDF 样本组。
【讨论】:
据我所知 Docotic.Pdf 不能显示 PDF 文件(至少是当前版本),它只能创建它们。 PdfPage.Thumbnail 是指嵌入在 PDF 文件中的页面缩略图,通常是缺失的,这就是该属性返回 null 的原因。
【讨论】: