Solidworks - Save Drawing As Pdf Problem (Not a Bug)

Can anybody from Dassault Systèmes tell me if they can stop the following from happening?

 

If I have a Solidworks Drawing (slddrw) open on screen and I save it as a pdf file, either manually or by using VBA or Vb.Net, the drawing shifts to the left of the screen and then back again.

 

I will not call this a bug but, is it possible to fix this so it does not happen with a Solidworks patch?

 

There is also a similar problem when exporting a part as a dxf file, the part zooms in and out a couple of times.

 

Many thanks in advance!

 

Darren

Answers 5
DM
DM 2025-05-27

Has this been reported to the VAR?  I have not had a problem with 2024 the few sp that I work with.  Used the save as pdf.  and then the add in for bluebeam to save a pdf.  
What version are you on? 

SG
SG 2025-05-27

I used SW2023 and recently switched to 2024. Instead of saving as pdf, I always use "print to pdf". I don't have your issue with "print to pdf" command.

DL
DL 2025-05-28

Out of interest, what's the motivation for getting rid of the behaviour?

CG
CG 2025-05-28

you won't get an answer from DS in the public forums - best to go through your VAR

JS
JS 2025-05-28

This is a weird interaction between the zoom value, the feature manager tree and the PDF save function for drawings.  The wider the feature manager tree, the bigger the jump to the left.  If you want to prevent it when saving a PDF programmatically, just hide the feature manager tree before saving as PDF and then restore it after:

Dim swApp As SldWorks.SldWorks
Dim mDoc As ModelDoc2
Dim mExt As ModelDocExtension
Dim errors As Long
Dim warnings As Long
Sub main()
   Set swApp = Application.SldWorks
   Set mDoc = swApp.ActiveDoc
   Set mExt = mDoc.Extension
   mExt.HideFeatureManager True
   mExt.SaveAs "E:\SOLIDWORKS Files\test2.pdf", 0, 0, Nothing, errors, warnings
   mExt.HideFeatureManager False
End Sub