Site Tools


software:musicpdf:dev

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
software:musicpdf:dev [2009/10/25 14:10] adminsoftware:musicpdf:dev [2009/10/27 01:24] (current) admin
Line 6: Line 6:
 Please install [[http://www.autoitscript.com/autoit3/|autoit3]] to develop, test and work with the script below. Please install [[http://www.autoitscript.com/autoit3/|autoit3]] to develop, test and work with the script below.
 <code> <code>
 +; 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.  See the
 +;    GNU General Public License for more details.
 +;
 +;    You should have received a copy of the GNU General Public License
 +;    along with this program.  If not, see <http://www.gnu.org/licenses/>
 +;
 +;    Contact details: http://www.nijdam.de/marc.html
 +
 +#requireadmin ; This program should have proper rights to start external applications. Presumably this behaviour requires user admin rights
 +
 #include <Constants.au3> ; Used for registry constants like REG_SZ, REG_DWORD etc. #include <Constants.au3> ; Used for registry constants like REG_SZ, REG_DWORD etc.
 #include <Process.au3> #include <Process.au3>
Line 14: Line 34:
 #Include <String.au3> #Include <String.au3>
  
-#requireadmin I guess so. +Current version of MusicPDF is compatible with PhotoScore version Neuratron PhotoScore Ultimate 6
-; Automate Neuratron Photoscore, written by Marc Nijdam, Oktober 2009 +
- +
-; $CmdLine[0] = number of parameters +
-; $CmdLine[1] = first parameter +
- +
-; Compatible with PhotoScore version Neuratron PhotoScore Ultimate 6 +
-; The slider for Pending Pages should be beginning just under the middle of the configuration settings wheel.+
 ; ;
-; Requires Imagemagick installation from http://www.imagemagick.org (dynamic, 16 bit images)+; Requires Imagemagick installation from http://www.imagemagick.org (See over there. Choose the dynamic, 16 bit images version)
 ; Path environment variable should be pointing to imagemagick, (default installation will add this to the %PATH% environment variable, which is persistant) ; Path environment variable should be pointing to imagemagick, (default installation will add this to the %PATH% environment variable, which is persistant)
-; If not it the following should be added: %PROGRAMFILES%\imagemagick+; If not there, this script adds the following temporarily: %PROGRAMFILES%\imagemagick
 ; ;
-Requires Ghostscript, which may be installed through Photoscore.+This program requires Ghostscript, which may be installed through Photoscore.
 ; Path environment variable should be pointing to: %PROGRAMFILES%\gs\gs8.56\bin;%PROGRAMFILES%\gs\gs8.56\lib ; Path environment variable should be pointing to: %PROGRAMFILES%\gs\gs8.56\bin;%PROGRAMFILES%\gs\gs8.56\lib
 ; ;
-Does this solve a R6034 error http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2+This solve a R6034 (AutoIt3 related) error
 +http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2
 ; ;
-; Write an environment variable +; Nb.: 
-EnvSet ( "envvariable" [, "value"] ) +; Write an environment variableEnvSet ( "envvariable" [, "value"] )
-; Code snippet:+
 ; ControlClick($parentWindowName,"ViewPages", ,2, 12, 81) ; ControlClick($parentWindowName,"ViewPages", ,2, 12, 81)
-Debug optie: ConsoleWrite("vertical: " & $y1) +; $CmdLine[0] = number of parameters 
-ConsoleWrite("Debug information"+$CmdLine[1] = first parameter
-; Set program run environment. During code development it is easier if this program takes set input output files+
  
 Const $NeuratronVersion = "6.0.0"; For which version is this program written and compatibl with? Const $NeuratronVersion = "6.0.0"; For which version is this program written and compatibl with?
Line 67: Line 79:
  
 Const $img_uniquename = "Neuratron6AU3_" ; Unique leading part of filename for temporary files Const $img_uniquename = "Neuratron6AU3_" ; Unique leading part of filename for temporary files
-Const $LandscapeMode = "Landscape" 
 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 pdf page.
 ; Convert -size 2480x3508 xc:white miff: ; Convert -size 2480x3508 xc:white miff:
 ; composite -density 300 -units PixelsPerInch -compose atop -gravity Center /tmp/$ptmpf.pbm - miff:- ; composite -density 300 -units PixelsPerInch -compose atop -gravity Center /tmp/$ptmpf.pbm - miff:-
Line 447: Line 459:
 ; ps2pdf13 -sPAPERSIZE=a4 - "/tmp/$ptmpf-$nmb.pdf" ; ps2pdf13 -sPAPERSIZE=a4 - "/tmp/$ptmpf-$nmb.pdf"
 ; ;
-; There is a problem with ImageMagick writing direclty to pdf, not outputting in the proper colorspace (grey instead of black and white). A solution is to write first to ps and then use ps2pdf.+; There is a problem with ImageMagick writing directly to pdf, not outputting in the proper colorspace (grey instead of black and white). A solution is to write first to ps and then use ps2pdf.
 ; 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 & "\DosResult.txt") ;==> Did you take into consideration the working path?  _RunDOS($DR_LINE & " > " & @TempDir & "\DosResult.txt") ;==> Did you take into consideration the working path?
- $DR_FILE = FileOpen(@TempDir & "\DosResult.txt",0) + Local $DR_FILE = FileOpen(@TempDir & "\DosResult.txt",0) 
- $DR_RESULT = FileRead($DR_FILE)+ Local $DR_RESULT = FileRead($DR_FILE)
  FileDelete(@TempDir & "\DosResult.txt")  FileDelete(@TempDir & "\DosResult.txt")
  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,$OFAG_query) +Func OpenFileAndGrep(Const $OFAG_path,Const $OFAG_query) 
- $OFAG_file = FileOpen($OFAG_path,0) + Local $OFAG_file = FileOpen($OFAG_path,0) 
- $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, @LF, 1) ; put read data, separated by LineFeed characters, in an array+ Local $OFAG_stdinArray = StringSplit($OFAG_result, @LF, 1) ; put read data, separated by LineFeed characters, in an array 
 + Local $OFAG_i
  For $OFAG_i In $OFAG_stdinArray  For $OFAG_i In $OFAG_stdinArray
  If StringInStr($OFAG_i,$OFAG_query) Then  If StringInStr($OFAG_i,$OFAG_query) Then
software/musicpdf/dev.1256476201.txt.gz · Last modified: 2009/10/25 14:10 by admin