demo-0-title = Scan to Images in Memory
demo-0-icon = /asprise/demo/bw/img-20.png
demo-0-code_display =//using asprise_imaging_api;\
\nResult result = new AspriseImaging().Scan(new Request()\
\n  new RequestOutputItem(AspriseImaging.OUTPUT_RETURN_BASE64, AspriseImaging.FORMAT_JPG) // Output type and image format//*\
\n ), "select", true, true); // "select" a scanner or use "default" scanner without selection\
\n\
\nList<Image> images = result == null ? null : result.GetImages(); // null when user cancels\
\n// you may then display the images using PictureBox ...\
\n\
\n// --- Alternatively, request can be specified using JSON ---\
\nResult result = new AspriseImaging().Scan("{" +\
\n  "  \"output_settings\" : [ {" +\
\n  "    \"type\" : \"return-base64\"," +//*\
\n  "    \"format\" : \"jpg\"" +//*\
\n  "  } ]" +\
\n  "}", "select", true, true);
demo-0-code_raw = \
{\
"output_settings" : [ {\
  "type" : "return-base64",\
  "format" : "jpg"\
} ]\
}

demo-1-title = Scan to JPG Images with Settings
demo-1-icon = /asprise/demo/bw/img-20.png
demo-1-code_display =//using asprise_imaging_api;\
\nResult result = new AspriseImaging().Scan(new Request()\
\n  .SetTwainCap(TwainConstants.ICAP_PIXELTYPE, TwainConstants.TWPT_RGB) // color mode\
\n  .SetTwainCap(TwainConstants.ICAP_SUPPORTEDSIZES, TwainConstants.TWSS_USLETTER) // paper size\
\n  .SetPromptScanMore(true) // whether to prompt user to scan more pages\
\n  .AddOutputItem(new RequestOutputItem(AspriseImaging.OUTPUT_SAVE, AspriseImaging.FORMAT_JPG) // output type and image format//*\
\n    .SetSavePath(".\\\\${TMS}${EXT}") // Save to current directory with timestamp as file name//*\
\n   ),\
\n "select", true, true); // "select" a scanner or use "default" scanner without selection\
\n\
\nList<string> files = result == null ? null : result.GetImageFiles(); // null when user cancels\
\nConsole.WriteLine("Scanned: " + string.Join(", ", files == null ? new string[0] : files.ToArray()));\
\n\
\n// --- Alternatively, request can be specified using JSON ---\
\nResult result = new AspriseImaging().Scan("{" +\
\n  "  \"twain_cap_setting\" : {" +\
\n  "    \"ICAP_PIXEXELTYPE\" : \"TWPT_RGB\"," +\
\n  "    \"ICAP_SUPPORPORTEDSIZES\" : \"TWSS_USLESLETTER\"" +\
\n  "  }," +\
\n  "  \"prompt_scan_more\" : true," +\
\n  "  \"output_settings\" : [ {" +\
\n  "    \"type\" : \"save\"," +//*\
\n  "    \"format\" : \"jpg\"," +//*\
\n  "    \"save_path\" : \".\\\\\\\\${TMS}${EXT}\"" +//*\
\n  "  } ]" +\
\n  "}", "select", true, true);
demo-1-code_raw = \
{\
"twain_cap_setting" : {\
  "ICAP_PIXELTYPE" : "TWPT_RGB",\
  "ICAP_SUPPORTEDSIZES" : "TWSS_USLETTER"\
},\
"prompt_scan_more":  true,\
"output_settings" : [ {\
  "type" : "save",\
  "format" : "jpg",\
  "save_path" : ".\\\\${TMS}${EXT}"\
} ]\
}

demo-2-title = Scan Docs and Upload to Server
demo-2-instruction = Scan and <b>upload</b> demo
demo-2-icon = /asprise/demo/bw/upload-20.png
demo-2-code_display =//using asprise_imaging_api;\
\nResult result = new AspriseImaging().Scan(new Request().AddOutputItem(\
\n  new RequestOutputItem(AspriseImaging.OUTPUT_UPLOAD, AspriseImaging.FORMAT_JPG).SetUploadSetting( // Upload//*\
\n    new UploadSetting("http://asprise.com/scan/applet/upload.php?action=dump")\
\n      .AddPostField("title", "Test scan"))) // Additional data to be passed to server: post fields, headers, etc.\
\n "select", true, true);\
\n\
\nString response = result == null ? null : result.GetUploadResponse();//*\
\nConsole.WriteLine("From server: \n" + response);\
\n\
\n// Alternatively, request can be specified using JSON\
\nResult result = new AspriseImaging().Scan("{" +\
\n  "  \"output_settings\" : [ {" +\
\n  "    \"type\" : \"upload\"," +\
\n  "    \"format\" : \"jpg\"," +\
\n  "    \"upload_target\" : {" +\
\n  "      \"url\" : \"http://asprise.com/scan/applet/upload.php?action=dump\"," +\
\n  "      \"post_fields\" : {" +\
\n  "        \"title\" : \"Test scan\"" +\
\n  "      }" + \
\n  "    }" +\
\n  "  } ]" +\
\n "}", "select", true, true);
demo-2-code_raw =\
{\
"output_settings" : [ {\
 "type" : "upload",//*\
 "format" : "jpg",\
 "upload_target" : {//*\
   "url" : "http://asprise.com/scan/applet/upload.php?action=dump",\
   "post_fields" : {\
     "title" : "Test scan"\
   }\
 }\
} ]\
}

demo-3-title = Scan Multiple Pages as PDF
demo-3-instruction = <ol><li>Edit the scanned page by click on the <span style="color: blue;">blue</span> icon on the image</li>\
  <li>Re-organize order of pages by drag and drop</li></ol>
demo-3-icon = /asprise/demo/bw/pdf-20.png
demo-3-code_display =Result result = new AspriseImaging().Scan(new Request().AddOutputItem(\
\n  new RequestOutputItem(AspriseImaging.OUTPUT_SAVE, AspriseImaging.FORMAT_PDF)//*\
\n    .SetPdfTextLine("Scanned on ${DATETIME} by user X") // Optional text line at the bottom of the 1st page\
\n    .AddExifTag("DocumentName", "Scan to PDF by Asprise") // Optional PDF doc properties (metadata)\
\n    .SetSavePath(".\\\\${TMS}${EXT}")\
\n  ).SetPromptScanMore(true) // whether to prompt user to scan more pages\
\n , "select", true, true);\
\n\
\nstring pdfFile = result == null ? null : result.GetPdfFile();\
\nConsole.WriteLine("Documents scanned as PDF: " + pdfFile);\
\n\
\n// Alternatively, request can be specified using the following JSON:\
\n{\
\n  "output_settings" : [ {\
\n    "type" : "save",\
\n    "format" : "pdf",//*\
\n    "pdf_text_line" : "Scanned on ${DATETIME} by user X",\
\n    "pdf_owner_password" : "",\
\n    "pdf_user_password" : "",\
\n    "exif" : {\
\n      "DocumentName" : "Scan to PDF by Asprise" \
\n    }, \
\n    "save_path" : ".\\\\${TMS}${EXT}" \
\n  } ], \
\n  "prompt_scan_more" : true\
\n}

demo-3-code_raw =\
{\
  "output_settings" : [ {\
    "type" : "save",\
    "format" : "pdf",\
    "pdf_text_line" : "Scanned on ${DATETIME} by user X",\
    "pdf_owner_password" : "",\
    "pdf_user_password" : "",\
    "exif" : {\
      "DocumentName" : "Scan to PDF by Asprise"\
    },\
    "save_path" : ".\\\\${TMS}${EXT}"\
  } ],\
  "prompt_scan_more" : true\
}

demo-4-title = PDF with CCITT G4 then Upload
demo-4-instruction = PDFs with CCITT G4 compression have extremely small file size.
demo-4-icon = /asprise/demo/bw/pdf-20.png
demo-4-code_display =Result result = new AspriseImaging().Scan(new Request().AddOutputItem(\
\n  new RequestOutputItem(AspriseImaging.OUTPUT_UPLOAD, AspriseImaging.FORMAT_PDF)\
\n    .SetPdfForceBlackWhite(true)//*\
\n    .SetUploadSetting(new UploadSetting("http://asprise.com/scan/applet/upload.php?action=dump")\
\n      .SetCookies("name=value; poweredBy=Asprise"))\
\n  ), "select", true, true);\
\n\
\nString response = result == null ? null : result.GetUploadResponse();\
\nConsole.WriteLine("From server: \n" + response);\
\n\
\n// Alternatively, request can be specified using the following JSON:\
\n{\
\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 }

demo-4-code_raw =\
{\
  "output_settings" : [ {\
    "type" : "upload",\
    "format" : "pdf",\
    "pdf_force_black_white" : true,\
    "upload_target" : {\
      "url" : "http://asprise.com/scan/applet/upload.php?action=dump",\
      "cookies" : "name=value; poweredBy=Asprise"\
    }\
  } ]\
}

demo-5-title = PDF/A to Meet Compliance Requirement
demo-5-icon = /asprise/demo/bw/pdf-20.png
demo-5-code_display =Result result = new AspriseImaging().Scan(new Request().AddOutputItem(\
\n  new RequestOutputItem(AspriseImaging.OUTPUT_SAVE, AspriseImaging.FORMAT_PDF)\
\n    .SetPdfaCompliant(true)//*\
\n    .AddExifTag(AspriseImaging.EXIF_NAME_DocumentName, "PDF/A to meet compliance requirements")\
\n    .SetSavePath(".\\\\${TMS}${EXT}")\
\n  ), "select", true, true);\
\n\
\nstring pdfFile = result == null ? null : result.GetPdfFile();\
\nConsole.WriteLine("Documents scanned as PDF: " + pdfFile);{\
\n\
\n// Alternatively, request can be specified using the following JSON:\
\n{\
\n  "output_settings" : [ {\
\n      "type" : "save",\
\n      "format" : "pdf",\
\n      "pdfa_compliant": true,//*\
\n      "exif" : {\
\n        "DocumentName" : "PDF/A to meet compliance requirements"\
\n      },\
\n      "save_path" : ".\\\\${TMS}${EXT}"\
\n    } ]\
\n}

demo-5-code_raw = \
{\
 "output_settings" : [ {\
   "type" : "save",\
   "format" : "pdf",\
   "pdfa_compliant": true,\
   "exif" : {\
     "DocumentName" : "PDF/A to meet compliance requirements"\
   },\
   "save_path" : ".\\\\${TMS}${EXT}"\
 } ]\
}

demo-6-title = Scan as TIFF with CCITT G4 Compression
demo-6-icon = /asprise/demo/bw/img-20.png
demo-6-code_display =Result result = new AspriseImaging().Scan(new Request().AddOutputItem(\
\n  new RequestOutputItem(AspriseImaging.OUTPUT_SAVE, AspriseImaging.FORMAT_TIF)//*\
\n    .SetTiffCompression(AspriseImaging.TIFF_COMPRESSION_CCITT_G4)// CCITT T.6 Compression//*\
\n    .SetSavePath(".\\\\${TMS}${EXT}")\
\n ), "select", true, true);\
\n\
\nstring tiffFile = result == null ? null : result.GetTiffFile();\
\nConsole.WriteLine("Documents scanned as TIFF: " + tiffFile);\
\n\
\n// Alternatively, request can be specified using the following JSON:\
\n{\
\n  "output_settings" : [ {\
\n    "type" : "save",\
\n    "format" : "tif",//*\
\n    "tiff_compression": "G4", \
\n    "save_path" : ".\\\\${TMS}${EXT}"\
\n  } ]\
\n}

demo-6-code_raw = \
{\
  "output_settings" : [ {\
    "type" : "save",\
    "format" : "tif",\
    "tiff_compression": "G4", \
    "save_path" : ".\\\\${TMS}${EXT}"\
  } ]\
}

demo-7-title = Scan and Recognize Barcodes
demo-7-instruction = Please scan pages with barcodes or QR codes
demo-7-icon = /asprise/demo/bw/full-20.png
demo-7-code_display =Result result = new AspriseImaging().Scan(new Request()\
\n  .SetRecognizeBarcodes(true)//*\
\n  .AddOutputItem(new RequestOutputItem(AspriseImaging.OUTPUT_SAVE, AspriseImaging.FORMAT_JPG).SetSavePath(".\\\\${TMS}${EXT}")),\
\n "select", true, true);\
\n\
\nList<string> barcodes = result == null ? null : result.GetBarcodes();\
\nConsole.WriteLine("Barcodes: " + string.Join(";\n", barcodes == null ? new string[0] : barcodes.ToArray()));\
\n\
\n// Alternatively, request can be specified using the following JSON:\
\n{\
\n   "recognize_barcodes" : true,//*\
\n   "output_settings" : [ {\
\n     "type" : "save",\
\n     "format" : "jpg",\
\n     "save_path" : ".\\\\${TMS}${EXT}"\
\n   } ]\
\n }

demo-7-code_raw = {\
    "recognize_barcodes" : true,\
    "output_settings" : [ {\
      "type" : "save",\
      "format" : "jpg",\
      "save_path" : ".\\\\${TMS}${EXT}"\
    } ]\
  }

demo-8-title = ADF with Blank Page Detection
demo-8-instruction = Select an ADF scanner with <b>Feeder</b> as paper source to scan multiple pages in one go. \
Alternatively, scan one page at a time using a Flatbed scanner.
demo-8-icon = /asprise/demo/bw/eye-20.png
demo-8-code_display =Result result = new AspriseImaging().Scan(new Request()\
\n  .SetTwainCap(TwainConstants.CAP_FEEDERENABLED, true) // select feeder instead of flatbed//*\
\n  .SetTwainCap(TwainConstants.CAP_AUTOFEED, true)\
\n  .SetTwainCap(TwainConstants.CAP_DUPLEXENABLED, true)\
\n  .SetDiscardBlankPages(true)//*\
\n  .SetBlankPageThreshold(0.02m) // Discard pages with ink coverage < 2%//*\
\n  .AddOutputItem(new RequestOutputItem(AspriseImaging.OUTPUT_SAVE, AspriseImaging.FORMAT_PDF).SetSavePath(".\\\\${TMS}${EXT}")),\
\n "select", true, true);\
\n\
\nstring pdfFile = result == null ? null : result.GetPdfFile();\
\nConsole.WriteLine("Documents scanned as PDF: " + pdfFile); \
\n\
\n// Alternatively, request can be specified using the following JSON:\
\n{\
\n    "twain_cap_setting" : {\
\n      "CAP_FEEDERENABLED" : true,\
\n      "CAP_AUTOFEED" : true,\
\n      "CAP_DUPLEXENABLED" : true\
\n    },\
\n    "discard_blank_pages" : true,//*\
\n     // pages with ink coverage below the threshold will be discarded\
\n    "blank_page_threshold" : "0.02", // default value is 0.02\
\n    "output_settings" : [ {\
\n      "type" : "save",\
\n      "format" : "pdf",\
\n      "save_path" : ".\\\\${TMS}${EXT}"\
\n    } ]\
\n }

demo-8-code_raw = {\
	"twain_cap_setting" : {\
	  "CAP_FEEDERENABLED" : true,\
	  "CAP_AUTOFEED" : true,\
	  "CAP_DUPLEXENABLED" : true\
	},\
    "discard_blank_pages" : true,\
    "blank_page_threshold" : "0.02",\
    "output_settings" : [ {\
      "type" : "save",\
      "format" : "pdf",\
      "save_path" : ".\\\\${TMS}${EXT}"\
    } ]\
 }

demo-9-title = Run Your Own Code
demo-9-icon = /asprise/demo/bw/edit-20.png
demo-9-code_display = // Type your request JSON below and click 'Execute Demo' to run it.\n
demo-9-code_raw = custom