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 - Make image transparent and text opaque
  FAQ FAQ  Forum Search   Register Register  Login Login

Make image transparent and text opaque

 Post Reply Post Reply
Author
Message
GMahler View Drop Down
Beginner
Beginner


Joined: 19 Dec 15
Location: Germany
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote GMahler Quote  Post ReplyReply Direct Link To This Post Topic: Make image transparent and text opaque
    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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3529
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 25 Dec 15 at 1:53PM
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

Back to Top
GMahler View Drop Down
Beginner
Beginner


Joined: 19 Dec 15
Location: Germany
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote GMahler Quote  Post ReplyReply Direct Link To This Post Posted: 04 Jan 16 at 1:37PM
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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3529
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jan 16 at 8:36PM
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

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