[研究][C#][ASP.NET] 使用 FreeSpire.Doc 12.2.0 把 .docx 轉成 .pdf
Nuget 安裝 FreeSpire.Doc 7.11.0 元件 (不是 Spire.Doc )
********************************************************************************
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SpireDocDemo.Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
</div>
</form>
</body>
</html>
|
Default.aspx.cs
using Spire.Doc;
using System;
namespace SpireDocDemo
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
//Load Document
Document document = new Document();
document.LoadFromFile(@"C:\temp\test.docx");
//Convert Word to PDF
document.SaveToFile(@"C:\temp\testt.pdf", Spire.Doc.FileFormat.PDF);
//Launch Document
System.Diagnostics.Process.Start(@"C:\temp\testt.pdf");
}
}
} |
(完)
相關
[研究]ASP.NET,試用FreeSpire.PDF 8.6.0、10.2.0
https://shaurong.blogspot.com/2024/05/aspnetfreespirepdf-8601020.html
[研究][C#][ASP.NET] 使用 FreeSpire.Doc 12.2.0 取代 .docx 中的文字
https://shaurong.blogspot.com/2024/05/caspnet-freespiredoc-1220-docx.html
[研究][C#][ASP.NET] 使用 FreeSpire.Doc 12.2.0 把 .docx 轉成 .pdf
https://shaurong.blogspot.com/2024/05/caspnet-freespiredoc-1220-docx-pdf.html
[研究]FreeSpire.PDF 6.2.60 升級 7.8.9 後出錯,warning CS0618: 'PdfTextFind.Bounds' 已經過時: 'This property may be removed in the future, please use TextBounds instead.'
https://shaurong.blogspot.com/2021/08/warning-cs0618-pdftextfindbounds-this.html
[研究][C#][ASP.NET] 使用 FreeSpire.Doc 7.11.0 取代 .docx 中的文字
https://shaurong.blogspot.com/2020/06/caspnet-freespiredoc-7110-docx.html
[研究][C#][ASP.NET] 使用 Free Spire.PDF for NET v6.2.0 取代 .pdf 中的文字
https://shaurong.blogspot.com/2020/06/caspnet-free-spirepdf-for-net-v620-pdf.html
[研究][C#][ASP.NET] 使用 FreeSpire.Doc 7.11.0 把 .docx 轉成 .pdf
https://shaurong.blogspot.com/2020/06/caspnet-spiredoc-docx-pdf.html
[研究][C#][ASP.NET] 免費 Free Spire.PDF for .NET 3.2.0 試用 Url to pdf 檔案 (NuGet 安裝)
https://shaurong.blogspot.com/2018/03/aspnet-free-spirepdf-for-net-pdf.html
[研究][C#][ASP.NET] 免費 PDFsharp v1.32.3057.0 產生 pdf 試用 (NuGet 安裝)
https://shaurong.blogspot.com/2018/03/caspnet-pdfsharp-v13230570-pdf-nuget.html




沒有留言:
張貼留言