Posted on 2013-12-16
Last Modified: 2013-12-17
We have used ghostscript (ps2pdf) and a2ps on both AIX and RH platforms for sometime and the resulting output works as expected on all desktop OS and clients, Windows, MAC and with various email clients, however, the same emails with PDF attachments cannot be viewed on mobile devices, iPad, iPhone, Android regardless of the email client. This is true even if the attachment is saved to the device and other office type, Adobe mobile applications are used to open it.

Generally, the error is The document cannot be opened because it is not a valid PDF document. Sometimes the document opens but no text is rendered.  In the process of trouble shooting we have discovered that the very same email attachments will open when forwarded from a desktop email client (i.e. Outlook) to an account and then accessed with mobile device.  This leads me to believe that the issue is with the original email attachment rather than the the actual file.

The file and transmission process is
1) Create a ASCII text report file on UNIX/LINUX server
2) Convert the file to PS with a2ps, text file with the a2ps options attached.
3) Convert the PS output to PDF (ghostscript ps2pdf)
4) uuencode the PDF file
5) Create the email with mail

Question by:gskortz
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
LVL 54

Expert Comment

by:Joe Winograd, EE MVE
ID: 39721984
This is a total hip-shot, but maybe the email clients on the mobile devices don't support the uuencoded file. You may want to try different encoding, perhaps MIME, which is ubiquitous these days and likely to be supported on the mobile email clients. But, again, this is just a guess...can't hurt to give it a try, though. Regards, Joe

Author Comment

ID: 39722613
Joe, thanks for the response. I tested using the AIX MIME encode (uuencode -m) and the results are different but not good. Instead of appears as an attachment to the file when using the uuencode -m option the BASE64 encoded text appears in the body of the email.

Since the the files are readable once forwarded from an email client, Outlook for example, I think this really is an Unix/Linux mail/sendmail issue specific lower level issue with "how" the attachments appear.
LVL 54

Expert Comment

by:Joe Winograd, EE MVE
ID: 39722638
But if it's a Unix/Linux mail/sendmail issue, why can all desktop operating systems with various email clients open them fine? You say it's only mobile operating systems (with any and all email clients) that can't open them – right?
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 39724854
The issue is the how the attachment is being handled by sendmail. Below is response from AIX technical support indicating not our problem.


The mail program on your mobile device is not extracting the uuencoded attachment from the mail body which contains the encoding related lines added by AIX sendmail. This is either a defect or a restriction in the mobile mail program you are using.

- AIX sendmail does not provide a different facility to send attachments. If you need more functionality you need to check for other mail programs to compose and send the mail.

- The mail command was not designed to handle the MIME encoded data to make it appear as an attachment to the mail client that is receiving it.

- In other words, the default mail command that ships with AIX is not capable of sending MIME encoded attachments. Therefore, you would need to download a 3rd party application, such as Alpine or Mutt. These are not supported IBM applications, but they should work.

Please let me know if you have any other questions.

Thank you for letting me know if you shall need further assistance on this service request or if I can go ahead and close it.
LVL 54

Accepted Solution

Joe Winograd, EE MVE earned 500 total points
ID: 39724916
Interesting that IBM recommends Alpine or Mutt. Here's a site with some other recommendations (one of them is Mutt):

I've had no experience with these, so can't offer any guidance, but it's certainly worthwhile for you to experiment with them. Regards, Joe

Author Comment

ID: 39724935
Thanks for the link I had previously looked at this site. I am going to experiment with mutt and see what happens.

Author Comment

ID: 39724988
I've requested that this question be closed as follows:

Accepted answer: 0 points for gskortz's comment #a39724935

for the following reason:

Appreciated the thought but not really a solution.
LVL 54

Expert Comment

by:Joe Winograd, EE MVE
ID: 39724961
You're welcome. Happy to try to help. Good luck with your experimentation. I hope you find that one of the encoding techniques works. Regards, Joe

Author Closing Comment

ID: 39724989
Appreciate the effort but really just suggest not a solution.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
youtube blocking politics 4 103
umask commands 5 15
File attachment in the SQL Database from application 10 47
How do I buy BitCoin? 4 27
A short article about a problem I had getting the GPS LocationListener working.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question