Issue Emailing Certain PDFs

I have a program that dynamically creates a pdf report in iText and saves it to a folder, where an email is generated with the PDF as an attachment. I have attempted this using both javamail and the commons email from apache, and sometimes it works fine, but sometimes the email just never goes out. In both situations, the file is successfully created (can see it and open it on the local file system) and in both situations all the code is executed, confirmed via print statements. To make matters worse, no errors show up in any logs, not the service I am executing's logs, or the Windows logs on any machien associated with the process.
Has anyone seen this behavior? Either scenarios that might cause this or some method of generating an error would be helpful.
Thanks in advance.

Nope... there is kind of too much code to post, but the class that actually send the email is shown below (ASCIIEmail is an object I wrote... I confirmed the values of each that I am using):
public class EmailDriver
     private static Log myLog = LogFactory.getLog(EmailDriver.class);
     public void sendASCIIEmail(ASCIIEmail email)
          try
               MultiPartEmail sEmail = new MultiPartEmail();
               sEmail.setHostName(email.getHostName());
               sEmail.setFrom(email.getFromEmail().getEmailAddress(), email.getFromEmail().getEmailName());
               for(int i = 0; i < email.getToSize(); i++)
                    sEmail.addTo(email.getTo(i).getEmailAddress(), email.getTo(i).getEmailName());
               for(int i = 0; i < email.getCCSize(); i++)
                    sEmail.addTo(email.getCC(i).getEmailAddress(), email.getCC(i).getEmailName());
               for(int i = 0; i < email.getBCCSize(); i++)
                    sEmail.addTo(email.getBCC(i).getEmailAddress(), email.getBCC(i).getEmailName());
               sEmail.setSubject(email.getSubject());
               sEmail.setMsg(email.getMessage());
               if(email.getAttachmentPath() != null)
                    EmailAttachment attachment = new EmailAttachment();
                    attachment.setPath(email.getAttachmentPath());
                    attachment.setDisposition(EmailAttachment.ATTACHMENT);
                    sEmail.attach(attachment);
               sEmail.send();
          catch(Exception e)
               myLog.error("Failed to send email: " + ExceptionStackPrinter.getStackTrace(e));
}In addition, if I comment out the attachment section it will always send the appropriate emails, and if I try using any illegal commands in here, it logs correctly using the apache log4j.
The part that is extremely confusing is it appears to depend on what I actually put in the pdf file, but I have never failed to actually generate the pdf file. I can always see it on the file system. My best guess is something is probably being formatted differently depending on the pdf content, but without finding any errors anywhere, I have been unable to ascertain exactly what the issue is.

Similar Messages

  • I have an issue with some PDF documents   some MS Office documents, notably MS Word when received in eMail as attachments not displaying on iPhones, iPad 2s

    Hi,
    I have an issue with some PDF documents & some MS Office documents, notably MS Word when received in eMail as attachments not displaying properly on iPhones, iPad 2s & new iPads?
    PDF docs - areas of the doc only show as grey splotches regardles of viewer
    MS Word Docs -
    inserted graphics don't display at all,
    tables & lists especially with borders are broken &
    tables & lists missing the borders &
    tables & lists missing the 1st 1-2 lines of the lists/tables.
    This is replicated on iPhone 4s, iPhone 4Ss, iPad 2s, iPad new (x2)
    It certainly happens in iOS 5.1.1 & iOS 5.1
    We believe it all worked aok in iOS 5.0.1(?) & prior
    There is no problems reading/seeing these PDF & Word docs on anything other than iDevices.
    This is rather critical for us & if not quickly fixed/rectified will prevent us from further purchases of these devices
    Rolling back to iOS 5.0.1 or prior I believe isn't possible because of the BaseBand update(?) & isn't much of an option because of the quite noticeable Battery/Charging/WiFi improvements in 5.1 & 5.1.1

    Hi,
    I logged a call with AppleCare & have since had explained why this occurs (some time ago)
    I'll try to explain what was indicated to me.
    iOS has a limited Font Set & this affects what PDFs can display. You need to use iOS supported fonts in your PDFs to see/read them properly  
    These supported fonts are indicated here => http://support.apple.com/kb/HT4980
    Regards MS office docs, iOS doesn't have much of an API to work with MS Office documents at all so is stuck with 3rd Party Apps to try to do it.
    Unfortunately Mail in/on iOS uses the API to attempt to open/use MS Office attachments unless you tell it to use an App to open the attachment.
    I have had success opening & reading MS office docs now with CloudOn, but find it slow & very awkward to use.
    Not too sure if this helps others, but at least it explains why this is occurring

  • I have an iphone 4. Recently I have issues with certain apps closing immediately once they are open. ie Email. Tried re-booting entire thing and still having issues. Any one else having this issue or a fix for it?

    I have an iphone 4. Recently I have issues with certain apps closing immediately once they are opened.(ie Email). Tried re-booting entire phone and still having issues. Any one else having this issue or know a fix for it?

    Delete background Apps from memory and then Reset.
    To Delete background Apps, double click Home button, in the bar at bottom, hold down on an App Icon until the minus sign appears, tap all the minus signs, until all background Apps are cleared from memory. Then Reset, hold both Home and Power buttons until the iPhone begins to restart itself, ignor the 'slide to power off' let the iPhone restart itself. Usually takes about 10 seconds of holding both buttons.

  • Preview (copy text) results in SQUIGGLES not text for certain PDFs

    hi - problem is "copy text and paste from certain PDFs result in squiggles
    When i use an online converter service (e.g. http://ebook.online-convert.com/convert-to-pdf) to convert files to PDF, Apple Preview does not work properly.
    What happens is, when I view this PDF and highlight the text to copy in Apple Preview (snowleapard 10.6.x), and then paste the text say in an email / text file or word doc ---- i get squiggles NOT text.
    However, if I view this same PDF in Adobe Pro, I get text (copy text and paste works)
    I can also view this same PDF in my iphone app, Goodreader, and "copy text and paste) to email works e.g.  I get text.
    Interestingly, if I create the PDF NOT from this online service, but say from Adobe PRO, Apple PReview works (e.g. I copy and paste the text no issue)
    is this a known bug of Apple Preview or is there some setting i must change somewhere?
    the support/developer dude of the online service keeps telling me its an Apple Preview problem, not a problem of his service.....
    thankyou in advance for your help.

    An example is [here|http://www.fs.usda.gov/Internet/FSE_DOCUMENTS/stelprdb5227378.pdf] on pages 31-36. Preview shows blank gridlines,
    I tried downloading the pdf file at that link, and in my system Preview displays those pages properly:
    You might try running the [OS X v10.6.6 combo update|http://support.apple.com/kb/DL1349] - it contains some updated Preview components which might include something that is currently missing in your system.

  • "Error - Printing" for only certain PDFs to certain printers with Reader 10.1.3

    One of my users is unable to print specific PDF files to a particular printer.  The same PDFs will print to other printers successfully from the Windows 7 machine.  But, for certain PDF files the printer queue will show status = "Error - Printing".  We have tried to print as image, saved the PDFs as different filenames but it still fails.  There seems to be no pattern for the PDF types.  One PDF is a scanned document and another is not scanned.  The machine is able to print most other PDF files just fine to this printer and can print successfully from all other applications except for Reader 10.1.3 for these certain PDF files.  The printer driver has been updated to the latest.  The printer is a Xerox DocuCenter-IV 2060.  AR 10.1.3 has been re-installed.
    The PDF files in question open fine and can be viewed in their entirety (i.e. they don't appear to be corrupt).  The fonts used are not any different from others used in PDFs that DO print ok.  This is a complete mystery so, if anyone has ideas, please pass them along.  Thanks so much

    This is a public forum; please do not post your email address or other private information.
    Regarding your issue; it appears you have already tried everything possible - I have no other ideas what to try with 10.1.3.
    The only solution for now I can see is to revert back to 9.5.1; is this a problem for you?  This should be only temporarily until a new version of 10.x or 11.x becomes available.

  • I get an error when trying to open certain PDF files in Lion on Mac.

    I am having trouble opening CERTAIN .PDF files on my MacBook Pro. I am running Lion. The file is attached to a Gmail message as a standard .PDF file.
    This is my error:
    "File "XX" cannot be opened. It may be damaged or use a file format Preview does not recognize."
    I have also downloaded Adobe X reader to see if the compatibility issue is just with Preview. I get an error that the file is "damaged" and cannot be recovered. Meanwhile, the file downloads/opens just fine on Windows XP Office and iOS (on my iPad). So I am thinking that it must be some sort of compatibility issue with Lion.
    So far, other .PDF files open on my MB Pro. I haven't tried all of my saved .PDF files, but I did try a couple.
    Anybody have any suggestions? There seems to be an error with this particular file opening in Lion, but not with the same file opening on another operating system.

    The issue mysteriously resolved itself. I shut down the computer, and the next day I booted back up and tried to open the same file, and everything was OK. Very bizarre, since I had opened it previously on this same MacBook. Anyway, anyone have any insight into what happened?

  • Convert email to PDF

    Version: Adobe Acrobat 9 Standard
    Using: Microsoft Outlook 2007
    Feature: Convert to Adobe PDF
    Issue: Unable to convert encrypted emails to PDF Portfolio.  I can open the encrypted email and convert it to PDF (single email to single PDF).  However, I cannot select multiple emails in a folder (i.e., Inbox), some encrypted/some not encrypted, or all encrypted, and then convert to PDF (portfolio PDF).  I can select multiple emails that are not encrypted and convert them to a portfolio PDF just fine.  It is the encrypted emails that are failing.
    Does anyone have a solution, a setting that must be changed, or a process that must be followed to make this work?
    Thank you in advance.
    Chris Kiel

    https://itunes.apple.com/gb/app/pdf-print-driver-for-ipad/id585512317?mt=8&affId =1285982&ign-mpt=uo%3D4
    First Install this app
    After installation, click to open this app
    Virtual Printer will OFF by default, tab to ON it
    Please do not turn on Wi-Fi Drive, this causes app hang sometimes
    Now open Mail or webpage & click to print, it’ll get printed into PDF via Virtual PDF Printer

  • No longer able to print emails to pdf

    Mysteriously, my Acrobat 9 Pro Extended will no longer allow me to print emails to pdfs. It used to do so. Now, when I try to print an email to pdf, I receive an error: invalidfont; offendingCommand; xshow.
    I used the built in "repair" function and reloading the software, both to no avail.
    Anyone know what the glitch might be?

    Hey beaswing,
    Thanks for the question. I understand that you are experiencing issues printing in OS X. The following resource outlines some great troubleshooting steps that may help your issue, including resetting the printing system and re-downloading drivers:
    Troubleshooting printer issues in OS X
    http://support.apple.com/kb/TS3147
    Thanks,
    Matt M.

  • I emailed a PDF form and when the receiver opens it, the document has errors on it. How do I fix this problem?

    I emailed a PDF file and when the receiver opened it there were errors in the file. Words on the document appeared different and weren't what they were supposed to be. How do I fix this problem?

    What did the errors say? Can you post a copy of the pdf so we can test out. The presets embed the font, but might be a unicode issue, or one of the few fonts which are copyrighted and do not allow embedding.
    What application was the pdf was created from, what settings were used, and if you can outline the fonts. What font or font(s) are the ones reflowing?

  • Trouble saving certain pdfs with Adobe x

    I have just upgraded to Adobe x and am now unable to save certain pdfs (eg journal articles). They are not protected files and I was able to do this with the previous version. Same issue as previously asked and also running Windows 7:
    "I am unable to save copies ofcertain pdfs in Reader X (10.1.1). The pdf (from an academic journal) opens without problem but when I click on the Save a copy icon in the tool bar nothing happens.  I'm told to click Shift+Ctrl+S and then get a "Bad Parameter " message.  If I click on the Print icon there is no problem.  I'm running Windows 7"
    Help would be great - needing to get study done!!
    Thanks
    Kelly

    After installing Reader 10 (aka Reader X), I had exact same problem --trying to save multiple documents via Firefox browser (up-to-date version 3.6.13), only first document can be saved -- attempts to save 2nd document results in nothing happening.  Uninstalled and reinstalled Reader 10, problem same.  After closing browser, waiting a couple of minutes, could then save 2nd file -- but then could not save 3rd file right away, etc.   Gave up -- uninstalled Reader 10 and went back to Reader 9.4 -- no problems with old version.  Based on other comments on this forum, it seems like Reader 10 is not ready for prime time.

  • Converting Outlook 2007 email to PDF; Have to reboot PC to convert multiple times

    I have an end user who converts multiple emails to PDF for filing purposes. Adobe converts multiple emails in a portfolio style. Email can be seen as in a file at the top and seen seperately ebelow. After 2-3 times Adobe won't convert to portfolio format, won't give error message, but will convert all selected email as one large PDF. Until user reboots machine, portfolios can't be created.  Tried on two different machines same issue. Using Adobe 9 Pro and Outlook 2007.

    Is Acrobat updated to 9.5.2?  What SP do you have installed for Office 2007?  What version of Windows (with SP) is running on these computers?

  • White lines appearing on certain PDF's???

    Certain PDF's when opened in Acrobat Pro 9 are appearing with white lines to the right and the bottom of the document.  However these lines do not exist when opened in other programs or other computers with Acrobat 9.  Also these lines never print.  Does anyone else have this issue or any possible solutions?  Thanks.

    It is best not to Flatten in InDesign, but to Flatten on the RIP (Raster Image Processor), that can only be done when you PDF as Acrobat 4 (or Print). Adobe recommends that your print shop handle flattening.
    No, you can not take an already flattened file and un-flatten it. Sorry. When flattening occurs, the entire page is divided into rectangular chunks for the output device, causing the white lines to appear where these rectangles intersect. They can not be re-assembled into the original components.
    Creating PostScript is what causes these lines. No PostScript device can natively handle un-flattened files. Only the PDF Print Engine (on newer devices) handles un-flattened transparency. Your print shop may or may not have upgraded to the newest technology.
    This document gives a thorough overview of Transparency:
    http://www.adobe.com/designcenter/creativesuite/articles/cs3ip_printprodtrans.pdf

  • Broadcast Email to PDF output format

    Hi All,
    We are using the standard web template (0ANALYSIS_PATTERN) to broadcast email for PDF output format. I'm managed to received the PDF attachment email but however instead of one query, it contains duplication of the same query (repeated query) in the PDF file. We are also using the standard 0QUERY_TEMPLATE_BROADCAST_PDF web template.
    Has anyone experience this issue before and what is the solution for this?

    Hi All,
    We are using the standard web template (0ANALYSIS_PATTERN) to broadcast email for PDF output format. I'm managed to received the PDF attachment email but however instead of one query, it contains duplication of the same query (repeated query) in the PDF file. We are also using the standard 0QUERY_TEMPLATE_BROADCAST_PDF web template.
    Has anyone experience this issue before and what is the solution for this?

  • Thunderbird seems to corrupt / damage certain PDF files

    Lately I have experienced trouble with receiving certain PDF files. (I say certain because it does not happen to all PDF files I have received).
    I can download and save them normally but they will not open and simply say they are corrupt and unrepairable. After some testing I pinpointed it to being an issue with Thunderbird as an e-mail with a pdf file could be opened on other e-mail accounts but the file still showed up as corrupt on thunderbird.
    Steps in which the issue occurs:
    > Receiving an e-mail with a PDF file
    > opening and/or saving the file
    Result:
    > Damaged/Corrupt file
    Expected result:
    > The correct and working PDF File.

    Open Tools/Options/Advanced/General/Config. editor and paste mail.server.default.fetch_by_chunks into the Search box. If the value is true, double-click it to make it false, and see if that makes any difference.

  • HP Laserjet pro P1606 wont print certain pdf documents

    My HP laserjet P1606 won't print certain pdf docs.  It's connected via USB to my imac (OS 10.7.5; Adobe Reader 9.5.5). My wireless HP Photosmart 6520 has no problem printing my pdf docs.   Not sure why some pdf's are able to print on the P1606 and others can't.  Any solutions?
    This question was solved.
    View Solution.

    Hi @JL_MAC, 
    I understand that you aren't able to print all the PDF documents from the HP Laserjet P1606dn, but the Photosmart 6520 can. I can help you with this.
    Run all the Adobe Reader updates to see if that helps. The latest version is 11.0.
    It might be a issue with the printer language.
    The Laserjet P1606dn printer is hostbased and the Photosmart 6520 printer language is PCL3 GUI.
    Hope this helps.
    Have a nice day!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

Maybe you are looking for

  • Employee as vendor - PRAA

    Hi We have a rek to create vendor from Employee..which is taken care by PRAA..which is good.. But its creating the Batch input Session everytime we try to create the vendor/vendors... My question is ..Is there any way that we can directly create the

  • Question About Ship-To-Party from SAP ECC.

    Hello, In SAP ECC I have 2 Account Groups: 1. For Customers 2. For Ship-To-Party. My Question is: When I download the Customers from ECC to CRM I specify in PIDE both Account Groups. Is the relationship created during the download or it must be creat

  • Photoshop Elements 7.0 will not open

    I have Photoshop Elements 7.0. All of a sudden it will not open. I can find the program in my system, when I click on it, I can see it try to open, but then nothing happens and it disappears. Please help!

  • Where is the batchusr.sql location???

    dear all, where is the location of batchusr.sql actually ???? i've searched on my db and oas home, even in oas installer : discoverer\utils directory, but still not found. there are any other source location to find it ??? this is the first time i tr

  • Use of Optional Packages

    Hello, I would like to know if there is any way to include in my application an optional package just in case the device does not have it in its Runtime Environment. What I was thinking is more like including all the classes from a jar file (e.g j2me