htmlpdf代码(html2pdf php)

  Aspose.Pdf for .NET 10.3.0 较先前版本各项功能又有了进一步提升和优化,这使得该 API在同类竞争者当中仍是一马当先。Aspose始终贯彻高标准,严要求,为的就是让开发人员能用最少的代码完成他们的需求!

  PDF-PPTX 转换

  

  aspose的另外一个API叫做 Aspose.Slides ,主要功能是创建和操控已有的MSPPT文件,还能够将PPT/PPTX文件转换成PDF文件,从而使得转换后的文件能够跨平台浏览,无需担心文档的布局和格式。 PDF能很好的保存源文件的原本的样子,所以用途和受众都很多。近来,有很多客户反映需要增加PDF文件转换为PPTX文件的功能,Aspose.Pdf for .NET当然也不负所望,将这个功能实现了。要实现这个需求,只需要将 PptxSaveOptions类实的对象实例化,将它作为第二个参数传递给Document.Save(. .)方法,详情请戳: Convert PDF to PPTX .

  此外,还可以通过查看Working with Document Conversion 抢先观看Aspose.Pdf for .NET.最新的一些转换功能。

  // Load PDF documentAspose.Pdf.Document doc = new Aspose.Pdf.Document(@"C:\pdftest\IN_7664539.pdf");// Instantiate PptxSaveOptions instanceAspose.Pdf.PptxSaveOptions pptx_save = new Aspose.Pdf.PptxSaveOptions();// Save the output in PPTX formatdoc.Save("c:/pdftest/IN_7664539.pptx", pptx_save); 创建多栏PDF文档

htmlpdf代码(html2pdf php)

  报刊杂志在同一个页面可以分好几栏,不像书本,文字段落左右两边铺陈。很多文档处理应用,比如 Microsoft Word 和Adobe Acrobat Writer 都允许用户在一个页面上创建多个栏目。现在Aspose.Pdf for .NET 也实现了PDF分栏功能,详情点击: Create Multi-Column PDF document

  Document doc = new Document();// specify the left margin info for the PDF filedoc.PageInfo.Margin.Left = 40;// specify the Right margin info for the PDF filedoc.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 objectpage.Paragraphs.Add(graph1);//specify the coordinates for the linefloat[] 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 tagsstring s = "" +"< strong> How to Steer Clear of money scams "+ "";//Create text paragraphs containing HTML textHtmlFragment heading_text = new HtmlFragment(s);page.Paragraphs.Add(heading_text);Aspose.Pdf.FloatingBox box = new Aspose.Pdf.FloatingBox();//Add four columns in the sectionbox.ColumnInfo.ColumnCount = 2;//Set the spacing between the columnsbox.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 lineAspose.Pdf.Drawing.Graph graph2 = new Aspose.Pdf.Drawing.Graph(50, 10);// specify the coordinates for the linefloat[] 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 objectbox.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 nisiipsum, 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 nisiipsum, 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 nisiipsum, 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 Pdfdoc.Save(outFile); PDF/A格式支持添加附件

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

  // 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.

  //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 !


【免责声明】:

本站所发布的一切资源仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。

【关于转载】:

本站尊重互联网版权体系,本站部分图片、文章大部分转载于互联网、所有内容不代表本站观点、不对文章中的任何观点负责、转载的目的只用于给网民提供信息阅读,无任何商业用途,所有内容版权归原作者所有
如本站(文章、内容、图片、视频)任何资料有侵权,先说声抱歉;麻烦您请联系请后台提交工单,我们会立即删除、维护您的权益。非常感谢您的理解。

【附】:

二○○二年一月一日《计算机软件保护条例》第十七条规定:为了学习和研究软件内含的设计思想和原理,通过安装、显示、传输或者存储软件等方式使用软件的,可以不经软件著作权人许可,不向其支付报酬!鉴于此,也希望大家按此说明研究软件!

注:本站资源来自网络转载,版权归原作者和公司所有,如果有侵犯到您的权益,请第一时间联系我们处理!

-----------------------------------------------------------------------------------------------------------

【版权声明】:

一、本站致力于为源码爱好者提供国内外软件开发技术和软件共享,着力为用户提供优资资源。
二、本站提供的源码下载文件为网络共享资源,请于下载后的24小时内删除。如需体验更多乐趣,还请支持正版。
三、如有内容侵犯您的版权或其他利益的,请编辑邮件并加以说明发送到站长邮箱。站长会进行审查之后,情况属实的会在三个工作日内为您删除。
-----------------------------------------------------------------------------------------------------------


内容投诉
源码村资源网 » htmlpdf代码(html2pdf php)

1 评论

您需要 登录账户 后才能发表评论

发表评论

欢迎 访客 发表评论