ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » json byte stream to pdf

Post new topic  Reply to topic
 json byte stream to pdf « View previous topic :: View next topic » 
Author Message
psh16
PostPosted: Fri Mar 06, 2015 1:24 pm    Post subject: json byte stream to pdf Reply with quote

Newbie

Joined: 06 Mar 2015
Posts: 1

Hello -

I have requirement to convert json byte stream to pdf in messgae broker , Can someone let me know how to do the same in ESQL or Java Compute node in message broker.

Sample json message :{"headers":{},"body":{"pdfByteArray":"amF2YS5pby5GaWxlSW5wdXRTdHJlYW1ANzYyYTc2MmE="}}

I need to convert "amF2YS5pby5GaWxlSW5wdXRTdHJlYW1ANzYyYTc2MmE="
to pdf in ESQL or JCN.

Much appreciated!

thanks !
Back to top
View user's profile Send private message
sumit
PostPosted: Fri Mar 06, 2015 1:58 pm    Post subject: Reply with quote

Partisan

Joined: 19 Jan 2006
Posts: 398

psh16 wrote:
I need to convert "amF2YS5pby5GaWxlSW5wdXRTdHJlYW1ANzYyYTc2MmE="
to pdf in ESQL or JCN.

Can you please tell what this is? Is it already a pdf content?
_________________
Regards
Sumit
Back to top
View user's profile Send private message Yahoo Messenger
kimbert
PostPosted: Fri Mar 06, 2015 4:23 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I would guess that the value of 'pdfByteArray' is a PDF document encoded as base64. I would use ESQL's base64Decode function to turn it into a BLOB. Then you can write the BLOB to a file.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
nelson
PostPosted: Fri Mar 06, 2015 7:52 pm    Post subject: Reply with quote

Partisan

Joined: 02 Oct 2012
Posts: 313

As kimbert said, you can use the base64decode function. But before, be sure of pdfByteArray's content:

In your sample, this base64 encoded:

Code:
amF2YS5pby5GaWxlSW5wdXRTdHJlYW1ANzYyYTc2MmE=


decoded is:

Code:
java.io.FileInputStream@762a762a
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » json byte stream to pdf
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.