目錄 / Table of Contents

Class OdfHybridPdfHelper

Namespace
OdfKit.Core
Assembly
OdfKit.Extensions.Pdf.dll

Embeds ODF packages in hybrid PDFs and extracts them back out. 提供混合 PDF (Hybrid PDF)的公用程式方法,支援在 PDF 中內嵌與提取 ODF 檔案。

public static class OdfHybridPdfHelper
Inheritance
OdfHybridPdfHelper
Inherited Members

Remarks

以增量更新附加內嵌檔案,原有 PDF 內容(含既有簽章的涵蓋範圍)不會被改寫。 支援標準安全處理常式加密的 PDF(RC4 40/128 位元、AES-128、AES-256);加密但未提供正確密碼時擲出 CryptographicException。

Methods

ExtractOdfFromPdf(Stream, string?)

Extracts an embedded ODF package from a hybrid PDF. 從混合 PDF 檔案流中提取並讀取隱藏的 ODF 檔案。

public static byte[]? ExtractOdfFromPdf(Stream pdfStream, string? password = null)

Parameters

pdfStream Stream

The source or target object. / PDF 檔案的資料流

password string

The value to use. / PDF 檔案密碼,若無則為 null

Returns

byte[]

The result. / 傳回提取出的 ODF 檔案位元組陣列;若未找到則為 null

ExtractOdfFromPdf(string, string?)

Extracts an embedded ODF package from a hybrid PDF. 從混合 PDF 檔案中提取並讀取隱藏的 ODF 檔案。

public static byte[]? ExtractOdfFromPdf(string pdfPath, string? password = null)

Parameters

pdfPath string

The path or URI. / PDF 檔案路徑

password string

The value to use. / PDF 檔案密碼,若無則為 null

Returns

byte[]

The result. / 傳回提取出的 ODF 檔案位元組陣列;若未找到則為 null

InjectOdfToPdf(Stream, Stream, Stream, string, string?)

Embeds an ODF package into a PDF as a hybrid PDF attachment. 將 ODF 檔案串流作為附件注入 PDF 檔案串流中,產生混合 PDF。

public static void InjectOdfToPdf(Stream pdfStream, Stream odfStream, Stream outputPdfStream, string odfFileName, string? password = null)

Parameters

pdfStream Stream

The source or target object. / 來源 PDF 檔案的資料流

odfStream Stream

The source or target object. / 要注入的 ODF 檔案的資料流

outputPdfStream Stream

The source or target object. / 接收輸出的混合 PDF 檔案資料流

odfFileName string

The path or URI. / 注入的 ODF 專案檔名

password string

The value to use. / PDF 密碼,若無則為 null

InjectOdfToPdf(string, string, string, string?)

Embeds an ODF package into a PDF as a hybrid PDF attachment. 將 ODF 檔案作為附件注入 PDF 中,產生混合 PDF(Hybrid PDF)。

public static void InjectOdfToPdf(string pdfPath, string odfPath, string outputPdfPath, string? password = null)

Parameters

pdfPath string

The path or URI. / 來源 PDF 檔案路徑

odfPath string

The path or URI. / 要注入的 ODF 檔案路徑

outputPdfPath string

The path or URI. / 輸出的混合 PDF 檔案路徑

password string

The value to use. / PDF 密碼,若無則為 null