Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pdf2json

Package Overview
Dependencies
Maintainers
1
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdf2json - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

14

lib/pdfanno.js

@@ -99,2 +99,3 @@ var nodeUtil = require("util"),

return;
var funcName = vParts[0];

@@ -116,3 +117,14 @@ var funcParam = vParts[1].split(')')[0];

case 'AFDate_FormatEx':
item.TName = 'date';
var dateMask = funcParam.replace(/^'+|^"+|'+$|"+$/g,''); //mask value
if (dateMask && dateMask.length <= 5) {
if (dateMask.length === 5) { // default to mm/dd
item.TName = 'mmdd';
}
else if (dateMask.length === 4) { // default to yyyy
item.TName = 'yyyy';
}
}
else {
item.TName = 'date';
}
break;

@@ -119,0 +131,0 @@ case 'AFSpecial_KeystrokeEx': //special format: "arbitrary mask"

4

package.json
{
"name": "pdf2json",
"_id": "pdf2json@0.4.0",
"version": "0.4.0",
"_id": "pdf2json@0.4.1",
"version": "0.4.1",
"description": "A PDF file parser that converts PDF binaries to text based JSON, powered by porting a fork of PDF.JS to Node.js",

@@ -6,0 +6,0 @@ "keywords": [

@@ -414,4 +414,9 @@ Introduction

About 5 types are detected only when the widget field type is "Tx" and the additional-actions dictionary 'AA' is set. Like what you see, not all pre-defined formatters and special formatters are supported, if you need more support, you can extend the 'processFieldAttribute' function in core.js file.
v0.4.1 added more date format detection, these formats are set in Acrobat's field's Properties => Format => Date => Custom:
* mmdd: 2 digit month and and 2 digit day in 'mm/dd'
* yyyy: 4 digit year
* date: mm/dd/year if other than mmdd and yyyy are detected
Types above are detected only when the widget field type is "Tx" and the additional-actions dictionary 'AA' is set. Like what you see, not all pre-defined formatters and special formatters are supported, if you need more support, you can extend the 'processFieldAttribute' function in core.js file.
For the supported types, the result data is set to the field item's T object. Example of a 'number' field in final JSON output:

@@ -418,0 +423,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc