Aspose.Pdf for .NET 10.3.0 implements PDF to PPTX conversion

Aspose.Pdf for .NET 10.3.0 has further improved and optimized the functions of the previous version, which makes the API still ahead of its competitors. Aspose always implements high standards and strict requirements, in order to allow developers to complete their needs with the least amount of code!

PDF-PPTX conversion

Aspose.Pdf for .NET 10.3.0

Another API of aspose is called Aspose.Slides . The main function is to create and manipulate existing MSPPT files, and it can also convert PPT/PPTX files into PDF files, so that the converted files can be browsed across platforms without worrying about the layout of the document. and format. PDF can preserve the original appearance of the source file very well, so there are many uses and audiences. Recently, many customers have reported that they need to add the function of converting PDF files to PPTX files. Of course, Aspose.Pdf for .NET has fulfilled this function. To achieve this requirement, you only need to instantiate an object of the PptxSaveOptions class and pass it as the second parameter to the Document.Save(. .) method. For details, please click: Convert PDF to PPTX .

Also, get a sneak peek at some of the latest conversion features in Aspose.Pdf for .NET. by checking out Working with Document Conversion .

1
2
3
4
5
6
// Load PDF document
Aspose.Pdf.Document doc = new Aspose.Pdf.Document( @"C:\pdftest\IN_7664539.pdf" );
// Instantiate PptxSaveOptions instance
Aspose.Pdf.PptxSaveOptions pptx_save = new Aspose.Pdf.PptxSaveOptions();
// Save the output in PPTX format
doc.Save( "c:/pdftest/IN_7664539.pptx" , pptx_save);

Create multi-column PDF documents

Newspapers and magazines can be divided into several columns on the same page, unlike books, where paragraphs are laid out on the left and right sides. Many document processing applications, such as Microsoft Word and Adobe Acrobat Writer, allow users to create multiple columns on a page. Now Aspose.Pdf for .NET also implements the PDF column function, click for details: Create Multi-Column PDF document

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Document doc = new Document();
// specify the left margin info for the PDF file
doc.PageInfo.Margin.Left = 40;
// specify the Right margin info for the PDF file
doc.PageInfo.Margin.Right = 40;
Page page = doc.Pages.Add();
 
Aspose.Pdf.Drawing.Graph graph1 = new Aspose.Pdf.Drawing.Graph(500, 2);
// Add the line to paraphraphs collection of section object
page.Paragraphs.Add(graph1);
 
//specify the coordinates for the line
float [] posArr = new float [] { 1, 2, 500, 2 };
Aspose.Pdf.Drawing.Line l1 = new Aspose.Pdf.Drawing.Line(posArr);
graph1.Shapes.Add(l1);
//Create string variables with text containing html tags
 
string s = "" +
 
"< strong> How to Steer Clear of money scams "
+ "" ;
//Create text paragraphs containing HTML text
 
HtmlFragment heading_text = new HtmlFragment(s);
page.Paragraphs.Add(heading_text);
 
Aspose.Pdf.FloatingBox box = new Aspose.Pdf.FloatingBox();
//Add four columns in the section
box.ColumnInfo.ColumnCount = 2;
//Set the spacing between the columns
box.ColumnInfo.ColumnSpacing = "5" ;
 
box.ColumnInfo.ColumnWidths = "105 105" ;
TextFragment text1 = new TextFragment( "By A Googler (The Official Google Blog)" );
text1.TextState.FontSize = 8;
text1.TextState.LineSpacing = 2;
box.Paragraphs.Add(text1);
text1.TextState.FontSize = 10;
 
text1.TextState.FontStyle = FontStyles.Italic;
// Create a graphs object to draw a line
Aspose.Pdf.Drawing.Graph graph2 = new Aspose.Pdf.Drawing.Graph(50, 10);
// specify the coordinates for the line
float [] posArr2 = new float [] { 1, 10, 100, 10 };
Aspose.Pdf.Drawing.Line l2 = new Aspose.Pdf.Drawing.Line(posArr2);
graph2.Shapes.Add(l2);
 
// Add the line to paragraphs collection of section object
box.Paragraphs.Add(graph2);
 
TextFragment text2 = new TextFragment( @"Sed augue tortor, sodales id, luctus et, pulvinar ut, eros. Suspendisse vel dolor. Sed quam. Curabitur ut massa vitae eros euismod aliquam. Pellentesque sit amet elit. Vestibulum interdum pellentesque augue. Cras mollis arcu sit amet purus. Donec augue. Nam mollis tortor a elit. Nulla viverra nisl vel mauris. Vivamus sapien. nascetur ridiculus mus. Nam justo lorem, aliquam luctus, sodales et, semper sed, enim Nam justo lorem, aliquam luctus, sodales et,nAenean posuere ante ut neque. Morbi sollicitudin congue felis. Praesent turpis diam, iaculis sed, pharetra non, mollis ac, mauris. Phasellus nisi ipsum, pretium vitae, tempor sed, molestie eu, dui. Duis lacus purus, tristique ut, iaculis cursus, tincidunt vitae, risus. Sed commodo. *** sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam justo lorem, aliquam luctus, sodales et, semper sed, enim Nam justo lorem, aliquam luctus, sodales et, semper sed, enim Nam justo lorem, aliquam luctus, sodales et, semper sed, enim nAenean posuere ante ut neque. Morbi sollicitudin congue felis. Praesent turpis diam, iaculis sed, pharetra non, mollis ac, mauris. Phasellus nisi ipsum, pretium vitae, tempor sed, molestie eu, dui. Duis lacus purus, tristique ut, iaculis cursus, tincidunt vitae, risus. Sed commodo. *** sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed urna. . Duis convallis ultrices nisi. Maecenas non ligula. Nunc nibh est, tincidunt in, placerat sit amet, vestibulum a, nulla. Praesent porttitor turpis eleifend ante. Morbi sodales.nAenean posuere ante ut neque. Morbi sollicitudin congue felis. Praesent turpis diam, iaculis sed, pharetra non, mollis ac, mauris. Phasellus nisi ipsum, pretium vitae, tempor sed, molestie eu, dui. Duis lacus purus, tristique ut, iaculis cursus, tincidunt vitae, risus. Sed commodo. *** sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed urna. . Duis convallis ultrices nisi. Maecenas non ligula. Nunc nibh est, tincidunt in, placerat sit amet, vestibulum a, nulla. Praesent porttitor turpis eleifend ante. Morbi sodales." );
box.Paragraphs.Add(text2);
 
page.Paragraphs.Add(box);
 
string outFile = "c:/pdftest/Muli-Column.pdf" ;
//Save the Pdf
doc.Save(outFile);

PDF/A格式支持添加附件

PDF/A格式的文件支持添加附件了。按照 Adobe Community post, PDF/A_3a 合规格式支持添加任意文件类型为附件。详情请看: Convert PDF File to PDF-A

1
// instantiate Document instance to load existing file Aspose.Pdf.Document doc = new Document("c:/colored.pdf"); //setup new file to be added as attachment FileSpecification fileSpecification = new FileSpecification("c:/input.jpg", "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("c:/Log.txt", Aspose.Pdf.PdfFormat.PDF_A_3A, ConvertErrorAction.Delete); // save resultant file doc.Save("c:/Converted.pdf");

支持OTF字体

Aspose.Pdf for .NET 支持在创建或操控PDF文件内容时用 Custom/TrueType 字体。这样文件内容显示就使用除系统默认字体以外的字体。 从本次版本开始,新增支持 Open Type Fonts。详细使用方法请看:How to use OTF fonts.

1
//Create new document instance Document pdfDocument = new Document(); // add page to pages collection of PDF file Aspose.Pdf.Page page = pdfDocument.Pages.Add(); // create TextFragment instnace with sample text TextFragment fragment = new TextFragment("Sample Text in OTF font"); // find font inside system font directory //fragment.TextState.Font = FontRepository.FindFont("HelveticaNeueLT Pro 45 Lt"); // or you can even specify the path of OTF font in system directory fragment.TextState.Font = FontRepository.OpenFont(@"E:\HelveticaNeueLTPro-Lt.otf"); // specify to emend font inside PDF file, so that its displayed properly, // even if specific font is not installed/present over target machine fragment.TextState.Font.IsEmbedded = true; // add TextFragment to paragraphs collection of Page instance page.Paragraphs.Add(fragment); // save resultant file pdfDocument.Save("c:/pdftest/OTF_Font_Tes.pdf");

其他更新内容

In addition to the new features and enhancements mentioned above, PDF to HTML and HTML to PDF conversion capabilities have also been significantly improved. Among these fixes, PCL to PDF, SVG to PDF, PDF to Excel, PDF to DOC, PDF to TIFF and TIFF to PDF conversion, PDF to PDF/A compatible file conversion, text replacement, PDF file rendering to XPS format, etc. Functions have also been refined and improved. Huidu Control Network welcome to download and use Aspose.Pdf for .NET 10.3.0 !

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326993742&siteId=291194637