Handling PDFs that exceed 10 MB

Username (e.g. epiz_XXX) or Website URL

sfl-w3.epizy.com

Error Message

Not applicable.

Other Information

My website is for a small book club that, among other things, publishes a fanzine in PDF format. For each issue of the fanzine, I give them a link that they can click so that they can view the fanzine in Adobe Acrobat or whatever.

My problem is that some of the individual PDFs exceed 10 MB in size so as soon as I upload them to the server, they get deleted, exactly as the FAQ warns. Okay, you obviously have these rules for a reason and I assume you are not going to make an exception for my larger PDFs (the biggest of which is just over 15 MB). What CAN I do to solve this problem? What do other sites at InfinityFree do when they have files that exceed 10 MB?

I am reluctant to split the PDFs into smaller PDFs as it complicates reading and printing them. I’m dubious about them compressing very much and I’m not keen on compressing them anyway because then the user has to uncompress them and can’t simply read or print them. Has anyone found a good and convenient way to handle a PDF that exceeds the 10 MB limit?

You cant disable the file size limit because it will lead to abuse problems.

In your case, you should consider optimizing the PDFs at their maximum. You can optimize images without ruining the quality using tools.

It is also advisable to have a code in which the splitted PDFs can be merged into one PDF.

1 Like

Hello there,

You should consider hosting your PDF files on 3rd party Cloud services like Google Drive. I do recommend you to do this instead of hosting your PDFs directly here which the free servers were not designed for PDF file hostings.

3 Likes

You can use this code to embed pdf file onto your website from google drive url:

<iframe src="/googledrive-link/example.pdf" width="100%" height="500px">
    </iframe>

But if you use this code, the PDF gets downloaded automatically by Chrome/Browser and opened in an external browser. This stuff or instead of just pdf viewer, not downloading was changed since 2012.

There is also an online tool which you can download and use it to make an embeding-pdf.
PDF.js or Flowpaper

I’m fine with optimizing the images and have already requested the files so that I can do that but until I’ve actually done the optimizing, I’m not 100% sure they will give me a sufficient size reduction that I can put the revised PDF on the server.

You also suggest having code to split and merge PDFs. Are you aware of any programs/utilities that do that? If so, can you point me to them, preferably free ones since I have no budget for software acquisition.

Thanks for the suggestion. I have a Google Drive and would be happy to use it for this purpose, as long as it has sufficient room for the files. (I’m not sure what the capacity is but will look into it.)

Thank you for the suggestion and code sample. Unfortunately, when I try doing what you’ve suggested, I get this message: Blocked by X-Frame-Options Policy. After a bit of research, I found that this is discussed in Mozilla’s Bugzilla on this page:

Strangely, Mozilla declared the bug resolved and closed 8 months ago, even though many people have tried to re-open the bug as recently as two weeks because it clearly HASN’T been resolved.

Are you using this technique? If so, how do YOU get around the Mozilla bug?

1 Like

Can you try this one?

<object data="myfile.pdf" type="application/pdf" width="100%" height="100%">
  <a href="/googledrive/myfile.pdf"></a>
</object>

Well, I found this tool use to split large pdf files into separated files, it is a paid version but there is a trial version for it.

I can recommend you FPDF, a free, open-source tool written in pure PHP.

Link: http://www.fpdf.org/en/script/script94.php

1 Like

It’s not working but I think it’s because I’m specifying the hrefs incorrectly.

I went into my Google Drive, created a folder named sfl and a subfolder named pdf and copied one of my PDFs, SideTrekkedIssue51.pdf into the pdf folder. Then I clicked on the PDF and got a link. I assume that link it is a full path to the file, although it differs from the URL I am seeing in my browser. This is the link:
https://drive.google.com/file/d/1au2rZV_RmA7IQA7fquYhu7oiFPaArmMM/view?usp=sharing

That’s what I put in both the data parameter of the object tag and the href of the a tag. When I display the page containing the object tag, I get a large window containing the source code of the web page that contains the object tag, NOT the PDF!

Then I changed things and tried again. I left the a tag pointing at the long link and put SideTrekkedIssue51.pdf in the data attribute of the object tag. When I displayed the page containing the object tag, I got a window pointing at the InfinityFree 404 error page.

Clearly neither of those two worked correctly so what do I need to do?

This is an .php file and not a pdf file.

It should have .pdf file extension to embed instead of that .php

You must completely embed an .pdf file (like those kind of .pdf file that we see or read) and not a php script so that it will work, and then try again the first thing that you do (the one that you get a large window) but you must put or change the link with the extension .pdf, not the .php.

Try to split it in parts, but InifnityFree doesn’t intend that you upload files on your site so try to use YouTube for videos and Mediafire for uploads

Yes, I know that and have specified a .pdf file extension; that’s why I’m so surprised to see the PHP file instead of the PDF!

I mean, that you can’t use you website as a file uploaded!

If you want to upload more, try to use premium hosting IFastnet.com

It turns out that I found an easier solution to my problem! I googled for PDF splitter programs and found one that also offered compression. I was originally skeptical about PDFs compressing - I’d heard they don’t compress well - but I decided to try and was VERY pleasantly surprised to find that they compressed the files very well. Now they are much smaller than 10 MB so there won’t be any problem storing them right on Infinity Free. Now I don’t have to use external file storage at all.

Even better, the compressed PDF displays just as well and just as easily as the uncompressed PDF and seems to be identical in quality.

I expect that there are several PDF compression utilities but the one I used seems to be free and does a good job. It’s at https://www.ilovepdf.com.

Thanks to EVERYONE who helped with suggestions!

3 Likes

You’re welcome!

Pls be aware that InfinityFree doesnt want to host file sharing site within your website’s resources, so please put the PDF’s on any cloud storages. BTW, your welcome.