Hi Markus.
I haven’t worked with copy restricted documents, but I use PDFBox to open and
work with password protected documents. At first glance it looks like it might
work for you (
http://stackoverflow.com/questions/14700241/remove-encryption-from-pdf-with-pdfbox-like-qpdf
). PDFBox also comes with a nice little utility class for merging PDFs, here’s
an example of how to use it. Although I suspect you’ll have to preprocess the
documents (removing access restrictions) before using the PDFMergerUtility.
public WOActionResults multipleInvoiceResponse() {
PDFMergerUtility list = new PDFMergerUtility();
list.addSource( new ByteArrayInputStream( pdfDocument1ByteArray
) );
list.addSource( new ByteArrayInputStream( pdfDocument2ByteArray
) );
list.addSource( /* etc… */ );
ByteArrayOutputStream out = new ByteArrayOutputStream();
list.setDestinationStream( out );
try {
list.mergeDocuments();
}
catch( COSVisitorException | IOException e ) {
throw new RuntimeException( "An exception occurred
while attempting to merge multiple invoices”, e );
}
return USHTTPUtilities.responseWithDataAndMimeType(
“invoices.pdf", out.toByteArray(), "application/pdf" );
}
Cheers,
- hugi
On 22.7.2014, at 10:40, Theodore Petrosky <[email protected]> wrote:
>
> what framework are you using to create these pdfs? I am using ERJasperReports
> (my own version to update to the newest JR). I will check again, but this was
> not difficult in jasperreports. It has a few bugaboos, but nothing
> insurmountable.
>
>
>
> On Jul 22, 2014, at 5:59 AM, Markus Ruggiero <[email protected]>
> wrote:
>
>> Folks,
>>
>> I have a large D2W application that generates tons of product spec sheets as
>> PDF. The customer requires that all the PDFs are copy restricted (no copy
>> allowed, just view and print). That all works.
>>
>> Now the customer has the idea that I should bundle all the generated PDFs
>> into one large PDF. I can do that, no problem. BUT (there is always one,
>> isn't there?) there are externally created PDFs (also copy restricted) that
>> I need to include into the compound PDF. Those 3rd party PDFs are out of my
>> control. I suggested to bundle the PDFs into a ZIP archive but the customer
>> wants ONE large PDF. No, they don't care about inconsistent page numbering,
>> they just want ONE PDF with 150+ pages and one cover page with internal
>> links to the embedded documents.
>>
>> Here is my problem: I have no idea how to do this. All the code I have found
>> cannot deal with protected PDFs (and I have no way to unprotect them
>> easily). The customer is even willing to accept something that can
>> circumvent the protection. The only way I know of to get rid of the
>> restriction is by opening the PDF in ColorSync on the Mac and then print to
>> pdf. However the production app runs on Solaris, there is no Mac around. I
>> might be able to talks the customer into buying a Mac just for this kind of
>> processing. But this is really really last resort.
>>
>> Any ideas? Any PDF guru out there?
>> Thanks for any help, I urgently need it.
>>
>> ---markus---
>>
>>
>>
>> Markus Ruggiero
>> [email protected]
>> Check out the new book about Project Wonder and WebObjects on
>> http://learningthewonders.com/
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/tedpet5%40yahoo.com
>>
>> This email sent to [email protected]
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/hugi%40karlmenn.is
>
> This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]