Re: Filled polygons print to PDF as opaque



Hi Tom,

I cross posted this question to the Adobe Acrobat Windows users forum.
I got the same answer from 2 people (3 including Bob Powell on this forum)
that PostScript does not handle Transparent (or at least partially
transparent patterns) and the PDF driver uses PostScript to do the heavy
lifting.

I guess that I am stuck with printing to a bitmap or drawing lines into a
clip area to form my own patterns if I want accurate output from PDF.

Bill

"tommaso.gastaldi@xxxxxxxxxxx" wrote:


Hi Bill,

I have been printing on a PS printer using transparency. It worked
fine, but ... I must say, much slower compared to when you use solid
color.

The difference wrt your code is that I used solidbrushes with a
variable alpha value. I suspect the problem is related with
"Color.Transparent". Try changing that with something like
Color.FromArgb(10, AColor). If you cannot solve the problem with that,
perhaps an idea could be that of doing it using solidbrushes...

Let me know your findings, I am interested in this question...

-tom

billw@xxxxxxxxxxxxx ha scritto:

Hi James,

Thanks. That makes sense.
Is this an educated guess or do you have some knowledge of the print drivers?

In either case, your implication is that I'm stuck with a bitmap if I want
accurate output. Right?

Thanks again,
Bill

"James Westgate" wrote:

I Believe this is a function of the print driver , ie it is not fully
GDI+ compliant

billw@xxxxxxxxxxxxx wrote:
I am using .NET 1.1 (C#) to draw a graph.

I am having trouble printing overlapped polygons that are filled with a
transparent brush (HatchBrush(AHatchStyle, AColor, Color.Transparent)) to a
PDF (or any PostScript based printer.) They print as though they are opaque,
not tranparent. I could draw into to a bitmap and then print the bitmap, but
that could be slow/huge. What else would you suggest?

Bill

PS
Here is a snippet that can be pasted into a new C# Windows Application
project with a Button, a PrintDocument & a PrintDialog (be sure to connect
the event handlers after pasting):

private void button1_Click(object sender, System.EventArgs e)
{
DialogResult result = printDialog1.ShowDialog();

if (result==DialogResult.OK)
{
printDocument1.Print();
}
}

static readonly Point[] s_P1 = new Point[] {new Point(10, 10), new Point(30,
150), new Point(180, 180), new Point(150, 30)};
static readonly Point[] s_P2 = new Point[] {new Point(80, 80), new Point(50,
220), new Point(190, 190), new Point(220, 50)};

Brush m_BG = new SolidBrush(Color.White);
Brush m_F1 = new HatchBrush(HatchStyle.ForwardDiagonal, Color.Black,
Color.Transparent);
Brush m_F2 = new HatchBrush(HatchStyle.BackwardDiagonal, Color.Blue,
Color.Transparent);

private void printDocument1_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.FillRectangle(m_BG, e.Graphics.ClipBounds);
e.Graphics.FillPolygon(m_F1, s_P1);
e.Graphics.FillPolygon(m_F2, s_P2);
}




.


Loading