Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Creating PDF using ITEXT API's - error

Hi,

In my WebDynpro Application I want to generate a PDF (using ITEXT API's) out of the data retrieved from back end system .

I used this source code.

Document document = new Document(PageSize.A4);
document.open();
PdfPTable table = new PdfPTable(1);
PdfPCell cell;
cell = new PdfPCell(new Paragraph("ONE"));
table.addCell(cell);
cell = new PdfPCell(new Paragraph("TWO")); 	
table.addCell(cell);
 
document.add(table);
document.close();
 
byte[] b = new byte[100 * 1024];
b =  document.toString().getBytes("UTF-8");
		
IWDCachedWebResource pdfRes = WDWebResource.getPublicCachedWebResource(b, WDWebResourceType.PDF, WDScopeType.CLIENTSESSION_SCOPE, 	wdThis.wdGetAPI().getComponent().getDeployableObjectPart(),"FileNameHelloText"));

I have used Window Manager to create a external window with the URL from pdfRes.getUrl() method.

After execution i get a pop up window with out PDF document.

Please let me know your thoughts & solutions to the above mentioned problem.

Thanks

Senthil

Former Member
Not what you were looking for? View more on this topic or Ask a question