Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Document is not getting generated after preview

CaptainG
Tera Contributor

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:

CaptainG_0-1775064900231.jpeg

 

Logs:

Request : <sysid> failed with ' Conversion failed. Cannot invoke "java.io.ByteArrayOutputStream.toByteArray()" because "pdfOS" is null': no thrown error

8 REPLIES 8

Hi @Tanushree Maiti / @pr8172510 

Its published and completely ootb template but still facing issue.

Hi @CaptainG 

 

Can you try this option

 

1. Clear your browser cache or try it in incognito window/private browser.

 

2. If  following kind of CSS added in the template

<style>

@page {size: landscape}

</style>

 

refer: Error Message: Cannot invoke "java.io.ByteArrayOutputStream.toByteArray()" because "pdfOS" is null 

2. If not working , can you try this

changing the system property  com.snc.pdf.deployment.mode from "SERVICE" to "INSTANCE"

Refer: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB2473690

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

CaptainG
Tera Contributor

Hi @pr8172510 / @Tanushree Maiti ,

Its published and completely ootb template but still failing.

abirakundu23
Giga Sage

Hi @CaptainG ,
Could you please clear the cache from browser as well as non Prod instance (Application Navigator) ?

Please check below thread : https://www.servicenow.com/community/hrsd-forum/document-templates-preview-and-pdf-generation-fail-o...

Please mark helpful and correct answer if it's worthy for you.