Method SavePageAsTgaAsync
SavePageAsTgaAsync(string, int, string, PdfRenderOptions, bool, CancellationToken)
Renders one page and writes it as TGA to a file.
public static Task SavePageAsTgaAsync(string inputPath, int pageIndex, string outputPath, PdfRenderOptions options = null, bool rle = false, CancellationToken cancellationToken = default)
Parameters
inputPathstringPath to the source PDF.
pageIndexintZero-based index of the page to render.
outputPathstringDestination file path.
optionsPdfRenderOptionsRender options.
rleboolWhen true, TGA output uses RLE compression.
cancellationTokenCancellationTokenCancels the operation.
Returns
Examples
using LMKit.Document.Pdf;
// TGA for game / 3D pipelines
PdfRenderer.SavePageAsTga("report.pdf", pageIndex: 0, "page-1.tga", rle: true);
SavePageAsTgaAsync(string, int, Stream, PdfRenderOptions, bool, CancellationToken)
Renders one page and writes it as TGA to a writable stream.
public static Task SavePageAsTgaAsync(string inputPath, int pageIndex, Stream outputStream, PdfRenderOptions options = null, bool rle = false, CancellationToken cancellationToken = default)
Parameters
inputPathstringPath to the source PDF.
pageIndexintZero-based index of the page to render.
outputStreamStreamWritable destination stream.
optionsPdfRenderOptionsRender options.
rleboolWhen true, TGA output uses RLE compression.
cancellationTokenCancellationTokenCancels the operation.
Returns
Examples
using System.IO;
using LMKit.Document.Pdf;
using MemoryStream output = new();
PdfRenderer.SavePageAsTga("report.pdf", pageIndex: 0, output, rle: true);