Feature Request  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
pat.sharp
User
Posts: 2
Joined: Tue Sep 07, 2010 6:16 pm

Feature Request

Post by pat.sharp »

Hello,

I would like the ability to have a Circle around a text box. I use this alot marking up engineering drawings, and need the ability to put a circle around a number. This is used to mark features, dimensions, notes, etc on a drawing for reference to fields on a spreadsheet.

Alternatively, a stamp that would have an incrementing number inside a circle would also be good.

This would make the product much more valuable to me.

Thanks.
lev
User
Posts: 258
Joined: Fri Apr 11, 2014 1:18 am

Re: Feature Request

Post by lev »

A dynamic stamp (a static circle with a text field that a dialog box will prompt you fill) could be created fairly easily. I can try to put something together in the next day or two. You will however have to tweak the script slightly after you bring the stamp into your pallet due to the fact that PDF-XChange will assign it a unique name that will not match the one in the script. In order to do this you have to have PDF-XChange Editor Plus. If you are interested and have the Plus version of the Editor let me know.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Feature Request

Post by Tracker Supp-Stefan »

Hello Lev,

Many thanks for offering to create that. Let us know if we can assist in any way!

Cheers,
Stefan
pat.sharp
User
Posts: 2
Joined: Tue Sep 07, 2010 6:16 pm

Re: Feature Request

Post by pat.sharp »

Hi There, I purchased the "PRO" product, so I believe that I do have the Editor Plus. Thank you for offering to help out. I look forward to seeing what you come up with. I think a lot of people would want to get a copy of what you have.

Thanks!
User avatar
Patrick-Tracker Supp
Site Admin
Posts: 1645
Joined: Thu Mar 27, 2014 6:14 pm
Location: Vancouver Island
Contact:

Re: Feature Request  SOLVED

Post by Patrick-Tracker Supp »

Hello all,

Thank you for your posts. It is indeed possible to create an incremental dynamic stamp using Editor plus. It is a little bit convoluted, so I have attached an example. Simply save the attached PDF under C:\Users\<user>\AppData\Roaming\Tracker Software\PDFXEditor\3.0\Stamps and restart the editor to see this counter. I admit it is a very simple example - If you are interested in creating your own, please see the steps below.

1- First, you must create a new PDF document on which you will create the visual aspects of the stamp. I have created a standard 8 1/2 X 11 page and placed a circle annotation on to it:

Image

This circle will be the border of the new stamp. Make sure to go to Comments> Flatten Comments before moving on to the next step.

2- Now, save this file to a convenient location (e.g. your Desktop). For the purpose of these instructions, we shall call it Counter2.pdf.

3- Close Counter2 leaving the Editor launched. Go to Tools> Comment and markup tools> Stamps pallet, and choose "New From File" and chose Counter2.pdf.
Image

4- In the next window, name the stamp to your desire (I have named it Counter2). Then choose "Add new" next to Target collection. I have named the new collection "Counters". Then click OK.

For these next steps, you will need either an Editor Plus or PDF-XChange PRO license.

5- Within windows explorer (aka File Explorer), navigate to C:\Users\<user>\AppData\Roaming\Tracker Software\PDFXEditor\3.0\Stamps. You can type the following in order to jump to the Roaming subfolder:

Code: Select all

%Apdata%
6- Within the \Stamps directory, you should see a PDF resulting from your new stamp collection. Order by newest to find Counter2. Once you are confident that you have found the correct stamp PDF, I recommend renaming it for convenience's sake. I have named it "Counters.pdf" because this file contains the aforementioned stamp collection.

7- Close the Editor.

8- Move "Counters.pdf" to your desktop, then open it in the Editor.

9- Go to Form> Edit Form and place a text field in the location you wish the number to show:

Image

Tip: In the properties toolbar, you can change the border fill to none, so that the boundaries of the form field are not shown on the stamp.
Tip: Change the Text alignment to centred so that the number is centred in the stamp.

11- Activate the properties pane (View> Other panes> Properties)

12- Make sure you select the text field with the Edit Form function active. Then look for the "Value Calculation" property. It should be at the bottom. Set it to "Custom action".

13- You will now see an additional option populate called "Run a JavaScript". Click on the ... button to activate the JavaScript Console.

Image

14- Paste the following script into the JavaSchript consol.

Code: Select all

if (event.source.forReal && (event.source.stampName == "TCS9kAUOm4Abn56QZCOZE3"))
{
	var counter = 0;
	if (typeof event.source.source.info.stampCounter != undefined)
	{
		counter = event.source.source.info.stampCounter;
	}
	counter++;
	event.source.source.info.stampCounter = counter;
	event.value = counter;
}
else
{
	event.value = 1;
}
15- Save and close Counters.pdf and the Editor.

16- Move Counters.pdf back into C:\Users\<user>\AppData\Roaming\Tracker Software\PDFXEditor\3.0\Stamps

17- Were this a typical dynamic stamp, you would be done here. However, to ensure the counter works correctly, and for each document, there are a couple more steps.

18- Launch the Editor and create a new document. Then go to the stamps pallet and place Counter2 anywhere on the page. Leave the stamp selected and use the keyboard shortcut Ctrl+J to launch the JS console again.

19- Paste the following code into the JS console, then click run:

Code: Select all

this.selectedAnnots[0].AP
20- The results should look similar to this, however, the code is generated by your PC, therefore will differ from mine:

Image

21- Copy this key to your clipboard, then close the Editor.

22- Move Counters.pdf back to your Desktop then open it in the Editor.

23- Activate the Edit form tool and select the text field. Go to the Properties pane and select ... next to the "Run a JavaScript" and replace "TCS9kAUOm4Abn56QZCOZE3" located on line one, with the string gathered in steps 20/21.

24- Save Counters.pdf, and close the Editor. Move Counters.pdf back into C:\Users\<user>\AppData\Roaming\Tracker Software\PDFXEditor\3.0\Stamps

You should now be able to use this counter2 stamp!

I hope this helps!
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Cheers,

Patrick Charest
Tracker Support North America
User avatar
Patrick-Tracker Supp
Site Admin
Posts: 1645
Joined: Thu Mar 27, 2014 6:14 pm
Location: Vancouver Island
Contact:

Re: Feature Request

Post by Patrick-Tracker Supp »

Examples.
Attachments
Counters.pdf
(4.85 KiB) Downloaded 216 times
CounterStamps.pdf
(4.83 KiB) Downloaded 222 times
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Cheers,

Patrick Charest
Tracker Support North America
lev
User
Posts: 258
Joined: Fri Apr 11, 2014 1:18 am

Re: Feature Request

Post by lev »

Pat,

If you still need a stamp that would allow you to have your own text inside the circle, let me know.
User avatar
Patrick-Tracker Supp
Site Admin
Posts: 1645
Joined: Thu Mar 27, 2014 6:14 pm
Location: Vancouver Island
Contact:

Re: Feature Request

Post by Patrick-Tracker Supp »

Hi Lev,

As far as I know it is not possible to have a text box with a circular border. This is specified by the PDF specification (so far as I can tell by deciphering the legal/technical jargon of the ISO for PDF specification). I am very interested to know what you have in mind!

Cheers :)
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Cheers,

Patrick Charest
Tracker Support North America
lev
User
Posts: 258
Joined: Fri Apr 11, 2014 1:18 am

Re: Feature Request

Post by lev »

Pat,

Attached PDF contains a stamp that will prompt you for a comment that will then be placed inside a circle. There's a text field inside the circle wide enough to accept 3 alphanumeric characters. The text field contains a script that triggers a dialog box that you'll enter your comment.

You'll have to import the PDF into your stamp palette. Once you import the stamp, open the Java Console (press Ctrl+J) and apply the stamp to a blank file. The Java Console will show the new stamp name, which you'll have to paste in place of the name saved inside the script. Look for

Code: Select all

if (event.source.forReal && (event.source.stampName == "Y1HMj0OBA6MpLEOsA1Jdg1"))
line near the bottom of the script. To get to the script you will have to activate the Edit Form tool and select the text field. Go to the Properties pane and select ... next to the "Run a JavaScript" at the bottom of the pane.

As Patrick indicated your stamp collection is located in C:\Users\<user>\AppData\Roaming\Tracker Software\PDFXEditor\3.0\Stamps. If you open a PDF saved in that folder to edit the script (to modify the stamp name), you'll have to Save As, since the Editor has the file in use. I generally add -1 to the end of the file (before the period). You'll have to close the Editor and delete the old stamp collection file. Make a backup of the original collection if you have anything you do not want to loose while trying to get this stamp working.

Let me know if you have any difficulties. If everything goes right you'll have to ask Patrick to add his counter to my script so that you could supply a starting value and each time you apply a stamp the value will be incremented by 1.
Attachments
DynamicCircle.pdf
(5.61 KiB) Downloaded 261 times
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: Feature Request

Post by Will - Tracker Supp »

Perfect, thanks very much Lev!

Re. circular text boxes - As far as I'm aware, it's only possible via the dynamic stamp method provided by Lev., as mentioned by Patrick, but an actual circular textbox annotation cannot be implemented, insofar as I'm given to understand.

Cheers,
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
jimytee
User
Posts: 1
Joined: Wed May 22, 2019 10:06 am

Re: Feature Request

Post by jimytee »

Hello,

is it possible to reset the counting number, after setting a few stamps?


regards,
jim
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: Feature Request

Post by Will - Tracker Supp »

Hi Jim,

This would be implemented within the script inside the stamp itself. You would simply set the counter variable to 0, after 'x' number of increments.

Thanks,
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
lindermman
User
Posts: 112
Joined: Sun Oct 21, 2018 10:17 am

Re: Feature Request

Post by lindermman »

Hi, people!
Sorry to bring this topic back. But thanks to this topic, I create a new tool.
Based on "Dynamic Circle" by lev, I made this new tool that I use to make annotations on my files.
I´ m a student, and all my study material are in PDF and I use the PDF XChange Editor to insert notes.

--> lev: I used the same code of DinamicCircle that you create. I just modified some properties and changed the circle by a brace.

If anyone wants to make some improvement, it will be very welcome!

Thank you, people! Thanks, lev!!!!
Attachments
DynCirc.pdf
(8.3 KiB) Downloaded 144 times
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: Feature Request

Post by Will - Tracker Supp »

Awesome, thanks for sharing lindermman! :D
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Post Reply