原創|產品更新|編輯:龔雪|2015-05-07 11:10:54.000|閱讀 503 次
概述:Aspose.Pdf for .NET 10.3.0較先前版本各項功能又有了進一步提升和優化,這使得該 API 在同類競爭者當中仍是一馬當先。Aspose始終貫徹高標準,嚴要求,為的就是讓開發人員能用最少的代碼完成他們的需求!
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Aspose.Pdf for .NET 10.3.0較先前版本各項功能又有了進一步提升和優化,這使得該 API 在同類競爭者當中仍是一馬當先。Aspose始終貫徹高標準,嚴要求,為的就是讓開發人員能用最少的代碼完成他們的需求!
aspose的另外一個API叫做 Aspose.Slides ,主要功能是創建和操控已有的MSPPT文件,還能夠將PPT/PPTX文件轉換成PDF文件,從而使得轉換后的文件能夠跨平臺瀏覽,無需擔心文檔的布局和格式。 PDF能很好的保存源文件的原本的樣子,所以用途和受眾都很多。 近來,有很多客戶反映需要增加PDF文件轉換為PPTX文件的功能,Aspose.Pdf for .NET當然也不負所望,將這個功能實現了。要實現這個需求,只需要將PptxSaveOptions類實的對象實例化,將它作為第二個參數傳遞給Document.Save(. .)方法,詳情請戳:.
此外,還可以通過查看 搶先觀看Aspose.Pdf for .NET.最新的一些轉換功能。
// 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);
報刊雜志在同一個頁面可以分好幾欄,不像書本,文字段落左右兩邊鋪陳。很多文檔處理應用,比如 Microsoft Word 和Adobe Acrobat Writer 都允許用戶在一個頁面上創建多個欄目。現在Aspose.Pdf for .NET 也實現了PDF分欄功能,詳情點擊:
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_3a 合規格式支持添加任意文件類型為附件。詳情請看:
// 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");
Aspose.Pdf for .NET 支持在創建或操控PDF文件內容時用 Custom/TrueType 字體。這樣文件內容顯示就使用除系統默認字體以外的字體。 從本次版本開始,新增支持 Open Type Fonts。詳細使用方法請看:
//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");
除了上述的新功能和功能增強意外, PDF to HTML 和 HTML to PDF 的轉換功能也有顯著提升。在這些修復中,PCL to PDF, SVG to PDF, PDF to Excel, PDF to DOC, PDF to TIFF以及 TIFF to PDF 轉換, PDF轉換為PDF /A兼容的文件,文字替換, PDF 文件渲染為 XPS格式等功能也有完善和改進。慧都控件網歡迎下載使用Aspose.Pdf for .NET 10.3.0!
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn