Quote from PaulJonestindall on March 27, 2020, 10:52 amAnyone know of a plugin that will handle PDF file attachments?
I need to be able to attach and extract an ascii text file readily. Or, alternatively, anyone know of a command line program that will do it?
I will also post in the plugins request section.
Thanks.
Anyone know of a plugin that will handle PDF file attachments?
I need to be able to attach and extract an ascii text file readily. Or, alternatively, anyone know of a command line program that will do it?
I will also post in the plugins request section.
Thanks.
Quote from Gaev on March 27, 2020, 3:00 pm@pauljonestindall
handle PDF file attachments
be able to attach and extract an ascii text file readily.Can you elaborate on the operating environment ...
- VisualNEOWin only or can VisualNEOWeb be deployed as well (to create/download a PDF file) ?
- single user (i.e. you) or are there multiple users involved ? if multiple, describe role/access control for each user
- how many text files and how big (lines) is each one ?
- define your understanding of "attach"
handle PDF file attachments
be able to attach and extract an ascii text file readily.
Can you elaborate on the operating environment ...
- VisualNEOWin only or can VisualNEOWeb be deployed as well (to create/download a PDF file) ?
- single user (i.e. you) or are there multiple users involved ? if multiple, describe role/access control for each user
- how many text files and how big (lines) is each one ?
- define your understanding of "attach"
Quote from PaulJonestindall on March 27, 2020, 5:33 pm@gaev
This would be for Windows.
By way of defining my understanding of "attach": PDF files in general have an apparent feature for attaching external files. Say, for example, if you have a PDF explaining a particular method of using Excel you can then add a file attachment, an actual .XLS file to the PDF as a sample file for the reader. The reader can then "extract" or detach that .XLS file as a separate and usable file. There are a variety of PDF editors including Acrobat that allow you to attach and detach files. The PDF and its attached file(s) are then portable as a single file.
If I understand you correctly this would be for single user. And again, if I understand correctly, I don't know that there is a limit to the number of files that can be attached but in my case I would require only one ASCII text file that may reach a maximum of perhaps 200 lines. It would be a data file something similar to an INI file.
This would be for Windows.
By way of defining my understanding of "attach": PDF files in general have an apparent feature for attaching external files. Say, for example, if you have a PDF explaining a particular method of using Excel you can then add a file attachment, an actual .XLS file to the PDF as a sample file for the reader. The reader can then "extract" or detach that .XLS file as a separate and usable file. There are a variety of PDF editors including Acrobat that allow you to attach and detach files. The PDF and its attached file(s) are then portable as a single file.
If I understand you correctly this would be for single user. And again, if I understand correctly, I don't know that there is a limit to the number of files that can be attached but in my case I would require only one ASCII text file that may reach a maximum of perhaps 200 lines. It would be a data file something similar to an INI file.
Quote from Gaev on March 27, 2020, 6:06 pm@pauljonestindall
Thank you for the clear explanation.
By way of defining my understanding of "attach": PDF files in general have an apparent feature for attaching external files. Say, for example, if you have a PDF explaining a particular method of using Excel you can then add a file attachment, an actual .XLS file to the PDF as a sample file for the reader. The reader can then "extract" or detach that .XLS file as a separate and usable file.
I did not know that.
There are a variety of PDF editors including Acrobat that allow you to attach and detach files. The PDF and its attached file(s) are then portable as a single file.
I will Google to see if there are any command line utilities for doing so.
In the mean time, have you considered ...
a) placing the two files (pdf, txt) in a .zip file ?
b) storing one/both files on a cloud server (Google, Amazon, Azure etc.) and providing users with a link to the files ?
I don't know that there is a limit to the number of files that can be attached but in my case I would require only one ASCII text file that may reach a maximum of perhaps 200 lines. It would be a data file something similar to an INI file.
I was asking only as design/operational considerations for any suggested solutions.
BTW, VisualNEOWin does a great job when it comes to reading/writing text files on the local disk; so it is a matter of finding a solution that delivers the two files to intended recipients.
Thank you for the clear explanation.
By way of defining my understanding of "attach": PDF files in general have an apparent feature for attaching external files. Say, for example, if you have a PDF explaining a particular method of using Excel you can then add a file attachment, an actual .XLS file to the PDF as a sample file for the reader. The reader can then "extract" or detach that .XLS file as a separate and usable file.
I did not know that.
There are a variety of PDF editors including Acrobat that allow you to attach and detach files. The PDF and its attached file(s) are then portable as a single file.
I will Google to see if there are any command line utilities for doing so.
In the mean time, have you considered ...
a) placing the two files (pdf, txt) in a .zip file ?
b) storing one/both files on a cloud server (Google, Amazon, Azure etc.) and providing users with a link to the files ?
I don't know that there is a limit to the number of files that can be attached but in my case I would require only one ASCII text file that may reach a maximum of perhaps 200 lines. It would be a data file something similar to an INI file.
I was asking only as design/operational considerations for any suggested solutions.
BTW, VisualNEOWin does a great job when it comes to reading/writing text files on the local disk; so it is a matter of finding a solution that delivers the two files to intended recipients.
Quote from PaulJonestindall on March 27, 2020, 6:22 pm@gaev
I have found a couple of command line programs that I'm exploring but I really haven't found a suitable one to work for me within the Run action environment. CPDF and PDFtk are two I found so far.
As a bit of background, and without revealing too many secrets of the business, as in, within my particular company, I've already developed the process to handle the PDFs and their transfer between employees, the traffic system if you will. Adding the file attachment seems to really be the best way.
I have found a couple of command line programs that I'm exploring but I really haven't found a suitable one to work for me within the Run action environment. CPDF and PDFtk are two I found so far.
As a bit of background, and without revealing too many secrets of the business, as in, within my particular company, I've already developed the process to handle the PDFs and their transfer between employees, the traffic system if you will. Adding the file attachment seems to really be the best way.
Quote from Gaev on March 27, 2020, 6:41 pm@pauljonestindall
I have found a couple of command line programs that I'm exploring but I really haven't found a suitable one to work for me within the Run action environment. CPDF and PDFtk are two I found so far.
I took a quick look at the CPDF website (https://community.coherentpdf.com/) ... looks like this is the command you need ...
cpdf.exe -attach-file sheet.xls -to-page 5 in.pdf -o out.pdf1) try and deploy it (replacing sheet.xls with your txt file) from the command prompt.
2) if that works, you should be able to deploy the Run command with the same syntax.
VisualNEOWin has good commands to enable you to dynamically compose the command parameters; if you need help, just ask.
I have found a couple of command line programs that I'm exploring but I really haven't found a suitable one to work for me within the Run action environment. CPDF and PDFtk are two I found so far.
I took a quick look at the CPDF website (https://community.coherentpdf.com/) ... looks like this is the command you need ...
cpdf.exe -attach-file sheet.xls -to-page 5 in.pdf -o out.pdf
1) try and deploy it (replacing sheet.xls with your txt file) from the command prompt.
2) if that works, you should be able to deploy the Run command with the same syntax.
VisualNEOWin has good commands to enable you to dynamically compose the command parameters; if you need help, just ask.
Quote from PaulJonestindall on March 30, 2020, 1:02 pm@gaev
I've tried both of these but have you been able to get the file back out? I haven't.
It seems CPDF has a rather confusing description of what they want for an output directory path:cpdf -dump-attached-files in.pdf -o /home/fred/attachments
That's not exactly helpful. I've tried a half dozen combinations including [PubDir] and the Pub Dir without the trailing "\".
Doesn't work for me.
PDFtk allows to unpack the attachment but I haven't figured out how to remove it.
I've tried both of these but have you been able to get the file back out? I haven't.
It seems CPDF has a rather confusing description of what they want for an output directory path:
cpdf -dump-attached-files in.pdf -o /home/fred/attachments
That's not exactly helpful. I've tried a half dozen combinations including [PubDir] and the Pub Dir without the trailing "\".
Doesn't work for me.
PDFtk allows to unpack the attachment but I haven't figured out how to remove it.
Quote from Gaev on March 30, 2020, 3:06 pm@pauljonestindall
have you been able to get the file back out?
I have not tried anything ... in these extra ordinary times, I am triple vigilant about downloading anything foreign on to my computer ... I was only going by their online documentation.
I haven't.
May I suggest a step by step investigative process that might allow you to zoom in on the exact root of the problem.
1) check out the proper command syntax/parameters outside of your VisualNEOWin application
So, if you can go to your command window and try these commands (with the appropriate file names) ...
cpdf.exe -attach-file sheet.xls -to-page 5 in.pdf -o out.pdf
cpdf.exe -list-attached-files 14psfonts.pdf
cpdf.exe -dump-attached-files in.pdf -o /home/fred/attachmentsNote that their documentation states that ...
In all cases, on Microsoft Windows, substitute cpdf.exe for cpdf.
If you encounter any problems, please post your results here (with the exact command/parameters used).
Once you can confirm that all 3 commands behave (in their intended native environment) as expected, you can try and invoke them from your VisualNEOWin application using the Run command
2) Make this a 2 step process ... in this first step, just hard-code the parameter information.
Again, if one/more commands do not respond as expected, post the exact parameters you used with the Run command ... hint: because of the minus signs and forward slashes, you might have to precede your parameters with ! (so VisualNEOWin does not attempt to do math on the values).
3) Once you have established that invoking the commands through the Run command work, the next (last) step would be to dynamically compose the parameters using [variables]
Please post how you are doing it ... what worked and what did not.
have you been able to get the file back out?
I have not tried anything ... in these extra ordinary times, I am triple vigilant about downloading anything foreign on to my computer ... I was only going by their online documentation.
I haven't.
May I suggest a step by step investigative process that might allow you to zoom in on the exact root of the problem.
1) check out the proper command syntax/parameters outside of your VisualNEOWin application
So, if you can go to your command window and try these commands (with the appropriate file names) ...
cpdf.exe -attach-file sheet.xls -to-page 5 in.pdf -o out.pdf
cpdf.exe -list-attached-files 14psfonts.pdf
cpdf.exe -dump-attached-files in.pdf -o /home/fred/attachments
Note that their documentation states that ...
In all cases, on Microsoft Windows, substitute cpdf.exe for cpdf.
If you encounter any problems, please post your results here (with the exact command/parameters used).
Once you can confirm that all 3 commands behave (in their intended native environment) as expected, you can try and invoke them from your VisualNEOWin application using the Run command
2) Make this a 2 step process ... in this first step, just hard-code the parameter information.
Again, if one/more commands do not respond as expected, post the exact parameters you used with the Run command ... hint: because of the minus signs and forward slashes, you might have to precede your parameters with ! (so VisualNEOWin does not attempt to do math on the values).
3) Once you have established that invoking the commands through the Run command work, the next (last) step would be to dynamically compose the parameters using [variables]
Please post how you are doing it ... what worked and what did not.
Quote from rasl on March 30, 2020, 3:41 pmTenga cuidado de que el comando correcto sea "cpdf.exe -dump-attachments in.pdf -o / home / fred / attachments" y no
"cpdf.exe -dump- attach -files in.pdf -o / home / fred / attachments"
y funciona bienUsing -o output/ the file is recovered in the output folder, see picture
salu2
Tenga cuidado de que el comando correcto sea "cpdf.exe -dump-attachments in.pdf -o / home / fred / attachments" y no
"cpdf.exe -dump- attach -files in.pdf -o / home / fred / attachments"
y funciona bien
Using -o output/ the file is recovered in the output folder, see picture
salu2
Uploaded files:Quote from PaulJonestindall on March 30, 2020, 4:02 pm@gaev
Ha! Get a load of this. The example they give in the manual isn't even the correct command:
cpdf -dump-attached-files in.pdf -o /home/fred/attachments
It's "-dump-attachments" as in the section description and NOT "-dump-attached-files" files as in the example.
Yes, I ran the program in the DOS CMD mode and it revealed the error:
Q:\QCCP\INI>cpdf -dump-attached-files cpdfmanual.pdf -o Q:\QCCP\INI
This demo is for evaluation only. http://www.coherentpdf.com/
cpdf: unknown option '-dump-attached-files'. Use -help for help.I changed the option:
Q:\QCCP\INI>cpdf -dump-attachments cpdfmanual.pdf -o Q:\QCCP\INI
This demo is for evaluation only. http://www.coherentpdf.com/And Voila! I believe I have what I need now. It works fine in the Run action. Sadly though I still have to go through the process of creating the output file with the attachment, deleting the original and renaming the new one. But It Works.
Thanks Gaev.
Ha! Get a load of this. The example they give in the manual isn't even the correct command:
cpdf -dump-attached-files in.pdf -o /home/fred/attachments
It's "-dump-attachments" as in the section description and NOT "-dump-attached-files" files as in the example.
Yes, I ran the program in the DOS CMD mode and it revealed the error:
Q:\QCCP\INI>cpdf -dump-attached-files cpdfmanual.pdf -o Q:\QCCP\INI
This demo is for evaluation only. http://www.coherentpdf.com/
cpdf: unknown option '-dump-attached-files'. Use -help for help.
I changed the option:
Q:\QCCP\INI>cpdf -dump-attachments cpdfmanual.pdf -o Q:\QCCP\INI
This demo is for evaluation only. http://www.coherentpdf.com/
And Voila! I believe I have what I need now. It works fine in the Run action. Sadly though I still have to go through the process of creating the output file with the attachment, deleting the original and renaming the new one. But It Works.
Thanks Gaev.
Quote from Gaev on March 30, 2020, 4:28 pm@pauljonestindall
Sadly though I still have to go through the process of creating the output file with the attachment, deleting the original and renaming the new one. But It Works.
You might save a step or two if you renamed the original file first e.g. ...
FileCopy "original.pdf" "originalSource2020mmdd.pdf"
FileErase "original.pdf" ... in case cpdf does not output if file already exists
Run cpdf.exe using originalSource2020mmdd.pdf as input and original.pdf as output
Thanks Gaev.
I was merely pasting stuff from their website ... so, no thanks to me ... looks like @rasl noticed the same error ... and posted it a few minutes before your post.
Sadly though I still have to go through the process of creating the output file with the attachment, deleting the original and renaming the new one. But It Works.
You might save a step or two if you renamed the original file first e.g. ...
FileCopy "original.pdf" "originalSource2020mmdd.pdf"
FileErase "original.pdf" ... in case cpdf does not output if file already exists
Run cpdf.exe using originalSource2020mmdd.pdf as input and original.pdf as output
Thanks Gaev.
I was merely pasting stuff from their website ... so, no thanks to me ... looks like @rasl noticed the same error ... and posted it a few minutes before your post.
Quote from PaulJonestindall on March 30, 2020, 5:05 pmThanks guys
Thanks guys