Package com.itextpdf.text.io

Examples of com.itextpdf.text.io.RandomAccessSourceFactory


  private List<String> supportedLanguages;

  public OpenTypeFontTableReader(String fontFilePath, int tableLocation)
      throws IOException {
    this.rf = new RandomAccessFileOrArray(
        new RandomAccessSourceFactory().createBestSource(fontFilePath));
    this.tableLocation = tableLocation;
  }
View Full Code Here


    public CidLocationFromByte(byte[] data) {
        this.data = data;
    }
   
    public PRTokeniser getLocation(String location) throws IOException {
        return new PRTokeniser(new RandomAccessFileOrArray(new RandomAccessSourceFactory().createSource(data)));
    }
View Full Code Here

    public PRTokeniser getLocation(String location) throws IOException {
        String fullName = BaseFont.RESOURCE_PATH + "cmaps/" + location;
        InputStream inp = StreamUtil.getResourceStream(fullName);
        if (inp == null)
            throw new IOException(MessageLocalization.getComposedMessage("the.cmap.1.was.not.found", fullName));
        return new PRTokeniser(new RandomAccessFileOrArray(new RandomAccessSourceFactory().createSource(inp)));
    }
View Full Code Here

        return true;
    }

    public static Object[] splitDAelements(String da) {
        try {
            PRTokeniser tk = new PRTokeniser(new RandomAccessFileOrArray(new RandomAccessSourceFactory().createSource(PdfEncodings.convertToBytes(da, null))));
            ArrayList<String> stack = new ArrayList<String>();
            Object ret[] = new Object[3];
            while (tk.nextToken()) {
                if (tk.getTokenType() == TokenType.COMMENT)
                    continue;
View Full Code Here

    private void updateByteRange(PdfPKCS7 pkcs7, PdfDictionary v) {
        PdfArray b = v.getAsArray(PdfName.BYTERANGE);
        RandomAccessFileOrArray rf = reader.getSafeFile();
      InputStream rg = null;
        try {
          rg = new RASInputStream(new RandomAccessSourceFactory().createRanged(rf.createSourceView(), b.asLongArray()));
            byte buf[] = new byte[8192];
            int rd;
            while ((rd = rg.read(buf, 0, buf.length)) > 0) {
                pkcs7.update(buf, 0, rd);
            }
View Full Code Here

        PdfArray b = v.getAsArray(PdfName.BYTERANGE);
        long[] gaps = b.asLongArray();
        if (b.size() != 4 || gaps[0] != 0)
            throw new DocumentException("Single exclusion space supported");
        RandomAccessSource readerSource = reader.getSafeFile().createSourceView();
        InputStream rg = new RASInputStream(new RandomAccessSourceFactory().createRanged(readerSource, gaps));
        byte[] signedContent = externalSignatureContainer.sign(rg);
        int spaceAvailable = (int)(gaps[2] - gaps[1]) - 2;
        if ((spaceAvailable & 1) != 0)
            throw new DocumentException("Gap is not a multiple of 2");
        spaceAvailable /= 2;
View Full Code Here

TOP

Related Classes of com.itextpdf.text.io.RandomAccessSourceFactory

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.