Unfortunately Replit recently removed their free plan and automatically unpublished my html2pdf app. This means the original URL is no longer working.
I don’t want to leave you all stranded, so if you want to continue generating HTML based PDF’s for free, you have 3 options:
1. Host the code yourself (e.g. on Replit, Render, Netlify, etc):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML to PDF</title>
<script src="https://cdn.tailwindcss.com"></script>
<script>
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}
function loadPdfContent() {
const pdfContent = getUrlParameter('PDF');
if (pdfContent) {
document.getElementById('content').innerHTML = pdfContent;
setTimeout(function () {
window.print();
}, 500); // 1000 milliseconds = 1 second
}
}
</script>
</head>
<body onload="loadPdfContent()">
<div id="content"></div>
</body>
</html>
2. Use one of the versions below:
Render (New Host): https://pdfwizard.onrender.com/?PDF=HTML
Netlify (New Host): https://pdfwizard.netlify.app?PDF=HTML
Replit (Same Host, Dev Link): https://81477b6b-70f9-464e-a644-cc79738b18fb-00-2dp7qyh8jyudg.worf.replit.dev/?PDF=HTML
3. Enrol in the Glide Document Masterclass (better methods):
If you’re looking for more robust, flexible and scalable methods of generating free HTML based PDFs, you can enrol in my Glide Document Masterclass by clicking here. Below is the trailer
Hi, tried putting the code directly on our website named the file ‘HTMLtoPDF.php’ but it is returning the error “Request-URI Too Long - The requested URL’s length exceeds the capacity limit for this server.”
Any ideas? Is it best hosted elsewhere?
Thanks.
URLs have a limit on how long they can be (imposed by browsers) so my guess is that you’re trying to convert a massive document? If not, it might be related to the php file? The example above is designed to be a html file (not sure if this matters in your case). Try convert something simple like <h1>hello</h1> and see what happens.
Interesting that they worked on the old instance but not when you self host… The code is literally the same. Have you tried option 1 with your docs? If both option 1 and 2 don’t work then it’s very odd because literally nothing changed besides the hosting provider, and that’s only affects option 1… If you’re using PHP then I assume you’re running a wordpress website… So your hosting provider or domain registrar may have weird limits imposed. Let me know how you go
I also just change a part to pdfwizard.netlify.app but most times isn’t work.
But before all was ok with this docs.
This night i have success with this new link, but now it became not work with my docs
I’m trying option 1, I don’t wanna waste time on self-hosing since for me this is just a backup option for only one app
It’s just that I assumed it would work if you host the same code with a different provider
@slscustom.ru@tuzin what happens if you try the link below? It’s the dev link of the old app hosted on replit. If it works, that may be a temporary fix…
I’m not sure how dev links work though… It may change or spin down after a while, so let me know how you go. This is essentially the exact same app as the original, just with a less pretty URL.
Thanks for this Marco, I have also found the new link is more fussy. 81477b6b-70f9-464e-a644-cc79738b18fb-00-2dp7qyh8jyudg.worf.replit.dev/?PDF works every time for me, and with some very large html too!
Woosh! Dodged a bullet here…thnx…I use that HTML2PDF site as well…but 81477b6b-70f9-464e-a644-cc79738b18fb-00-2dp7qyh8jyudg.worf.replit.dev/?PDF …also worked for me…
It seems to work for now with no issues… Hopefully Replit doesn’t change the URL of this app again! If they do I will update this post with any alternatives I find.