Can a text object completely obscure an underlying image?  SOLVED

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
DIV
User
Posts: 252
Joined: Fri Jun 23, 2017 1:47 am

Can a text object completely obscure an underlying image?

Post by DIV »

Hi, Tracker staff.

On the weekend I was tying to do the following.

I had received a scanned document, in PDF format. Most was legible, but a portion of one page wasn't: the middle third of page 11. I separately received a transcription of the illegible portion of text.

What I wanted to do was to create a new text object with an opaque background, enter the transcription into that text object, format it something like the original document, and place the text object over the top of the illegible section, thereby obscuring it.

Everything worked well except that text objects don't seem to have any background colour (at least, not one that I can configure), the background of all text objects is clear rather than opaque, and therefore it was not able to obscure the underlying image.
So adding a new text object on top of blurry text just made it harder to read anything, not easier.

Of course, instead of using a text object I could have used an annotation object, such as a Typewriter comment, which indeed can be set to have an opaque white background, as I wanted.
But the problem with that is that later I want to be able to add numerous small annotations to the document: typically short Typewriter comments, but also sometimes ovals, rectangles and arrows, relating to individual words or phrases in the text, and it is troublesome trying to create these over the top of a larger comment. Clicking the mouse tends to select the existing comment, rather than insert the new annotation. The workaround is to make the comment somewhere else, and then move/drag it into place, but it's inconvenient.


So then I thought that maybe I can insert an opaque white rectangle in between the underlying scan image and the new text object. However, as the rectangle was an annotation/comment, it seems to be impossible for it to be ordered underneath the text object: thus it always obscured both the new text object containing the transcription and the original image containing the blurry text.

In the end what I did is the following:
  1. Copy the image twice, to obtain three instances on that page.
  2. Crop the bottom two thirds of one image (in an external editor) and resize to match the top third of the original image.
  3. Crop the upper two thirds of another image (in an external editor) and resize to match the lower third of the original image.
  4. Place the new text object in the middle third of the page, using the blurry image text as a guide to size and styling.
  5. Delete the third (uncropped) image.
Was there a better way?

—DIV
User avatar
BigMike
User
Posts: 307
Joined: Wed Nov 07, 2007 10:07 am

Re: Can a text object completely obscure an underlying image?  SOLVED

Post by BigMike »

Try this, I guess, it'll do what you like:
- Add a "text box annotation" above the blurred content
- Put text content inside the text box as you like
- After you've finished, use the "flatten annotations feature" (right click menu of the annotation)
- Now the text box annotation is part of the document (and no annotation anymore), the contained text can be annotated as any other text in the PDF
Last edited by BigMike on Mon Mar 22, 2021 9:21 am, edited 1 time in total.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17893
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Can a text object completely obscure an underlying image?

Post by Tracker Supp-Stefan »

Hello BigMike,

Thanks for the suggestion! Indeed that would work!
This creates a complex "XForm" object with two elements in it - one being the background with the desired colour that will hide the blurred text from the original image, and then the "base content text object" is on top of that, still without any colour or fill behind the text itself!

Please take a look below. I have deliberately moved the text to be away from the 'path' which is the dark yellow/orange box above it:
image.png
Kind regards,
Stefan
DIV
User
Posts: 252
Joined: Fri Jun 23, 2017 1:47 am

Re: Can a text object completely obscure an underlying image?

Post by DIV »

Great thinking, BigMike!

I have never used that "Flatten Selected Comments" command before. The sizing of my replacement text won't necessarily be precisely the same as the original blurry source, so I may choose the following slightly adjusted workflow in future.
  1. Add a Rectangle Tool object at the appropriate position (and size).
  2. Format the object to have an opaque (white) fill and no visible outline (border width zero, or white stroke).
  3. Select the object, right-click and invoke "Flatten Selected Comments". It then becomes part of the 'underlying' page content, rather than being an annotation that notionally 'hovers' above the page.
  4. Add new text (reproducing the original content) with Home > Add > Add Text. This is also 'underlying' page content, but since it's the most recent addition, it will be uppermost within that 'stack'.
  5. Eventually add further comments (about the original text) with the Typewriter Tool.
I've only tested this briefly, but it seems that it's important not to swap the order of steps 3 and 4. If the text is added before the rectangle annotation is flattened, then the text will have been added to that 'underlying' page content prior to the rectangle, with the consequence that the rectangle would become the most recent addition and hence be uppermost within that 'stack'.
(Of course, if not flattened, the rectangle annotation persists at a conceptually higher level 'floating' above the underlying text and/or images.)

There's one more thing to be aware of that is different between the two workflows discussed.
If the paragraph is present in a Text Box object (annotation), then dragging the top/bottom/left/right handles on the object will resize the 'canvas' within which the paragraph flows, without altering the size or proportions of the individual characters.
On the other hand, if the paragraph is present as ordinary Text (by adding text or by flattening a Text Box), then dragging the top/bottom/left/right handles on the object will resize the 'canvas' within which the paragraph flows and at the same time it will alter the size & proportions of the individual characters — as if you were editing an image of text.

—DIV
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8557
Joined: Wed Jan 03, 2018 6:52 pm

Re: Can a text object completely obscure an underlying image?

Post by TrackerSupp-Daniel »

Hello, DIV

You could also make use of the "arrange" tools to move the text/rectangle forward/backwards in the document, so if you do make a mistake and get steps 3 and 4 out of order, that is an easy way to fix it.

As for your mention of resizing the base content text "canvas". This is the intended handling, but if you select the text directly for editing (going inside the canvas) you can then resize it and the text will reflow as it does with the textbox and other commenting tools.

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Post Reply