Tuesday, 20 February 2018
  2 Replies
  1.6K Visits
I was having a problem when using PDF Embed with Joomla 3.8.5, specifically when I provide a link to a PDF which contains a query string (e.g. http://localhost:8080/getpdf.php?number=10) an error would occur in the PDF Embed viewer. The error message is "Stream must have data".

I was able to fix this by modifying pdf_embed.php with a line to urlencode the pdf location variable.

public function plg_pdfembed_replacer($ploc, $w, $h, $viewer)
$ploc = urlencode($ploc);
switch ($viewer)

FYI, the fix is in bold. I've only tested this with pdfjs viewer.
Hope this helps someone in the same situation.