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!
![]() |
How to remove only text from a page |
Post Reply ![]() |
Author | ||
aderg ![]() Beginner ![]() ![]() Joined: 24 Oct 19 Status: Offline Points: 11 |
![]() ![]() ![]() ![]() ![]() 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..
|
||
![]() |
||
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
|
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 |
||
![]() |
||
aderg ![]() Beginner ![]() ![]() Joined: 24 Oct 19 Status: Offline Points: 11 |
![]() ![]() ![]() ![]() ![]() |
|
"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?
|
||
![]() |
||
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
|
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 |
||
![]() |
||
aderg ![]() Beginner ![]() ![]() Joined: 24 Oct 19 Status: Offline Points: 11 |
![]() ![]() ![]() ![]() ![]() |
|
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.. |
||
![]() |
||
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
|
Now you know the reason - there isn't any special direct functionality ;-)
|
||
Cheers,
Ingo |
||
![]() |
||
dicmmooee ![]() Beginner ![]() Joined: 02 Sep 20 Status: Offline Points: 1 |
![]() ![]() ![]() ![]() ![]() |
|
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! |
||
![]() |
||
tfrost ![]() Senior Member ![]() Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
![]() ![]() ![]() ![]() ![]() |
|
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. |
||
![]() |
||
Sopracenery ![]() Team Player ![]() ![]() Joined: 31 Aug 20 Location: Germany Status: Offline Points: 29 |
![]() ![]() ![]() ![]() ![]() |
|
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 |
||
![]() |
||
dicmmooee2 ![]() Beginner ![]() Joined: 09 Sep 20 Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
|
Thanks for your useful reply! Good luck!
|
||
![]() |
||
mandriospo ![]() Beginner ![]() Joined: 16 Dec 21 Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
|
how to check if stream looks this way?
|
||
![]() |
||
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
|
Mostly this won't work. Try to open a pdf with notepad and browse through the content. Most content you'll not be able to read few content you will be able and this will give you an idea what's possible and what not. |
||
Cheers,
Ingo |
||
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store