This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
software:musicpdf:dev [2009/10/25 14:10] – admin | software:musicpdf:dev [2009/10/27 01:24] (current) – admin | ||
---|---|---|---|
Line 6: | Line 6: | ||
Please install [[http:// | Please install [[http:// | ||
< | < | ||
+ | ; MusicPDF, Automatic cleaning and leveling pdf files with Neuratron | ||
+ | ; Copyright (C) Oktober 2009 by Marc Nijdam | ||
+ | ; | ||
+ | ; This program is free software: you can redistribute it and/or modify | ||
+ | ; it under the terms of the GNU General Public License as published by | ||
+ | ; the Free Software Foundation, either version 3 of the License, or | ||
+ | ; any later version. | ||
+ | ; | ||
+ | ; This program is distributed in the hope that it will be useful, | ||
+ | ; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
+ | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
+ | ; GNU General Public License for more details. | ||
+ | ; | ||
+ | ; You should have received a copy of the GNU General Public License | ||
+ | ; along with this program. | ||
+ | ; | ||
+ | ; Contact details: http:// | ||
+ | |||
+ | # | ||
+ | |||
#include < | #include < | ||
#include < | #include < | ||
Line 14: | Line 34: | ||
#Include < | #Include < | ||
- | # | + | ; Current version |
- | ; Automate Neuratron Photoscore, written by Marc Nijdam, Oktober 2009 | + | |
- | + | ||
- | ; $CmdLine[0] = number | + | |
- | ; $CmdLine[1] = first parameter | + | |
- | + | ||
- | ; Compatible | + | |
- | ; The slider for Pending Pages should be beginning just under the middle of the configuration settings wheel. | + | |
; | ; | ||
- | ; Requires Imagemagick installation from http:// | + | ; Requires Imagemagick installation from http:// |
; Path environment variable should be pointing to imagemagick, | ; Path environment variable should be pointing to imagemagick, | ||
- | ; If not it the following | + | ; If not there, this script adds the following |
; | ; | ||
- | ; Requires | + | ; This program requires |
; Path environment variable should be pointing to: %PROGRAMFILES%\gs\gs8.56\bin; | ; Path environment variable should be pointing to: %PROGRAMFILES%\gs\gs8.56\bin; | ||
; | ; | ||
- | ; Does this solve a R6034 error - http:// | + | ; This solve a R6034 (AutoIt3 related) |
+ | ; http:// | ||
; | ; | ||
- | ; Write an environment variable | + | ; Nb.: |
- | ; EnvSet ( " | + | ; Write an environment variable: EnvSet ( " |
- | ; Code snippet: | + | |
; ControlClick($parentWindowName," | ; ControlClick($parentWindowName," | ||
- | ; Debug optie: ConsoleWrite(" | + | ; $CmdLine[0] = number of parameters |
- | ; ConsoleWrite(" | + | ; $CmdLine[1] = first parameter |
- | ; Set program run environment. During code development it is easier if this program takes set input output files | + | |
Const $NeuratronVersion = " | Const $NeuratronVersion = " | ||
Line 67: | Line 79: | ||
Const $img_uniquename = " | Const $img_uniquename = " | ||
- | Const $LandscapeMode = " | ||
Const $img_width = 2480 ; constant in pixels, defining what the page width may be at most when portrait modus is used | Const $img_width = 2480 ; constant in pixels, defining what the page width may be at most when portrait modus is used | ||
Const $img_height = 3508 ; constant in pixels, defining what the page height may be at most when portrait modus is used | Const $img_height = 3508 ; constant in pixels, defining what the page height may be at most when portrait modus is used | ||
Line 441: | Line 452: | ||
; # Finished with Neuratron | ; # Finished with Neuratron | ||
; ################################################################################################################# | ; ################################################################################################################# | ||
- | ; Convert each tiff page to an pdf page. | + | ; Below is for portrait paper orientation: |
+ | ; Convert each tiff page to a pdf page. | ||
; Convert -size 2480x3508 xc:white miff: | ; Convert -size 2480x3508 xc:white miff: | ||
; composite -density 300 -units PixelsPerInch -compose atop -gravity Center / | ; composite -density 300 -units PixelsPerInch -compose atop -gravity Center / | ||
Line 447: | Line 459: | ||
; ps2pdf13 -sPAPERSIZE=a4 - "/ | ; ps2pdf13 -sPAPERSIZE=a4 - "/ | ||
; | ; | ||
- | ; There is a problem with ImageMagick writing | + | ; There is a problem with ImageMagick writing |
; The solution to specify the page size is done with the following example: | ; The solution to specify the page size is done with the following example: | ||
; gswin32c.exe -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -sOutputFile=outgsr.pdf -dDEVICEWIDTHPOINTS=842 -dDEVICEHEIGHTPOINTS=595 outr.ps | ; gswin32c.exe -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -sOutputFile=outgsr.pdf -dDEVICEWIDTHPOINTS=842 -dDEVICEHEIGHTPOINTS=595 outr.ps | ||
Line 483: | Line 495: | ||
; ############################################################################################################## | ; ############################################################################################################## | ||
- | Func DOSResult($DR_LINE) | + | Func DOSResult(Const $DR_LINE) |
_RunDOS($DR_LINE & " > " & @TempDir & " | _RunDOS($DR_LINE & " > " & @TempDir & " | ||
- | $DR_FILE = FileOpen(@TempDir & " | + | Local $DR_FILE = FileOpen(@TempDir & " |
- | $DR_RESULT = FileRead($DR_FILE) | + | Local $DR_RESULT = FileRead($DR_FILE) |
FileDelete(@TempDir & " | FileDelete(@TempDir & " | ||
FileClose($DR_FILE) | FileClose($DR_FILE) | ||
Line 500: | Line 512: | ||
; Opens a file and returns a line which contains a specified keyword | ; Opens a file and returns a line which contains a specified keyword | ||
- | Func OpenFileAndGrep($OFAG_path, | + | Func OpenFileAndGrep(Const $OFAG_path,Const $OFAG_query) |
- | $OFAG_file = FileOpen($OFAG_path, | + | Local $OFAG_file = FileOpen($OFAG_path, |
- | $OFAG_result = FileRead($OFAG_file) | + | Local $OFAG_result = FileRead($OFAG_file) |
FileClose($OFAG_file) | FileClose($OFAG_file) | ||
Line 508: | Line 520: | ||
Return | Return | ||
Else | Else | ||
- | $OFAG_q = "" | + | Local $OFAG_q = "" |
- | $OFAG_stdinArray = StringSplit($OFAG_result, | + | Local $OFAG_stdinArray = StringSplit($OFAG_result, |
+ | Local $OFAG_i | ||
For $OFAG_i In $OFAG_stdinArray | For $OFAG_i In $OFAG_stdinArray | ||
If StringInStr($OFAG_i, | If StringInStr($OFAG_i, |