Copy/paste text blocks, keeping formatting and position

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
hello_world.c
User
Posts: 5
Joined: Wed Jun 08, 2022 10:15 am

Copy/paste text blocks, keeping formatting and position

Post by hello_world.c »

What I am trying to do is the following: I have a set of similar PDF files where I need to replace a text block. The first one I have edited to my wishes, I go to Home - Edit - Text (with "Edit Text Elements as Blocks" turned on), then select the text block and do CTRL+C to copy. Then I go to the second and subsequent PDF, select the same text block, delete it and then do a paste by CTRL+V or right mouse click - Paste.

The problem: Sometimes it works as expected and the copied text block is inserted at the original position with the original formatting intact but sometimes, it is placed at an arbitrary position in the middle with completely different fonts and font sizes. I can't figure out a surefire way to always keep position and formatting when pasting but there must be a (non-obvious) way.

If needed I can post screenshots. Help?
User avatar
Dimitar - Tracker Supp
Site Admin
Posts: 1776
Joined: Mon Jan 15, 2018 9:01 am

Re: Copy/paste text blocks, keeping formatting and position

Post by Dimitar - Tracker Supp »

Hello hello_world.c,

Welcome to our Forum.

I think the reason behind this is that in some of these files the Fonts are not embedded!

Just to confirm if this is the source of the problems, may I ask you to send us one of the problematic files to: support@pdf-xchange.com

Also, could you please tell us what version is your PDF Editor?

You may see this information in the PDF Editor's Help -> About menu.

Regards.
asdf3sthdhawer53
User
Posts: 33
Joined: Wed Feb 03, 2021 10:21 am

Re: Copy/paste text blocks, keeping formatting and position

Post by asdf3sthdhawer53 »

I'm having the same problem. Copying a text frame/shape and then attempting to paste it into the same page or another page in the same file will be completely different font (Arial), font size, line spacing, justification, position, and shape.

If I click the thumbnails panel before pasting, then the result is the same font, but everything else is different, in a new blank page.

The font is Courier New, not embedded.


I also tried creating my own text box with some text, in Arial, size 14, bold. When I copy and paste it, the new copy will also reset to default in a different position, but in Arial.

I cannot provide a sample PDF.
Willy Van Nuffel
User
Posts: 2342
Joined: Wed Jan 18, 2006 12:10 pm

Re: Copy/paste text blocks, keeping formatting and position

Post by Willy Van Nuffel »

I think the most important thing is to "select the object" in the right manner:

>> The most easy way is to copy the complete text-block (so, not a part of it).

In case it goes about base-content (text, images, shapes):
- in the Home-ribbon, click Edit and make sure that there is a check-mark before "Edit Text Elements as Blocks"
- in the Home-ribbon, click Edit > All Content
- click onto the object that you like to copy, to select it (just one single click)

In case it goes about annotations (typewriter, text box, call-out, ...)
- in the Home-ribbon, click "Select Comments"
- click onto the comment/annotation-object that you like to copy, to select it (just one single click)

To paste the selected object:
1) First method
- right-click at the position where you like to drop the copy
- in the shortcut-menu, click "Paste (as Contents)"

2) Second method
- keep pressing the CTRL-key, then grab the selected object and drag it to the desired position


>> If you like to copy a part of the text
- select the text that you like copy (in the base-content textbox or in the comment textbox)
- right-click and "Copy"
- after this, right-click where you like to paste
- click "Paste as Rich Text"

Does this help?
hello_world.c
User
Posts: 5
Joined: Wed Jun 08, 2022 10:15 am

Re: Copy/paste text blocks, keeping formatting and position

Post by hello_world.c »

Thank you for your reply. In my case, it seems resolved. I also did an update to the latest version 9.5 build 366.0 so I don't really know if it's been fixed there or in the procedure. I believe I already did it this way in the past but just for the record, this is what I am doing now:

- in the Home-ribbon, click Edit and make sure that there is a check-mark before "Edit Text Elements as Blocks"
- in the Home-ribbon, click Edit > Text
- select the text block in the source PDF
- do Ctrl+C
- switch to the tab of the target PDF but don't click or select anything there (remove overlapping elements in the target PDF before using this procedure, if applicable)
- do Ctrl+V

This seems to work well now and position, content and formatting is all copied.
Willy Van Nuffel
User
Posts: 2342
Joined: Wed Jan 18, 2006 12:10 pm

Re: Copy/paste text blocks, keeping formatting and position

Post by Willy Van Nuffel »

Thanks for your answer hello_world.c

It is good to know that copy/paste also works correctly at your side now.

Kind regards.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17765
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Copy/paste text blocks, keeping formatting and position

Post by Tracker Supp-Stefan »

:)
asdf3sthdhawer53
User
Posts: 33
Joined: Wed Feb 03, 2021 10:21 am

Re: Copy/paste text blocks, keeping formatting and position

Post by asdf3sthdhawer53 »

Yesterday when I encountered the problem, I did make sure that "edit text elements as blocks" and "all content" were selected. I one clicked the text box, ctrl-copy, go to other page, ctrl-paste. It did not work as expected.

But today, I did the exact same procedure, and now it does paste with the same format and position.

So I don't really know what the difference was which caused the differing result.

I noticed in the past that sometimes it was successful and other times it was not.
Willy Van Nuffel
User
Posts: 2342
Joined: Wed Jan 18, 2006 12:10 pm

Re: Copy/paste text blocks, keeping formatting and position

Post by Willy Van Nuffel »

@asdf3sthdhawer53 thanks for your answer.

Probably you mean CTRL + C for the copy, and CTRL + V for the paste ?
I suppose you do not press the CTRL key while clicking Copy or Paste in the menu ?

When you do the Paste, please try this via right-mouse-click and then click the specific icon for "Paste as Contents" in the menu.

Good luck.
PDF-XChange Editor - Paste as Contents.png
PDF-XChange Editor - Paste as Contents.png (15.25 KiB) Viewed 2198 times
hello_world.c
User
Posts: 5
Joined: Wed Jun 08, 2022 10:15 am

Re: Copy/paste text blocks, keeping formatting and position

Post by hello_world.c »

asdf3sthdhawer53 wrote: Fri Feb 03, 2023 1:49 pm I noticed in the past that sometimes it was successful and other times it was not.
I had the same thing. So perhaps I just got lucky today. Time will tell...
asdf3sthdhawer53
User
Posts: 33
Joined: Wed Feb 03, 2021 10:21 am

Re: Copy/paste text blocks, keeping formatting and position

Post by asdf3sthdhawer53 »

Willy Van Nuffel wrote: Fri Feb 03, 2023 2:26 pm @asdf3sthdhawer53 thanks for your answer.

Probably you mean CTRL + C for the copy, and CTRL + V for the paste ?
I suppose you do not press the CTRL key while clicking Copy or Paste in the menu ?

When you do the Paste, please try this via right-mouse-click and then click the specific icon for "Paste as Contents" in the menu.

Good luck.

PDF-XChange Editor - Paste as Contents.png
Yes I meant Ctrl+C and Ctrl+V.

I just tried the context menu and see the "paste as contents" option, and it works.

However, I just closed the PDF and opened it again, and now "paste as contents" is no longer available, only "paste as plain text", which is the problem we are having.

Sometimes it works, sometimes it doesn't. I don't know how to get it to work again, so now I'm stuck again with the same problem.
asdf3sthdhawer53
User
Posts: 33
Joined: Wed Feb 03, 2021 10:21 am

Re: Copy/paste text blocks, keeping formatting and position

Post by asdf3sthdhawer53 »

I tested it more and got it to work by using the edit >> "Text", instead of "All Content".

But then when I switched back to "All Content", the problem occurred again.

If I switch again to "Text", the problem is still there.

I don't know what action is causing the problem to go away or come back.


Edit 2:
I'm trying to switch on and off "edit text blocks as elements" and either "all content" or "text", and I get inconsistent results of the "paste contents" or "paste of plain text". Sometimes repeating the steps doesn't show "paste contents" no matter how many times or which combinations I try.

Edit 3:
When I got it working again, without changing any settings, I try copying another text box, and when I paste it, it's now switched back to "plain text". And no matter how many times I try switching the combination of settings or keyboard command vs context menu, I can't get the "paste contents" to come back.
Last edited by asdf3sthdhawer53 on Fri Feb 03, 2023 5:49 pm, edited 1 time in total.
Willy Van Nuffel
User
Posts: 2342
Joined: Wed Jan 18, 2006 12:10 pm

Re: Copy/paste text blocks, keeping formatting and position

Post by Willy Van Nuffel »

Hi,

Thanks for trying to reproduce the problem. Myself I am not able to, it works every time.

So, I wonder, are you working with the latest version (= 9.5.366.0) of PDF-XChange Editor (Help > About) ?
If not, would you try upgrading ?

Regards.
asdf3sthdhawer53
User
Posts: 33
Joined: Wed Feb 03, 2021 10:21 am

Re: Copy/paste text blocks, keeping formatting and position

Post by asdf3sthdhawer53 »

Willy Van Nuffel wrote: Fri Feb 03, 2023 5:46 pm Hi,

Thanks for trying to reproduce the problem. Myself I am not able to, it works every time.

So, I wonder, are you working with the latest version (= 9.5.366.0) of PDF-XChange Editor (Help > About) ?
If not, would you try upgrading ?

Regards.
Yes, I have the latest version installed, 9.5.366.0. I noticed the problem a while ago with an older version, but I didn't do much copy pasting. But yesterday I needed to do a lot of copy pasting on several identical forms with mostly different text but a few that are the same. And that was when I noticed how difficult it was.

Windows 10 pro 22H2
Willy Van Nuffel
User
Posts: 2342
Joined: Wed Jan 18, 2006 12:10 pm

Re: Copy/paste text blocks, keeping formatting and position

Post by Willy Van Nuffel »

Could it be that it is only happening with specific documents, like (fillable-)forms for example?

Would you mind trying to reproduce the problem with the (simple) attached document ?
TEST Copy text.pdf
(10.98 KiB) Downloaded 25 times
asdf3sthdhawer53
User
Posts: 33
Joined: Wed Feb 03, 2021 10:21 am

Re: Copy/paste text blocks, keeping formatting and position

Post by asdf3sthdhawer53 »

Here is what I see when the problem occurs:
asdfasdfasdf.jpg
asdf3sthdhawer53
User
Posts: 33
Joined: Wed Feb 03, 2021 10:21 am

Re: Copy/paste text blocks, keeping formatting and position

Post by asdf3sthdhawer53 »

Here it is with your sample PDF
Untitled-3.jpg
Sorry here it is more clearly when I change the font in your original text
Untitled-4.jpg
Edit2:
I was able to get "paste contents" to work by switching off "edit text elements as blocks", but then when I switch it off and switch it on again, I only get "paste as plain text", and I can't get the "paste contents" back again. It seems to be random whether or not I can use "paste contents", but when it does work, it's triggered by switching some options on and off.
User avatar
Sean - Tracker
Site Admin
Posts: 175
Joined: Wed Sep 14, 2016 5:42 pm
Location: British Columbia

Re: Copy/paste text blocks, keeping formatting and position

Post by Sean - Tracker »

Hi asdf3sthdhawer53,

This does indeed appear to be a bug with the Edit Text Elements as Blocks feature. I will mention it to the development team today and get back to you about it in due course.

Kind regards,
Sean Godley
Technical Writer
Tracker Software Products (Canada) LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
Willy Van Nuffel
User
Posts: 2342
Joined: Wed Jan 18, 2006 12:10 pm

Re: Copy/paste text blocks, keeping formatting and position

Post by Willy Van Nuffel »

I am still unable to reproduce the wrong behavior (even after switching on/off "Edit Text Elements as Blocks").

So, thanks to Tracker Support for picking this up.

Kind regards.
User avatar
Sean - Tracker
Site Admin
Posts: 175
Joined: Wed Sep 14, 2016 5:42 pm
Location: British Columbia

Re: Copy/paste text blocks, keeping formatting and position

Post by Sean - Tracker »

Thanks Willy.

Kind regards,
Sean Godley
Technical Writer
Tracker Software Products (Canada) LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
asdf3sthdhawer53
User
Posts: 33
Joined: Wed Feb 03, 2021 10:21 am

Re: Copy/paste text blocks, keeping formatting and position

Post by asdf3sthdhawer53 »

With the new build 367.0, the problem occurs less often than before.
Previously it would occur 90% of the time with only "paste as plain text", and required switching on and off the edit tool options to get it to work one time.
Now with the update, the problem occurs around 20% of the time, but does not require switching any options. If the problem occurs, I repeat the copy and paste again and usually the second time should work correctly to "paste as contents" with all the formatting retained.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8371
Joined: Wed Jan 03, 2018 6:52 pm

Re: Copy/paste text blocks, keeping formatting and position

Post by TrackerSupp-Daniel »

Hello, asdf3sthdhawer53

Could I possibly ask for a video recording this issue as it occurs, and a copy of the document and content that you are copy/pasting into it, so that we can try to reproduce it here again? Following the items previously discussed, I cannot seem to reproduce this at the moment.

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
asdf3sthdhawer53
User
Posts: 33
Joined: Wed Feb 03, 2021 10:21 am

Re: Copy/paste text blocks, keeping formatting and position

Post by asdf3sthdhawer53 »

I've sent the sample by email to the support address.

Please keep confidential any identifying information, correspondence, and email addresses, without sharing with third parties. -Thanks
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8371
Joined: Wed Jan 03, 2018 6:52 pm

Re: Copy/paste text blocks, keeping formatting and position

Post by TrackerSupp-Daniel »

Hello, asdf3sthdhawer53

Thank you for sending that over, I have received your email, and am just discussing with another member of the support team and our lead developer in the office here. After we have finished testing, and our lead developer confirms he does not need your file in order to resolve the issue, will delete these files right away. Is it okay if he holds onto a copy of the document on his device specifically for this task?

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
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8371
Joined: Wed Jan 03, 2018 6:52 pm

Re: Copy/paste text blocks, keeping formatting and position

Post by TrackerSupp-Daniel »

Hello again!

After some further fiddling around and no success reproducing this issue as of yet, our Dev team leader is curious to know, do you have any applications at all which "listen" to the clipboard? Anything that syncs files between more than one device, such as windows 11's new inbuilt "clipboard sync", as well as onedrive, or other third party apps, really anything that allow you to copy/paste between multiple devices?

If you have any of these types of apps running, please disable them, and see if that negates the issue for you. If disabling them fixes the issue, please look into those applications settings and ensure that any "clipboard" related options are disabled. While these are handy tools, they cause issues with numerous applications copy/paste functions due to the fact that the clipboard can contain multiple sets of data from a single copy operation. If the clipboard happens to get "locked" by a syncing application before all sets of data are copied, than the copy partially fails, and only one version of the data is available, in your case, the first copied, which is the plain text data.

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
hello_world.c
User
Posts: 5
Joined: Wed Jun 08, 2022 10:15 am

Re: Copy/paste text blocks, keeping formatting and position

Post by hello_world.c »

Hello Daniel,

OP here, want to add that I have indeed running "Ditto" on my devices. So your explanation makes sense, this could be the common factor. However, disabling it permanently won't be an option for me since it is too important.

https://apps.microsoft.com/store/detail/ditto-clipboard/9NBLGGH3ZBJQ

Cheers,
Chris
asdf3sthdhawer53
User
Posts: 33
Joined: Wed Feb 03, 2021 10:21 am

Re: Copy/paste text blocks, keeping formatting and position

Post by asdf3sthdhawer53 »

Hi Daniel, you may retain the files for the purpose of the troubleshooting.

I am not aware of a software running that syncs the clipboard that you have described.
I have Windows 10 Pro, and OneDrive is disabled from startup and not running.

I tried disabling DisplayCAL Profile Loader, third party virus scanner, third party firewall, but the behavior with the plain text pasting did not change.

The plain text pasting occurs not in sequence (with the latest build). Sometimes it is once every 2, 3, 4, 5, or 6 copy and paste, but on average once out of 4 to 5 times, if I copy/paste in 2 or 3 second intervals. In the previous build, it occurred 9 out of 10 times.

When I have time later, I may try to install PDF-XChange Editor Pro on an old laptop that's also running Windows 10 Pro, to see if the same problem occurs.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8371
Joined: Wed Jan 03, 2018 6:52 pm

Re: Copy/paste text blocks, keeping formatting and position

Post by TrackerSupp-Daniel »

Hello, asdf3sthdhawer53

have you checked your windows clipboard settings as well? By default, windows 10 and 11 both have "sync across devices" enabled if you are signed into a Microsoft account, which, even if you do not have other devices, could cause this issue when syncing to Microsoft servers.

It is also worth noting that the inconsistency is not unexpected, apps/functions like this often do monitor the clipboard in Realtime, but check it every few seconds/minutes, if you happen to be copying the content at the moment that check happens, it can cause that app to lock the clipboard preventing us from completing the copy.

Finally I should say that this issue is one which, as you both know, was noticed and partially addressed with this build release. The root cause of the issue is that, much like many other apps, we copied each clipboard item to the clipboard one "piece" at a time. The Dev team is working on a way to copy all clipboard items in a single bulk action in a future release.
For now, we have already made some changes to reduce the number of copy actions from what it was in the past, as you noticed this significantly reduced the frequency of these issues occurring, but did not remove them entirely. If disabling your clipboard manager is not an option, than I am afraid you will need to work with the knowledge that periodically you will encounter this issue, until it is resolved, which may be a few more releases away.

If your clipboard manager offers any functions to prevent it from "locking" the clipboard contents while it performs its copy, that should prevent this issue entirely in the meantime, as the lock applied by other apps is what causes us to stop our copy process.

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
asdf3sthdhawer53
User
Posts: 33
Joined: Wed Feb 03, 2021 10:21 am

Re: Copy/paste text blocks, keeping formatting and position

Post by asdf3sthdhawer53 »

Thanks for the detailed explanation. I had a look at the Windows settings on my computer and "sync across devices" is off.

At the moment, I can work with this new build, knowing the clipboard problem will occur only on average 20% of the time. It doesn't add much inconvenience to repeat the copy/paste when encountering the problem. It's much better than the previous build.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8371
Joined: Wed Jan 03, 2018 6:52 pm

Re: Copy/paste text blocks, keeping formatting and position

Post by TrackerSupp-Daniel »

Hello, asdf3sthdhawer53

It is very odd to hear that this would be happening while you are sure that all clipboard syncing functions are turned off, we will have to look into what else could cause that, but so far I have not been able to reproduce the issue on this end with a device that I know does not have anything capable of doing that, other than windows itself, installed.
In any case, I am glad to hear that the current improvements, while not perfect, at good enough to be workable, and I apologies for the continued minor inconveniences while we are working on improving this.

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
asdf3sthdhawer53
User
Posts: 33
Joined: Wed Feb 03, 2021 10:21 am

Re: Copy/paste text blocks, keeping formatting and position

Post by asdf3sthdhawer53 »

I tried it on another computer and it did not have the problem.

The differences between the two devices I tried:

A: Lenovo laptop with problems
  • Several Lenovo software in the background, including an FN hot key software
    AMD cpu and chipset
    AMD Radeon Software
B: Acer laptop without problems
  • No Acer software in the background
    Intel cpu and chipset
Hopefully there isn't something more serious happening, like malware listening to the clipboard.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8371
Joined: Wed Jan 03, 2018 6:52 pm

Re: Copy/paste text blocks, keeping formatting and position

Post by TrackerSupp-Daniel »

Hello, asdf3sthdhawer53

Lenovo is certainly well known for offering a number of bloatware options, so if their services are running in the background, one of them could be the root of the issue. Are you able to temporarily disable all of them? I know from experience that it can be a nightmare to "remove" them entirely from some devices, but temporarily disabling them is not usually too much work.

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
hello_world.c
User
Posts: 5
Joined: Wed Jun 08, 2022 10:15 am

Re: Copy/paste text blocks, keeping formatting and position

Post by hello_world.c »

For the record, I, too, have experienced the issue on a Lenovo (Thinkpad X1 Carbon) with the Lenovo hotkey tool installed.

Cheers,
Chris
asdf3sthdhawer53
User
Posts: 33
Joined: Wed Feb 03, 2021 10:21 am

Re: Copy/paste text blocks, keeping formatting and position

Post by asdf3sthdhawer53 »

I terminated all the Lenovo background services that I could find, including that FN hotkey software, and some Adobe updaters and listeners, but the problem still persists. At first, I was able to copy/paste 15 times without problems so I thought it was gone, but then it occurred 3 times in a row, then resumed occurring on average once every 5 times.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8371
Joined: Wed Jan 03, 2018 6:52 pm

Re: Copy/paste text blocks, keeping formatting and position

Post by TrackerSupp-Daniel »

Hello, asdf3sthdhawer53

In that case, I am afraid there is little I can offer beyond ask you to continue waiting for us to implement our improvements to clipboard handlings. This may still be some ways away, but hopefully it is not too long of a wait for you...

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