PDF-List (Calc),Hyperlinks,pdftk,read-write metadata, merge
Posted: Thu Sep 05, 2019 6:39 pm
The attached .ods-file has a Toolbar with 4 Buttons. You can import all PDFs of a chosen folder (optional with Subfolders) as Hyperlinks. Besides the usual ctrl-click on Hyperlink a custom set App can be used to open a selected PDF.
If the commandline-tool pdftk is installed you have more features:
- The list also shows the Page Count and the MetaData (Infokeys) of the PDFs.
- MetaData can be written back into the PDFs.
- PDFs can be merged.
There are 4 Buttons in the Toobar:
1.ListPDFs
Please edit the first lines of Sub listPDFs to you liking (especially if you want to use pdftk or not.
You get a Folder-Selector. The list of imported PDFs will contain:
Without pdftk:
With pdftk also the Page-Count and all available MetaData will be listed:
If the Page-Count of a PDF is missing then the PDF was skipped on import because it probalby was password-protected.
2.open_pdf_in_app
The PDF of the row you have selected will be opened in the given external App.
Please edit the first line of sub open_pdf_in_app to give the path to your external App.
Next 2 Buttons only work with installed pdftk:
3.Write_Info_to_new_PDF(s)
The Metadata of all PDFs of a selection range will be written back into the PDFs. The Original PDF will be moved into a subfolder called "!.OriginalPDFs", so you have a backup. (This subfolder "!.OriginalPDFs" will always be skipped when listing with Button 1)
You also can create new custom MetaData-Fields (in the Header-Row). Only filled cells will be written back into the PDF.
PDFs with missing Page-Count will be skipped because they likely are password-protected.
4.mergePDFs
All PDFs of a selection range will be merged into a new PDF. This will be called "mergedPDFs.pdf" and will be located in the Folder that is shown in cell A1.
If the commandline-tool pdftk is installed you have more features:
- The list also shows the Page Count and the MetaData (Infokeys) of the PDFs.
- MetaData can be written back into the PDFs.
- PDFs can be merged.
There are 4 Buttons in the Toobar:
1.ListPDFs
Please edit the first lines of Sub listPDFs to you liking (especially if you want to use pdftk or not.
Code: Select all
sub listPDFs
Folderpath="E:\PDF" 'edit your default path here
subdirs=1 'to not list subfolders use subdirs=0
pdftkapp="pdftk" 'if you don't use pdftk then use: pdftkapp=""
Without pdftk:
Code: Select all
PDF-Name (Hyperlinked) - Size
Code: Select all
PDF-Name (Hyperlinked) - Size - Pages - Title - Author - Subject - Keywords - ...
2.open_pdf_in_app
The PDF of the row you have selected will be opened in the given external App.
Please edit the first line of sub open_pdf_in_app to give the path to your external App.
Code: Select all
sub open_pdf_in_app
PDF_App="E:\Installationsprogramme\Sumatra\SumatraPDF.exe" 'edit this path
3.Write_Info_to_new_PDF(s)
The Metadata of all PDFs of a selection range will be written back into the PDFs. The Original PDF will be moved into a subfolder called "!.OriginalPDFs", so you have a backup. (This subfolder "!.OriginalPDFs" will always be skipped when listing with Button 1)
You also can create new custom MetaData-Fields (in the Header-Row). Only filled cells will be written back into the PDF.
PDFs with missing Page-Count will be skipped because they likely are password-protected.
4.mergePDFs
All PDFs of a selection range will be merged into a new PDF. This will be called "mergedPDFs.pdf" and will be located in the Folder that is shown in cell A1.