Document is not getting generated after preview
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello team,
I have selected document template and after preview i am getting below error and logs. Can someone please help with this. Its for ootb document template and as well as custom document template.
Error:
Logs:
Request : <sysid> failed with ' Conversion failed. Cannot invoke "java.io.ByteArrayOutputStream.toByteArray()" because "pdfOS" is null': no thrown error
- Labels:
-
Human Resources Service Delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi CaptainG,
1. Understanding the error
Error:
Conversion failed. Cannot invoke "java.io.ByteArrayOutputStream.toByteArray()" because "pdfOS" is null
This means:
- The PDF engine failed to generate output
- So the stream (
pdfOS) was never initialized
2. Why this happens (most common causes)
1. Missing / misconfigured PDF Generation Plugin
Check if required plugins are active:
- Document Generation
- PDF Generation (iText / DocGen related plugins)
Sometimes after upgrades or changes, dependencies break
2. HTML in template is not valid
Even for OOTB templates, if you modified:
- HTML structure
- CSS
- Embedded scripts
It can break PDF rendering
Things to check:
- Unclosed tags
- Unsupported CSS
- Images / external references
3. Fonts / attachments issue
If template uses:
- Custom fonts
- Images
And system cannot access them → PDF fails silently
4. Instance-level issue (very common)
This error is often seen when:
- PDF generation service is not responding properly
- Node/cache issue
Try:
cache.do- Switch node (if multi-node instance)
5. Template context / data issue
If preview works partially but fails on generate:
- Check:
- Fields used in template
- Null/invalid data
3. Quick validation steps
Try these to isolate:
- Use completely OOTB template (no changes)
- Generate for a simple record
- Check:
- Same error or not
If still failing → platform issue
If not → template issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @pr8172510 ,
I have verified all the things, its completely OOTB template but still failing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Tanushree Maiti ,
Its published and its completely ootb template but still facing issue.
