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!
![]() |
Make image transparent and text opaque |
Post Reply ![]() |
Author | |
GMahler ![]() Beginner ![]() Joined: 19 Dec 15 Location: Germany Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() Posted: 19 Dec 15 at 5:02PM |
Hey,
I'm very new to Quick PDF Library and I'm not yet having a grip to the vast set of functions. I have a PDF that comes from Nuance OCR. It has one image per page and invisible but selectable text (the OCR text). Nuance calls this "text over image". I'd like to do the following: - Make the image transparent (about 20%) - Make the text visible/opaque The reason for this is that I want to check the quality of the OCR by being able to directly compare the recognized text to the image. That's why I'd like to see the text. I've looked through the documention but I haven't found a way to directly manipulate the text or the image transparency. All the methods I found just seem to work "subsequently". Does this mean I have to build a completely new PDF document by copying the contents of my original PDF, image per image, text block per text block, to be able to set text color or image transparency? I hope not... ;-) Thanks in advance for enlighting hints. Georg |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Georg,
Hi Georg, your main point is to separate content of pdf-pages. The page-content can be built on several layers (OptionalContentGroups/OGCs). One basic layer, the next layer with an image, then a layer with the text content, and so on. What i wanna say is one approach could be to deal with the layer-functionalities: http://www.debenu.com/docs/pdf_library_reference/ContentStreamsAndOptionalContentGroups.php First you should determine the layer count: Function "ContentStreamCount". Deleting one layer after the other starting from layer 0 (the first) will delete each layer content showing you the remaining content. What i can image is that the image is on one separate layer and if this layer is deleted you should see any text content... Try it ;-) Cheers and welcome here, Ingo Edited by Ingo - 25 Dec 15 at 1:54PM |
|
Cheers,
Ingo |
|
![]() |
|
GMahler ![]() Beginner ![]() Joined: 19 Dec 15 Location: Germany Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Hi Ingo,
thank you very much for your answer! I experimented with the layers/content streams and I got weird results. ContentStreamCount returns 2, as expected. When I delete Stream 1, the resulting PDF seems completely empty. No image, no selectable text. When I delete Stream 2, BOTH are still visible. In both cases, the size of the resulting PDF is very near to the original, despite one layer should have been removed. Doesn't "DeleteContentStream" do what it is supposed to do? Or am I misunderstanding some fundamental concepts? I haven't found more fitting methods in "Content Streams and Optional Content Groups" help page. Btw: I do not want to delete layers, I'd like to manipulate them as described in my initial post. Best regards, Georg |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Georg,
you won't get success in changing/modifying a ready-made pdf-document. What you can do is content-extraction (text and images). With the extraction then you can build a new document similar to the original one. BTW: If CombineContentStream was used all content from the different layers will be together. Cheers, Ingo |
|
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