We help IT Professionals succeed at work.

PDF doc and emailling

Gordon Hughes
on
Medium Priority
51 Views
Last Modified: 2020-02-10
Is it possible to email a pdf document to an email address contained within the PDF document, and if so how?
Gordon
Comment
Watch Question

David FavorFractional CTO
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Yes.

PDF docs are just text, so if I were going to do this, I'd use...

1) Poppler tools to convert the PDF to text. Something like this...

pdftotext -enc ASCII7 -nopgbrk -layout "$file" > "$file.txt" 2>/dev/null

Open in new window


2) Then use a PERL script to extract all email addresses.

3) Then, in the same PERL script, loop through all the email addresses produced step #2, using either an MTA (EXIM, PostFix, Sendmail) or SWAKS + Mailgun to send my email.

Not overly complex code. Just take a while to write.
Bill PrewTest your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016

Commented:
Yes it's possible.

To answer the "how" question, I'd need to know more about your environment.  Windows?  Unix?  How do you send emails, Outlook?  SMTP server?  How can the email address be found in the pDF, is it preceded or followed by certain trigger text?  Would need you to upload an example PDF.  Etc, more details are needed to answer effectively...


»bp
Gordon HughesDirector

Author

Commented:
I have now purchased Visual cut and hopefully it will work
Bill PrewTest your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016

Commented:

Interesting tool, hope that works out well for you.

Gordon HughesDirector

Author

Commented:
I have purchased Visual cut to fix this
Bill PrewTest your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016

Commented:
Looks like an interesting product, and sounds like it could meet your needs nicely.

If you can, it would be great to post back here after you explore it with your feedback on how well it works out, for the benefit of future Experts Exchange members that might be looking for something similar and find this previous question on the site.

Good Luck!


»bp
Gordon HughesDirector

Author

Commented:
Hi
I have managed to burst and email a crystal report using Visual Cut
It would not work with my iCloud account as it did not allow me to set up all the smtp setting
However, it has worked with my gmail account by altering the security settings.
One issue i had was the the supplier would not let me use an evaluation copy, so had to purchase to start
Gordon
Director
Commented:
I have bought Visual Cut

Explore More ContentExplore courses, solutions, and other research materials related to this topic.