How to convert a string into PDF format by using BW for mailing (send mail) purpose.

How to convert a string into PDF format by using BW for mailing (send mail) purpose.

book

Article ID: KB0092844

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Description:
These steps are applicable to convert a string into PDF after invoking a web service. Later, the same can be attached in a Send Mail activity.

Issue/Introduction

How to convert a string into PDF format by using BW for mailing (send mail) purpose.

Resolution

Writing a stream of strings into a PDF file will not make the document a PDF document. It is more applicable to a Text document. To create a specific document such as PDF or doc, the stream needs to be converted into the right format. Likewise, a message sent by a web service is not formalized into a PDF. Although the message is written into a PDF file, it cannot be opened by a PDF reader. So before being written to file, a message should be formatted to PDF format first.

A workaround is to use JavaMethod activity to formalize the message into PDF binary code and map the binary code to MIMEPart of a SendMail activity. The PDFUtil.jar (attached) is a support written JAR file that can be used to convert a String into PDF binary code and the itext-2.0.6.jar (attached) is its dependency.Find the sample project TestEmailPDF.rar attached for more details.

Attachments

How to convert a string into PDF format by using BW for mailing (send mail) purpose. get_app
How to convert a string into PDF format by using BW for mailing (send mail) purpose. get_app
How to convert a string into PDF format by using BW for mailing (send mail) purpose. get_app