StaticinitializeInitializes the PDF SDK with the provided configuration
This method must be called before any other SDK operations. It sets up the underlying PDF editor service with the necessary configuration such as worker paths, WASM files, and other initialization parameters.
Configuration data for initializing the SDK
Promise that resolves when initialization is complete
StaticlistRetrieves all system fonts available for use in PDF documents
This method returns a list of fonts that can be used when creating or editing text content in PDF documents.
Promise resolving to an array of available system fonts
StaticopenCreates and opens a new blank PDF document
This method creates a new PDF document with default or custom settings and returns a DocumentModel instance that can be used to add content and manipulate the document.
Optionaldata: ICreateNewDocumentDataOptional configuration for the new document (page size, PDF version, etc.)
Promise resolving to a DocumentModel instance for the new document
StaticopenOpens an existing PDF document from a file
This method loads a PDF document from the provided file data and returns a DocumentModel instance that can be used to manipulate the document.
Object containing the file data to open
Promise resolving to a DocumentModel instance for the opened document
StaticregisterRegisters user-provided fonts for use in PDF documents
This method allows you to register custom fonts from external sources (e.g., Google Fonts API) that will be available for use when creating or editing text content in PDF documents. The fonts must be registered before opening or creating a document.
Array of user font objects containing family, variants, and file URLs
const userFonts = {
baseUrl: 'https://fonts.googleapis.com/css2',
fonts: [
{
family: 'Roboto',
variants: ['regular', 'bold', 'italic'],
files: {
regular: 'https://fonts.gstatic.com/...',
bold: 'https://fonts.gstatic.com/...',
},
// ... other font metadata
}
]
};
await PdfSdk.registerUserFonts(userFonts);
Main SDK class for PDF operations
This class provides static methods for:
All methods are static and should be called directly on the class. The SDK must be initialized before any document operations can be performed.