Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Getting 'Fatal error ' when generating pdf using Adobe pdfservices-sdk

New Here ,
Dec 14, 2022 Dec 14, 2022

Getting 'Fatal error ' as below when generating pdf using Adobe

pdfservices-sdk

version 2.2.2 Html to pdf operation

All validations successfully done. Beginning CreatePDF operation execution 2022-12-13 16:59:48.749 [XNIO-1 task-14] ERROR c.a.e.d.m.b.s.CreatePDFFromHTML - Exception encountered while executing operation com.adobe.pdfservices.operation.exception.ServiceApiException: description ='Fatal error, Please check logs for details.'; requestTrackingId='Y6GzQ0h7Wj1e2GAdWMuBVapadrRcvtwY'; statusCode=500; errorCode=UNKNOWN at com.adobe.pdfservices.operation.pdfops.CreatePDFOperation.execute(CreatePDFOperation.java:212) at com.anthem.emep.dckr.microsvc.bbbookletservice.service.CreatePDFFromHTML.generatePdf(CreatePDFFromHTML.java:68)

4.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 14, 2022 Dec 14, 2022

Can you share the HTML input you used?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2022 Dec 14, 2022
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Adobe IO</title>
<script src="https://cdn.jsdelivr.net/npm/jsonata/jsonata.min.js"></script>
</head>

<body onload = "initial()">
<script type="text/javascript">
function initial()
{
var document = window.document;
document.getElementById("outline").innerHTML = String(window.json.outline);
}
</script>

<div>
<div>
<p id="outline"></p>
</div>
</div>
</body>

</html>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 15, 2022 Dec 15, 2022

It looks like you probably also passed custom data too - can you share that?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 29, 2022 Dec 29, 2022

Attached data

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 03, 2023 Jan 03, 2023

One thing I notice is that you don't have the required script tag, as documented here: https://developer-stage.adobe.com/document-services/docs/overview/pdf-services-api/howtos/create-pdf...

 

Specifically: <script src='./json.js' type='text/javascript'></script>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 03, 2023 Jan 03, 2023

I can see the script tag in attached html, attached the screenshot for the script tag, and this html works perfectlt just with this data it's not working, just wondering it's because of some limitation like inser/replace or page limitation it has  to generate pdf 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 03, 2023 Jan 03, 2023

Um, I think you attached a screen shot of your credentials. I'd edit the post asap.

 

The script tag is NOT visible in the first post above. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 03, 2023 Jan 03, 2023

yes I couldn't remove the attached credential,
Attached the screenshot for script tag in header and body

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 03, 2023 Jan 03, 2023

I didn't know I had the ability - but I just removed your attachment.

 

I'm looking at your second attachment, you still do NOT have the script tag. To be clear, it must be this: <script src='./json.js' type='text/javascript'></script>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 03, 2023 Jan 03, 2023
 <script src="https://cdn.jsdelivr.net/npm/jsonata/jsonata.min.js"></script>

I'm having above line in html file

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 03, 2023 Jan 03, 2023

Please read what I've said multiple times. You need a script tag that points to json.js. You see my posts saying that, right?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 03, 2023 Jan 03, 2023

Okay, can you clear my question why same html working for same data but it's not working only for the attached data all together

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 03, 2023 Jan 03, 2023

It shouldn't be working at all w/o the script tag. That's why I'm asking you to add it. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 03, 2023 Jan 03, 2023

Tried with script pointing to json.js  with the attached data, getting below error 

3-01-03 17:28:09.874 [XNIO-1 task-7] ERROR c.a.e.d.m.b.s.CreatePDFFromHTML -
Exception encountered while executing operation
com.adobe.pdfservices.operation.exception.ServiceApiException: description ='Fatal error, Please check logs for details.'; requestTrackingId='wfVqk8fERUNpp6Y7HFWWU4UqpoXAyHCC'; statusCode=500; errorCode=UNKNOWN

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Adobe IO</title>
<script src="https://cdn.jsdelivr.net/npm/jsonata/jsonata.min.js"></script>
</head>

<body onload = "initial()">
<script src="./json.js"></script>
<script type="text/javascript">
function initial()
{
var document = window.document;
document.getElementById("outline").innerHTML = String(window.json.outline);
}
</script>

<div>
<div>
<p id="outline"></p>
</div>
</div>
</body>

</html>


 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 03, 2023 Jan 03, 2023

Ok, I thought it might be size, but I'm having trouble getting this working even when I've trimmed your HTML. Reporting internally.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 04, 2023 Jan 04, 2023

The Jsondata1.json file that you attached isn't JSON. It's HTML.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 04, 2023 Jan 04, 2023
LATEST

Joel, grab the earlier attachment. It was right. Trust me, I checked it. 😉

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources