For non-commercial use only
To purchase a license visit http://www.coherentpdf.com/

cpdf encountered an error. Technical details follow:

foo.pdf: No such file or directory

Fatal error: exception Pdf.PDFError("foo.pdf: No such file or directory")
Raised at file "pdfread.ml", line 1483, characters 29-47
Called from file "cpdfcommand.ml", line 27, characters 6-31
  try Pdfread.pdf_of_channel_lazy ?source b c d with
    Pdf.PDFError s when String.length s >=10 && String.sub s 0 10 = "Encryption" ->
      raise (Cpdf.SoftError "Bad owner or user password when reading document")

let pdfread_pdf_of_file a b c =
  try Pdfread.pdf_of_file a b c with
    Pdf.PDFError s when String.length s >=10 && String.sub s 0 10 = "Encryption" ->
      raise (Cpdf.SoftError "Bad owner or user password when reading document")

let optstring = function
  | "" -> None
Called from file "cpdfcommand.ml", line 1763, characters 50-101
let get_pdf_from_input_kind ((_, _, _, u, o) as input) op = function
  | AlreadyInMemory pdf -> pdf
  | InFile s ->
      begin try Hashtbl.find filenames s with
        Not_found ->
          let pdf = decrypt_if_necessary input op (pdfread_pdf_of_file (optstring u) (optstring o) s) in
            Hashtbl.add filenames s pdf; pdf
      end
  | StdIn ->
      decrypt_if_necessary input op (pdf_of_stdin u o)

Called from file "list.ml", line 101, characters 35-42

let rev_map2 f l1 l2 =
  let rec rmap2_f accu l1 l2 =
    match (l1, l2) with
    | ([], []) -> accu
    | (a1::l1, a2::l2) -> rmap2_f (f a1 a2 :: accu) l1 l2
    | (_, _) -> invalid_arg "List.rev_map2"
  in
  rmap2_f [] l1 l2
;;

Called from file "pdfutil.ml", line 96, characters 6-27
Called from file "cpdfcommand.ml", line 2649, characters 25-94
                      let spdf = get_pdf_from_input_kind input (Some Decrypt) namewiths in
                        write_pdf x (Cpdf.copy_id true spdf pdf)
                  | _ -> write_pdf x pdf
          in
            let names, ranges, rotations, _, _ = split5 inputs in
              let pdfs = map2 (fun i -> get_pdf_from_input_kind i (Some Decrypt)) inputs names in
                (* If at least one file had object streams and args.preserve_objstm is true, set -objstm-create *)
                if args.preserve_objstm then
                  iter
                    (fun pdf ->
                       if Hashtbl.length pdf.Pdf.objects.Pdf.object_stream_ids > 0
Called from file "list.ml", line 73, characters 12-15
  rmap_f [] l
;;

let rec iter f = function
    [] -> ()
  | a::l -> f a; iter f l

let rec iteri i f = function
    [] -> ()
  | a::l -> f i a; iteri (i + 1) f l

Called from file "cpdfcommand.ml", line 3363, characters 6-603
      in
        match args with
        | [] -> []
        | _ -> combine (map Array.of_list args) (map (eq (length args)) (ilist 1 (length args)))
    in
      iter
        (fun (s, islast) ->
           (*Printf.printf "AND:%b, %s\n" islast (Array.fold_left (fun x y -> x  ^ " " ^ y) "" s);
           flprint "\n";*)
           reset_arguments ();
           parse_argv () s (align_specs specs) anon_fun usage_msg;
Re-raised at file "cpdfcommand.ml", line 3396, characters 31-32
      if args.debug then raise e else exit 2
  | Pdf.PDFError s as e ->
      prerr_string
        ("cpdf encountered an error. Technical details follow:\n\n" ^ s ^ "\n\n");
      flush stderr;
      if args.debug then raise e else exit 2
  | Cpdf.SoftError s -> soft_error s
  | Cpdf.HardError s -> error s
  | e ->
      prerr_string
        ("cpdf encountered an unexpected error. Technical Details follow:\n" ^
Called from file "cpdfcommandrun.ml", line 3, characters 8-25
let _ = Exnsource.add_dir ""

let _ = Cpdfcommand.go ()