You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When exporting a PDF in Typora, the following error is displayed:
Failed to add header / footer.
`pdf` must be of type `string` or `Uint8Array` or `ArrayBuffer`, but was actually of type `null`
As a result, the exported PDF does not include any header or footer content. The settings used for export are shown in the attached screenshot.
To Reproduce
Steps to reproduce the behavior:
Set up the page settings as shown in the screenshot (e.g., custom margins, A4 size, and headers/footers with variables like ${pageNo} / ${totalPages}).
Export a Markdown file to PDF.
Observe the error message and missing header/footer in the exported PDF.
Expected behavior
Headers and footers should be correctly rendered in the exported PDF, without any errors.
Screenshots / Screencasts
Sample Markdown File
Any Markdown file.
Desktop (please complete the following information):
OS: Windows 11 64-bit
Typora Version: 1.10.5-dev
The text was updated successfully, but these errors were encountered:
I have tested 1.10.5-dev on two different windows computers and found that the problem can be repeated. This warning will appear if you use customization on the margins (even if you do not adjust the default customization value), but there will be no problem if you use the default.
The log files (%APPDATA%/Typora) are as follows
INFO 2025/1/30 01:36:17 get PDF data
ERROR 2025/1/30 01:36:17 unhandledRejection Error: Script failed to execute, this normally means an error was thrown. Check the renderer console for the error.
at node:electron/js2c/sandbox_bundle:2:58548
at IpcRendererInternal.<anonymous> (node:electron/js2c/sandbox_bundle:2:52741)
at IpcRendererInternal.emit (node:electron/js2c/sandbox_bundle:2:34768)
at Object.onMessage (node:electron/js2c/sandbox_bundle:2:50819)
INFO 2025/1/30 01:36:17 get background color
INFO 2025/1/30 01:36:18 load file [C:\Users\HoeYeung\AppData\Local\Temp\Typora\1738172178001-1.html] for PDF export
INFO 2025/1/30 01:36:18 generate print window with id 3
ERROR 2025/1/30 01:36:18 Error: margins must be less than or equal to pageSize
at _.printToPDF (node:electron/js2c/browser_init:2:77206)
at C:\Program Files\Typora\resources\app.asar\atom.compiled.dist.jsc:1:6414
at async WebContents.<anonymous> (node:electron/js2c/browser_init:2:86077)
INFO 2025/1/30 01:36:20 [blur] 1
INFO 2025/1/30 01:36:20 [win] blur
INFO 2025/1/30 01:40:02 [focus] 1
INFO 2025/1/30 01:40:03 [blur] 1
INFO 2025/1/30 01:40:03 [win] blur
Describe the bug
When exporting a PDF in Typora, the following error is displayed:
As a result, the exported PDF does not include any header or footer content. The settings used for export are shown in the attached screenshot.
To Reproduce
Steps to reproduce the behavior:
${pageNo} / ${totalPages}
).Expected behavior
Headers and footers should be correctly rendered in the exported PDF, without any errors.
Screenshots / Screencasts
Sample Markdown File
Any Markdown file.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: