Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Possible to decode base64 document contents to XDP?

Avatar

Level 2

Hi,

As the title says, is it possible to decode the base64-encoded contents of my PDF back to an XDP format?

Using this JavaScript SOAP.stringFromStream(SOAP.streamEncode(Collab.documentToStream(event.target), "base64")); I am able to submit the base64 encoded PDF document to my server side for processing. Is there any way to convert this back to XDP format at this stage?

Thanks,

Ray

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Do you have LiveCycle Server? If so there is a method provided there. If not there shoudl be a method provided in the programming language that you are using.

Paul

View solution in original post

5 Replies

Avatar

Correct answer by
Former Community Member

Do you have LiveCycle Server? If so there is a method provided there. If not there shoudl be a method provided in the programming language that you are using.

Paul

Avatar

Level 2

I don't have LiveCycle server on my server-side. It's a Java based server-side where my processing will be performed.

Presently, when I decode my base64-encoded String it's not in XDP format. Can see some text but a lot of it is not readable. Any ideas what method I should be looking for in Java?

Avatar

Former Community Member

No it is a PDF that you are sending back in ....so it is the contents of the PDF.

Paul

Avatar

Level 2

Maybe someone might have a few ideas on how I can approach my problem so.

My web application maintains session info of any logged in users. One of the attributes of the session is a "securityToken".

When the user clicks a button on the PDF within my web application, a Web Service call is made. However, I need to get the securityToken into this Web Service call. This securityToken isn't something that the user should be manually entering.

Can anyone think of any possible solution to solve this problem?

Thanks,

Ray.

Avatar

Former Community Member

Hi Ray,

In your form if you have bound the webservice in Data View tab then you shuould be able to pass that token as part of the web service request data. By doing this you are putting the token as the form data so you might have to populate the value in a hidden text fields in the form and thus the value gets stored there but is not visible.

To answer the base64 decoding issue, you may be able to decode the data via java api. Have a look at package com.adobe.idp.common.util.Base64 class in LiveCycle client apis and there is a decode method there.

cheers,

Parth

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----