-
-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Bug Report
Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 8.0.0
@capacitor/core: 8.0.0
@capacitor/android: 8.0.0
@capacitor/ios: 8.0.0
Installed Dependencies:
@capacitor/android: not installed
@capacitor/cli: 8.0.0
@capacitor/core: 8.0.0
@capacitor/ios: 8.0.0
[success] iOS looking great! 👌
Plugin Version
│
▲ 💊 Capgo Doctor 💊
│
● App Name: ep
│
● App ID: com.ep.app
│
● App Version: 1.0.594
│
● Web Dir: dist
│
● OS: darwin Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000
│
● Node: v24.7.0
│
● Installed Dependencies:
│
● @capgo/cli: 7.68.0
│
● @capawesome/capacitor-live-update: 8.1.0
│
● @capgo/capacitor-document-scanner: 8.3.0
│
● @capgo/capacitor-launch-navigator: 8.0.3
│
● @capgo/capacitor-pdf-generator: 8.0.3
│
● @capgo/nativegeocoder: 8.0.8
│
● @capawesome/cli: 3.11.0
│
◇ Latest Dependencies:
│
● @capgo/cli: 7.68.0
│
● @capawesome/capacitor-live-update: 8.1.0
│
● @capgo/capacitor-document-scanner: 8.3.0
│
● @capgo/capacitor-launch-navigator: 8.0.3
│
● @capgo/capacitor-pdf-generator: 8.0.3
│
● @capgo/nativegeocoder: 8.0.8
│
● @capawesome/cli: 3.11.0
│
◆ ✅ All dependencies are up to date
context(s)
try {
const pdf = await PdfGenerator.fromData({
data: html,
documentSize: 'A4',
orientation: 'landscape',
type: 'base64',
fileName: 'receipt.pdf',
});
}
catch (error) {
console.error('Error generating PDF:', error);
}
Calling this with valid HTML, crashes the app with IOS error: Main Thread Checker: UI API called on a background thread: -[WKWebView .cxx_construct]
PID: 61459, TID: 21714526, Thread name: (none), Queue name: bridge, QoS: 0
See backtrace below
ManualModel: false
AutoMode: false
CapgoCloud: false
OnPremise: falsePlatform(s)
IOS 26.1 iPhone 16 Pro (Physical Device)
IOS 18.6 iPhone 16 Simulator
Capacitor 8.0.0
"react": "^19.2.3",
"@ionic/react": "^8.7.16",
@capgo/capacitor-pdf-generator": "^8.0.3" or 8.0.2
Current Behavior
generateHTMLReport().then((html) => {
console.debug("Generated HTML Report");
PdfGenerator.fromData({
data: html,
documentSize: "A4",
orientation: "landscape",
type: "base64"
})
or using await PdfGenerator.fromData
Causing a crash, tried with my html or with the simple html example you provided in the docs.
Expected Behavior
PDF should be created successfully and should not crash the entire app
Code Reproduction
const receiptHtml = <html> <body> <h1>Capgo Store</h1> <p>Thank you for your purchase.</p> </body> </html>;
console.debug("Generating HTML Report for PDF generation");
generateHTMLReport().then((html) => {
console.debug("Generated HTML Report");
PdfGenerator.fromData({
data: receiptHtml,
documentSize: "A4",
orientation: "landscape",
type: "base64",
})
.then((pdfBase64: any) => {
// Do something with the generated PDF base64 string
console.debug("Generated PDF Base64:", pdfBase64);
})
.catch((error: any) => {
console.error("Error generating PDF:", error);
});
Other Technical Details
npm --version output: 11.5.1
node --version output:v24.7.0
pod --version output (iOS issues only): 1.16.2
Additional Context
⚡️ To Native -> PdfGenerator fromData 114204666
Main Thread Checker: UI API called on a background thread: -[WKWebView .cxx_construct]
PID: 61459, TID: 21714526, Thread name: (none), Queue name: bridge, QoS: 0
Backtrace:
5 libobjc.A.dylib 0x000000019618f1d0 AF9349A3-834F-369E-ACE5-C50571C9C7BA + 29136
6 CapgoCapacitorPdfGenerator 0x0000000103841294 $sSo9WKWebViewC5frame13configurationABSo6CGRectV_So0aB13ConfigurationCtcfC + 48
7 CapgoCapacitorPdfGenerator 0x00000001038410f8 $s26CapgoCapacitorPdfGenerator0C14GenerationTask33_D282405BECB45ECCB5A0B015126D3674LLC6plugin4call6source7optionsAdA0cD6PluginC_So13CAPPluginCallCAD6SourceOAA0cD7OptionsACLLVtcfc + 884
8 CapgoCapacitorPdfGenerator 0x000000010383d3e4 $s26CapgoCapacitorPdfGenerator0C14GenerationTask33_D282405BECB45ECCB5A0B015126D3674LLC6plugin4call6source7optionsAdA0cD6PluginC_So13CAPPluginCallCAD6SourceOAA0cD7OptionsACLLVtcfC + 64
9 CapgoCapacitorPdfGenerator 0x000000010383d6d8 $s26CapgoCapacitorPdfGenerator0cD6PluginC8fromDatayySo13CAPPluginCallCF + 624
10 CapgoCapacitorPdfGenerator 0x000000010383d7cc $s26CapgoCapacitorPdfGenerator0cD6PluginC8fromDatayySo13CAPPluginCallCFTo + 68
11 Capacitor 0x0000000103d29930 $s9Capacitor0A6BridgeC12handleJSCall4callyAA0D0V_tFyyYbcfU0_ + 920
12 Capacitor 0x0000000103d2a368 $sIegh_IeyBh_TR + 48
13 libdispatch.dylib 0x000000010437063c _dispatch_call_block_and_release + 32
14 libdispatch.dylib 0x000000010438a2d0 _dispatch_client_callout + 16
15 libdispatch.dylib 0x0000000104378b4c _dispatch_lane_serial_drain + 796
16 libdispatch.dylib 0x00000001043797d4 _dispatch_lane_invoke + 432
17 libdispatch.dylib 0x0000000104385b20 _dispatch_root_queue_drain_deferred_wlh + 344
18 libdispatch.dylib 0x00000001043851c4 _dispatch_workloop_worker_thread + 752
19 libsystem_pthread.dylib 0x00000001f52423b8 _pthread_wqthread + 292
20 libsystem_pthread.dylib 0x00000001f52418c0 start_wqthread + 8