You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
867 B
47 lines
867 B
|
|
|
|
|
|
#--------------- |
|
#debug/test only - don't output to stdout/stderr in production code |
|
#puts stdout "pdf2text.tcl: converting PDF to text" |
|
#puts stdout "::argv: $::argv" |
|
#--------------- |
|
|
|
package require tclMuPDF |
|
package require punk::args |
|
package require punk::ansi |
|
package require punk::lib |
|
package require textblock |
|
package require punk::pdf |
|
|
|
if {$::tcl_interactive} { |
|
if {[catch { |
|
package require punk::nav::ns |
|
punk::nav::ns::ns/ // punk::pdf |
|
} err eopts]} { |
|
puts stdout "Error loading/navigating to punk::nav::ns: $err" |
|
} else { |
|
namespace eval ::punk::pdf { |
|
set text [punk::pdf::text -outchannel return {*}$::argv] |
|
puts stdout $text |
|
} |
|
} |
|
} else { |
|
#default -outchannel stdout. |
|
punk::pdf::text {*}$::argv |
|
} |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|