Global

Methods

constructor(permissions, userPassword, ownerPassword, fileId)

Source:

初始化加密设置

Example
var security = new PDFSecurity(["print"])
Parameters:
Name Type Description
permissions Array

用户允许的权限,"print", "modify", "copy" 和 "annot-forms"。

userPassword String

权限适用于此用户。留空表示文档没有密码保护,但用户有上述权限。

ownerPassword String

Owner 对文件有完全功能。

fileId String

作为十六进制字符串,应与文件 ID 相同。

encryptor(objectId, generation) → {function}

Source:

返回一个可以接受字节字符串并返回加密版本的加密函数

Example
out("stream");
encryptor = security.encryptor(object.id, 0);
out(encryptor(data));
out("endstream");
Parameters:
Name Type Description
objectId number
generation number

不确定这是什么用途,可以设置为 0

Returns:
Type
function

hexToBytes(hex) → {String}

Source:

将十六进制字符串转换为字节字符串

Parameters:
Name Type Description
hex String

Hex string

Returns:
Type
String

lsbFirstWord(data) → {Array}

Source:

将 4 字节数字分解为其各个字节,以最低有效位为先

Parameters:
Name Type Description
data number

32-bit number

Returns:
Type
Array

mapArrayBufferViews()

Source:

将 ArrayBufferViews 映射到 ArrayBuffers 的辅助函数 用于 BlobBuilder 构造函数和旧浏览器,这些浏览器不支持 Blob 构造函数中的 ArrayBufferViews

md5cycle()

Source:
License:
  • Joseph Myers 没有指定特定许可证。 作者:Joseph Myers 访问自:http://www.myersdaily.org/joseph/javascript/md5.js 修改自:Owen Leong

processOwnerPassword(paddedUserPassword, paddedOwnerPassword) → {String}

Source:

计算加密字典中的 'O' 字段

Parameters:
Name Type Description
paddedUserPassword String

填充的用户密码字节串

paddedOwnerPassword String

填充的 Owner 密码字节串

Returns:
Type
String

rc4(key, data) → {string}

Source:

将字节字符串转换为十六进制字符串

Parameters:
Name Type Description
key string

加密密钥的字节串

data string

要加密的数据字节串

Returns:

加密后的字符串

Type
string

repeat()

Source:
License:
  • FPDF is released under a permissive license: there is no usage restriction. 您可以自由地在您的应用程序中嵌入它(商业或非商业),无论是否修改。 参考:http://www.fpdf.org/en/script/script37.php

RGBColor()

Source:
Author:
License:
  • 如果您喜欢它,请使用它

一个解析颜色值的类

Sets options for Bidi conversion(:)

Source:
Parameters:
Name Type Description
: Object
  • isInputVisual {boolean} (默认值为 false): 允许的值:true(Visual mode), false(Logical mode)
  • isInputRtl {boolean}: 允许的值 true(Right-to-left direction), false (Left-to-right directiion), undefined(Contectual direction, i.e.direction defined by first strong character of input string)
  • isOutputVisual {boolean} (默认值为 false): 允许的值:true(Visual mode), false(Logical mode)
  • isOutputRtl {boolean}: 允许的值 true(Right-to-left direction), false (Left-to-right directiion), undefined(Contectual direction, i.e.direction defined by first strong characterof input string)
  • isSymmetricSwapping {boolean} (默认值为 false): 允许的值 true(需要对称交换), false (不需要对称交换),

toHexString(byteString) → {String}

Source:

将字节字符串转换为十六进制字符串

Parameters:
Name Type Description
byteString String

字节字符串

Returns:
Type
String

toPDFName(str)

Source:

将字符串转换为 PDF Name Object。 详情:PDF 参考 1.3 - 第 3.2.4 节 Name Object

Parameters:
Name Type Description
str

Type Definitions

ApiSwitchBody(pdf)

Source:
Parameters:
Name Type Description
pdf jsPDF

PatternData

Source:

{Matrix|undefined} matrix {Number|undefined} xStep {Number|undefined} yStep {Array.|undefined} boundingBox

Type:
  • Object