Page 1 of 1

How to print white text and area visible

Posted: 22 Jul 2008, 15:55
by yannick
Hello,

-I add some CADText in a new layer and i use White color because i choose black color for cadimage background.
When i print with following code, the new text doesn't appear because background of page is white:
PrintingForm prtForm = new PrintingForm();
System.Windows.Forms.PrintPreviewDialog printPrevDlg = new System.Windows.Forms.PrintPreviewDialog();

prtForm.Image = this.cadImage;
prtForm.CreateNewPages();

prtForm.TypePage = DrawingSize.Fit;
printPrevDlg.Document = prtForm.Print(false);
printPrevDlg.ShowDialog();
if (printPrevDlg.Document != null)
printPrevDlg.Document.Dispose();

In orignal dwg file some text exist and appear with white color in cadImage and when i print the file they appear black on print page.
How can i do same think?

Here is code use to add new Text :
CADLayer entLayer = (CADLayer)cadImage.Converter.Layers["TEST"];
CADText text= new CADText();
text.Color = Color.white;
text.Point = ptOrigine;
text.Height = dbHeightText;
text.Rotation = 0;
text.Text = sText;
text.LineWeight = 2;
cadImage.Converter.GetSection(ConvSection.Entities).AddEntity(entity);
cadImage.Converter.OnCreate(entity);
cadImage.Converter.Loads(entity);
text.Layer = entLayer;

- If i add a new CADText at top of the screen it doesn't appear in the preview print screen. As if new objet wasn't use to calcul new size of cadimage.
- How can i print only area visible on screen not entire map file?

Best regards, yannick.

Re: How to print white text and area visible

Posted: 22 Jul 2008, 18:22
by support
Hello!
-I add some CADText in a new layer and i use White color because i choose black color for cadimage background.
It is necessary to use it like the following:

Code: Select all

text.Color = CADConst.clNone;
- If i add a new CADText at top of the screen it doesn't appear in the preview print screen. As if new objet wasn't use to calcul new size of cadimage.
It is necessary to use two lines in addition:

Code: Select all

this.cadImage.GetExtents();
this.DoResize();
- How can i print only area visible on screen not entire map file?
Currently our demos have no respective example. We will inform you when it is ready.

Sergey.