国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Spire.PDF for .NET【文檔操作】演示:合并 PDF 文件并添加頁(yè)碼

這篇具有很好參考價(jià)值的文章主要介紹了Spire.PDF for .NET【文檔操作】演示:合并 PDF 文件并添加頁(yè)碼。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

需要合并 PDF 的原因有很多。例如,合并 PDF 文件允許您打印單個(gè)文件,而不是為打印機(jī)排隊(duì)多個(gè)文檔,組合相關(guān)文件通過(guò)減少要搜索和組織的文件數(shù)量來(lái)簡(jiǎn)化管理和存儲(chǔ)多個(gè)文檔的過(guò)程。在本文中,您將學(xué)習(xí)如何使用Spire.PDF for .NET將多個(gè) PDF 文檔合并為一個(gè) PDF 文檔,以及如何使用C# 和 VB.NET將不同 PDF 文檔中的選定頁(yè)面合并為一個(gè) PDF 。

Spire.PDF for .NET?是一款獨(dú)立 PDF 控件,用于 .NET 程序中創(chuàng)建、編輯和操作 PDF 文檔。使用 Spire.PDF 類(lèi)庫(kù),開(kāi)發(fā)人員可以新建一個(gè) PDF 文檔或者對(duì)現(xiàn)有的 PDF 文檔進(jìn)行處理,且無(wú)需安裝 Adobe Acrobat。

E-iceblue?功能類(lèi)庫(kù)Spire 系列文檔處理組件均由中國(guó)本土團(tuán)隊(duì)研發(fā),不依賴(lài)第三方軟件,不受其他國(guó)家的技術(shù)或法律法規(guī)限制,同時(shí)適配國(guó)產(chǎn)操作系統(tǒng)如中科方德、中標(biāo)麒麟等,兼容國(guó)產(chǎn)文檔處理軟件 WPS(如 .wps/.et/.dps 等格式

Spire.PDF for.net下載? ?Spire.PDF for java下載

安裝適用于 .NET 的 Spire.PDF

首先,您需要將 Spire.PDF for .NET 包中包含的 DLL 文件添加為 .NET 項(xiàng)目中的引用。 DLL 文件可以從此鏈接下載或通過(guò)NuGet安裝。

PM> Install-Package Spire.PDF
將多個(gè) PDF 合并為一個(gè) PDF

Spire.PDF for .NET 提供PdfDocument.MergeFiles()方法將多個(gè) PDF 文檔合并為單個(gè)文檔。詳細(xì)步驟如下。

  • 獲取要合并的文檔的路徑并將其存儲(chǔ)在字符串?dāng)?shù)組中。
  • 調(diào)用PdfDocument.MergeFiles()方法來(lái)合并這些文件。
  • 使用PdfDocumentBase.Save()方法將結(jié)果保存到 PDF 文檔。

C#

using System;
using Spire.Pdf;

namespace MergePDFs
{
class Program
{
static void Main(string[] args)
{
//Get the paths of the documents to be merged
String[] files = new String[] {
"C:\\Users\\Administrator\\Desktop\\PDFs\\sample-1.pdf",
"C:\\Users\\Administrator\\Desktop\\PDFs\\sample-2.pdf",
"C:\\Users\\Administrator\\Desktop\\PDFs\\sample-3.pdf"};

//Merge these documents and return an object of PdfDocumentBase
PdfDocumentBase doc = PdfDocument.MergeFiles(files);

//Save the result to a PDF file
doc.Save("output.pdf", FileFormat.PDF);
}
}
}

VB.NET

Imports System
Imports Spire.Pdf

Namespace MergePDFs
Class Program
Shared Sub Main(ByVal args() As String)
'Get the paths of the documents to be merged
Dim files() As String = New String() {"C:\\Users\\Administrator\\Desktop\\PDFs\\sample-1.pdf","C:\\Users\\Administrator\\Desktop\\PDFs\\sample-2.pdf","C:\\Users\\Administrator\\Desktop\\PDFs\\sample-3.pdf"}


'Merge these documents and return an object of PdfDocumentBase
Dim doc As PdfDocumentBase = PdfDocument.MergeFiles(files)

'Save the result to a PDF file
doc.Save("output.pdf", FileFormat.PDF)
End Sub
End Class
End Namespace

Spire.PDF for .NET【文檔操作】演示:合并 PDF 文件并添加頁(yè)碼,Spire.PDF for .Net 教程,pdf,.net,java,spire.doc,文檔控件

將不同 PDF 的選定頁(yè)面合并為一個(gè) PDF

Spire.PDF for .NET 提供PdfDocument.InsertPage()方法和PdfDocument.InsertPageRange()方法,用于將頁(yè)面或頁(yè)面范圍從一個(gè) PDF 文檔導(dǎo)入到另一個(gè) PDF 文檔。以下是將不同 PDF 文檔中的選定頁(yè)面合并為一個(gè)新 PDF 文檔的步驟。

  • 獲取源文檔的路徑并將其存儲(chǔ)在字符串?dāng)?shù)組中。
  • 創(chuàng)建PdfDocument數(shù)組,并將每個(gè)源文檔加載到單獨(dú)的PdfDocument對(duì)象中。
  • 創(chuàng)建另一個(gè)PdfDocument對(duì)象來(lái)生成新文檔。
  • 使用PdfDocument.InsertPage()方法和PdfDocument.InsertPageRange()方法將源文檔的選定頁(yè)面或頁(yè)面范圍插入到新文檔中。
  • 使用PdfDocument.SaveToFile()方法將新文檔保存為 PDF 文件。

C#

using System;
using Spire.Pdf;

namespace MergeSelectedPages
{
class Program
{
static void Main(string[] args)
{
//Get the paths of the documents to be merged
String[] files = new String[] {
"C:\\Users\\Administrator\\Desktop\\PDFs\\sample-1.pdf",
"C:\\Users\\Administrator\\Desktop\\PDFs\\sample-2.pdf",
"C:\\Users\\Administrator\\Desktop\\PDFs\\sample-3.pdf"};

//Create an array of PdfDocument
PdfDocument[] docs = new PdfDocument[files.Length];

//Loop through the documents
for (int i = 0; i < files.Length; i++)
{
//Load a specific document
docs[i] = new PdfDocument(files[i]);
}

//Create a PdfDocument object for generating a new PDF document
PdfDocument doc = new PdfDocument();

//Insert the selected pages from different documents to the new document
doc.InsertPage(docs[0], 0);
doc.InsertPageRange(docs[1], 1,3);
doc.InsertPage(docs[2], 0);

//Save the document to a PDF file
doc.SaveToFile("output.pdf");
}
}
}

VB.NET

Imports System
Imports Spire.Pdf

Namespace MergeSelectedPages
Class Program
Shared Sub Main(ByVal args() As String)
'Get the paths of the documents to be merged
Dim files() As String = New String() {"C:\\Users\\Administrator\\Desktop\\PDFs\\sample-1.pdf","C:\\Users\\Administrator\\Desktop\\PDFs\\sample-2.pdf","C:\\Users\\Administrator\\Desktop\\PDFs\\sample-3.pdf"}


'Create an array of PdfDocument
Dim docs() As PdfDocument = New PdfDocument(files.Length) {}

'Loop through the documents
Dim i As Integer
For i = 0 To files.Length- 1 Step i + 1
'Load a specific document
docs(i) = New PdfDocument(files(i))
Next

'Create a PdfDocument object for generating a new PDF document
Dim doc As PdfDocument = New PdfDocument()

'Insert the selected pages from different documents to the new document
doc.InsertPage(docs(0), 0)
doc.InsertPageRange(docs(1), 1,3)
doc.InsertPage(docs(2), 0)

'Save the document to a PDF file
doc.SaveToFile("output.pdf")
End Sub
End Class
End Namespace

Spire.PDF for .NET【文檔操作】演示:合并 PDF 文件并添加頁(yè)碼,Spire.PDF for .Net 教程,pdf,.net,java,spire.doc,文檔控件

以上便是如何合并 PDF 文件并添加頁(yè)碼,如果您有其他問(wèn)題也可以繼續(xù)瀏覽本系列文章,獲取相關(guān)教程~文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-845151.html

到了這里,關(guān)于Spire.PDF for .NET【文檔操作】演示:合并 PDF 文件并添加頁(yè)碼的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶(hù)投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • PDF控件Spire.PDF for .NET【安全】演示:在 PDF 中添加或刪除數(shù)字簽名

    PDF控件Spire.PDF for .NET【安全】演示:在 PDF 中添加或刪除數(shù)字簽名

    隨著 PDF 文檔在商業(yè)中越來(lái)越流行,確保其真實(shí)性已成為一個(gè)關(guān)鍵問(wèn)題。使用基于證書(shū)的簽名對(duì) PDF 進(jìn)行簽名可以保護(hù)內(nèi)容,還可以讓其他人知道誰(shuí)簽署或批準(zhǔn)了該文檔。在本文中,您將了解如何使用不可見(jiàn)或可見(jiàn)簽名對(duì) PDF 進(jìn)行數(shù)字簽名,以及如何使用Spire.PDF for .NET從 PDF 中

    2024年02月03日
    瀏覽(23)
  • PDF控件Spire.PDF for .NET【安全】演示:使用文本或/和圖像對(duì) PDF 進(jìn)行數(shù)字簽名

    PDF控件Spire.PDF for .NET【安全】演示:使用文本或/和圖像對(duì) PDF 進(jìn)行數(shù)字簽名

    數(shù)字簽名確保簽名的文檔不能被除其作者之外的任何人更改。添加簽名是確保文檔內(nèi)容真實(shí)性的最常見(jiàn)方法。PDF 文檔中的可視數(shù)字簽名可以顯示文本或圖像(例如手寫(xiě)簽名)。本文從以下三個(gè)方面介紹如何使用Spire.PDF for .NET對(duì)PDF 進(jìn)行數(shù)字簽名。 Spire.PDF for .NET?是一款獨(dú)立

    2024年01月23日
    瀏覽(21)
  • PDF控件Spire.PDF for .NET【安全】演示:使用時(shí)間戳服務(wù)器對(duì) PDF 進(jìn)行數(shù)字簽名

    PDF控件Spire.PDF for .NET【安全】演示:使用時(shí)間戳服務(wù)器對(duì) PDF 進(jìn)行數(shù)字簽名

    Spire.PDF for .NET?是一款獨(dú)立 PDF 控件,用于 .NET 程序中創(chuàng)建、編輯和操作 PDF 文檔。使用 Spire.PDF 類(lèi)庫(kù),開(kāi)發(fā)人員可以新建一個(gè) PDF 文檔或者對(duì)現(xiàn)有的 PDF 文檔進(jìn)行處理,且無(wú)需安裝 Adobe Acrobat。 E-iceblue?功能類(lèi)庫(kù)Spire 系列文檔處理組件均由中國(guó)本土團(tuán)隊(duì)研發(fā),不依賴(lài)第三方軟件

    2024年04月10日
    瀏覽(24)
  • Spire.PDF for .NET 9.8.5 Crack

    Spire.PDF for .NET 9.8.5 Crack

    Spire.PDF for .NET is a professional PDF API applied to creating, writing, editing, handling and reading PDF files without any external dependencies within .NET ( C#, VB.NET, ASP.NET, .NET Core, .NET 5.0, .NET 6.0, .NET 7.0, MonoAndroid and Xamarin.iOS ) application. Using this .NET PDF library, you can implement rich capabilities to create PDF files from sc

    2024年02月10日
    瀏覽(70)
  • 利用Spire.Pdf實(shí)現(xiàn)PDF添加印章的操作

    利用Spire.Pdf實(shí)現(xiàn)PDF添加印章的操作

    在一些文檔處理中,我們需要對(duì)PDF蓋上公司的印章操作,本篇隨筆介紹利用Spire.Pdf實(shí)現(xiàn)PDF添加印章的操作,如全章和騎縫章的處理。 有時(shí)候,需要在特定的位置蓋章,以及各個(gè)頁(yè)面蓋上騎縫章,如下界面效果所示。 全章的位置定位好后,繪制一個(gè)圖片即可,騎縫章則是根據(jù)

    2024年02月16日
    瀏覽(26)
  • 【itext7】itext7操作PDF文檔之創(chuàng)建PDF文檔、加載PDF文檔、添加空白頁(yè)、操作PDF頁(yè)面、itext中的常見(jiàn)類(lèi)及其方法

    這篇文章,主要介紹itext7操作PDF文檔之創(chuàng)建PDF文檔、加載PDF文檔、添加空白頁(yè)、操作PDF頁(yè)面、itext中的常見(jiàn)類(lèi)及其方法。 目錄 一、itext7操作PDF 1.1、itext7介紹 1.2、引入itext-core依賴(lài) 1.3、創(chuàng)建PDF文檔 1.4、加載PDF文檔 1.5、操作PDF頁(yè)面 1.6、添加空白頁(yè)面 二、itext常見(jiàn)類(lèi)和方法 2.1、

    2024年02月16日
    瀏覽(20)
  • 兩個(gè)pdf文件合并為一個(gè)怎么操作?分享pdf合并操作步驟

    兩個(gè)pdf文件合并為一個(gè)怎么操作?分享pdf合并操作步驟

    不管是初入職場(chǎng)的小白,還是久經(jīng)職場(chǎng)的高手,都必須深入了解pdf,特別是關(guān)于pdf的各種操作,如編輯、合并、壓縮等操作,其中合并是這么多操作里面必需懂的技能之一,但是很多人還是不知道兩個(gè)pdf文件合并為一個(gè)怎么操作,下面 不管是初入職場(chǎng)的小白,還是久經(jīng)職場(chǎng)的

    2024年02月10日
    瀏覽(20)
  • 使用Python合并PDF文件并添加自定義目錄及頁(yè)腳

    在處理文檔時(shí),我們經(jīng)常遇到需要合并多個(gè)PDF文件并添加目錄及頁(yè)腳的情況。本文將介紹如何使用Python,特別是 PyPDF2 和 reportlab 庫(kù)來(lái)實(shí)現(xiàn)這一功能。我們將通過(guò)一個(gè)實(shí)用的示例來(lái)演示整個(gè)過(guò)程,包括如何動(dòng)態(tài)創(chuàng)建目錄頁(yè)和在每頁(yè)底部添加頁(yè)碼。 首先,確保你的環(huán)境中安裝了

    2024年03月13日
    瀏覽(23)
  • Spire.Barcode for Java 5.1.0 + Spire.Barcode for .NET 7.2.0

    Spire.Barcode for Java 5.1.0 + Spire.Barcode for .NET 7.2.0

    Spire.Barcode for Java is a professional barcode component specially designed for developers to generate, read and scan 1D 2D barcodes on Java applications (J2SE and J2EE). Developers and programmers can use Spire.Barcode to add Enterprise-Level barcode formats to their Java applications quickly and easily. Spire.Barcode for Java provides a very easy way to

    2024年02月16日
    瀏覽(47)
  • Spire.Office for.NET Crack

    Spire.Office for.NET Crack

    Spire.Office for.NET是E-iceblue提供的企業(yè)級(jí)Office.NET API的組合。它包括Spire.Doc、Spire.XLS、Spire.Seadsheet、Spire.Presentation、Spire_PDF、Spire.DataExport、SpireOfficeViewer、Spire-PDFViewer、Spire.DocViewer、Spire.Barcode和Spire.Email.Spire.Office包含上述.NET API的最新版本。 使用Spire.Officefor.NET,開(kāi)發(fā)人員可以創(chuàng)

    2024年02月15日
    瀏覽(25)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包