cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer data from WebDynpro Context to PDF - Options

Former Member
0 Kudos

Hi,

I have set of data in webdynpro context, i would like to create table in PDF and transfer the context data to PDF.

I tried using ITEXT API's to create PDF, it is not working, please let me know the ways to generate PDF.

I don't want to use Interactive Form UI element.

I don't want intermediate conversion like creating XML and then PDF etc.

Thanks

Senthil

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I am able to create the PDF using the ITEXT, issue was related to URL generation. It is fixed.

Thanks

Senthil

balaji_bodagala5
Participant
0 Kudos

Hi Senthil,

write a separate class,and write the method which will return collection,before that add the itext.jar in the lib,and add the written class must be placed in src\packges,

iterate the collection store in strings that will be set to context element.we can bind the value node to UI element.

Thanks,

Balaji

Former Member
0 Kudos

Hi,

I have included the ITEXT.jar.

I tried creating a simple PDF (without any context data, with just some static text) using ITEXT api's it is not working.

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 <b>with out PDF document.</b>

I read the blog written by Prakash, in Portal we have access to HTTP Servlet Response but in WebDynpro we don't have access, if you have solution (or sample code) to create PDF let me know..

Thanks

Senthil