Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - How to check if there are figures in a page?
  FAQ FAQ  Forum Search   Register Register  Login Login


Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

How to check if there are figures in a page?

 Post Reply Post Reply
Author
oald View Drop Down
Member
Member


Joined: 16 Sep 2011
Points: 42
Post Options Post Options   Quote oald Quote  Post ReplyReply Direct Link To This Post Topic: How to check if there are figures in a page?
    Posted: 30 Sep 2011 at 12:50pm
I'm developing a tool to remove blank pages in a PDF document, my way is to use getPageNumWords method, if the number of words in a page is 0, the tool regards it as a blank page,
 
for (var k = this.numPages - 1; k >= 0; k--) 
{
   numWords = this.getPageNumWords(k);
   if (numWords == 0)
   {
       this.deletePages(k,k);
   }
}
 
But there is an issue that Figures that cannot be OCRed (see the attachment for an example) uploads/151/Test.pdf is also removed as blank pages as there are no words in it, could you show me how to resolve this? Your help is really appreciated!
Back to Top
Sponsored Links


Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 628
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 30 Sep 2011 at 2:27pm
It can't be done with JS, unfortunately.
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
BAlheit View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 1110
Post Options Post Options   Quote BAlheit Quote  Post ReplyReply Direct Link To This Post Posted: 30 Sep 2011 at 4:28pm
You can remove empty pages with the Preflight Tool.
Back to Top
oald View Drop Down
Member
Member


Joined: 16 Sep 2011
Points: 42
Post Options Post Options   Quote oald Quote  Post ReplyReply Direct Link To This Post Posted: 01 Oct 2011 at 5:37am
Hi BAlheit,
 
I'm using Acrobat 8 Professional and I just have a check, there is no "Remove empty page" function in Preflight, is it only available in Acrobat 9 or 10?


Edited by oald - 01 Oct 2011 at 5:38am
Back to Top
BAlheit View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 1110
Post Options Post Options   Quote BAlheit Quote  Post ReplyReply Direct Link To This Post Posted: 01 Oct 2011 at 10:37am
You can add a custom profile and add new fixups:

Back to Top
oald View Drop Down
Member
Member


Joined: 16 Sep 2011
Points: 42
Post Options Post Options   Quote oald Quote  Post ReplyReply Direct Link To This Post Posted: 01 Oct 2011 at 4:30pm
Hi BAlheit,
 
Thanks for your answer! But how I can get the profile? Need I create it by myself, or I can download it from somewhere?
Back to Top
BAlheit View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 1110
Post Options Post Options   Quote BAlheit Quote  Post ReplyReply Direct Link To This Post Posted: 01 Oct 2011 at 5:06pm
In Acrobat 8 Professional create a new profile and add the fixup 'Remove empty pages'.
Back to Top
oald View Drop Down
Member
Member


Joined: 16 Sep 2011
Points: 42
Post Options Post Options   Quote oald Quote  Post ReplyReply Direct Link To This Post Posted: 03 Oct 2011 at 6:29am
Hi BAlheit,
 
Thanks for your follow up, I will have a try.
Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 628
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 03 Oct 2011 at 10:12am
You can execute a preflight profile using the preflight() method of the Document object.
Use Preflight.getProfileByName() to retrieve the PreflightProfile object you want to execute.
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.027 seconds.