[英]Save the output as PDF file
我们目前正在使用SoftArtisans生成Excel和Word文件。 我们需要扩展它以创建PDF文件。
OfficeWriter当前是否支持此功能?
如果没有,是否有计划添加此功能? 还是可以用于将Excel / Word文件转换为PDF格式的任何开源库?
据我所知, PdfSharp和Migradoc是最好的和最受欢迎的。 Migradoc是PdfSharp的高级封面。
注意:我为OfficeWriter的制造商SoftArtisans工作。
OfficeWriter当前不支持将Excel / Word文件转换为PDF。 我们通常建议将第三方组件转换为PDF。 但是,其中许多组件都要求在服务器上安装Office,Microsoft不建议这样做。 因此,重要的是选择一个不需要在服务器上安装Office或仔细管理它的转换器。
以下是我们过去向用户推荐的一些将Word转换为PDF的解决方案:
•用于SharePoint的Word Services –如果使用的是SharePoint Server 2010,则可以使用Word Services执行格式转换。 有关此解决方案的更多信息,请参见: http : //msdn.microsoft.com/zh-cn/library/office/ff181518.aspx
•彩虹PDF-rainbowpdf.com
•EasyPDF-pdfonline.com/easypdf/
有关更多信息,请参阅我们的博客文章: http : //blog.softartisans.com/2011/08/05/kb-tools-to-convert-word-documents-to-pdf/
PfgSharp非常受欢迎。 这是CodeProject
一个示例,该示例说明如何创建简单的PDF,以使您对如何使用它有一些了解:
class Program
{
static void Main(string[] args)
{
// Create a new PDF document
PdfDocument document = new PdfDocument();
document.Info.Title = "Created with PDFsharp";
// Create an empty page
PdfPage page = document.AddPage();
// Get an XGraphics object for drawing
XGraphics gfx = XGraphics.FromPdfPage(page);
// Create a font
XFont font = new XFont("Verdana", 20, XFontStyle.BoldItalic);
// Draw the text
gfx.DrawString("Hello, World!", font, XBrushes.Black,
new XRect(0, 0, page.Width, page.Height),
XStringFormats.Center);
// Save the document...
const string filename = "HelloWorld.pdf";
document.Save(filename);
// ...and start a viewer.
Process.Start(filename);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.