39 lines
1.4 KiB
C#
39 lines
1.4 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Elwig.Helpers.Printing {
|
|
internal partial class PdfiumNative {
|
|
|
|
public const int FPDF_ANNOT = 0x01;
|
|
public const int FPDF_PRINTING = 0x800;
|
|
|
|
[LibraryImport("pdfium.dll")]
|
|
public static partial void FPDF_InitLibrary();
|
|
|
|
[LibraryImport("pdfium.dll")]
|
|
public static partial void FPDF_DestroyLibrary();
|
|
|
|
[LibraryImport("pdfium.dll", StringMarshalling = StringMarshalling.Utf8)]
|
|
public static partial IntPtr FPDF_LoadDocument(string filePath, string? password);
|
|
|
|
[LibraryImport("pdfium.dll")]
|
|
public static partial void FPDF_CloseDocument(IntPtr document);
|
|
|
|
[LibraryImport("pdfium.dll")]
|
|
public static partial int FPDF_GetPageCount(IntPtr document);
|
|
|
|
[LibraryImport("pdfium.dll")]
|
|
public static partial IntPtr FPDF_LoadPage(IntPtr document, int pageIndex);
|
|
|
|
[LibraryImport("pdfium.dll")]
|
|
public static partial void FPDF_ClosePage(IntPtr page);
|
|
|
|
[LibraryImport("pdfium.dll")]
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|
public static partial bool FPDF_GetPageSizeByIndex(IntPtr document, int pageIndex, out double width, out double height);
|
|
|
|
[LibraryImport("pdfium.dll")]
|
|
public static partial void FPDF_RenderPage(IntPtr hdc, IntPtr page, int startX, int startY, int sizeX, int sizeY, int rotate, int flags);
|
|
}
|
|
}
|