cart: empty [ Login ]

DXF convert to PDF -- white entities on white page

1 2  next > 
FizixMan
11/6/2008 9:10 PM

When we have some white entities in our DXF, AutoCad makes them black when plotting. Now when we convert our DXF to PDF, all the white entities essentially disappear. They are there, but because they're white on a white page they're invisible. I'm wondering if there's some setting or established methodology for DXF-PDF conversion that would handle these white entities. Thanks!

Wout
11/6/2008 9:29 PM

Yes sir! Try using GraphicsConfig.WhiteBackgroundCorrectForBackColor as the graphics configuration when creating the PDF document. Wout

FizixMan
11/7/2008 12:10 AM

Thanks for the quick response! That worked for our shapes, but unfortunately the text stays white. Attached is the DXF we're using for reference. It's the text '1of1' that's staying white. Is this expected?

Wout
11/7/2008 1:51 PM

Hi, It looks like the color of a number of entities is transparent, other programs seem to ignore the transparency, but if you make those entities opaque it should be ok. Wout

FizixMan
11/7/2008 4:16 PM

So for that we would recursively run through all the entities in the DXF and force them to be opaque? It's interesting that the text is being listed as transparent, I don't recall having set anything of the sort. Is there optionally a method to force everything to come out black?

Wout
11/7/2008 4:26 PM

Hi, I think I'll have to look a bit further what the proper behavior is, but the DXF you attached has the 440 group set in the entities (the transparency group). I see that the file is created using CadLib, but you mention that the file comes from somewhere else, can you send me the original unprocessed file? Just wondering how the transparent group got there if you didn't touch it (might be bug somewhere, let's hope not! D) Thanks! Wout

FizixMan
11/7/2008 4:54 PM

This example here is generated from scratch with CadLib. Sometimes we may take an existing DXF and add new items to it, but that is not the case this time. We don't believe we're purposely adding transparent entities to the file, but is it possible we're inadvertently doing so by setting some property on some of the entities or layers? What ways can we create this transparency group? If from these examples we find we aren't using them, then we'll write a quick program that would emulate the same result that our source code does. Maybe from that you can see where we're shooting ourselves in the foot. I attached a smaller version (got rid of all the other stuff except the offending entities) to look at.

Wout
11/7/2008 5:03 PM

Ah, this one also has it. How are you creating the colors? Be careful of setting the A value to 255 if you explicitly set it. Wout

FizixMan
11/7/2008 5:21 PM

I think we may have found it. On our side, we feed in a colour integer. But the source program that produces the colour integers outside CadLib only uses RGB whereas C# uses ARGB. We're investigating, but apparently our colours are using alpha 0 (transparent). I suspect because our integers when converting to System.Color (through Color.FromArgb) are creating the transparency. Thanks for the help, I'll let you know what we find out.

FizixMan
11/7/2008 5:56 PM

Yup, that did it. Any colours being fed into it from our application are now setting the Alpha property to opaque and it's coming out proper now. Thanks for the help!

1 2  next >