This is an archived forum post. The information may be outdated. Contact us if you have any questions.

PDF has active hyperlinks but text is invisible

cyrilg wrote on 2016-08-25:
I use node.js and the rest API to generate Pdf from HTML using the following code:

  var newpdf = {};
  newpdf.src = '<a href="https://www.google.com">Google</a>';
  newpdf.username = 'cyrilg';
  newpdf.key = "635************************ba";
  newpdf.pdfcrowd_logo=true;
  var options = { 
    method: 'POST',
    url: 'https://pdfcrowd.com/api/pdf/convert/html/',
    headers:{ 'content-type': 'application/x-www-form-urlencoded' },
    form: newpdf 
  };
  request(options,function (error, response, body){
    console.log(error);
    //console.log(body);
    res.setHeader('Content-disposition', 'attachment; filename=file.pdf');
    res.setHeader('Content-type', 'application/pdf');
    res.charset = 'UTF-8';
    res.write(body);
    res.end();
    
  });


The Pdf I get back from the API is totally blank but the hyperlinks seem to be active. If you hover on the top left corner of the pdf attached, there is an active link to Google and if you hover on the bottom right, you get the hyperlink to pdfcrowd as I use the parameter pdfcrowd_logo = true. The same problem occurs if I generate a pdf from a url.
Am I missing a parameter to display the text?

Thanks!
support wrote on 2016-08-30:
Hello,

The problem seems to be caused by the fact that newpdf.src is not urlencoded.
Hope this helps.