{"id":69,"date":"2009-09-22T11:56:12","date_gmt":"2009-09-22T07:56:12","guid":{"rendered":"http:\/\/avpsoft.ru\/blog\/?p=69"},"modified":"2017-02-15T13:35:56","modified_gmt":"2017-02-15T13:35:56","slug":"apfill_automate","status":"publish","type":"post","link":"https:\/\/avpsoft.com\/blog\/2009\/09\/22\/apfill_automate\/","title":{"rendered":"Using APFill for automatic calculation of ink\/toner coverage of PDF\/PS files"},"content":{"rendered":"<p><a href=\"\/products\/apfill\/\">APFill<\/a> is intended for calculating toner\/ink coverage in <a href=\"http:\/\/en.wikipedia.org\/wiki\/PDF\">PDF<\/a> or <a href=\"http:\/\/en.wikipedia.org\/wiki\/PostScript\">PS<\/a> files. It allows you to estimate the cost of printing a specific file. <a href=\"\/products\/apfill\/\">APFill<\/a> separately measures <a href=\"http:\/\/en.wikipedia.org\/wiki\/CMYK\">CMYK<\/a>, as well as up to 8 other colors in a file. Besides, <a href=\"\/products\/apfill\/\">APFill<\/a> can also calculate ink coverage for bitmap formats, such as <a href=\"http:\/\/en.wikipedia.org\/wiki\/TIFF\">TIFF<\/a>, JPG and BMP in the RGB or grayscale mode, which can be useful for printing on a black and white printer or for measuring the density of CMYK components that were separated and saved in a TIFF file, for example.<\/p>\n<p>Besides the standard mode, when the user opens a file, measures it and gets the coverage calculation results, <a href=\"\/products\/apfill\/\">APFill<\/a> has an automatic mode and can be started from the command line with various parameters.<br \/>\n<!--more--><br \/>\nIn this case, once a PDF\/PS file is processed with the specified parameters, APFill generates the results in the form of a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Comma-separated_values\">CSV<\/a> text file with values delimited with a semi-column. This file can be opened in <strong>MS Excel<\/strong> for further processing (calculation of net cost, retail price, etc).<\/p>\n<p>Let\u2019s take a look at two types of operation in the automatic mode. Most parameters in this mode are specified the same way, so the modes differ only in the way input and output files are defined.<\/p>\n<p><strong>1. Manual output file selection mode.<\/strong><\/p>\n<p>To work in this mode, APFill should be started with the <strong>COVERAGE<\/strong> \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435:<\/p>\n<p><code>\"C:\\Program Files\\APFill\\APFill.exe\"\u00a0coverage -r300 -dA4 -c4 -show -noprogress c:\\input.pdf c:\\output.txt<\/code><\/p>\n<p>In this mode, the user specifies the source file (c:input.pdf) and the output text file (c:output.txt) the results will be saved to. The meaning of other parameters (-r, -d, -c, -show,..) will be explained below.<\/p>\n<p><strong>2. Automatic output file generation mode.<\/strong><\/p>\n<p>This mode will be enabled if there is no <strong>COVERAGE<\/strong> parameter in the command line. In this case, the output file is not specified, but is selected automatically by <a href=\"\/products\/apfill\/\">APFill<\/a> by adding \u201ccoverage.txt\u201d to the name of the input file.<\/p>\n<p>Example:<\/p>\n<p><code>apfill.exe -r300 -dA4 -c4 -show -noprogress c:\\input.pdf<\/code><\/p>\n<p>If default parameters are used, the command can be as simple as<\/p>\n<p><code>apfill.exe c:\\input.pdf<\/code><\/p>\n<p>In this case, the program will process the source file and will create an output CSV file called \u201cc:input.pdf.COVERAGE.txt\u201d<\/p>\n<p>This mode is very convenient in that you can simply drag a PDF file on the <a href=\"\/products\/apfill\/\">APFill<\/a> icon and the program will be started in this mode. The output file will be generated in the same folder.<\/p>\n<p>Let\u2019s take a look at the parameters that can be used in the automatic mode:<\/p>\n<p>Example:<\/p>\n<p>-r300 \u2013 means that the PDF file will be processed with the resolution of 300 dpi.<\/p>\n<p>-dA4 \u2013 the default page size. This is the page size that will be used if it is not explicitly specified in the source PDF\/PS file.<\/p>\n<p>-show \u2013 show the calculation results as a table.<\/p>\n<p>-noprogress \u2013 do not show the progress indicator on the screen. The program will work in the background.<\/p>\n<p><strong>How APFill can be used for automatic processing of files in a folder <\/strong><\/p>\n<p>For instance, APFill is installed on the server and you want it to process all the files that users copy to a specific shared folder.<\/p>\n<p>You have a folder called \u201cC:PDFFolder\u201d containing users\u2019 files that are copied there for ink coverage calculations. You want APFill to automatically process these files and save the results in \u201cc:APFill_OUT\u201d. You also want to move processed PDF\/PS files to \u201cc:APFill_processed\u201d.<\/p>\n<p>To accomplish all of the above, let\u2019s create a .bat file that will be started with an interval of 10 minutes. The file will process all the files and sort them by folders:<\/p>\n<p><code>FOR %%I IN (\"C:\\PDFFolder*.pdf\") DO \"%ProgramFiles%\\apfill\\apfill.exe\" -r300 -noprogress \"%%I\"<br \/>\nmove \/Y C:\\PDFFolder*.p* c:\\APFill_processed<br \/>\nmove \/Y C:\\PDFFolder*.coverage.txt c:\\APFill_OUT<\/code><\/p>\n<p>The first line of the file starts <a href=\"\/products\/apfill\/\">APFill<\/a> for all the files in the folder in the automatic mode (no progress indicator, 300 dpi). This is the second type of automatic operation supported by APFill, so the calculation results for each file will be saved in the same folder with \u201c.coverage.txt\u201d added to the end of the file name.<\/p>\n<p><img src=\"\/blog\/wp-content\/uploads\/2009\/09\/apfill_automate_001.png\" alt=\"\" \/><\/p>\n<p>After processing, prior to copying:<\/p>\n<p><img src=\"\/blog\/wp-content\/uploads\/2009\/09\/apfill_automate_002.png\" alt=\"\" \/><\/p>\n<p>The second line moves all the processed files (pdf or ps) to \u201cc:\\APFill_processed\u201d<\/p>\n<p><img src=\"\/blog\/wp-content\/uploads\/2009\/09\/apfill_automate_003.png\" alt=\"\" \/><\/p>\n<p>The third line moves the output files to \u201cc:\\APFill_OUT\u201d<\/p>\n<p><img src=\"\/blog\/wp-content\/uploads\/2009\/09\/apfill_automate_004.png\" alt=\"\" \/><\/p>\n<p>Below is a sample output file:<\/p>\n<p><img src=\"\/blog\/wp-content\/uploads\/2009\/09\/apfill_automate_005.png\" alt=\"\" \/><\/p>\n<p>You can rename any output file to CSV and it in Excel:<\/p>\n<p><img src=\"\/blog\/wp-content\/uploads\/2009\/09\/apfill_automate_006.png\" alt=\"\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>APFill is intended for calculating toner\/ink coverage in PDF or PS files. It allows you to estimate the cost of printing a specific file. APFill separately measures CMYK, as well as up to 8 other colors in a file. Besides, APFill can also calculate ink coverage for bitmap formats, such as TIFF, JPG and BMP &#8230;<\/p>\n<p><a href=\"https:\/\/avpsoft.com\/blog\/2009\/09\/22\/apfill_automate\/\" class=\"more-link\">Continue reading &lsquo;Using APFill for automatic calculation of ink\/toner coverage of PDF\/PS files&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[25,14],"_links":{"self":[{"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/posts\/69"}],"collection":[{"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/comments?post=69"}],"version-history":[{"count":4,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/posts\/69\/revisions"}],"predecessor-version":[{"id":411,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/posts\/69\/revisions\/411"}],"wp:attachment":[{"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/media?parent=69"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/categories?post=69"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/avpsoft.com\/blog\/wp-json\/wp\/v2\/tags?post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}