{"action":"created","issue":{"url":"https://api.github.com/repos/mileszs/wicked_pdf/issues/604","repository_url":"https://api.github.com/repos/mileszs/wicked_pdf","labels_url":"https://api.github.com/repos/mileszs/wicked_pdf/issues/604/labels{/name}","comments_url":"https://api.github.com/repos/mileszs/wicked_pdf/issues/604/comments","events_url":"https://api.github.com/repos/mileszs/wicked_pdf/issues/604/events","html_url":"https://github.com/mileszs/wicked_pdf/issues/604","id":199044087,"node_id":"MDU6SXNzdWUxOTkwNDQwODc=","number":604,"title":"HTML file renamed to PDF","user":{"login":"amerritt14","id":16766681,"node_id":"MDQ6VXNlcjE2NzY2Njgx","avatar_url":"https://avatars3.githubusercontent.com/u/16766681?v=4","gravatar_id":"","url":"https://api.github.com/users/amerritt14","html_url":"https://github.com/amerritt14","followers_url":"https://api.github.com/users/amerritt14/followers","following_url":"https://api.github.com/users/amerritt14/following{/other_user}","gists_url":"https://api.github.com/users/amerritt14/gists{/gist_id}","starred_url":"https://api.github.com/users/amerritt14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amerritt14/subscriptions","organizations_url":"https://api.github.com/users/amerritt14/orgs","repos_url":"https://api.github.com/users/amerritt14/repos","events_url":"https://api.github.com/users/amerritt14/events{/privacy}","received_events_url":"https://api.github.com/users/amerritt14/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-01-05T19:54:29Z","updated_at":"2018-08-15T07:48:04Z","closed_at":"2017-01-06T12:29:47Z","author_association":"NONE","body":"Problem Summary:\r\nFollowing the most basic example, my PDF's that are generated are displaying blank, and if I open them in a text editor it's displaying the full HTML code as if I chose \"view source\" on the webpage.\r\n\r\nGemfile\r\n```\r\ngem \"wicked_pdf\"\r\ngem \"wkhtmltopdf-binary\"\r\n```\r\n\r\nawards_controller.rb\r\n```\r\n...\r\ndef show\r\n    @award = Award.find(params[:id])\r\n    respond_to do |format|\r\n      format.html\r\n      format.pdf{\r\n        render pdf: @award.id\r\n      }\r\n    end\r\n  end\r\n...\r\n```\r\n\r\nshow.pdf.erb\r\n```\r\n<div>\r\n  Hello World from the SHOW method\r\n</div>\r\n```\r\n\r\nSpin up the server, navigate to localhost:3020/awards/1.pdf in both Chrome and Firefox shows an error of either \"Failed to load PDF document\" or \"This PDF document may not be displayed properly\". As I said, if I save the .pdf file and open it in a text editor it shows the html.\r\n\r\nwkhtmltopdf seems to be installed correctly because I can go into my terminal and use\r\n```\r\nwkhtmltopdf http://localhost:3020/awards award.pdf\r\n```\r\nLikewise from my rails console I can use\r\n```\r\nsystem \"wkhtmltopdf http://localhost:3020/awards award.pdf\"\r\n```\r\n\r\nAny suggestions are appreciated."},"comment":{"url":"https://api.github.com/repos/mileszs/wicked_pdf/issues/comments/413120908","html_url":"https://github.com/mileszs/wicked_pdf/issues/604#issuecomment-413120908","issue_url":"https://api.github.com/repos/mileszs/wicked_pdf/issues/604","id":413120908,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzEyMDkwOA==","user":{"login":"PirunSeng","id":12696293,"node_id":"MDQ6VXNlcjEyNjk2Mjkz","avatar_url":"https://avatars0.githubusercontent.com/u/12696293?v=4","gravatar_id":"","url":"https://api.github.com/users/PirunSeng","html_url":"https://github.com/PirunSeng","followers_url":"https://api.github.com/users/PirunSeng/followers","following_url":"https://api.github.com/users/PirunSeng/following{/other_user}","gists_url":"https://api.github.com/users/PirunSeng/gists{/gist_id}","starred_url":"https://api.github.com/users/PirunSeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PirunSeng/subscriptions","organizations_url":"https://api.github.com/users/PirunSeng/orgs","repos_url":"https://api.github.com/users/PirunSeng/repos","events_url":"https://api.github.com/users/PirunSeng/events{/privacy}","received_events_url":"https://api.github.com/users/PirunSeng/received_events","type":"User","site_admin":false},"created_at":"2018-08-15T07:48:04Z","updated_at":"2018-08-15T07:48:04Z","author_association":"NONE","body":"Restarting the server is just a temporarily fixed. However, I think the problem **failed to load PDF document** might be caused by something else. In my case, not sure if it is caused by the **file size** of the pdf file. My real example, I have 3 pdf files to be rendered. At the same time of deployment, there is only one of them randomly failed to load while the other two are always fine. I've checked file size of the one (~= 500KB) which is failed to load, and it appears that it is much bigger than the other two (<= 150KB). I'm concerning about the file size as I used to see somebody else mentioned about it, too. I'm still finding a permanent solution to fix such this issue."}}
{"actor":{"display_login":"PirunSeng"}}