zoukankan      html  css  js  c++  java
  • Aspose.Pdf for .NET控件PDF文档到Excel、EPS、SVG等的转换

    Aspose.Pdf for .NET v8.6.0于昨日发布,该版本包含一个相当令人期待和兴奋的功能——就是让你能转换PDF文件为MS Excel工作簿。使用这个新的更新,开发人员就可以转换PDF文件为XLS格式,PDF文件中每个页面都以一个单独的工作表呈现。以下代码片段展示了如何使用这项功能:

    1
    2
    3
    4
    5
    6
    // Load PDF document
    Aspose.Pdf.Document doc = newAspose.Pdf.Document(@"C:input.pdf");
    // Instantiate ExcelSave Option object
    Aspose.Pdf.ExcelSaveOptions excelsave = newExcelSaveOptions();
    // Save the output in XLS format
    doc.Save("c:/resultant.xls", excelsave);

    之前的版本支持文档转换PDF文件为PS格式,要转换PDF文档到EPS格式,你只需要改变PrintFileName(打印文件名称)如下:

    1
    PrinterSettings.PrintFileName ="Hello.eps";

    获取PS和EPS文件唯一的区别在于打印机选项。请看看“Using LaTeX with EPS Figures”打印为EPS部分,默认是“HP LaserJet 2300 Series PS”打印机及其它任意PS打印机创建PS文件。你可以改变PostScript输出选项为Encapsulated Postscript(EPS)来保存EPS文件。

    在本次更新中,还将有直接保存PDF文件为SVG格式的功能。如下代码显示了运行这项文档转换的简单代码行。

    1
    2
    3
    4
    5
    6
    7
    8
    // Load PDF document
    Aspose.Pdf.Document doc = newAspose.Pdf.Document(@"C:TableResult.pdf");
    Aspose.Pdf.SvgSaveOptions saveOptions = newAspose.Pdf.SvgSaveOptions();
    // Do not compress SVG image to Zip archive
    saveOptions.CompressOutputToZipArchive = false;
    // Output file name
    stringoutFileName = @"C:output.svg";
    doc.Save(outFileName, saveOptions);

    在PDF转换为HTML期间,你还可以为图像文件指定一个单独文件夹。

  • 相关阅读:
    HDU 4913 Least common multiple
    HDU 4915 Parenthese sequence
    HDU 2459 Maximum repetition substring
    HDU 5727 Necklace
    HDU 5724 Chess
    HDU 5726 GCD
    hihoCoder1033 交错和 数位DP
    2016百度之星资格赛题解
    10LaTeX学习系列之---Latex的文档结构
    09LaTeX学习系列之---Latex 字体的设置
  • 原文地址:https://www.cnblogs.com/platfarm/p/3901288.html
Copyright © 2011-2022 走看看