Method: Pdfcrowd::PdfToTextClient#convertFileToFile
- Defined in:
- lib/pdfcrowd.rb
#convertFileToFile(file, file_path) ⇒ Object
Convert a local file and write the result to a local file.
-
file- The path to a local file to convert. The file must exist and not be empty. -
file_path- The output file path. The string must not be empty.
5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 |
# File 'lib/pdfcrowd.rb', line 5852 def convertFileToFile(file, file_path) if (!(!file_path.nil? && !file_path.empty?)) raise Error.new(Pdfcrowd.(file_path, "convertFileToFile::file_path", "pdf-to-text", "The string must not be empty.", "convert_file_to_file"), 470); end output_file = open(file_path, "wb") begin convertFileToStream(file, output_file) output_file.close() rescue Error => why output_file.close() FileUtils.rm(file_path) raise end end |