当前位置: 首页>>代码示例>>C#>>正文


C# Document.Convert方法代码示例

本文整理汇总了C#中Document.Convert方法的典型用法代码示例。如果您正苦于以下问题:C# Document.Convert方法的具体用法?C# Document.Convert怎么用?C# Document.Convert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Document的用法示例。


在下文中一共展示了Document.Convert方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Run

        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdf_DocumentConversion();

            //open document
            Document pdfDocument = new Document(dataDir + "PDFToPDFA.pdf");
            
            //Convert to PDF/A compliant document
            //during conversion process, the validation is also performed
            pdfDocument.Convert(dataDir + "log.xml", PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);

            //save output document
            pdfDocument.Save(dataDir + "PDFToPDFA_out.pdf");
        }
开发者ID:joyang1,项目名称:Aspose_Pdf_NET,代码行数:15,代码来源:PDFToPDFA.cs

示例2: Main

        public static void Main(string[] args)
        {
            // The path to the documents directory.
            string dataDir = Path.GetFullPath("../../../Data/");

            //open document
            Document pdfDocument = new Document(dataDir + "input.pdf");

            //Convert to PDF/A compliant document
            //during conversion process, the validation is also performed
            pdfDocument.Convert(dataDir + "log.xml", PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);

            //save output document
            pdfDocument.Save(dataDir + "output.pdf");
        }
开发者ID:Ravivishnubhotla,项目名称:Aspose_Pdf_NET,代码行数:15,代码来源:Program.cs

示例3: Run

        public static void Run()
        {
            // ExStart:PDFToPDFA3b
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdf_DocumentConversion();

            // Open document
            Document pdfDocument = new Document(dataDir + "input.pdf");            
            
            pdfDocument.Convert(new MemoryStream(), PdfFormat.PDF_A_3B, ConvertErrorAction.Delete);

            dataDir = dataDir + "PDFToPDFA3b_out.pdf";
            // Save output document
            pdfDocument.Save(dataDir);
            // ExEnd:PDFToPDFA3b
            Console.WriteLine("\nPDF file converted to PDF/A-3B format.\nFile saved at " + dataDir);
        }
开发者ID:aspose-pdf,项目名称:Aspose.Pdf-for-.NET,代码行数:17,代码来源:PDFToPDFA3b.cs

示例4: Run

        public static void Run()
        {
            // ExStart:PDFToPDFA
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdf_DocumentConversion();

            // Open document
            Document pdfDocument = new Document(dataDir + "PDFToPDFA.pdf");
            
            // Convert to PDF/A compliant document
            // During conversion process, the validation is also performed
            pdfDocument.Convert(dataDir + "log.xml", PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);

            dataDir = dataDir + "PDFToPDFA_out.pdf";
            // Save output document
            pdfDocument.Save(dataDir);
            // ExEnd:PDFToPDFA
            Console.WriteLine("\nPDF file converted to PDF/A-1b compliant PDF.\nFile saved at " + dataDir);
        }
开发者ID:aspose-pdf,项目名称:Aspose.Pdf-for-.NET,代码行数:19,代码来源:PDFToPDFA.cs

示例5: Run

        public static void Run()
        {
            // ExStart:AddAttachmentToPDFA
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdf_DocumentConversion();

            // Instantiate Document instance to load existing file
            Aspose.Pdf.Document doc = new Document(dataDir + "input.pdf");
            // Setup new file to be added as attachment
            FileSpecification fileSpecification = new FileSpecification(dataDir + "aspose-logo.jpg", "Large Image file");
            // Add attachment to document's attachment collection
            doc.EmbeddedFiles.Add(fileSpecification);
            // Perform conversion to PDF/A_3a so attachment is included in resultnat file
            doc.Convert(dataDir + "log.txt", Aspose.Pdf.PdfFormat.PDF_A_3A, ConvertErrorAction.Delete);
            // Save resultant file
            doc.Save(dataDir + "AddAttachmentToPDFA_out.pdf");
            // ExEnd:AddAttachmentToPDFA
            Console.WriteLine("\nAttachment added successfully to PDF/A file.\nFile saved at " + dataDir);
        }
开发者ID:aspose-pdf,项目名称:Aspose.Pdf-for-.NET,代码行数:19,代码来源:AddAttachmentToPDFA.cs

示例6: Run

        public static void Run()
        {
            // ExStart:ReplaceMissingFonts
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdf_DocumentConversion();

            Aspose.Pdf.Text.Font originalFont = null;
            try
            {
                originalFont = FontRepository.FindFont("AgencyFB");
            }
            catch (Exception)
            {
                // Font is missing on destination machine
                FontRepository.Substitutions.Add(new SimpleFontSubstitution("AgencyFB", "Arial"));
            }
            var fileNew = new FileInfo(dataDir + "newfile_out.pdf");
            var pdf = new Document(dataDir + "input.pdf");
            pdf.Convert( dataDir +  "log.xml", PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);
            pdf.Save(fileNew.FullName);
            // ExEnd:ReplaceMissingFonts
        }
开发者ID:aspose-pdf,项目名称:Aspose.Pdf-for-.NET,代码行数:22,代码来源:ReplaceMissingFonts.cs


注:本文中的Document.Convert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。