Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - How to remove only text from a page
  FAQ FAQ  Forum Search   Register Register  Login Login

How to remove only text from a page

 Post Reply Post Reply
Author
Message
aderg View Drop Down
Beginner
Beginner
Avatar

Joined: 24 Oct 19
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote aderg Quote  Post ReplyReply Direct Link To This Post Topic: How to remove only text from a page
    Posted: 15 Jul 20 at 7:41PM
How to remove only text from the page so that the graphics remain?
If I use DeleteContentStream, I get a blank page..
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3187
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 15 Jul 20 at 7:52PM
Hi aderg,

no real solution for this.
With extract functionality you can try to determine the area where the text blocks are...
With draw functionality you can overwrite these areas with white colour for example.

Perhaps it's better to do it the other way round extracting the things you want to have onto  new blank pages...

Cheers,
Ingo

Back to Top
aderg View Drop Down
Beginner
Beginner
Avatar

Joined: 24 Oct 19
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote aderg Quote  Post ReplyReply Direct Link To This Post Posted: 15 Jul 20 at 8:10PM
"you can overwrite these areas with white colour" - it’s not good if the text was drawn over the picture
"extracting the things you want to have onto  new blank pages" - this only works with bitmaps, but how to extract vector graphics?
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3187
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 16 Jul 20 at 3:22PM
that are easy steps you can do for similar results.
Not a good solution that's true ;-)
There isn't any built-in-function for your needs.
You have to read the online reference and the developer guide and develope your own solution with a little help by QuickPDF ;-)

Cheers,
Ingo

Back to Top
aderg View Drop Down
Beginner
Beginner
Avatar

Joined: 24 Oct 19
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote aderg Quote  Post ReplyReply Direct Link To This Post Posted: 16 Jul 20 at 3:29PM
Thanks, I read the developer guide :)
But I did not find the ability to delete text, as well as the ability to copy all content without text..
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3187
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 16 Jul 20 at 10:59PM
Now you know the reason - there isn't any special direct functionality ;-)

Cheers,
Ingo

Back to Top
dicmmooee View Drop Down
Beginner
Beginner


Joined: 02 Sep 20
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote dicmmooee Quote  Post ReplyReply Direct Link To This Post Posted: 02 Sep 20 at 1:43AM
Dear sir,
Could you please give a sample to draw functionality you can overwrite these areas with white colour above certain text.
High appreciation for your support!
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 297
Post Options Post Options   Thanks (1) Thanks(1)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 02 Sep 20 at 2:07PM
There is a sample of using GetPageText to get the position of each text item here at:
http://quickpdf.org/forum/extracting-text-by-csv-coordinates_topic3805_post15214.html

Then for each text item you can draw a filled box over it with SetFillColor and DrawBox

Check the Reference Guide for the options for these functions.


Back to Top
Sopracenery View Drop Down
Beginner
Beginner
Avatar

Joined: 31 Aug 20
Location: Germany
Status: Offline
Points: 7
Post Options Post Options   Thanks (1) Thanks(1)   Quote Sopracenery Quote  Post ReplyReply Direct Link To This Post Posted: 02 Sep 20 at 7:46PM
Hi,

If there is no built-in solution nor a better suggestion for this and you REALLY want to have the job done, you can try to eliminate each character in the content stream. 
Usually text looks like this:
(HELLO WORLD) or like this:
(H) 2.342 (E) 2.122 (L) 2.214 (L) 2.434 (O) 9.342 (W) 2.12 (O) 2.21 (R) 2.34 (L) 2.12 (D) 
Now you can try to replace all (H)s and (E)s and so on with one space in brackets "( )" and each full word found by text extraction with spaces without brackets:

Select a ContentStream and call 
DebenuPDFLibrary1811.ReplaceTag("HELLO", "     ")
DebenuPDFLibrary1811.ReplaceTag("WORLD", "     ")
DebenuPDFLibrary1811.ReplaceTag("(H)", "( )")
DebenuPDFLibrary1811.ReplaceTag("(E)", "( )")
and repeat it with the complete alphabet.
Please check if your graphs are affected. No warranty!

Feedback appreciated

Martin
Back to Top
dicmmooee2 View Drop Down
Beginner
Beginner


Joined: 09 Sep 20
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote dicmmooee2 Quote  Post ReplyReply Direct Link To This Post Posted: 09 Sep 20 at 4:38PM
Thanks for your useful reply! Good luck!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store