Hello,
First of all, thank you very much for working on this useful module.
As I am a novice, I will try to describe what seems pertinent to my problem. I am able to generate and download pdfs from my site (i.e. Results/download pdf/Download PDF) yet emailed pdfs, though received as attachments cannot be opened. I receive the following error from Acrobat:
"Acrobat could not open 'webform_submission-66--11.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded). To create an Adobe PDF document, go to the source application. Then print the document to Adobe PDF"

The emailed file is also 13KB larger than the one downloaded from the site. In addition the attached pdf has always the same filename: "webform_submission-66-.pdf" while the form that can be downloaded from the site has an additional piece: "webform_submission-66-14.pdf", 14 indicating the number in the sequence of submitted webforms and thus that number varies depending on which webform in the sequence is downloaded as a pdf.

Searching through the list of posts, the one that comes closest to my problem seems by Rob (eggersrj on September 20, 2009) who mentioned the attachment of a binary file containing gibberish.
This is one line from the file when I opened it with the text editor in my terminal:VBERi0xLjYKNyAwIG9iago8PCAvVHlwZSAvUGFnZSAvUGFyZW50IDEgMCBSIC9MYXN0TW9kaWZp
That said, I am not using the smtp module he refers to.
Thank you very much in advance for your assistance.
JS

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mr.york’s picture

Status: Active » Needs review
FileSize
2.62 KB
pierog1971’s picture

Thank you for your response, but something doesn't quite work.
It might be me or a typo in the patch. I do not code. Thus I would assume it is me.
I get the following message trying to patch from within the webform2pdf directory using the
patch < webform2pdf-951324-1.patch command.

patch: **** malformed patch at line 24: @@ -1509,7 +1530,12 @@ function _webform2pdf_get_submissions($n

Regards
JS

ShawnB’s picture

I also received the same malformed patch error. After updating the module manually, though, I can confirm that the changes work.

pierog1971’s picture

Shawn,
Forgive my ignorance but by "updating manually" I assume, you copied and pasted the patch code into the webform2pdf.module, correct? If correct, would you mind telling me explicitly where to insert it? To a novice like me they look like separate files which must obviously connect somewhere.

As far as the malformation is concerned, I wonder about the possibility of a parenthesis or more missing after ($n But then again, you got it to work.

Below is the line in question:
/**
* Overview form of all components for this webform.
@@ -1509,7 +1530,12 @@ function _webform2pdf_get_submissions($n
} // function _webform2pdf_get_submissions()

Thank you for the help
Regards,
JS

mr.york’s picture

FileSize
2.63 KB

Sorry, next patch.

mr.york’s picture

Status: Needs review » Fixed
pierog1971’s picture

Thank you very much! It did the job. Only, if you have the time, would you mind explaining what the problem was that lead to the particular error?

I will continue testing the module's possibilities as I would like to use it for research purposes.
Köszönöm,
JS

mr.york’s picture

Szívesen!
The error was that an '\' character was missing before 'n', that's why it outputted 'n' chars instead of writing in a new line ('\n'). Mail clients can't handle these long lines correctly. The rest of the patch is only some makeup :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Evangeline93’s picture

Version: 6.x-2.x-dev » 7.x-3.0
Priority: Normal » Major
Status: Closed (fixed) » Active

Hello,

I am having the same problem, only in drupal 7. I am confused about how to implement the patch and if I should even use this patch on the drupal 7 version of the module.

Thank you!

Jennifer

Evangeline93’s picture

Priority: Major » Critical

Can anyone help, please? I have a client waiting on this.

Jennifer

Evangeline93’s picture

Will anyone help in this? This is getting ridiculous. I understand that people are helping for free on here, but nobody can even respond with one sentence? Even to say that they don't know the answer? My clients are willing to pay a bit to get this working. I am depending on this module to make my client's form work the way they need it to work. If this module is not going to work, I would appreciate some suggestions on where to find one that will. I am finding that the Drupal community is very slow and very rarely is there an answer to anything. Very frustrating and I hope I don't need to manage another Drupal site anytime soon because this experience is painful and makes me look bad to my client because it is taking forever to get any answers, if I get one at all. At least write something, please.

Evangeline93’s picture

Issue summary: View changes
donaldp’s picture

Evangeline. You have been adding information to a thread that was closed 3 years ago and related to a Drupal 6 version of the module. It is very unlikely that your problem is related to this issue. As far as I can see the patches provided with this issue are built into the Drupal 7 version.

I have recently been working on a similar issue where emailed PDFs will not open. This occurs only when the PDF being emailed is greater than about 7MBytes in size and the system is configured to only send plain text emails (Not HTML). I suspect that the problem is caused by a core Drupal function: drupal_html_to_text() which appears to be truncating MIME encoded data larger than 10MBytes. I am still investigating this but the workaround is to allow your system to send emails including HMTL.

Evangeline93’s picture

Hi donaldp,

Thank you for your email. I was under the impression that new threads are not supposed to be created if a discussion on the subject is already started, so I joined this one. Thank you for explaining that I needed to post else where.

As for the PDFs, I will have a very small form (6 inputs - no uploaded files - and a signature) and I will still get the error.

Thank you for responding. I truly understand if you don't have time, I am just getting frustrated that all of the modules that have had issues have seemingly dead forums. I know you are doing this for free and I don't want to rush you since you probably have other work. My clients have been waiting for a couple months now because of modules that aren't working, so I am getting a bit frustrated that at every corner there is a problem with the modules and often the modules that those other modules depend on.

Thank you for your time and I will see if enabling HTML emails will help!

Jennifer

Evangeline93’s picture

Donaldp,

Could you please tell me where I need to enable the HTML emails? I went in the PDF module configuration and selected "Full HTML," but I am still having the issue. I think I enabled it in the wrong area. I am completely new to Drupal, so if you can guide me to where I need to enable the HTML emails, that would help me greatly! Thank you for your time!

Jennifer

donaldp’s picture

Jennifer
The problem I'm describing is only a factor if the created PDF is greater than about 7MBytes. If you click on one of the downloadpdf links on the results tab of your webform can you open or save the PDF document? If so what is it's size. It would be unusual for the PDF to be that large. If it's smaller than that then my problem will not be the same problem as yours and enabling HTML emails will have no effect.
If you can confirm the size of your PDFs I can let you know how I tested and got around the problem.

Evangeline93’s picture

Hello,

When I get mine in an email, I try to download it and shows that it is 0 bytes in size in the download window. :-(

I can download it and save it on my computer, but when trying to open it at any point, I get a nasty error saying that it won't open.

Thank you,

Jennifer

donaldp’s picture

Hi Jennifer
As your PDF is 0 bytes long it does not sould like your problem is related to what I experienced. Without more information about what you are trying to do I'm afraid I can't be of any further help other than to suggest that you check that you have your PHP environment setup to report warnings and errors that you might be missing.
Also check the version of the TCPDF library you have installed and check that any relevant patches for webform2pdf have been installed. There are a number of issues related to later versions of the TCPDF library that can be helped by these patches.

The problem I had was caused by the PHP class DOMDocument. The loadHTML() function in this appears to have a limit to the size of the doument it can load. It appears to just truncate without warning anything larger than this. This is called by the Drupal function drupal_html_to_text() function. Webform2pdf could probably be improved by not attaching the PDF as part of the 'body' section of the email to avoid it getting parsed by the html to text function but I've not looked into this in any detail.

mr.york’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)
Evangeline93’s picture

Hello mr.york,

What information is still needed? I cannot give more information than I have already given unless I am directed with some sort of questions.

Please let me know what is needed and I will supply information,

Jennifer

Evangeline93’s picture

Hi donaldp,

I will work on those suggestions. if I have more questions, I will ask. As I am very new to Drupal, a lot of this is Greek to me.

Thank you!

Jennifer

mr.york’s picture

What version of PHP, webform2pdf and tcpd are you using?

mr.york’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
amanaplan’s picture

webdev100’s picture

Hi,

I read the above discussion to the problem. I did not see the solusion.

I am having the similar issue. If someone can help, i will really appreciate it.

Installed modules:

7.x-1.0-beta1 TCPDF , 7.x-4.2 WEBFORM , 7.x-4.x-dev WEBFORM2PDF.

After I submit the webform, I get email with the pdf file attached but the file is 0 bytes. I cant open the file. If you can help me how to attach the valid pdf file to email, i will really appreciate it. I have done lot of google search and saying patching is only option. I am not sure on that.

Error message :

'Adobe reader could not open the file because it is either not a supported file or the file has been damaged'

I have spent so much time on creating the form, styling the form. Now, I am just stuck with the above error.

Can you please help?

Thanks.