Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!

Base 64 to pdf attachment

Avatar

Community Advisor

Hi All,

 

We have the below requirement

 

1)We receive the base 64 encoded Request in Real time in JSON format.

2)We need to decode it and convert it to .pdf file and send it as an attachment in the Transactional Email     Delivery.

 

Kindly help us in how to convert Base 64 to pdf attachment and which works in all browser clients and let us know.

 

Regards,

Pravallika.

 

9 Replies

Avatar

Community Advisor

Hi Team,

 

Please let us know if u have any insights on this issue?

 

Regards,

Pravallika.

Avatar

Community Advisor

Hi Team,

 

Can you Please suggest us the 3rd Party Conversion tool to integrate with Campaign which can be used for Base64 to pdf?

 

Regards,

Pravallika.

Avatar

Community Advisor

Hello @LakshmiPravallika,

 

On what Os your Adobe campaign is installed ? Windows or Linux ? On-Premise, hybrid or fully hosted ? 

I may have a solution for you if you are on-premise or hybrid, and if your ACC instance is on Windows server.

 

Br,

Amine

 

Avatar

Community Advisor

Hi @Amine_Abedour 

 

The Adobe Campaign is installed in fully hosted environment and on Windows.

 

Please let us know the solution used for Hybrid Environment so that we will try to use the same approach.

 

Regards,

Pravallika.

Avatar

Community Advisor

Hello @LakshmiPravallika,

 

I receive the attachement in XML format like this :

<ctx [...]>
	[...]
	<pj fileName="PdfFileName.pdf"> 
		[attached encoded in base64]
	</pj>
</ctx>

The solution that worked for me is : 

  • I store the base64 in a temporary text file (1)
  • I use the system commande "certutil -decode" with the temporary text file as first parameter and the final PDF final as second parameter to decode the base64 to a pdf file (2) (don't mind the ''pushd'' and ''popd'' in the command, i use them because my working directory is in a NAS)
  • Then i store the path to my newly decoded attached in database so that i can point to it from my delivery 

 

Amine_Abedour_0-1668518934478.png

 

 

 

I hope i was clear, if not, please let me know.

Br,

Amine

 

Avatar

Community Advisor

Hi @Amine_Abedour 

 

We have checked the code solution provided by you and had few queries below:

 

Is the above JS Code used on Transactional Server?

If yes, can you please let us know how you have got the directory path...because rtServers are managed by Adobe, so can we have a look into rtServers Backend Directories?

 

Need some better understanding on the above code provided..

 

Regards,

Pravallika.

 

Avatar

Community Advisor

Hi @Amine_Abedour 

 

Please let us know if you had a chance to check the queries what we have on the solution provided by you?

 

 

Regards,

Pravallika.

Avatar

Community Advisor

Hello @LakshmiPravallika,

 

No, the above code is not used in a transactionel server. We are On-premise and have a Midsourcing style architecture.

 

Find bellow a diagram on how i made it work : 

 

Amine_Abedour_0-1668689395403.png

 
I don't think this is feasible in a fully hosted environment. This is the reason I asked the question before giving my method.
 
I hope i was clear, if not, please let me know.
Br,
Amine 

Avatar

Community Advisor

Hi @Amine_Abedour ,

 

Thanks for your Update on this.

 

Can you Please suggest us the 3rd Party Conversion tool to integrate with Campaign which can be used for Base64 to pdf?

 

Regards,

Pravallika.