private void doActionWrite() throws PageException, IOException, DocumentException {
required("pdf", "write", "source", source);
required("pdf", "write", "destination", destination);
if(destination.exists() && !overwrite)
throw new ApplicationException("destination file ["+destination+"] already exists");
PDFDocument doc = toPDFDocument(source, password, null);
//PdfReader pr = doc.getPdfReader();
// output
boolean destIsSource = doc.getResource()!=null && destination.equals(doc.getResource());