code-1-title=Load sample code ...
code-1-code=

code-2-title=Scan to JPEG
code-2-code={\
\n  "twain_cap_setting" : {\
\n    "ICAP_PIXELTYPE" : "TWPT_RGB", // Color\
\n    "ICAP_XRESOLUTION" : "100", // DPI: 100\
\n    "ICAP_YRESOLUTION" : "100",\
\n    "ICAP_SUPPORTEDSIZES" : "TWSS_USLETTER" // Paper size\
\n  },\
\n  "output_settings" : [ {\
\n    "type" : "save",\
\n    "format" : "jpg",\
\n    "save_path" : "${TMP}\\\\${TMS}${EXT}"\
\n  } ]\
\n}

code-3-title=Scan to PDF
code-3-code={\
\n   "output_settings" : [ {\
\n     "type" : "save",\
\n     "format" : "pdf",\
\n     /** Optional text line at the bottom of the 1st page */\
\n     "pdf_text_line" : "Scanned on ${DATETIME} by user X",\
\n     "pdf_owner_password" : "", // optional\
\n     "pdf_user_password" : "",\
\n     "exif" : { // optioanl PDF document properties (metadata)\
\n       "DocumentName" : "Scanned with Asprise Software"\
\n     },\
\n     "save_path" : ".\\\\${TMS}${EXT}"\
\n   } ]\
\n }

code-4-title=Scan to PDF and Upload
code-4-code= {\
\n   "output_settings" : [ {\
\n     "type" : "upload",\
\n     "format" : "pdf",\
\n     "pdf_force_black_white" : true,\
\n     "upload_target" : {\
\n       "url" : "http://asprise.com/scan/applet/upload.php?action=dump",\
\n       "cookies" : "name=value; poweredBy=Asprise"\
\n     }\
\n   } ]\
\n }

code-5-title=Sample with Complete Options
code-5-code={\
\n  "request_id": "123",\
\n  "processing_strategy": "after-all-scans",\
\n\
\n  // --- Scan Settings ---\
\n  "twain_cap_setting": {\
\n    "ICAP_PIXELTYPE": "TWPT_GRAY,TWPT_RGB", // Preferrs Gray, fall back to Color\
\n    "ICAP_XSCALING/RESET": "null", // Resets a capability\
\n    "ICAP_XRESOLUTION": "200", // Sets the resolution\
\n    "ICAP_YRESOLUTION": "200",\
\n    "ICAP_FRAMES":  "(0, 0, 4, 6)" // Scan part of the image only\
\n  },\
\n\
\n  "prompt_scan_more":  true, \
\n  "discard_blank_pages": "false", // Default value: false \
\n  "blank_page_threshold": "0.02",\
\n  "blank_page_margin_percent": "8",\
\n\
\n  "recognize_barcodes": "false", \
\n\
\n  "image_processing": "",\
\n\
\n  "output_settings": [\
\n    {\
\n      "type": "save", // return-handle, return-base64, save, upload[-thumbnail]\
\n      "format": "pdf", // bmp, png, jpg, tif, pdf // optional, default is jpg\
\n      "thumbnail_height": 200, // only for -thumbnail; optional, default is 200\
\n      "save_path": "${TMP}\\\\${TMS}${EXT}", // only for save\
\n      "jpeg_quality": "90", // optional, default is 80\
\n      "tiff_compression": "G4", // optional, default is empty\
\n      "tiff_force_single_page": "false",\
\n      "pdf_force_black_white": "true",\
\n      "pdfa_compliant": "false",\
\n      "pdf_owner_password": "",\
\n      "pdf_user_password": "",\
\n      "pdf_text_line": "By ${USERNAME} on ${DATETIME}",\
\n      "exif": {\
\n        "DocumentName": "PDF/A Scan",\
\n        "UserComment": "Scanned using Asprise software"\
\n      },\
\n      "upload_after_all_done": "true", // default is true\
\n      "upload_one_by_one": "false", // default is false\
\n      "upload_target": {\
\n        "url": "http://asprise.com/scan/applet/upload.php?action=dump",\
\n        "method": "post",\
\n        "max_retries": 2,\
\n        "post_fields": { // Additional POST fields\
\n          "provider": "Asprise"\
\n        },\
\n        "post_file_field_name": "asprise_scans", // Field name of of uploaded files\
\n        "post_files": [ // additional files to be uploaded\
\n          "C:\\\\_tmp0.jpg"\
\n        ],\
\n        "cookies": "name=Asprise; domain=asprise.com",\
\n        "auth": "user:pass",\
\n        "headers": [\
\n          "Referer: http://asprise.com"\
\n        ],\
\n        "log_file": "null", // Log HTTP operations to a file for debug purpose\
\n        "max_operation_time": 600,\
\n        "to_file": "null" // Save the HTTP response to a file.\
\n      }\
\n    }\
\n  ],\
\n\
\n  // --- Other Return Options: image info ---\
\n  "retrieve_caps": [\
\n    "ICAP_PIXELTYPE",\
\n    "ICAP_XRESOLUTION",\
\n    "ICAP_UNITS",\
\n    "ICAP_FRAMES"\
\n  ],\
\n\
\n  "retrieve_extended_image_attrs": [\
\n    "BARCODE",\
\n    "TWEI_PATCHCODE"\
\n  ]\
\n}

code-6-title=Instruction
code-6-code=// Type request JSON (Ctrl+SPACE for code assist) or load a sample\
\n

