cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate a multiple pages printable PDF

Former Member
0 Kudos

Hi all, I've a web dynpro in which my client fill any fields. One of this was "Total pages" and now I'm looking for a solution to create one printable PDF for every page or a unique printable PDF with n pages (n = total pages). How to do this ?

Thanks in advance

Best regards

Gianfranco

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Shabir, I've not a pdf link. I generate it dynamically at run time with ADS.

Gianfranco

Former Member
0 Kudos

Hi Gianfranco,

If you have the link for Pdfs, based on number of pdfs to generate, you can put code similar to the one below inside respective numberOfPages Loop

String pdfLink = <Your Link>

FileInputStream fileIn = new FileInputStream(pdfLink);

int lastIndex = pdfLink.lastIndexOf(Constants.PATH_SEP);

String saveFileName = pdfLink.substring(lastIndex);

IWDResource resource = WDResourceFactory.createCachedResource(fileIn, saveFileName,WDWebResourceType.PDF,true);

String url = resource.getUrl(WDFileDownloadBehaviour.OPEN_INPLACE.ordinal());

wdComponentAPI.getWindowManager().createNonModalExternalWindow(url,saveFileName).show();

Hope this helps.

PradeepBondla
Active Contributor
0 Kudos