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,7 @@
 | 
			
		||||
%Document -composition[-json]
 | 
			
		||||
%Document discourage GhostScript usage, since it can strip data (-gs-malformed, embed missing fonts)
 | 
			
		||||
%Document [ ] pagespecs
 | 
			
		||||
%Document extensions to -info
 | 
			
		||||
\documentclass{book}
 | 
			
		||||
% Edit here to produce cpdfmanual.pdf, cpdflibmanual.pdf, pycpdfmanual.pdf,
 | 
			
		||||
% dotnetcpdflibmanual.pdf, jcpdflibmanual.pdf jscpdflibmanual.pdf etc.
 | 
			
		||||
 
 | 
			
		||||
@@ -165,6 +165,16 @@ let getstring encoding pdf =
 | 
			
		||||
  | Stripped -> get_info false pdf
 | 
			
		||||
  | UTF8 -> get_info_utf8 pdf
 | 
			
		||||
 | 
			
		||||
let get_catalog_item name pdf =
 | 
			
		||||
  match Pdf.lookup_direct pdf "/Root" pdf.Pdf.trailerdict with
 | 
			
		||||
  | Some catalog ->
 | 
			
		||||
      begin try
 | 
			
		||||
        implode (tl (explode (Pdfwrite.string_of_pdf (unopt (Pdf.lookup_direct pdf name catalog)))))
 | 
			
		||||
      with
 | 
			
		||||
        _ -> ""
 | 
			
		||||
      end
 | 
			
		||||
  | _ -> ""
 | 
			
		||||
 | 
			
		||||
let output_info encoding pdf =
 | 
			
		||||
  let getstring = getstring encoding pdf in
 | 
			
		||||
    Printf.printf "Version: %i.%i\n" pdf.Pdf.major pdf.Pdf.minor;
 | 
			
		||||
@@ -177,7 +187,9 @@ let output_info encoding pdf =
 | 
			
		||||
    Printf.printf "Producer: %s\n" (getstring "/Producer");
 | 
			
		||||
    Printf.printf "Created: %s\n" (getstring "/CreationDate");
 | 
			
		||||
    Printf.printf "Modified: %s\n" (getstring "/ModDate");
 | 
			
		||||
    Printf.printf "Trapped: %s\n" (getstring "/Trapped")
 | 
			
		||||
    Printf.printf "Trapped: %s\n" (getstring "/Trapped");
 | 
			
		||||
    Printf.printf "PageMode: %s\n" (get_catalog_item "/PageMode" pdf);
 | 
			
		||||
    Printf.printf "PageLayout: %s\n" (get_catalog_item "/PageLayout" pdf)
 | 
			
		||||
 | 
			
		||||
type xmltree =
 | 
			
		||||
    E of Cpdfxmlm.tag * xmltree list
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user