A major point of confusion with this module is that Views Data Export PDF displays default to "Provide as file" being unchecked, yet that option must be checked in order to get PDF output from the view at all. If it's left unchecked, the following happens:

  • If the export is batched: A "PDF" file is provided that's actually HTML, causing the browser to display an error that the file is corrupt when trying to display it.
  • If the export is not batched: An HTML page is displayed in the browser.

It seems like either:

  1. The intent of the "Provide as file" option from the Views Data Export module has been misunderstood (understandable, since the option is not straightforward to begin with); OR
  2. The option is being abused to provide site builders/developers a way to access the HTML output from the export that is normally fed into WkHtmlToPdf, so that developers can craft an appropriate stylesheet for the export.

If it's situation #1 above, then the appropriate fix is to remove logic from this module that depends on the option being checked so that it always exports in PDF format.

If it's situation #2 above, then the appropriate fix is to stop abusing the option by creating a separate option called "Render in HTML format for development purposes" or similar, that can be toggled on by developers when they need the ability to style the output.

Comments

GuyPaddock created an issue. See original summary.

guypaddock’s picture

Title: HTML is Generated Instead of PDF if "Provide as file" is Unchecked » UI/UX: HTML Output is Generated Instead of PDF Output if "Provide as file" is Unchecked
guypaddock’s picture

guypaddock’s picture

Assigned: guypaddock » Unassigned
guypaddock’s picture

Status: Needs review » Fixed

#3114202: Mega-patch - Re-factor of Views Data Export PDF to Fix Bugs and Improve UX, which contains a fix for this issue, has been committed to dev. Closing out.

Status: Fixed » Closed (fixed)

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