Package railo.runtime.text.pdf

Examples of railo.runtime.text.pdf.PDFDocument


  private PDFDocument toPDFDocument(Object source,String password, Resource directory) throws PageException {
   
    if(source instanceof PDFDocument)
      return (PDFDocument)source;
    if(Decision.isBinary(source)){
      return new PDFDocument(Caster.toBinary(source),password);
    }
    if(source instanceof Resource){
      return new PDFDocument((Resource) source,password);
    }
    if(source instanceof String){
      if(directory!=null) {
        Resource res = directory.getRealResource((String)source);
        if(!res.isFile()){
          Resource res2 = ResourceUtil.toResourceNotExisting(pageContext, (String)source);
          if(res2.isFile())
            res=res2;
          else
            throw new ExpressionException("file or directory "+res+" not exist");
        }
        return new PDFDocument(res,password)
      }
      return new PDFDocument(ResourceUtil.toResourceExisting(pageContext, (String)source),password)
    }
   
    throw new CasterException(source,PdfReader.class);
  }
View Full Code Here

TOP

Related Classes of railo.runtime.text.pdf.PDFDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.