Author Topic: pdf- export. comment-sticky-notes - offset. HOW TO AVOID  (Read 13237 times)

0 Members and 1 Guest are viewing this topic.

hidden layer

  • Full Member
  • ***
  • Posts: 138
pdf- export. comment-sticky-notes - offset. HOW TO AVOID
« on: October 16, 2018, 11:37:26 AM »
Hi there,

for export to pdf I use Acrobat PDFMaker Add-On (some files in Add-Ins Directory).
One reason is that I can export layers, comments and so on for technical overviews with lots of Details.
In preferences I check in the function 'convert comments to Adobe PDF comments'.

While exporting visio-files to pdf the shapes with some content in shapesheet-miscellaneous-comment this Add-On creates the sticky notes for these comments (as a hint for additional Information).
When opening the pdf in full page view (100% zoom) these sticky notes have an offset to the shape they belong to. When zooming in the offset remains but will be reduced. (at 1600% zoom it's next to the shape.)

As a workaround I shift the pop-ups in pdf to its shapes and save it before spreading to others.

So the question is:
is it possible to avoid this offset?

I want to raise this question here before I mess around wit Javascript in Acrobat- maybe ist possible to shift all the sticky notes with one script- maybe not.

Thanks a lot for any advice.
cheers,
Peter

oh- I forgot: Visio 2010 32-Bit, Acrobat PDFMaker 18 for Visio, Acrobat ProDC Version 18.11.20035.264147; Windows7 Version 6.1.7601
« Last Edit: October 16, 2018, 12:03:17 PM by hidden layer »

metuemre

  • Full Member
  • ***
  • Posts: 178
Re: pdf- export. comment-sticky-notes - offset. HOW TO AVOID
« Reply #1 on: October 17, 2018, 04:35:41 AM »
It is possible to create a new comment in pdf or access existing comments and read their properties directly from VBA. But Adobe does not let you change properties (position, content, type, etc.) of existing comments.

A workaround is to make a folder level javascript file, put a function in it and call that function from a VBA macro. I attached two files as an example. You need to put ShiftComment.js file to the javascripts folder in C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\Javascripts and restart the Acrobat. Since you are using Acrobat DC, path to this folder may be different.

When you run VBA macro in visio file, it opens a file explorer for you to select a pdf file. Then it will ask the shift value. Then it will pass this value to the function in javascript file. Javascript function will read all the comments in the pdf and shift them to left or right based on the value you entered. Positive values will shift the comments to right and negative values to left. Note that for a 8.5 x 11 PDF page:
x-axis range is 0 - 612 pts
y-axis range is 0 - 792 pts
(1 inch = 72 pts)

Feel free to ask if you face any problems.

Tested on Visio 2013 Pro, Acrobat XI Standard on a Windows 7 64 Bit machine.

hidden layer

  • Full Member
  • ***
  • Posts: 138
Re: pdf- export. comment-sticky-notes - offset. HOW TO AVOID
« Reply #2 on: October 18, 2018, 02:08:23 AM »
Hello metuemre
thank you for your explanation and effort.
I thought as much that it will be not that easy...

I've checked with a testfile but your proposal doesn't seem to work.

Maybe it's my fault but here is how I've done it.

The .js file is in "C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Javascripts\"

I've executed the macro [Sub ShiftComments()], choose a testfile, entered 100 in the Inputbox (which should be definitive visible) but the appearance in Acrobat is the same.
In attachment you'll see how it appears in Acrobat at 105% zoom. The sticky note appears left above the red square (which contains the comment).

Any idea what went wrong?
I'm just wondering why the InputBox expects only a value (without axis x or y).

cheers
Peter

metuemre

  • Full Member
  • ***
  • Posts: 178
Re: pdf- export. comment-sticky-notes - offset. HOW TO AVOID
« Reply #3 on: October 18, 2018, 02:41:18 AM »
Hi Peter,

I thought you just wanted to shift the comments in x axis. I can add y axis as well. It will be easier to troubleshoot if you can provide a sample visio file. Did you get any error after execution of the macro?

hidden layer

  • Full Member
  • ***
  • Posts: 138
Re: pdf- export. comment-sticky-notes - offset. HOW TO AVOID
« Reply #4 on: October 24, 2018, 10:46:30 AM »
Hi metuerme,
sorry for late reply- some circumstances...

I got no error message while executing the macro-  But I'm not sure if anything avoid the macro working. Thanks to admin rights I could store the macro in the dedicated Folder- so there was no visible blocking Point.
But as I told there was no shift of the bubble visible. I thought that a value of 100 would be definitive visible- am I wrong?

In Visio this works fine. I have A3-format with around 100 shapes- each with a comment and you can easily find to which shape a comment belongs to.
Exporting to pdf is (from my perspective) responsible for the Offset. After exporting the comment-bubbles seems to belong to another shape more above and more right. If you zoom in it gets better but this is very inconvenient.
If you open the pdf- you'll see how it Looks like. The visio is it's original.

The Thing to open the Point here was to find out if there is a solution already known.

Thanks for helping anyway!

cheers
Peter

metuemre

  • Full Member
  • ***
  • Posts: 178
Re: pdf- export. comment-sticky-notes - offset. HOW TO AVOID
« Reply #5 on: October 25, 2018, 02:57:26 AM »
Hi Peter,

I tried the macro on a different computer with Visio 2010 pro and Acrobat DC Pro and it still works. -17 for x and y axises shift comments on top of colored boxes perfectly.

Another option for you is to use Acrobat Action Wizard. First replace the ShiftComments.js file in App Folder with the attached one. Then go to Tools - Action Wizard - New Custom Command - Execute Javascript in Acrobat DC Pro. Then give a proper name to the label. After you click OK the Javascript Editor window opens, put "reposition(-17,-17)" in there without double quotes. Select "Don't show options, options are always the same". After you click OK, on the right pane, you will see your Command under Custom Commands. Each time you click that command will shift comments in the document. Note that this command will be accessible to every pdf document so you don't have to create it again.

Feel free to ask if you face any problems.
Emre

hidden layer

  • Full Member
  • ***
  • Posts: 138
Re: pdf- export. comment-sticky-notes - offset. HOW TO AVOID
« Reply #6 on: October 26, 2018, 05:44:02 AM »
Hi Emre,
I'll try this on Monday.

Thanks so far- have a brilliant Weekend,
Peter

hidden layer

  • Full Member
  • ***
  • Posts: 138
Re: pdf- export. comment-sticky-notes - offset. HOW TO AVOID
« Reply #7 on: November 21, 2018, 02:31:16 AM »
Hi Emre,
unfortunately it was another Monday - new laptop- new Problems...but after all I got it.

yes this works with the Action wizard.

after checking the functionality I figuerd out that the 1st value have to be positive to move the comments left (and the second remains negative to move them down)... anyway- it works!
Also I let the Checkbox deselected to move them succesively to the optimal Position.

So thanks again for this and the Patience

Peter