private int getKeyLength(PdfDictionary encryptionDict) { Integer keyLength = encryptionDict.getAsInt(PdfName.Length); return keyLength != null ? (int) keyLength : 40; } }
/** * Gets line gap style value, {@code LC} key. * * @return 0 - butt cap, 1 - round cap, 2 - projecting square cap. */ public Integer getLineCapStyle() { return getPdfObject().getAsInt(PdfName.LC); }
/** * Get overprint control mode, {@code OPM} key. * * @return an {@code int} value if exist, otherwise {@code null}. */ public Integer getOverprintMode() { return getPdfObject().getAsInt(PdfName.OPM); }
/** * Gets the number of bits used to represent the edge flag for each vertex. * But only the least significant 2 bits in each flag value shall be used. * The valid flag values are 0, 1 or 2. * * @return the number of bits. Can be 2, 4 or 8. */ public int getBitsPerFlag() { return (int) getPdfObject().getAsInt(PdfName.BitsPerFlag); }
/** * Gets the number of bits used to represent each vertex coordinate. * * @return the number of bits. Can be 1, 2, 4, 8, 12, 16, 24, or 32. */ public int getBitsPerCoordinate() { return (int) getPdfObject().getAsInt(PdfName.BitsPerCoordinate); }
/** * Gets the number of vertices in each row of the lattice. * * @return the number of vertices. Can only be greater than 1. */ public int getVerticesPerRow() { return (int) getPdfObject().getAsInt(PdfName.VerticesPerRow); }
/** * Gets the number of bits used to represent the edge flag for each vertex. * But only the least significant 2 bits in each flag value shall be used. * The valid flag values are 0, 1, 2 or 3. * * @return the number of bits. Can be 2, 4 or 8. */ public int getBitsPerFlag() { return (int) getPdfObject().getAsInt(PdfName.BitsPerFlag); }
/** * Gets the number of bits used to represent each vertex coordinate. * * @return the number of bits. Can be 1, 2, 4, 8, 12, 16, 24, or 32. */ public int getBitsPerCoordinate() { return (int) getPdfObject().getAsInt(PdfName.BitsPerCoordinate); }
/** * Gets the number of bits used to represent each colour component. * * @return the number of bits. Can be 1, 2, 4, 8, 12, or 16. */ public int getBitsPerComponent() { return (int) getPdfObject().getAsInt(PdfName.BitsPerComponent); }
/** * Gets the number of bits used to represent each colour component. * * @return the number of bits. Can be 1, 2, 4, 8, 12, or 16. */ public int getBitsPerComponent() { return (int) getPdfObject().getAsInt(PdfName.BitsPerComponent); }
/** * Gets the number of bits used to represent each vertex coordinate. * * @return the number of bits. Can be 1, 2, 4, 8, 12, 16, 24, or 32. */ public int getBitsPerCoordinate() { return (int) getPdfObject().getAsInt(PdfName.BitsPerCoordinate); }
/** * Gets the number of bits used to represent each colour component. * * @return the number of bits. Can be 1, 2, 4, 8, 12, or 16. */ public int getBitsPerComponent() { return (int) getPdfObject().getAsInt(PdfName.BitsPerComponent); }
/** * Gets line join style value, {@code LJ} key. * * @return 0 - miter join (see also miter limit), 1 - round join, 2 - bevel join. */ public Integer getLineJoinStyle() { return getPdfObject().getAsInt(PdfName.LJ); }
/** * Gets the shading type. * * @return int value of {@link PdfName#ShadingType}. */ public int getShadingType() { return (int) getPdfObject().getAsInt(PdfName.ShadingType); }
/** * Gets the number of bits used to represent each vertex coordinate. * * @return the number of bits. Can be 1, 2, 4, 8, 12, 16, 24, or 32. */ public int getBitsPerCoordinate() { return (int) getPdfObject().getAsInt(PdfName.BitsPerCoordinate); }
/** * Gets the number of bits used to represent each colour component. * * @return the number of bits. Can be 1, 2, 4, 8, 12, or 16. */ public int getBitsPerComponent() { return (int) getPdfObject().getAsInt(PdfName.BitsPerComponent); }
/** * Gets the number of bits used to represent the edge flag for each vertex. * But only the least significant 2 bits in each flag value shall be used. * The valid flag values are 0, 1, 2 or 3. * * @return the number of bits. Can be 2, 4 or 8. */ public int getBitsPerFlag() { return (int) getPdfObject().getAsInt(PdfName.BitsPerFlag); }
public int getType() { return (int) ((PdfDictionary)getPdfObject()).getAsInt(PdfName.FunctionType); }
protected void initKeyAndReadDictionary(PdfDictionary encryptionDictionary, Key certificateKey, Certificate certificate, String certificateKeyProvider, IExternalDecryptionProcess externalDecryptionProcess, boolean encryptMetadata) { String digestAlgorithm = getDigestAlgorithm(); byte[] encryptionKey = computeGlobalKeyOnReading(encryptionDictionary, (PrivateKey) certificateKey, certificate, certificateKeyProvider, externalDecryptionProcess, encryptMetadata, digestAlgorithm); Integer keyLen = encryptionDictionary.getAsInt(PdfName.Length); int keyLength = keyLen != null ? (int) keyLen : 40; initKey(encryptionKey, keyLength); }
protected void initKeyAndFillDictionary(PdfDictionary encryptionDictionary, Certificate[] certs, int[] permissions, boolean encryptMetadata, boolean embeddedFilesOnly) { addAllRecipients(certs, permissions); Integer keyLen = encryptionDictionary.getAsInt(PdfName.Length); int keyLength = keyLen != null ? (int) keyLen : 40; String digestAlgorithm = getDigestAlgorithm(); byte[] digest = computeGlobalKey(digestAlgorithm, encryptMetadata); initKey(digest, keyLength); setPubSecSpecificHandlerDicEntries(encryptionDictionary, encryptMetadata, embeddedFilesOnly); }