4

I created a massive (7GB) PDF in R, and now every computer/program combination I try and open it with craps out. I'm not even sure why as the entire file fits easily in RAM on more than one of the machines I used.

I've tried Adobe Reader on Windows and OS X, and also QuickLook and Preview on os x; this was on machines with up to 16GB ram apiece, but every time the OS or application just crashes.

I can pretty easily get ahold of a Windows 8, Ubuntu (any version), or OS X 10.8-10.9 machine as need be.

I'm fairly confident that the file is fine, I've created other files in the same way, but with smaller datasets and those files opened fine.

Unfortunately I don't think I can split the file as it's just one big plot, so there's only one page in the PDF and I don't know of any way to split it without opening it. And generating many PDFs from smaller chunks of the input data isn't an option for me as I was supposed to be finding a program that would plot arbitrarily large datasets. Well, R succeeded in plotting the data (the plot is viewable while the R session is still running even), but the saved version of the output is pretty much unusable.

EDIT: So the SVG wound up being only 260MB. I'm guessing that R makes really inefficient pdfs which just isn't a problem with smaller datasets. The SVG is a little slow to open but it does open and that's all that I needed, thanks everyone.

If the first person to suggest an SVG wants to submit that as an answer, I'll accept it.

  • It may not be the size - could be you're just writing a junk file. Try a smaller size to see if it gets better when smaller, or is still unopeneable, to be sure you're barking up the correct tree... – Ecnerwal Mar 2 '14 at 23:26
  • I think acrobat is still 32bit internally. There is a limit of 8,388,607 objects due to this. Can you split the file? – Paul Mar 2 '14 at 23:27
  • 3
    Does it need to be a PDF? Would an SVG or something like that suffice? – Paul Mar 3 '14 at 1:17
  • 3
    Considering the sheer... unusualness of what you're using, is there any way you could put up the file? I have SOME ideas but this is one of those things that is pretty hard to replicate - off hand sumatra has unofficial 64 bit PDF reader builds you might want to try – Journeyman Geek Mar 3 '14 at 3:04
  • 1
    If you're ending up with 7GB PDFs, there's a good chance that you're simply using the wrong file format for the job. You're likely better off finding an alternative format. SVG was suggested, but I get the feeling you're going to want something else if you have that many data points. – Bob Mar 3 '14 at 3:32
1

Since no one made an answer out of the "Just use svg" comment, I'll do it. It solved my problem even if it didn't solve the problem as posed.

0

Like @gbc921, you should try to convert the file over to another file format that might be a little easier on your system. PDFs are not the way to go with large files. TXT format may be good if you are working with text only, but I don't know an alternative for images. Another thing to do is to keep the file off your computer hard drive so it doesn't take so long to read the file, but rather on a flash drive that uses flash storage and may be easier to load faster. Lastly, I would consider turning off all the programs that you aren't using while viewing/editing the pdf. You can use task manager on Windows, I don't know the function in OS X. Make sure you have screen brightness and other performance saving options on so your computer doesn't crash.

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.