pdf - PDF 文档的大小,如何使用 Spire.pdf 从毫米转换为像素?

标签 pdf size converter

PDF 文档的大小,如何使用 Spire.pdf 从毫米转换为像素?

    PdfDocument doc = new PdfDocument();
    doc.PageScaling = PdfPrintPageScaling.ActualSize;
    doc.LoadFromFile("myDocument.pdf");

    foreach (PdfPageBase page in doc.Pages)
    {
          //Result returns the pixel type. But I want to show in millimeters
         Console.WriteLine("PageSize: {0}X{1}", page.Size.Width, page.Size.Height);
    }

最佳答案

PDF 页面的大小不是以像素表示,而是以点表示。

1 inch = 72 points
1 inch = 25.4 mm

这导致:
1 point = 0.352777778 mm

关于pdf - PDF 文档的大小,如何使用 Spire.pdf 从毫米转换为像素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34545339/

相关文章:

java - PDF到图像转换

delphi - 将 PDF 文档 (*.pdf) 转储到文本?

c# - iText 7 试用许可证

python - 使用 PythonMagick 从 pdf 更改为图像时图像质量下降

c - Realloc - Realloc 不会生成更小的 char*

python - 如何在 Python 中使用 XSLT 转换 XML 文件?

pdf - PDF 文档可以包含具有不同 DPI 的图像吗?

java - BufferedInputStream 的缓冲区大小

wpf - WPF控件的实际大小

java - 需要为 TextView 格式化货币