Author |
Message
|
lerner |
Posted: Thu Jul 05, 2012 1:42 am Post subject: writing data into a pdf with fileoutput node |
|
|
Apprentice
Joined: 17 May 2012 Posts: 26
|
Hi all,
I came with new problem..need to write data into a pdf file
iam using WMBv8.0
I've used fileoutput node and writng data into .txt file it's worked.
but when i'm trying to write the same data into a pdf(by specifying file name as xyz.pdf in fileoutputnode properties),pdf file was created bt it was not opened showing some warning in adobe reader like "could not open xyz.pdf either it is not supported type or file is damaged"
give me ur suggestions to sort out this ... |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jul 05, 2012 1:59 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
The difference between a PDF file and a TXT file is the same thing as the difference between a TXT file and a ZIP file.
The contents are entirely different!
You can't just tell Adobe that text data represents a PDF document if the text doesn't actually represent PDF data!
The only thing that Broker FileOutput knows about a file is that it has a name and location and that it has contents. It doesn't make any changes to those contents to match the OS's understanding of the meaning of the file name.
If you want to create a readable usable PDF file, then you *must* create PDF data *inside* your message flow and have the FileOutput write that out.
And, NO, broker DOES NOT provide any PARSERS or ASSISTANCE for creating PDF files. Use Java or .NET Compute nodes. |
|
Back to top |
|
 |
lerner |
Posted: Thu Jul 05, 2012 2:28 am Post subject: |
|
|
Apprentice
Joined: 17 May 2012 Posts: 26
|
thanks for the response mqjeff.
now i got some thing about creating pdf's
as you said no broker provides any assistance for creating pdf files..
can java compute node or .NET node do that..?(i mean is it possible to code to create pdf content using these nodes)
please clarify this.. i will work according to ur suggested stuff |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jul 05, 2012 2:40 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I am sure with some dilligent effort on your part you can find usable libraries (even if you have to pay Adobe) for creating PDF files that you can then use from within code in a Java or .NET library. |
|
Back to top |
|
 |
lerner |
Posted: Thu Jul 05, 2012 2:52 am Post subject: |
|
|
Apprentice
Joined: 17 May 2012 Posts: 26
|
thanks mqjeff for such quick response..
i will work on your suggested stuff |
|
Back to top |
|
 |
lerner |
Posted: Thu Jul 05, 2012 9:48 pm Post subject: |
|
|
Apprentice
Joined: 17 May 2012 Posts: 26
|
hi guys any other ideas are appreciated |
|
Back to top |
|
 |
lerner |
Posted: Thu Jul 05, 2012 10:09 pm Post subject: |
|
|
Apprentice
Joined: 17 May 2012 Posts: 26
|
hi mqjeff
yesterday i worked on your stuff..in java i am finding there are ways to create pdf's bt my case is to create pdf content..and writing the data into pdf through fileoutput
iam not getting even single thought how to proceed (i mean creating pdf content).could you pls help me
my flow is like
mq i/p-->compute---> fileoutput
i need to send this pdf to remote server(FTP server),so i have to use file output...suggest me... |
|
Back to top |
|
 |
kash3338 |
Posted: Thu Jul 05, 2012 10:23 pm Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
lerner wrote: |
hi mqjeff
yesterday i worked on your stuff..in java i am finding there are ways to create pdf's bt my case is to create pdf content..and writing the data into pdf through fileoutput |
Why do you want to use only Fileoutput to do this when Java does that for you. Instead of Fileoutput you can directly FTP your PDF doc from your Java Code (One option)
lerner wrote: |
my flow is like
mq i/p-->compute---> fileoutput
i need to send this pdf to remote server(FTP server),so i have to use file output...suggest me... |
You need not have a Java Compute to do this, you can have a separate Java application which just converts the String you send to a PDF content and send the bytes back to you. Invoke the Java app from your compute node and get back the bytes (BLOB) and write to Fileoutput node. |
|
Back to top |
|
 |
lerner |
Posted: Thu Jul 05, 2012 10:47 pm Post subject: |
|
|
Apprentice
Joined: 17 May 2012 Posts: 26
|
Quote: |
Why do you want to use only Fileoutput to do this when Java does that for you. Instead of Fileoutput you can directly FTP your PDF doc from your Java Code (One option) |
1.
actually in my flow iam doing lot of tranformations like filename creation with my i/p paramenters,conversions to binary to strng,etc which are specific to fileoutput..this is one issue(creating pdf content) i'm facing problem.if i use java node instead of fileoutput i have to change entire code it will be difficult for me because i'm new to java..
Quote: |
You need not have a Java Compute to do this, you can have a separate Java application which just converts the String you send to a PDF content and send the bytes back to you. Invoke the Java app from your compute node and get back the bytes (BLOB) and write to Fileoutput node. |
2.
could you pls be more specific it so that i can understand..actually my doubt is how to create a pdf content..is there any builtin applications ??? |
|
Back to top |
|
 |
MBMQDeveloper |
Posted: Fri Jul 06, 2012 3:20 am Post subject: |
|
|
Novice
Joined: 02 Jul 2012 Posts: 19
|
Have a Java code to convert your text file to pdf (refer to "roseindia" website and look for TextToPDF conversion...I was able to find the code there) and then try to call the same from your compute node. |
|
Back to top |
|
 |
MBMQDeveloper |
Posted: Fri Jul 06, 2012 3:21 am Post subject: |
|
|
Novice
Joined: 02 Jul 2012 Posts: 19
|
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jul 06, 2012 3:50 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Right, so that looks like a perfectly okay library to use to create a PDF document, provided it has the necessary license requirements for lerner's project.
There's no solidly good reason for using it outside of Broker rather than inside a JCN, at least as shown so far. There may be various factors that prefer one choice over the other, but again not shown.
My personal preference is to do everything inside the message flow, and not call out to external things unless there's a good reason. |
|
Back to top |
|
 |
|