Print Scale Factor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Print Scale Factor

timbul
if we open dxf file with text editor print scale factor was saved in dxf file

$PSVPSCALE
...
0.1 (in this example print scale factor = 1:10)
...

1. open drawing
2. print preview
3. set print scale (1:10 for example)
4. save drawing
5. close drawing
6. open drawing again
7. print preview

you will need to set print scale again,
check fixed check box (lock print scale to current value) we will need more effort to remember scale factor if we work with many and different paper size with vary paper scale.

Timbul
Reply | Threaded
Open this post in threaded view
|

Re: Print Scale Factor

dxli
I will wait for Rallaz's opinion on this first.
Reply | Threaded
Open this post in threaded view
|

Re: Print Scale Factor

Rallaz
The var $PSVPSCALE was introduced in DXF 2000 and stores
"View scale factor for new viewports" that is, when you create a
new "viewport" entity in paper space this entity are created using
the relation into model/paper stored in this var.
Valid values:
0 = Scaled to fit
>0 = Scale factor (a positive real value).

In DXF the print configuration are stored in OBJECTS section as
PLOTSETTINGS.
The PLOTSETTINGS object contains print scale, paper size, print
area and more.

LibreCAD implementation:
Read/write object section are NOT implemented in dxf library,
therefore can not be saved PLOTSETTINGS object, but the var
$PSVPSCALE are read and saved.
seem that QCAD uses $PSVPSCALE for save the scale factor
and LC also, but in first call to print preview are called
RS_ActionPrintPreview::fit().

Dongxu, I think you know better than me the code relating to
printing, but I think with a few simple changes could work:

One possibility is something like:
File qg_printpreviewoptions.cpp
line #123 void QG_PrintPreviewOptions::setAction(...)

                updateDisabled=true;
                setScaleFixed(true);
            }else{
-                fit();
+                double currScale = graphic->getGraphicVar("$PSVPSCALE", 0);
+                if(currScale  > 0.0)
+                    scale (currScale);
+                else
+                    fit();
                setScaleFixed(false);
            }
        }else{

Another option are check "$PSVPSCALE" in
RS_ActionPrintPreview::showOptions() and initialize one double var,
then in QG_PrintPreviewOptions::setAction() call scale() with this value
instead of call fit()
Reply | Threaded
Open this post in threaded view
|

Re: Print Scale Factor

dxli
Hi Rallaz,

Thanks a lot for the explanation. I will work on the relevant painter support here.

Thanks,

Dongxu

On Thu, Jun 21, 2012 at 11:56 AM, Rallaz [via LibreCAD] <[hidden email]> wrote:
The var $PSVPSCALE was introduced in DXF 2000 and stores
"View scale factor for new viewports" that is, when you create a
new "viewport" entity in paper space this entity are created using
the relation into model/paper stored in this var.
Valid values:
0 = Scaled to fit
>0 = Scale factor (a positive real value).

In DXF the print configuration are stored in OBJECTS section as
PLOTSETTINGS.
The PLOTSETTINGS object contains print scale, paper size, print
area and more.

LibreCAD implementation:
Read/write object section are NOT implemented in dxf library,
therefore can not be saved PLOTSETTINGS object, but the var
$PSVPSCALE are read and saved.
seem that QCAD uses $PSVPSCALE for save the scale factor
and LC also, but in first call to print preview are called
RS_ActionPrintPreview::fit().

Dongxu, I think you know better than me the code relating to
printing, but I think with a few simple changes could work:

One possibility is something like:
File qg_printpreviewoptions.cpp
line #123 void QG_PrintPreviewOptions::setAction(...)

                updateDisabled=true;
                setScaleFixed(true);
            }else{
-                fit();
+                double currScale = graphic->getGraphicVar("$PSVPSCALE", 0);
+                if(currScale  > 0.0)
+                    scale (currScale);
+                else
+                    fit();
                setScaleFixed(false);
            }
        }else{

Another option are check "$PSVPSCALE" in
RS_ActionPrintPreview::showOptions() and initialize one double var,
then in QG_PrintPreviewOptions::setAction() call scale() with this value
instead of call fit()



If you reply to this email, your message will be added to the discussion below:
http://forum.librecad.org/Print-Scale-Factor-tp5706781p5706793.html
To start a new topic under LibreCAD-dev, email [hidden email]
To unsubscribe from LibreCAD-dev, click here.
NAML



--
Dongxu Li, Ph.D.
www.librecad.org

Reply | Threaded
Open this post in threaded view
|

Re: Print Scale Factor

dxli
In reply to this post by timbul
Hi timbul,

Would you please test my commit: 34b00a6c9

Looks like PSVPSCALE was already there, but somewhere in development, we (most likely I should be the one to blame) messed it up. The printpreview part has been messy for long. hopefully, the framework is robust enough for us to easily tweak it.

Thanks,

dxli
Reply | Threaded
Open this post in threaded view
|

Re: Print Scale Factor

timbul
Hi dxli,

I have compiled latest commit, but still not function

BR,
timbul
Reply | Threaded
Open this post in threaded view
|

Re: Print Scale Factor

dxli
Hi timbul,

I will troubleshoot more.

thanks for testing!

dxli

timbul wrote
Hi dxli,

I have compiled latest commit, but still not function

BR,
timbul