final CreditNote creditNote = getCreditNoteFromViewState();
try {
final CreditNoteDocument original = new CreditNoteDocument(creditNote, getMessageResourceProvider(request), true);
final CreditNoteDocument duplicate = new CreditNoteDocument(creditNote, getMessageResourceProvider(request), false);
final byte[] data = ReportsUtils.exportMultipleToPdfAsByteArray(original, duplicate);
CreditNoteGeneratedDocument.store(creditNote, original.getReportFileName() + ".pdf", data);
response.setContentLength(data.length);