Print Page | Close Window

FillColor is always white

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3845
Printed Date: 29 Mar 24 at 12:30AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: FillColor is always white
Posted By: Sykh
Subject: FillColor is always white
Date Posted: 17 Sep 20 at 10:56AM
Hi everyone,
im using V18 with c# and im trying to draw a colored box...i got the box on the right position, right size but the fill color is always white even tho i called SetFillColor with a 0-1 double and not 0-255 int Wink

Any clues? SetFillColor returns 1, the Box gets drawn, i see the outline but the inside is always white.


        private String preparePage(String path, String filename)
        {
            PDFLibrary tempQp = this.loadDLL();
            tempQp.LoadFromFile(path + filename, "");
            tempQp.SetOrigin(1);
            //tempQp.SetFillColor(196, 214, 240);
            Console.WriteLine("SetFillColor: "+tempQp.SetFillColor(0.93, 0.29, 0.42));
            tempQp.SetLineColor(0, 1, 0);
            Console.WriteLine("Preparing " + filename);
            double pageHeight = qp.PageHeight();
            tempQp.NewOutline(0, filename, 1, 0.0);

            for (int i = 1; (i <= tempQp.PageCount()); i++) {
                Console.WriteLine("Adding Coorporate Identity on Page " + i);
                tempQp.SelectPage(i);
                Console.WriteLine("Page Height: " + pageHeight + " Width: " + tempQp.PageWidth());
                tempQp.DrawBox(0.0, 0.0, tempQp.PageWidth(), 77.0, 2);
            }
            
            tempQp.SaveToFile(tempPath + filename);
            return (tempPath + filename);
        }


Thanks.



Replies:
Posted By: tfrost
Date Posted: 17 Sep 20 at 5:57PM
If you run the DebenuPDFLibraryDemo program and run the Vector Graphics/DrawShapes script, do you get green circles?   If so, I would try moving the SetFillColor to inside your loop, but I do not know why that would be necessary, if it is.


Posted By: Ingo
Date Posted: 17 Sep 20 at 9:42PM
Hi Sykh,

i think it's your SetFillColor.
The first line with SetFillColor is deactivated with the doubled slashes.
The second SetFillColor is only in the WriteLine-syntax.
I think a "tempQp.SetFillColor(0.93, 0.29, 0.42)" alone on a single code line will work.

Cheers and welcome here,
Ingo



-------------
Cheers,
Ingo



Posted By: Sykh
Date Posted: 22 Sep 20 at 11:02AM
Hey Ingo,
this shouldn't and doesn't matter, i run the command in that WriteLine to see if it returns 1 or 0 (it returns 1)


tempQp.SetFillColor(0.93, 0.29, 0.42);
//Console.WriteLine("SetFillColor: "+tempQp.SetFillColor(0.93, 0.29, 0.42));


Still creates white blocks over the blue ones i want to paint over.

Moving it into the loop didn't change it either :(


Posted By: tfrost
Date Posted: 22 Sep 20 at 4:13PM
You did not mention earlier that you were trying to overwrite other blocks.  Are you sure that the blocks are being rendered in the sequence you expect?  It is not an area I am used to dealing with, but might the blue blocks somehow be configured to render on top?  Someone else may be able to say how this could happen.


Posted By: Sykh
Date Posted: 22 Sep 20 at 4:15PM
Na the blue block is gone, thats how i know it's "working" :D
I set the mode to 3, there is a white block with black border exactly at the location i want it to be, it just needs a different fill color.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk