Skip to main content
Participating Frequently
Aug 21, 2023 1:28 PM UTC
Question

Create PDF from dynamic HTML

Hi Team, I need to create pdf from dynamic html.
So I have HTML file, inline CSS and json data.

How I can  use new rest API's to create PDF.
I tried following steps - 
1.Create a zip file from html, css and json file.

2.Generate access token.

2.Upload them to adobe cloud and get asset ID.

3.Call api- https://pdf-services-ue1.adobe.io/operation/htmltopdf

but it's not working.

Can any one help me on this? As new rest api documentation is not clear

31 replies

Participant
May 6, 2025 12:51 PM UTC

Hi,

 

Was this issue resolved. We too have a similar issue for one specific case.

Any info would be helpful

Translate
Participating Frequently
Jul 15, 2024 5:33 PM UTC

Hi Raymond, it's blocking us in PROD environment. can you please help?

Translate
Raymond Camden
Community Manager
Community Manager
Jul 15, 2024 6:03 PM UTC

I'm working with someone else who sent me some sample HTML, but no data. If you can quickly send me a MINIMAL example that includes the HTML + all assets, ie, the zip, and your data, I will try to reproduce.

Translate
Raymond Camden
Community Manager
Community Manager
Jul 15, 2024 6:26 PM UTC

Query, the other person's HTML is missing this:

 

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

 

Can you confirm if your templates have this?

Translate
Joel Geraci
Community Expert
Community Expert
Aug 21, 2023 3:02 PM UTC

Are you bundling the JSON in the ZIP? If you run the index.html file from localhost does it display properly?

Translate
Participating Frequently
Aug 22, 2023 1:36 PM UTC

Hi, Joel_Geraci, can you please check my comments and update as I have to complete this ASAP.

Translate
Raymond Camden
Community Manager
Community Manager
Jul 9, 2024 6:32 PM UTC

I uploaded asset. Now I am doing download polling to asset
https://pdf-services-ue1.adobe.io/operation/htmltopdf/<asset_id>/status

h = {
"Authorization": f"Bearer {access_token}",
"x-api-key": client_id}

getting response
{'error': {'code': 'BAD_ADDRESS', 'message': 'Bad Address, request terminated; requestId=kuoRG2ucAHYiBzuoSvebuKP3wKPTEvCv', 'status': 400}, 'status': 'failed'}



You don't use the assetId in the poll, but the job id. 

Translate