PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Accurately obtaining the license key is crucial for applying the license.
<type> field. If <type>online</type> is present, it indicates an online license. If <type>offline</type> is present or if the field is absent, it indicates an offline license.LICENSE_KEY position within the <key>LICENSE_KEY</key> field. This is your license key.Use ComPDFKitConversion::LibraryManager.license_verify before initializing the SDK and starting conversions.
require "compdfkit_conversion"
license = "LICENSE_KEY"
device_id = "DEVICE_ID"
app_id = "com.example.application"
code = ComPDFKitConversion::LibraryManager.license_verify(license, device_id, app_id)
unless code == ComPDFKitConversion::ErrorCode::SUCCESS
raise "license verification failed: #{code}"
end
ComPDFKitConversion::LibraryManager.initialize_sdkYou can also read the license information from environment variables in command-line tools:
license = ENV.fetch("COMPDFKIT_LICENSE")
device_id = ENV.fetch("COMPDFKIT_DEVICE_ID", "")
app_id = ENV.fetch("COMPDFKIT_APP_ID", "com.example.application")The sample scripts also accept --license, --device-id, and --app-id. When these options are not provided, they read the same environment variables and fall back to the local demo values packaged in the samples.