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 |
I will wait for Rallaz's opinion on this first.
|
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() |
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 -- Dongxu Li, Ph.D. www.librecad.org |
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 |
Hi dxli,
I have compiled latest commit, but still not function BR, timbul |
Free forum by Nabble | Edit this page |