Removing Blank Pages

15 views
Skip to first unread message

Paul Boniol

unread,
Aug 28, 2014, 3:14:44 AM8/28/14
to NLUG
I've got a large PDF.  The program that created it inserted a large number of blank pages (600 pages, best guess 1/4 are blank).  

Is there any way to print the pages with text and not print all the blank pages?

Google turned folks wanting to do it, and few answers.  (Or folks complaining about printer driver/PPD issues adding blank pages.  Or with a scanned PDF, which this isn't.)

I tried Adobe Acrobat X preflight "remove empty pages" from the PDF (I found where and how with great difficulty).  If I did everything correctly, and appears I did, there must be something invisible on the pages, so Acrobat doesn't consider them blank and leaves them in...

There was something loosely defined on making images of the pages and evaluating the contrast or something.  But I'm not sure how to do that.

Any ideas?  My Google-foo has run out on this one.

Paul

Eric Andre

unread,
Aug 28, 2014, 3:17:09 AM8/28/14
to nlug...@googlegroups.com

Which program created it and who created it? -general curiosity.

--
--
You received this message because you are subscribed to the Google Groups "NLUG" group.
To post to this group, send email to nlug...@googlegroups.com
To unsubscribe from this group, send email to nlug-talk+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/nlug-talk?hl=en

---
You received this message because you are subscribed to the Google Groups "NLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nlug-talk+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Chaney

unread,
Aug 28, 2014, 9:02:37 AM8/28/14
to nlug...@googlegroups.com
I'm assuming you're using Perl here.  There are a couple of reasonable looking options on cpan for reading and manipulating PDFs.  I've done it myself before.

My recommendation is to write a program to read these in and then dump the contents out as text, or at least the basic structure.  It's tedious as some formatters place every single letter on the page.  The point is to see what is on blank pages that makes them look "not blank" to a computer.  Probably the easy way is to just look at a sample PDF and make note of some page numbers of blank pages and then only dump those.  If you can then easily identify that then you can drop those pages and write the PDF back out (or create a new PDF which includes only non-blank pages - even better as it can be a filter).

Michael


--
--
You received this message because you are subscribed to the Google Groups "NLUG" group.
To post to this group, send email to nlug...@googlegroups.com
To unsubscribe from this group, send email to nlug-talk+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/nlug-talk?hl=en

---
You received this message because you are subscribed to the Google Groups "NLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nlug-talk+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

andrew mcelroy

unread,
Aug 28, 2014, 9:09:06 AM8/28/14
to nlug...@googlegroups.com
see if this ghostscript script can help
http://www.planetpdf.com/forumarchive/151779.asp
I haven't ran it, but it claims it will remove blank pages in a pdf.

Paul Boniol

unread,
Aug 28, 2014, 9:28:17 AM8/28/14
to NLUG
It is a Cold Fusion script my co-worker wrote that generated it.  It is very touchy about margins and things and requires frequent tweaks to try to stop generating blank pages.

Paul

Michael Chaney

unread,
Aug 28, 2014, 9:40:47 AM8/28/14
to nlug...@googlegroups.com
That answers a question that I've had in the back of my mind for a long time: does anybody still use cold fusion?

Sounds like fixing the CF script is the path of least resistance.  Upgrading it to Perl would be a good first step.

Michael


--
--
You received this message because you are subscribed to the Google Groups "NLUG" group.
To post to this group, send email to nlug...@googlegroups.com
To unsubscribe from this group, send email to nlug-talk+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/nlug-talk?hl=en

---
You received this message because you are subscribed to the Google Groups "NLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nlug-talk+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shawn Oden

unread,
Aug 28, 2014, 11:19:54 AM8/28/14
to nlug...@googlegroups.com
There are still a few of us using ColdFusion. :-)  Since it's an Adobe product, it actually does PDF generation pretty well. 

Are you able to post the code? Which version of ColdFusion server are you running?

Shawn

Chris McQuistion

unread,
Aug 28, 2014, 11:55:02 AM8/28/14
to nlug-talk
We're still running Coldfusion, unfortunately.  It's part of a large 3rd-party software that we've been using for 8 years.

On the plus side, we upgraded to the latest version, just this year, from the version that was 8 years old .... :-(


--

Shawn Oden

unread,
Aug 28, 2014, 12:50:36 PM8/28/14
to nlug...@googlegroups.com
Chris, you aren't related to Craig are you?

Chris McQuistion

unread,
Aug 28, 2014, 3:06:45 PM8/28/14
to nlug-talk
Yep.  He's my brother.


Paul Boniol

unread,
Aug 28, 2014, 3:59:03 PM8/28/14
to NLUG
We are still on 8... We have gone through the docs / code, after making changes (some global on a live system, thanks to a sophisticated Perl script) we are ready to go all the way to 11 with little more needing to be done.  New server should be installed shortly but that's outside our positions (should have already happened, but evidently there's some hold-up).

If we didn't have tons of custom code in CF, we'd have gone to PHP (though most new things around us seem to be going to Java... :-\ ).

There's a good amount of code to producing the PDF, I'd have to go through and see if I could post.  My co-worker is back in the office today (he's been out sick) so hopefully he'll be able to find and resolve it since he knows what the issue(s) are with it.  I think it revolves around our needing to do page breaks when we hit the end of groupings, need to figure out where on the page we are, etc.

Shawn Oden

unread,
Aug 28, 2014, 4:19:15 PM8/28/14
to nlug...@googlegroups.com
Cool deal. I worked with him for several years at Kroll. Good guy. Sharp coder.

Unless you don't like him. Then I've never heard of the guy and probably wouldn't like him if I ever met him. :-)

Shawn

Shawn Oden

unread,
Aug 28, 2014, 4:30:10 PM8/28/14
to nlug...@googlegroups.com
Good luck. I'm one of the few people in Nashville that will still admit to being a CF coder. Good to hear that it's still being used in some places. It's a much better language than its reputation indicates. It's come a pretty long way since the Allaire days. But that will get us all into a philosophical discussion about the value of some languages. :-)

Back to the discussion at hand, there have been some pretty big updates to PDF generation, even between CF 8 and 11. If the code was written pre-CF8, there are probably a few things that can be done to make it run even more efficiently on the CF8 server. Should be a big jump between 8 and 11. Regardless, a 600 page PDF is pretty impressive. You sound like you're on the right track thoough. Finding the correct page endings will probably get rid of your phantom page characters.  

Shawn



--
--
You received this message because you are subscribed to the Google Groups "NLUG" group.
To post to this group, send email to nlug...@googlegroups.com
To unsubscribe from this group, send email to nlug-talk+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/nlug-talk?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "NLUG" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nlug-talk/VQflWZcNaN0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nlug-talk+...@googlegroups.com.

Paul Boniol

unread,
Aug 28, 2014, 6:08:18 PM8/28/14
to NLUG
We've been using it for at least part of our work since CF 5 and building on it each year.  This report has certainly been modified frequently under 8, not sure if it takes advantage of everything in 8.

"I made the boxes thinner and tweaked some things for certain buildings.  This leaves more white space on each page, but at least none are blank that I saw."  

So problem solved for now.  Hopefully we'll be able to do something better under 11.  Or just wait till we get a package system, that is coming some time, very preliminary stages of looking.

It's down to 475 pages now, was 599.  So there were 124 blank pages that were eliminated.


You received this message because you are subscribed to the Google Groups "NLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nlug-talk+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages