Командная строка pdf to excel

PDF to Excel Converter Command Line is a command line application to
extract tables from PDF files and save to CSV files. It can be installed on your
web server and be used by multiple users in your network. PDF to Excel Converter
Command Line is a program to convert Adobe PDF documents into CSV format.
Intelligent algorithm of parsing PDF format provides high performance of the
conversion process. This Command line application allows to script, automate and
schedule the conversion process.

PDF to Excel Converter Command Line can extract data from almost any
type of PDF to Excel without losing any the original Text, Tables. With it,
users will be able to edit their PDF forms in MS Excel. And it supports page
range selection, which means users can convert selected PDF pages from a big PDF
file, and it will save much more time than converting the whole PDF file. It can
convert multiple PDF files to Excel within one process. Download it right now to test it in your
work environment.

In order to convert PDF to Excel, you will need a simple command where you
should specify the source file name and location, destination file name and
conversion parameters. Destination file name and location defines how converted
Excel file will be named and where it will be saved.

When using convert PDF to Excel command line mode you don’t need to spend
time on managing the program via user interface. All you need to do is to write
a single command where all required parameters are specified with a pair of
symbols. Easy in use and extremely fast in performance. PDF to Excel Converter
Command Line is an ideal solution for your Windows server that will make this
feature available for multiple users.

PDF to Excel Converter Command Line Advanced Features:
* Convert PDF to Microsoft Excel CSV document.
* Able to determine the tables and Text columns in PDF pages automatically.
* Do not need third-part PDF related software.
* Batch convert source files with wildcard characters. eg: *.pdf, aa*.pdf,
bb??.pdf.
* Convert password encrypted PDF to Excel.
* Convert PDF pages in specified page range.
* Convert all pages of PDF into one single CSV file.
* Option to rename output file if file exist or overwrite the file.
* Compatible with Windows 7/8 of both 32-bit and 64-bit.
* Recognizes PDF tables.
* Converts individual pages or all pages.
* Adobe Acrobat is not required.
* Extract data from almost any type of PDF.
* Unlimited 24/7 support service.
* 1-year subscription for updates.

PDF to Excel Converter Command Line FAQs:
Q: Does this program support secured PDF files?
A: Yes, PDF to Excel Converter will try to remove all PDF passwords and
restrictions first before converting PDF files. It will prompt you to enter user
password if the PDF file needs user password to open.

Q: Does this program retain document layout?
A: Yes, PDF to Excel Converter will save the forms in PDF document to CSV
document.

Q: Can I choose which PDF pages to convert?
A: Yes, you can use —pages option to choose the pages that you want to convert.

Q: Can this program convert Excel file back to PDF file?
A: No, it can only convert PDF to Excel, not backwards.

Q: Does this program support command line?
A: Yes, PDF to Excel Converter supports command line.

Q: Does this software support OCR function?
A: No, this software doesn’t support OCR function, if your PDF file created by
scanner, you can use «OCR to Any Converter Command Line» software,

https://veryutils.com/ocr-to-any-converter-command-line

Requirements:
* Supported OS: Windows XP(SP2 or SP3)/Vista/7/8/10, Server 2003/2008/2012/2016,
and later systems.

Command Line Options:
Product Name: VeryUtils PDF to Excel Converter Command Line
Features:
1. Convert PDF files to CSV, TSV, JSON files.
2. Standalone software, don’t require any 3rd software.
3. Determine tables in PDF pages and export them to Excel Spreadsheet
automatically.
4. Decrypt a password protected PDF file.

—————————————————————————
usage: pdf2excel.exe [-$ XXXXXXXXXXXXXXXXXX] [-a [AREA]] [-b [DIRECTORY]] [-c
[COLUMNS]] [-d] [-f [FORMAT]] [-g] [-h] [-i] [-l] [-n] [-o [OUTFILE]] [-p
[PAGES]] [-r] [-s [PASSWORD]] [-t] [-u] [-v] [Input PDF file]

pdf2excel Command Line software helps you extract tables from PDFs.

-$
Set your license key

-a,—area [AREA]
-a/—area = Portion of the page to analyze. Accepts top,left,bottom,right.
Example: —area «269.875,12.75,790.5,561». If all values are between 0-100
(inclusive) and preceded by ‘%’, input will be taken as % of actual height or
width of the page. Example: —area «%0,0,100,50». To specify multiple areas,
—area option should be repeated. Default is entire page.

-b,—batch [DIRECTORY]
Convert all .pdfs in the provided directory.

-c,—columns [COLUMNS]
X coordinates of column boundaries. Example: —columns «10.1,20.2,30.3»

-d,—debug
Print detected table areas instead of processing.

-f,—format [FORMAT]
Output format: (CSV,TSV,JSON). Default: CSV

-g,—guess
Guess the portion of the page to analyze per page.

-h,—help
Print this help text.

-i,—silent
Suppress all console output.

-l,—lattice
Force PDF to be extracted using lattice-mode extraction (if there are ruling
lines separating each cell, as in a PDF of an Excel spreadsheet).

-n,—no-spreadsheet
[Deprecated in favor of -t/—stream] Force PDF not to be extracted using
spreadsheet-style extraction (if there are no ruling lines separating each
cell).

-o,—outfile [OUTFILE]
Write output to [file] instead of STDOUT. Default: —

-p,—pages [PAGES]
Comma separated list of ranges, or all. Examples: —pages 1-3,5-7, —pages 3 or
—pages all. Default is —pages 1.

-r,—spreadsheet
[Deprecated in favor of -l/—lattice] Force PDF to be extracted using
spreadsheet-style extraction (if there are ruling lines separating each cell, as
in a PDF of an Excel spreadsheet).

-s,—password [PASSWORD]
Password to decrypt document. Default is empty.

-t,—stream
Force PDF to be extracted using stream-mode extraction (if there are no ruling
lines separating each cell).

-u,—use-line-returns
Use embedded line returns in cells. (Only in spreadsheet
mode.)
—————————————————————————

Command Line Examples:
pdf2excel.exe —pages all -o test1.csv test1.pdf
pdf2excel.exe —pages all -o test2.csv test2.pdf
pdf2excel.exe —pages all -o test3.csv test3.pdf
pdf2excel.exe —pages all -o test4.csv test4.pdf
pdf2excel.exe —area «269.875,12.75,790.5,561» —pages 5 -o test4.csv test4.pdf
pdf2excel.exe —area «%0,0,100,50» —pages 5 -o test4.csv test4.pdf
pdf2excel.exe —lattice —pages all -o test1.csv test1.pdf
pdf2excel.exe —stream —pages all -o test1.csv test1.pdf

When you need to convert table PDF to Excel by command line, please have a free trial of VeryPDF OCR to Any Converter Command Line. This software also can help you convert table PDF to word, text and others. As this software was developed based on OCR technology,  it can either be used to convert image PDF to Excel or text based PDF to Excel. And in the market, most of software are GUI version which can not be used together with other application but this one does work. In the following part, I will show you how to convert PDF to Excel by command line.

Step 1. Download OCR to Any Converter CMD

  • Please note this software is Windows application, now it can not work under Mac, Linux or other system. But it supports all the Windows system both of 32-bit and 64-bit.
  • Please extracted the downloaded zip file to some folder then call ocr2any.exe in MS Dos Windows. Run bat file to check conversion effect immediately.

Step 2. Convert PDF to Excel by Command Line

    • Usage:        ocr2any.exe [options] <PDF-file> <Text-file>
    • Please check more usage and parameters in readme.txt file.
    • When you need to convert PDF to Excel by command line, please refer to the following command line templates.

ocr2any.exe -ocr2 C:in.pdf C:out.xls
When converting text based table PDF file to Excel, please refer to the above command line template.
ocr2any.exe  -ocr2 C:*.pdf C:*.xls
When you need to convert text based PDF file to Excel in batch, you can use wild character *.
ocr2any.exe -ocr2 -ocr2excelmode 0 D:temp*.pdf D:temp*.xls
When you need to convert scan table PDF or image table PDF to Excel in batch, please use the above command line.
ocr2any.exe -ocr2 D:temp*.pdf D:temp*.doc
When you need to use enhanced OCR module to convert scanned PDF and image files to Excel, please refer to the above command line.

ocr2any.exe -ocr2 -ocr2excelmode 0 C:in.pdf C:out.xls
ocr2any.exe -ocr2 -ocr2excelmode 1 C:in.pdf C:out.xls
ocr2any.exe -ocr2 -ocr2excelmode 2 C:in.pdf C:out.xls
This software provide more than 3 OCR modes to convert PDF to Excel, please choose the proper one according to your PDF file.
for %F in (D:temp*.tif) do ocr2any.exe -ocr2 -ocr2autorotate «%F» «%~dpnF.xls»
ocr2any.exe -ocr2 -ocr2excelmode 0 D:temp*.pdf D:temp*.xls
The above command line templates can help you write bat files to do batch conversion automatically and easily.

Related Parameters:

-ocr2                : use enhanced OCR module to convert scanned PDF and image files to RTF, DOC, TXT, CSV, Excel, HTML files
-ocr2aor          : detect page direction and rotate it automatically when -ocr2 used
-ocrmode <int> : set OCR mode
-ocrmode 0: output to text file
-ocrmode 1: OCR PDF pages and insert new text layer under original PDF pages
-ocrmode 2: output to plain text based PDF file
-ocrmode 3: output to OCRed PDF file (BW) with hidden text layer
-ocrmode 4: output to OCRed PDF file (Color) with hidden text layer
-text <string>  : add additional text at end of each text page, this parameter supports the following variables:
%PageNumber%: current page number
%PageCount% : total page count of PDF file

Now let us check the conversion effect from the following snapshot.

input PDF and output Excel

Please check more functions and usage on our website. During the using, if you encounter any problem, please contact us as soon as possible.

Rating: 0.0/10 (0 votes cast)

Rating: -2 (from 2 votes)

I’m looking for a tool where I can reliable convert a pdf to an excel spreadsheet from the commandline (as I would like to use a script to automate this).

I need something that will properly convert the pdf, as you would using Acrobat Pro or similar programs.

asked Aug 7, 2016 at 23:55

A. L's user avatar

A. LA. L

11.5k22 gold badges83 silver badges155 bronze badges

pdftotext This command will help you to convert pdf to text. Excel has the capability to import text data. If you prefer to convert text data to csv please refer the answer given here

Community's user avatar

answered Aug 8, 2016 at 0:31

Steephen's user avatar

SteephenSteephen

14.3k7 gold badges38 silver badges46 bronze badges

1

   mzelensky

28.10.13 — 13:42

Доброго всем!

Нужна прога для конвертации файлов из PDF в EXCEL с поддержкой командной строки (чтобы можно было запустить программно из 1С-ны).

Перебрал уже штук 5 разных вариантов, но ни одна нормально не работает.

В общем, кто чем пользуется? Подскажите?

   Нуф-Нуф

1 — 28.10.13 — 13:46

ABBYY?

   mehfk

2 — 28.10.13 — 13:47

Наймите оператора машинного долбления.

   aka AMIGO

3 — 28.10.13 — 13:48

(1) +1 + Finereder

   aka AMIGO

4 — 28.10.13 — 13:49

ИМХО — из 1С не выйдет.. это вам не операционка, а специфическое приложение к ней

   mzelensky

5 — 28.10.13 — 13:49

Это ток что перепробовал, не подходит:

Wondershare PDF Converter Pro

Total PDF ConverterX

Total PDF Converter

Solid Converter PDF

Библиотеку от ABBY тож не предлагать…

   Нуф-Нуф

6 — 28.10.13 — 13:50

(5) а что не подходит? почему?

   mzelensky

7 — 28.10.13 — 13:50

(1) я сказал с возможностью управления из команднйо строки.

Где у абби такое приложение?

   aka AMIGO

8 — 28.10.13 — 13:50

а ну и ладно :)

   mzelensky

9 — 28.10.13 — 13:51

(6) Либо нет команднйо строки, либо конвертит с грубыми ошибками

   mzelensky

10 — 28.10.13 — 13:51

Ближе всего прога «Total PDF ConverterX». Но почему-то у нее возникает глюк при конвертации в Эксель…хотя в Ворд конвертит замечательно.

   Нуф-Нуф

11 — 28.10.13 — 13:52

вообще не представляю какой смысл конвертации таблиц из пдф в эксель из командной строки без верификации…

   1dvd

12 — 28.10.13 — 13:52

Если PDF со сканера, то нифига не поможет

   mzelensky

13 — 28.10.13 — 13:52

(2) ты готов приступить? плачу копейку за документ.

   mzelensky

14 — 28.10.13 — 13:53

(11) Ради бога, можешь НЕ ПРЕДСТАВЛЯТь дальше.

   mzelensky

15 — 28.10.13 — 13:53

(12) ПДФ не со сканера.

   Нуф-Нуф

16 — 28.10.13 — 13:53

(14) спс, бро

   mzelensky

17 — 28.10.13 — 13:55

(16) Обращайся, если что :)

   Lama12

18 — 28.10.13 — 13:59

(0) Что за PDF? Может там достаточно отправить документ на печать через принтер «Text». Или вообще скопировать в поток файла.

   Lama12

19 — 28.10.13 — 14:00

Билайн как раз такие PFD шлет.

   Lama12

20 — 28.10.13 — 14:00

PDF

   mzelensky

21 — 28.10.13 — 14:04

(18) чисто текст меня не устраивает. Файлы сложной структуры. Поэтому нужно именно в Эксель с разбивкой по колонкам

   mzelensky

22 — 28.10.13 — 14:18

ап-ну

   Рамиль Маугли

23 — 28.10.13 — 14:24

Стоимость ABBYY FlexiCapture 9.0 с ежемесячной обработкой 5000 страниц составляет 75000 рублей.

   zak555

24 — 28.10.13 — 14:25

(23) для этого придумали патч

   1dvd

25 — 28.10.13 — 14:26

(24) врёшь. патч придумали не для этого

   mzelensky

26 — 28.10.13 — 14:28

(24) ты о чем?

   mzelensky

27 — 28.10.13 — 14:28

(23) Этот вариант уже проходили. НЕ ПОДХОДИТ. Давай дальше.

   Рамиль Маугли

28 — 28.10.13 — 14:31

(27) Если найдете что то стоящее, то напишите в теме пожалуйста. Я вот сколько не искал, кроме FlexiCapture 9.0 ничего не нашел.

   mzelensky

29 — 28.10.13 — 14:32

(28) я смотрел эту прогу (заказывал демо у разрабов). С ней нормально работать не возможно.

+ Ценник более чем не адекватный.

   Рамиль Маугли

30 — 28.10.13 — 14:34

(29) Не знаю почему вы не смогли с ней работать. Вещь очень удобная и действительно выполняет обещанные функции.

   zak555

31 — 28.10.13 — 14:36

(25) а для чего ?

   1dvd

32 — 28.10.13 — 14:37

(31) чтобы исправлять баги. А для того (23) придумали лекарства(таблетки) :)

   zak555

33 — 28.10.13 — 14:38

(32) я использую лекарства под названием патч

   mehfk

34 — 28.10.13 — 14:48

(13)А поипацца не завернуть?

   mzelensky

35 — 29.10.13 — 08:13

(30) Кто вам устанавливал прогу + создавал макеты документов? Сами или кому-то платили?

+ Скольки типов документов используете? Они статические или динамические?

   mzelensky

36 — 29.10.13 — 08:14

(34) Если не умеешь разговаривать нормально, то лучше молчи, а то походишь на малолетку в истерии.

   IamAlexy

37 — 29.10.13 — 08:16

(0) ни разу не видел ни одного конвертера который бы из ПДФ корректно конвертировал куда либо данные без искажений.. без потери форматирования или с сохранением таблиц..

   mzelensky

38 — 29.10.13 — 08:37

(37) ну почему же, вот этот достаточно неплохо делает «Total PDF ConverterX», если файлы не сильно сложные.

Вот этот «Solid Converter PDF» хорошо конвертит, но с особенностями — он группирует строку документа в одну ячейку экселя (т.е. если в файле 10 строк по 5 колонок), то в экселе это будет 10 строк по одной колонке (в этой одной колонке будет сформатирована инфа. Для человеческого осмысления достаточно сносно, но для программного не очень).

   IamAlexy

39 — 29.10.13 — 08:40

(38) вот  в этом то и беда — все вроде что то конвертируют но везде косяки..

условно говоря: нельзя взять договор в ПДФ где оформление шрифтов + есть таблицы  и получить точно такой же в редактируемом формате.. всегда что то слетает..

   George Wheels

40 — 29.10.13 — 08:43

А зачем через командную строку? Чем COM хуже?

   mzelensky

41 — 29.10.13 — 08:44

(40) если знаешь подходящую прогу с возможностью управления через COM, то тоже сгодится.

Есть на примете подобные?

   mzelensky

42 — 29.10.13 — 08:46

(39) да понятно это. Но у меня другого варианта просто нет. Поэтому и перебираю кучу прог — ищу меньшее из зол.

   organizm

43 — 29.10.13 — 08:47

(42) а может стоит рассмотреть проблему в корне?.. распознавание это лажа, требует участия человека.

   George Wheels

44 — 29.10.13 — 08:51

(41) Adobe Acrobat Pro

   mzelensky

45 — 29.10.13 — 08:52

(43) Поверь — не вариант.

И это не распознавание. Пдф — не картинка, а программно сформированный. Так что если косяки и лезут, то с форматированием таблиц.

   mzelensky

46 — 29.10.13 — 08:52

(44) Есть пример использоания из 1С ?

   George Wheels

47 — 29.10.13 — 08:54

(46) Из 1С я с ним не работал.

   Кирпич

48 — 29.10.13 — 09:01

   mzelensky

49 — 29.10.13 — 09:33

(47) ну так а почему думаешь, что к нему по COM можно обратиться? Или есть пример из другйо системы?

   Кирпич

50 — 29.10.13 — 09:37

(49) То, что к акробату можно обратиться через COM знают все. Только тебе это вряд ли поможет. Ты можешь вытащить текст из PDF, но лепить из этого текста таблицы придется самому.

   mzelensky

51 — 29.10.13 — 09:40

(50) т.е. дать команду на выгрузку нельзя?

Ну так толку тогда с этого подключения.

   Кирпич

52 — 29.10.13 — 09:44

(51) дать команду на выгрузку в Excel?

ну как бы графику преобразовывать в Excel это задача программ типа FineReader.

что можно делать с акробатом можно узнать в их SDK.

   mzelensky

53 — 29.10.13 — 09:49

(52) НУ что опять за танцы с бубном :(

«Опять начинается — залезь туда, почитай там, потом открой здесь, выясни как работает это и потом запусти вон там.»

Почему я не могу просто указать исходный файл, указать путь к выходному файлу, задать необходимый формат и ВСЕ!!! Без всех этих SDK, преобразований, гемора и так далее…

   mzelensky

54 — 29.10.13 — 09:49

(53) + Сори…психанул. Просто задолбала меня эта хрень уже.

   Кирпич

55 — 29.10.13 — 09:54

(53) потому что преобразовывать PDF в Excel никому (ну может еще пара человек), кроме тебя не нужно. Нормальные люди договорятся с источником PDF файлов, чтобы они сразу давали XLS и всё.

   mzelensky

56 — 29.10.13 — 10:03

(55) ты глубоко заблуждаешься.

   Кирпич

57 — 29.10.13 — 10:07

(55) да прям. если бы это было кому то нужно, уже давно бы сделали.

   Кирпич

58 — 29.10.13 — 10:08

(56) вот тебе зачем это нужно? чего у вас за файлы и зачем их в XLS нужно пихать.

   mehfk

59 — 29.10.13 — 10:09

(36) Бу-га-га

   Кирпич

60 — 29.10.13 — 10:10

ладно в dbf какой нибудь, чтобы в БД добавить какие то данные. а то в XLS. нафига?

   hhhh

61 — 29.10.13 — 10:12

(58)+ да, какой смысл преобразовывать в Excel, если и pdf прекрасно можно выводить на экран.

В крайнем случае можно расширение файла поменять на xls, чтобы пользователи не нервничали.

   mzelensky

62 — 29.10.13 — 10:13

(60) мне нужен любой формат, который можно было бы удобно обработать программно.

   mzelensky

63 — 29.10.13 — 10:14

(61) Плохая шутка.

   mzelensky

64 — 29.10.13 — 10:18

(58) Представь себе файл ПДФ на 150 листов, где описана заявка на 500 артикульных позиций (заказы, артикулы, количества, суммы, упаковка, расположение и так далее).

Представил?

А теперь представь, что тебе принесли такой файлик и сказали — у тебя 15 минут, чтобы эта заявка была в базе!

Твои действия?

Я хочу уйти от ручного ввода, от ручных проверок, от человеческого фактора в принципе, от всего этого гемороя!

Вот зачем мне это. Если ты считаешь, что это никому не нужно, то смысла в дальнейшей дискуссии не вижу.

   Кирпич

65 — 29.10.13 — 10:19

(62) ну тогда в текст переводи. а дальше уже соображай. Ну что за файлы то? интересно же.

   mzelensky

66 — 29.10.13 — 10:19

(59) О, малолетка пришла…ты чего школу прогуливаешь, балбес?

   mehfk

67 — 29.10.13 — 10:20

(66) Совсем дурак что-ли? А если не дурак — бери какой-нибудь OpenCV и пиши сам.

   mzelensky

68 — 29.10.13 — 10:20

(65) просто в текст переводить не получится — слишком сложная структура файлов, не обработаешь нормально.

Только что смотрел всю эту кухню.

   mzelensky

69 — 29.10.13 — 10:21

(67) ага, вот ща операционку свою закончу компилить и сразу этим займусь.

   Кирпич

70 — 29.10.13 — 10:22

(64) да какой дибил заявку на 150 листов делает для людей. Надо приложить усилия в другом направлении — чтобы давали не PDF, а нормальный формат. А PDF можно посмотреть? Может в нем таблица отдельно зашита и её можно вытащить проще.

   mzelensky

71 — 29.10.13 — 10:23

(70) Долбаемся с этими уродами уже месяца 2. Кроме как ПДФ они ничего не дадут. Бесполезно. У них SAP !!!!!!

   mehfk

72 — 29.10.13 — 10:24

(69) Очередной мистабол, с тобой все ясно.

   mzelensky

73 — 29.10.13 — 10:24

(70) ну могу на почту кинуть пример файла

   mzelensky

74 — 29.10.13 — 10:25

(72) Брысь отсюда. не мешай людям общаться. Сбегай за угол школы, покури

   Кирпич

75 — 29.10.13 — 10:27

(73) ну давай. я тебе письмо кинул на mail.ru

   mehfk

76 — 29.10.13 — 10:28

(74) Не говори мне что делать, и я не скажу куда тебе идти, ОК?

   mzelensky

77 — 29.10.13 — 10:31

(75) ответил

   Кирпич

78 — 29.10.13 — 10:32

+(75) хотя конечно это изврат. я думаю они могут давать заявки и не в PDF. правильный путь — заставить их давать заявки не в PDF.

   mzelensky

79 — 29.10.13 — 10:33

(76) Эту херню можешь кому угодно другому впаривать.

   mehfk

80 — 29.10.13 — 10:34

(79) Какую «херню»?

   mzelensky

81 — 29.10.13 — 10:34

(78) ты думаешь мы такие вот извращенцы, что сами просим — скидывайте нам в ПДФ, на пое****ся хочется ?!

Говорю же, 2 месяца уже паримся. Ответ у них один — мы не может по другому. ТОЛЬКО ПДФ!

   Кирпич

82 — 29.10.13 — 10:35

(73) ну тут можно тупо текст вытащить. колонки разделены «|»

щас попробую. потом тебе продам :)

   mzelensky

83 — 29.10.13 — 10:37

(82) это в первой таблице разделены, а в других смотрел? + там шапка на каждой странице которую выбрасывать нужно.

   hhhh

84 — 29.10.13 — 10:38

(63) но, конвертер — это по-любому тупиковый вариант. Даже не стоит рассматривать этот вариант. Всё равно вручную надо всё контролировать. Посадить человека на окладе и пусть он загружает файлы.

(81) просто не вы должны этим заниматься, а начальство должно переговорить между собой, ваше и ихнее. Они за рюмкой коньяка быстрее договорятся.

   mzelensky

85 — 29.10.13 — 10:40

(84) Тебе ящик коньяка дать, пойдешь договариваться?

   Kandellaster

86 — 29.10.13 — 10:40

в общем есть бюджетно-гомороидальный вариант, таблицу свою программно запихиваеш в LibreOffice который замечательно экспортирует в PDF. Как запустить и экспорт программно тут придется повозится но это реально есть там встроенные языки на которых пишутся макросы и макросы можно программно через COM в 1С вызвать

   Kandellaster

87 — 29.10.13 — 10:40

(86) это если совсем ничего не найдеш)

   mzelensky

88 — 29.10.13 — 10:45

(86) Не совсем понял.

«таблицу свою программно запихиваеш в LibreOffice который замечательно экспортирует в PDF»

У меня и так на входе PDF, зачем мне его еще раз экспортировать?

   mehfk

89 — 29.10.13 — 10:46

(86) ТС-у нужно наоборот Pdf2xls

   Kandellaster

90 — 29.10.13 — 10:46

аа так это я не понял просто

   Kandellaster

91 — 29.10.13 — 10:48

а документ точно не скан в PDF?

   mzelensky

92 — 29.10.13 — 10:49

(91) Точно. Зуб даю :)

   mzelensky

93 — 29.10.13 — 10:52

(82) Походу пока что более лучшего варианта не вижу…тож попробую сейчас чистый текст немного попарсить. Поглядим что выйдет.

   Kandellaster

94 — 29.10.13 — 10:52

ну ладно а есть все делающий и устраивающий вас конвертер но не консольный?

   Kandellaster

95 — 29.10.13 — 10:53

если есть можно попробовать еще один еретический способ

   mzelensky

96 — 29.10.13 — 10:57

(95) НУ допустим найду. Что дальше? Запускать эмитацию нажатия кнопок?

   Kandellaster

97 — 29.10.13 — 10:58

   mzelensky

98 — 29.10.13 — 11:02

(97) не, я такой вариант не рассматриваю.

   George Wheels

99 — 29.10.13 — 11:07

   mzelensky

100 — 29.10.13 — 11:13

(99) английскую мануалку на 226 листов? Спасибо конечно, но она мне ничего не даст

DocTo

Document Converter

Simple utility for converting a Microsoft Word Document ‘.doc’, Microsoft Excel ‘.xls’ and Microsoft Powerpoint .ppt files to any other supported format
such as .txt .csv .rtf .pdf.

Can also be used to convert .txt, .rtf, .csv to .doc, .xls or .pdf format.

Can be used to convert older word documents to latest format.

Must have Microsoft Word, Excel or Powerpoint installed on host machine.

Download Release From Github Releases — https://github.com/tobya/DocTo/releases/
Further Information available at https://tobya.github.io/DocTo/
Further Examples available at https://docto.toflidium.com

Features

  1. Convert Doc/RTF/Text file to any Word SaveAs Type Doc/Text/RTF/PDF
  2. Convert XLS/XLSX/CSV file to any Excel SaveAs Type CSV/Text/PDF
  3. Convert Text/CSV file to full fledged Word or Excel format.
  4. Single File Conversion
  5. Multiple / Directory File Conversion.
  6. Delete after conversion
  7. Fire https Webhook on each conversion.

Examples

More Examples available at

  • View Examples
  • https://docto.toflidium.com/
  • Wiki
  • All Parameters Explained

Installation

Download .exe from Release https://github.com/tobya/docTo/releases

Package Managers

Choco

Also Available for installation via Chocolatey

choco install docto

to upgrade to latest version before generally available (replace with current version)

choco upgrade docto —version=1.8

Node

Node Wrappers has been created by @KerimG & @brrd

https://www.npmjs.com/package/node-docto

https://github.com/brrd/msoconvert

Bugs and Features

Please log an issue for any bugs, features or suggestions.

Examples

Single

Convert Microsoft Word Document to text

docto -f C:DirectoryMyFile.doc -O "C:Output DirectoryMyTextFile.txt" -T wdFormatText

Convert Microsoft Excel Document to csv text

docto -XL -f C:DirectoryMyFile.xls -O "C:Output DirectoryMyTextFile.csv" -T xlCSV    

Convert Microsoft Word Document to PDF (requires version of Microsoft Word that supports this).

 docto -f C:DirectoryMyFile.doc -O "C:Output DirectoryMyTextFile.pdf" -T wdFormatPDF

Multiple Files and Folders

Convert All Microsoft Word Documents in Directory and its Sub Directories to PDF

docto -f "C:Dir with SpacesFilesToConvert" -O "C:DirToOutput" -T wdFormatPDF  -OX .pdf

Delete Original File after Conversion

Delete Original Files after conversion (-R) .

docto -f "C:Dir with SpacesFilesToConvert" -O "C:DirToOutput" -T wdFormatPDF  -OX .pdf -R true

Webhooks

Add a Webhook to fire on each conversion (-W)

docto -f "C:Dir with SpacesFilesToConvert" -O "C:DirToOutput" -T wdFormatPDF  -OX .pdf  -W https://toflidium.com/webhooks/docto/webhook_test.php

A Webhook is a url that can be called on each converstion to give you the ability to repond externally whenever a file is converted. Currently https address is experimental so log an issue if you have any issues.

Use in the Wild

If you are using DocTo in the wild somewhere, please add details to this wiki page

OneDrive Conversion

If you need to upgrade a bunch of files to work without conversion on OneDrive /Office365 / Word 20XX then you can use DocTo.
See this StackExchange question

https://webapps.stackexchange.com/questions/74859/what-format-does-word-online-use

Command Line Help

Help
Docto Version:%s
Office Version : %s
Open Source: https://github.com/tobya/DocTo/
Description: DocTo converts Word Documents and Excel Spreadsheets to other formats.

Command Line Parameters:
Each Parameter should be followed by its value eg
        -f "c:DocsMyDoc.doc"
Parameters markers are case insensitive.

  -H  This message
      --HELP -?
  -WD Use Word for Converstion (Default). Help '-h -wd'
      --word
  -XL Use Excel for Conversion. Help '-h -xl'
      --excel
  -PP Use Powerpoint for Conversion. help '-h -pp'
      --powerpoint
  -VS Use Visio for Conversion. 
      --visio
  -F  Input File or Directory
      --inputfile
  -FX Input file search for if -f is directory. Can use .rtf test*.txt etc
      Default ".doc*" (will find ".docx" also)
      --inputextension
  -O  Output File or Directory to place converted Docs
      --outputfile
  -OX Output Extension if -F is Directory. Please include '.' eg. '.pdf' .
      If not provided, pulled from standard list.
      --outputextension
  -T  Format(Type) to convert file to, either integer or wdSaveFormat constant.
      Available from
      https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.word.wdsaveformat
      or https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.excel.xlfileformat
      or https://docs.microsoft.com/en-us/office/vba/api/powerpoint.presentation.saveas
      See current List Below.
      --format
  -TF Force Format. -T value if an integer, is checked against current list
      compiled in. It is not passed if unavailable.  -TF will pass through value
      without checking. Word will return an "EOleException  Value out of range"
      error if invalid. Use instead of -T.
      --forceformat
  -L  Log Level Integer: 1 ERRORS 2 STANDARD 5 CHATTY 9 DEBUG 10 VERBOSE. Default: 2=STANDARD
      --loglevel
  -C  Compatibility Mode Integer. Set to an INTEGER value from
      https://msdn.microsoft.com/en-us/library/office/ff192388.aspx.
      Set the compatibility mode when you want to convert documents to a later
      version of word. See help '-h -c' for further info.
      --compatibility
  -E  Encoding Integer: Sets codepage Encoding.  See
      https://msdn.microsoft.com/en-us/library/office/ff860880.aspx
      for more details and values.
      --encoding
  -M  Ignore all files in __MACOSX subdirectory if it exists.  Default True.
      --ignoremacos
  -N  Make list of files that take over n seconds to complete.
      Use number of seconds over that conversion takes and add to list.
      Outputs to filename 'docto.ignore.txt'
      --listlongrunning
  -NX Ignore any file listed in docto.ignore.txt, created by -N
      --ignorelongrunninglist
  -G  Write Log to file in directory
      --writelogfile
  -GL Log File Name to Use. Default 'DocTo.Log';
      --logfilename
  -Q  Quiet Mode: Nothing will be output to console.  To see any errors you must
      set -G or -GL. Equivalent to setting -L 0
      --quiet
  -R  Remove Files after successful conversion: Default false; To use specify
      value eg -R true
      --deletefiles
  -W  Webhook: Url to call on events. See help '-H -HW' for more details.
      --webhook
  -X  Halt on COM Error: Default True;  If you have trouble with some files
      not converting, set this to false to ignore errors and continue with
      batch job.
      --halterror
  -V  Show Versions.  DocTo and Word/Excel/Powerpoint

Long Parameters:

  --BookmarkSource
      PDF conversions can take their bookmarks from
      WordBookmarks, WordHeadings (default) or None
  --DoNotOverwrite
  --no-overwrite
      Existing files are overridden by default, if you do not wish a file to be
      over written use this option.
  --no-subdirs Only convert specified directory. Do not recurse sub directories
  --ExportMarkup Value for wdExportItem - default wdExportDocumentContent.
      use    wdExportDocumentWithMarkup to export all word comments with pdf
  --no-IncludeDocProperties 
  --no-DocProp
      Do not include Document Properties in the exported pdf file.      
  --PDF-OpenAfterExport
      If you wish for a converted PDF to be opened after creation. No value req.
  --PDF-FromPage
      Save a range of pages to pdf. Integer/String. If integer --PDF-ToPage must also be set.
      Other values wdExportCurrentPage, wdExportSelection
  --PDF-ToPage
      Save a range of pages to pdf. Integer. --PDF-FromPage must also be set.
  --PDF-OptimizeFor
      Set the pdf/xps to be optimized for print or screen.
      Default  ForPrint | ForOnScreen
  --XPS-no-IRM
      Do not copy IRM permissions to exported XPS document.
  --PDF-No-DocStructureTags
      Do not include DocStructureTags to help screen readers.
  --PDF-no-BitmapMissingFonts
      Do not bitmap missing fonts, fonts will be substituted.   
  --use-ISO190051 
      Create PDF to the ISO 19005-1 standard.




Experimental:
  --skipdocswithtoc
      EXPERIMENTAL.  Will skip any docs that contain a TOC to prevent hanging.
      Currently matches some false positives.  Default False.
  --stdout
      Send file to Stdout after conversion. ( Does not work correctly for binary files)

ERROR CODES:
200 : Invalid File Format specified
201 : Insufficient Inputs.  Minimum of Input File, Output File & Type
202 : Incorrect switches.  Switch requires value
203 : Unknown switch in command
204 : Input File does not exist
205 : Invalid Parameter Value
220 : Word or COM Error
221 : Word not Installed
400 : Unknown Error

Parameter Overview

Usage

3 Parameters are required

  • -F Input File Name
  • -O Output File Name
  • -T Type to be converted to.

Parameters that take a value have a space seperating them from the value. Some parameters do
not require a value. All parameters are case insensitive.

Input File or Directory

-F —inputfile

The file or folder you wish docto to open. If it is a folder, docto will load all files in that
directory and its subdirectories. If you do not wish to load files from subdirectories see the --no-subdirs
parameter.

Conversion will be performed on each file in turn.

Output File or Folder

-O —outputfile

The filename or foldername where you would like the output files to be placed. If Input is a file but
output is a folder then the output file will have the same name as the input but with the new extension.

Conversion Type

-T —format

Specify what format you wish to convert to such as wdFormatPDF or wdFormatText etc.

View possible Word Formats
and Excel Formats. Can also use the integer value

Help

-H , —Help

Display the help text listing all parameters and versions of docto and office applications

Version

-V —version

Display the version string of both DocTo and Microsoft Office.

Application Selection

-WD -XL -PP -VS

This parameter tells DocTo which of the applications you wish to use to load and save your document
For historical reasons DocTo defaults to -WD if no value is given, however it is a good habit to get
into to always use one of these values any time you use Docto.

  • -WD Microsoft Word
  • -XL Microsoft Excel
  • -PP Microsoft Powerpoint
  • -VS Microsoft Visio

Input Folder Extension

-FX —inputextension

By default DocTo will load all files in the directory with the standard Application extension

eg.

  • Word (.doc) matches .doc & .docx files
  • Excel (.xls) matches .xls & .xlsx files
  • Powerpoint (.ppt) matches .ppt & .pptx files
  • Visio (.vsd)

If you wish to convert a differnt set of files eg *.rtf or *.txt you can specify it here by ext
such as .rtf

Output Extension

-OX —outputextension

The output extension on a conversion is pulled from a standard list, eg. if converting to wdFormatPDF the file
will be output with extension .pdf. If you would like to specify your own extension (such as .pdfx) you can
with this parameter.

Force Format Use

-TF —forceformat

If -T is an integer if it is a value that wasnt available when DocTo was compiled it will raise an error.
If you use -TF it will pass the integer value of -T to the Office Application without checking.

Logging

-L —loglevel

Set level of log output. -l 10 is useful for debugging. Use -l 0 or -Q to surpress logging.

####Levels

  • 10 VERBOSE
  • 9 CHATTY
  • 5 STANDARD
  • 1 ERRORS (default)
  • 0 SILENT

Document Compatibility

-C —compatibility

Compatibility Mode Integer. Set to an INTEGER value from msdn list .

Set the compatibility mode of the version of word the document is to be compatible with. Particuarily
useful when wishing to convert older documents to current version. Can be used to convert old
word documents to be compatible with onedrive.

Document Encoding

-E —encoding

Sets codepage Encoding. See MSDN
for more details and values.

List Long running Files

-N —ListLongRunning

Some files when being converted can cause a dialog box to pop up. This can only be fixed by
manual intervention. By setting this parameter you can at least record the documents that are
causing difficulty (to a file called docto.ignore.txt) and if you set -NX these documents will be skipped on subsequent executions.

Skip Files in docto.ignore.txt file

-NX —IgnoreLongRunningList {no-value-required}

When set any files listed in docto.ignore.txt in the same directory as DocTo.exe will be skipped.
This allows troublesome documents in a directory structure to be ignored.

Logging

Write to Log File

-G —writelogfile [no value required]

Write the log to a file as well as stdout. docto.log by default.

Log File

-GL —logfilename {filename}

Specify the filename that you wish the logfile to be written to.

Quiet Mode

-Q —quiet [no value required]

No output to stdout. Everything including errors are surpressed. Use in conjunction with -G
to ensure you get errors.

Delete Input Files

-R —deletefiles {true|false}

If you would like for the inputfile to be deleted after conversion you can set this to true.

Fire a Webhook

-W —webhook

If you wish you can call a web url after each conversion or error.
The Webhook URL will be called on the following events with the following parameters

  • File Conversion

    • action=convert
    • type=wdFormatType (or int if no matching format type)
    • ouputfilename=File being written to.
    • inputfilename=File being converted.
  • Error

    • action=error
    • type=wdFormatType (or int if no matching format type)
    • ouputfilename=File being written to.
    • inputfilename=File being converted.
    • error=Error Message

Return value is logged in DocTo Log

Halt on Errors

-X —halterror {true|false}

Docto will halt when a COM error is raised. If you wish to ignore the error and continue set this value
to true.

Bookmark Source

—BookmarkSource {source}

PDF conversions can take their bookmarks from WordBookmarks, WordHeadings (default) or None

Overwrite Files

—DoNotOverwrite —no-overwrite [no value required]

Existing files are overridden by default, if you do not wish a file to be over written
use this option.

Recurse SubDirectories

—no-subdirs

By default sub directories are converted. Use to only convert specified directory. Do not recurse sub directories

Export Markup

—ExportMarkup

Specifies

  • wdExportDocumentContent Exports the document without markup.
  • wdExportDocumentWithMarkup Exports the document with markup.

use wdExportDocumentWithMarkup to export all word comments with pdf

Open after Export

—PDF-OpenAfterExport

If you wish for the converted PDF to be opened after creation. No value req.

Convert Specific Pages

—PDF-FromPage

—PDF-ToPage

Only convert certain pages in the document.

Use ISO19005-1

—use-ISO190051

Create PDF to the ISO 19005-1 standard, also know as PDF-A or PDF Archive.

Special Case Parameters

Do not ignore __MACOSX Directory

-M —ignoreMACOS {true|false}

By default DocTo ignores any files in a hidden __MACOSX directory that MACOS creates. This directory is often
present on an external disk that is shared between systems. If you wish to check this dir set this value. You must specify value eg -M false.

Compiling

The project compiles with Delphi (I use 10.3 but it should compile with most versions including XE4 & 7). The project will not compile on Linux as it uses several Windows only components such as COM and Word and Excel do not have Linux versions anyway so there would be no point.

XLSTo

XLSTo is now incorporated into DocTo. Previously XLSTo was a seperate EXE that was used to convert xls files to csv or pdf. This can now be done with the main DocTo.exe by simply adding the -XL flag.

Get Involved.

I am happy to accept any PR anyone might like to submit. If a large amount of work involved, please open an issue first to ensure the effort wont be wasted.

The main branch name in the repo is DocTo

Понравилась статья? Поделить с друзьями:
  • Командная работа в word
  • Командировочное удостоверение форма т 10 бланк скачать бесплатно в excel
  • Командировочное удостоверение образец скачать word бесплатно
  • Командировочное удостоверение бланк скачать word образец
  • Команды для excel на английском