I am trying to create a PDF inside webMethods and found the helpful package PDFCreator (and it’s samples).
I am required to have images inside the PDF document.
In the PDFCreator sample ‘basicParagraph’ it references a getImage service, however this does not exist in the downloadable PDFCreator package on here (or the old wmusers for that matter).
Does anybody know where a version of the PDFCreator package is that contains this service?
The package version I have is 1.0 however the author (David Vilaverde) may not have versioned the package.
HI there
I have ever tried to create the PDF with image source files using this code:
///
/// create PDF Document object from image source
///
///
///
public PDFDocument CreateImageOnlyPDFDocumentDemo(List images)
{
return new PDFDocumentt(images);
}
YOu can also have a try.Or just google one of the PDF creater to help you out.
/**
* The primary method for the Java service
*
* @param pipeline
* The IData pipeline
* @throws ServiceException
*/
public static final void createitextPdf(IData pipeline) throws ServiceException {
try {
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
String Report = IDataUtil.getString( pipelineCursor, "Report" );
String AbsoluteFileName = IDataUtil.getString( pipelineCursor, "AbsoluteFileName" );
pipelineCursor.destroy();
Document document = new Document();
PdfWriter writer = PdfWriter.getInstance(document,new FileOutputStream(AbsoluteFileName));
document.open();
XMLWorkerHelper.getInstance().parseXHtml(writer, document,new StringReader(Report));
document.close();
}
catch (Exception e) {
System.out.println("**********************Error Occured from here ***************************************************");
e.printStackTrace();
System.out.println("**************************************************Error Ends Here **********************************************");
}
}
// --- <<IS-BEGIN-SHARED-SOURCE-AREA>> ---
// --- <<IS-END-SHARED-SOURCE-AREA>> ---
}
Give the input Report as html string which contains all your texts and images(images with relative path of the server)
and AbsoluteFilename as a “location\filename.pdf” in your server .
Do download itextpdf-5.5.0 and place in <IS\lib\jars>