Display HTML file as PDF format in Google Drive viewer

I’m trying to protect my PDF files from being downloaded piece by piece. I discovered that even when I disable download and print options in Google Drive, users can still save the PDF page by page as images.

To work around this, I converted my PDF to HTML format using pdf2htmlEX tool. My plan was to upload the HTML version to Google Drive and have it display like a PDF document. However, when I try to open the HTML file in Drive, it just shows the raw HTML source code instead of rendering it properly.

Does anyone know how to make Google Drive display an HTML file as a formatted document rather than showing the code? Also, I’m open to other suggestions for sharing PDF content while preventing users from downloading it image by image.

Google Drive’s viewer doesn’t support HTML rendering - it just shows HTML files as plain text, which is why you’re seeing the source code. I ran into this same issue protecting training materials at my last job. Here’s the thing: any client-side protection can be bypassed by anyone who knows what they’re doing. We ended up using a document management system that required server-side authentication for each page request. For your case, I’d suggest embedding your content in something like Notion or using a dedicated document viewer service. Some companies go with watermarked PDFs and user tracking instead of trying to block downloads completely. Converting to HTML actually makes your content more vulnerable since people can easily grab the text from the page source.

totally agree, google drive isn’t great for html. GitHub Pages sounds good! you could also try using something like issuu for a more secure pdf experience.

Google Drive treats HTML files as text documents, so you’re seeing raw code instead of the actual page. There’s no way to change this in Drive’s viewer. I’ve run into similar issues with document protection before. HTML actually makes your content less secure - anyone can view the source code and grab your text easily. If you’re trying to stop people from screenshotting pages, try FlipHTML5 or Scribd instead. They’ve got better viewing controls and some screenshot protection. You could also host the HTML file on a simple web service and share that link, but determined users can still access everything through developer tools.