mirror of
				https://github.com/johnwhitington/cpdf-source.git
				synced 2025-06-05 22:09:39 +02:00 
			
		
		
		
	more
This commit is contained in:
		| @@ -8,6 +8,12 @@ let version_date = "(devel, build of 4th June 2019)" | |||||||
| open Pdfutil | open Pdfutil | ||||||
| open Pdfio | open Pdfio | ||||||
|  |  | ||||||
|  | let tempfiles = ref [] | ||||||
|  |  | ||||||
|  | let exit n = | ||||||
|  |   begin try List.iter Sys.remove !tempfiles with _ -> exit n end; | ||||||
|  |   exit n | ||||||
|  |  | ||||||
| let initial_file_size = ref 0 | let initial_file_size = ref 0 | ||||||
|  |  | ||||||
| let empty = Pdf.empty () | let empty = Pdf.empty () | ||||||
| @@ -2226,6 +2232,7 @@ let mend_pdf_file_with_ghostscript filename = | |||||||
|   Printf.eprintf "CPDF could not mend. Attempting to mend file with gs\n"; |   Printf.eprintf "CPDF could not mend. Attempting to mend file with gs\n"; | ||||||
|   flush stderr; |   flush stderr; | ||||||
|   let tmpout = Filename.temp_file "cpdf" ".pdf" in |   let tmpout = Filename.temp_file "cpdf" ".pdf" in | ||||||
|  |     tempfiles := tmpout::!tempfiles; | ||||||
|     let gscall = |     let gscall = | ||||||
|       args.path_to_ghostscript ^ |       args.path_to_ghostscript ^ | ||||||
|       " -dNOPAUSE -dQUIET -sDEVICE=pdfwrite -sOUTPUTFILE=" ^ tmpout ^ |       " -dNOPAUSE -dQUIET -sDEVICE=pdfwrite -sOUTPUTFILE=" ^ tmpout ^ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user