I am trying to create a simple pink rectangle but the following code DOES NOT give ne a pink colour.
What am I doing wrong. All you have to do is set Red, Green and Blue.
Looks like a bug...... :-(
dim colour as ceTe.DynamicPDF.RgbColor = New ceTe.DynamicPDF.RgbColor(255, 0, 255)
None of the below have worked.
'pink 255 20 147
'pink 255, 105, 180,
'pink 255, 192, 203,
'pink 255, 182, 193,
'pink 255, 20, 147,
Regards,
Preetinder Chagger
ceTe.DynamicPDF.RgbColor
Re: ceTe.DynamicPDF.RgbColor
Support · Nov 12, 2007Hello Preetinder,
We are able to create a rectangle with the color RgbColor(255, 0, 255) without any problem. Please make sure that you are using the latest build of our product. We have used the other color combinations also without any problem. Following is the code we used to create this rectangle.
Document doc = new Document();
Page page = new Page();
Rectangle rec = new Rectangle(10, 10, 100, 100);
RgbColor col = new RgbColor(255, 0, 255);
rec.BorderColor = col;
page.Elements.Add(rec);
doc.Pages.Add(page);
doc.DrawToWeb();
Thanks,
ceTe Software Support Team.
Re: ceTe.DynamicPDF.RgbColor
Forum member · Feb 7, 2018This doesn't work. Intelsense says rgbcolor() takes intergers but at run type DynamicPDF throws a GeneratorException saying RGB values must be from 0.0 to 1.0.
Re: ceTe.DynamicPDF.RgbColor
Support · Feb 8, 2018Hello,
Converting the integer values into respective RGB float values should work. Here is the code:
Dim MyDocument As Document = New Document()
Dim MyPage As Page = New Page()
MyDocument.Pages.Add(MyPage)
Dim rect As Rectangle = New Rectangle(50, 500, 150, 75)
Dim redValue As Single = 128 / 255
Dim greenValue As Single = 0 / 255
Dim blueValue As Single = 0 / 255
rect.FillColor = New RgbColor(redValue, greenValue, blueValue)
MyPage.Elements.Add(rect)
MyDocument.Draw("C:\Temp\MyDocument.pdf")
Thanks,
ceTe Software Support Team.