Table of Contents

Method SavePageAsTgaAsync

Namespace
LMKit.Document.Pdf
Assembly
LM-Kit.NET.dll

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

inputPath string

Path to the source PDF.

pageIndex int

Zero-based index of the page to render.

outputPath string

Destination file path.

options PdfRenderOptions

Render options.

rle bool

When true, TGA output uses RLE compression.

cancellationToken CancellationToken

Cancels the operation.

Returns

Task

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

inputPath string

Path to the source PDF.

pageIndex int

Zero-based index of the page to render.

outputStream Stream

Writable destination stream.

options PdfRenderOptions

Render options.

rle bool

When true, TGA output uses RLE compression.

cancellationToken CancellationToken

Cancels the operation.

Returns

Task

Examples

using System.IO;
using LMKit.Document.Pdf;

using MemoryStream output = new();
PdfRenderer.SavePageAsTga("report.pdf", pageIndex: 0, output, rle: true);
Share