Package org.xhtmlrenderer.pdf

Examples of org.xhtmlrenderer.pdf.ITextFontResolver


        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream(f);
            BufferedOutputStream bos = new BufferedOutputStream(fos);
            renderer.setDocument(doc, null, new XhtmlNamespaceHandler());
            ITextFontResolver resolver = renderer.getFontResolver();
            // TODO: encoding is hard-coded as IDENTITY_H; maybe give user option to override
            resolver.addFont(
                    fontPathTF.getText(),
                    BaseFont.IDENTITY_H,
                    BaseFont.EMBEDDED
            );
            renderer.layout();
View Full Code Here


      ITextRenderer iTextRenderer = new ITextRenderer();
      out = new ByteArrayOutputStream();

      // 設定字型
      ITextFontResolver fontResolver = iTextRenderer.getFontResolver();
      fontResolver.addFont(getFontPath(), BaseFont.IDENTITY_H,
          BaseFont.NOT_EMBEDDED);

      PDFEncryption pdfEncryption = new PDFEncryption();
      // 設定加密
      if (reportData.containsKey(ReportParamEnum.encrypt.toString())) {
View Full Code Here

      builder.setErrorHandler(errorHandler);
    } catch (ParserConfigurationException e) {
      throw NSForwardException._runtimeExceptionForThrowable(e);
    }
    InputStream is = new ByteArrayInputStream(document.getBytes(encoding));
    ITextFontResolver resolver = renderer.getFontResolver();
    for (String font : fontsFromConfiguration(configuration)) {
      try {
        resolver.addFont(font, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
   
View Full Code Here

        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream(f);
            BufferedOutputStream bos = new BufferedOutputStream(fos);
            renderer.setDocument(doc, null, new XhtmlNamespaceHandler());
            ITextFontResolver resolver = renderer.getFontResolver();
            // TODO: encoding is hard-coded as IDENTITY_H; maybe give user option to override
            resolver.addFont(
                    fontPathTF.getText(),
                    BaseFont.IDENTITY_H,
                    BaseFont.EMBEDDED
            );
            renderer.layout();
View Full Code Here

TOP

Related Classes of org.xhtmlrenderer.pdf.ITextFontResolver

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.