Skip to main content
kerenm51152362
Participant
August 22, 2018
Question

visibleBounds seems to have changed behavior between 2014 and 2018

  • August 22, 2018
  • 4 replies
  • 1164 views

Just installed our new PC and got Illy 2018 ( we have 2014 on the previous machine ).

We have a script that creates a document and then crops it to the visibleBounds rectangle.

That worked just fine in Illustrator 2014 but in 2018 instead of returning the real visual bound - it rather seems to return the Artboard bound of the document

I suspect there is a chance my approach may have been wrong at the first place but it worked before (by luck?).

Can someone please tell me how to deal with it ?

( I installed the 2014 on the new machine but now I am back to the dreadful PARM errors very often. I guess the new machine is too fast for the old Illy )

thanks in advance

This topic has been closed for replies.

4 replies

kerenm51152362
Participant
August 27, 2018

Thanks everyone for the help.

I found the real problem and hence the difference between the Illustrator 2014 and 2018

When looked closely at my file, I noticed an empty Path object at the outer perimeter

In Illustrator 2014 an empty path object does not count for "visible" and thus the visible boundary was smaller while in 2018 version it does count even though it is empty and has no stroke or anything at all

Disposition_Dev
Legend
August 27, 2018

"visibleBounds" is not a valid property of the document object.

visibleBounds is a property of PageItem

Silly-V
Legend
August 27, 2018

Actually believe it or not, it is!

When the document is blank, it alerts this: 0,0,0,0.

But when you have a square with a 1 pt stroke with its geo bounds (the path corner) at 0,0 the visibleBounds are:

-0.5,0.5,150.5,-150.5

Disposition_Dev
Legend
August 22, 2018

additionally, i'm confused about what you mean when you say that your script "creates a new document and then crops it to the visible bounds". If you're creating a new document, presumably there is no artwork in it, so there can be no visible bounds, as visibleBounds is a property of an art object.

if you can provide as much information as possible, we will have a much better chance of being helpful.

Silly-V
Legend
August 22, 2018
We have a script that creates a document and then crops it to the visibleBounds rectangle.

Yea, when a new document is created, there's nothing in it and there's no visualBounds of anything.

renél80416020
Inspiring
August 26, 2018

Salut !

alert(app.documents[0].visibleBounds)

Retourne un tableau de 4 nombres

Lecture seule. Limites visibles du document, incluant l’épaisseur de contour de tous les objets de l’illustration.

- Si le document est vide

retourne

0,0,0,0

-------------------

en anglais

Read-only. The visible bounds of the document, including stroke width of any objects in the illustration.

Disposition_Dev
Legend
August 22, 2018

can you share your script? can you share a test file?

It's very difficult to offer any advice or debugging at all unless we have something to work with.