#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2005
    Location
    Nicosia,Cyprus
    Posts
    14
    Rep Power
    0

    Cfdocument Word to pdf missing text


    Hello All,
    I'm having a problem converting WORD files to PDF files.
    Sometimes in some .doc files after the conversion is done there is some text missing in the PDF. As far as I've noticed it's usually in the bottom of the page.

    Also there is a problem with the text overlapping the document's footer.

    After doing some research it turned out the problem existed since CF7 and there was a hotfix but for some reason the problem reappeared in CF8 and CF9.
    There is even an open bug report on Adobe without any solution.

    I'm posting some of the articles and posts I've found to help anyone not familiar with the problem understand it better.

    http://forums.adobe.com/thread/612724

    http://cfbugs.adobe.com/cfbugreport/...ml#bugId=82761

    So my questions are:
    1. is this bug really my problem or is anyone sure it's 100% fixed and i should look somewhere else for a solution.

    2.if the bug is not fixed then is there a way of converting Word files to PDF without the use of cfdocument?

    Thanks.
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,241
    Rep Power
    967
    CFDOCUMENT uses Apache POI to perform the conversion, so if there is a problem it would probably be in that library rather than CF itself. Generating PDFs can be tricky and almost all problems end up being related to the way the elements are styled or positioned. Is there anything unusual about the styling of this Word document? And are you using CF9 with the latest updates applied?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    131
    Rep Power
    6
    Originally Posted by Abnaxus
    the problem existed since CF7
    ... Also the ability to convert MS Word documents to pdf was only introduced in CF9 (and utilizes OpenOffice for the conversion ). So I have a feeling you are talking about converting HTML to pdf format, not MS Word. Can you clarify?
    Last edited by cfSearching; November 23rd, 2011 at 06:13 PM.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2011
    Posts
    13
    Rep Power
    0
    Sorry guys i had some forgot password issues and even thought i tried a couple of times it refuses to sent me a new one.
    so i created a new account.


    @cfSearching
    The only reason i mentioned 7 was the post in the forum i linked in my first post

    Since it was already fixed in MX 7.x, I would imagine it fixed in CF 9.
    i haven't used Coldfusion's previous version so i took the guys post as true.

    HTML to PDF works fine and I'm using it at another part of the same site.
    I am talking about straight Word to PDF conversion.


    @kiteless
    Well there are some tables,footers,headers in the word files.
    Since they are for a client i won't have any way of checking what they try to convert.
    Since i can't link to the client's files I'll try to create a word file to replicate the problem and post it here along with the pdf output.
    it's not easy since it doesn't happen in every word document they try to convert.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2011
    Posts
    13
    Rep Power
    0
    ok guys i've managed to reproduce the problem

    Original Word File
    w w w.mediafire.com/?m1t4se5dz1c67e6

    PDF output
    w w w.mediafire.com/?z36fi20ywfvkcw5

    It seems the problem occurs when you have a table inside the footer and a table in the content that stretches in more that one page.
    This cause some of the table content to disappear and sometimes the content table to overlap the footer table
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    131
    Rep Power
    6
    Originally Posted by Abnaxus78
    i haven't used Coldfusion's previous version so i took the guys post as true.
    It may be true, but my reason for asking was that cfdocument uses a different technology for html => pdf conversions than for ms word => pdf. The former uses adobe and iText libraries and the latter uses OpenOffice. So you are probably encountering a different issue altogether. Have you checked the OpenOffice site to see if this is a known OOO issue?
  12. #7
  13. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,241
    Rep Power
    967
    It's also totally possible that, given the more complex formatting in the Word document, you may just be running into a limitation of POI or iText. It obviously works well in most situations, but since these aren't Microsoft products and are essentially reverse-engineering the Word document, it wouldn't surprise me to find cases that will trip it up.

    Unfortunately, if you can't tweak the Word doc's formatting, the only other option would be to pull in the very latest versions of the POI and/or iText jars and try to manipulate them yourself. But it probably wouldn't be easy and will definitely give you a new perspective on just how much CF is doing under the hood to simplify interaction with those libraries.

    Either way you could also create a new issue in the CF bug tracker and include these two files, which might help the CF engineers see if they can come up with a solution that could be included in CF 10.

    Originally Posted by Abnaxus78
    ok guys i've managed to reproduce the problem

    Original Word File
    w w w.mediafire.com/?m1t4se5dz1c67e6

    PDF output
    w w w.mediafire.com/?z36fi20ywfvkcw5

    It seems the problem occurs when you have a table inside the footer and a table in the content that stretches in more that one page.
    This cause some of the table content to disappear and sometimes the content table to overlap the footer table
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    131
    Rep Power
    6
    Originally Posted by kiteless
    you may just be running into a limitation of POI or iText
    Actually CF uses OpenOffice for MS Word conversions, not POI.
  16. #9
  17. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,241
    Rep Power
    967
    Ah, right, I forgot that POI doesn't support Word very well for some reason (maybe the difficulty in getting it to work well in a range of situations).
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2011
    Posts
    13
    Rep Power
    0
    ok guys thanks for the replies.
    i knew it was gonna be hard to find a solution. it always is when a problem occurs only sometimes.
    and you're right since i don't have any access to the way the client will format the Word files then my hands are tight.

    Thanks for your help.
    I'll get back to you in case i manage to find a solution or a different way of doing what i want to do.
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2011
    Posts
    13
    Rep Power
    0
    Guys another question.
    Is there a way to make coldfusion run an application installed on the server in order to sent commands ( like command prompt commands) ?
    In other words can i run a different converter program through coldfusion and send to it some parameters?.
    ( source file,destination .etc) so that i get the same result as cfdocument?
    If there is such a capability then which program would you recommend i use?

    I've taken a look at http://w w w.verypdf.com/pdfcamp/convert-doc-pdf.html but i couldn't get it to work even straight from the command prompt since it kept telling me it's a trial version without giving me the opportunity to create a single file in order to see if the output is correct
  22. #12
  23. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,241
    Rep Power
    967
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    131
    Rep Power
    6
    Originally Posted by Abnaxus78
    i knew it was gonna be hard to find a solution.
    Checking the CF bug database first is always a good idea. But afaik, CF just passes the Word conversion request off to OpenOffice. Since it is an external program, you are far more likely to find issues/patches/updates on the OpenOffice site itself.
    Last edited by cfSearching; November 30th, 2011 at 08:25 PM.

IMN logo majestic logo threadwatch logo seochat tools logo