I noticed that when I make a shape invisible programmatically via macros, it gets hidden from print preview as well, which is not expected. However the same thing does not happen for shapes in LO draw (ie shapes hidden from view come in the print preview). On debugging I realized that the object types used in both cases were different.
I also noticed when I hide a shape from printing it gets hidden when I print the file, but not when I Print preview it or export it as a pdf, which is inconsistent behaviour
These issues are not present in draw as mentioned before.
I have tested this out on OO 4.1.5 as well and this issue is also present there.
Can someone please verify this issue as well? If you are able to reproduce it, I will raise a bug.
I am using LO 6.3 on Mac OS 10.13.6.
Edit : The issue is different from what I explained earlier. I have modified the question and description to that effect and attached a file. I had incorrectly mentioned that the shape was hidden from printing. But the issue is not with printing but in print preview and export as pdf