Print Page | Close Window

SetFillColor does not work with DAOpen API

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3397
Printed Date: 04 May 24 at 6:28PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: SetFillColor does not work with DAOpen API
Posted By: lakkan
Subject: SetFillColor does not work with DAOpen API
Date Posted: 14 Oct 16 at 2:30PM
Hi,

SetFillColor and DrawBox API functions does not work, when PDF file is accessed using QP.DAOpen("xxx.pdf") API function , but they work, if file is loaded using  QP.LoadFromFile("aaa.pdf");

Please let me know, if you have any solution for this, I want to make SetFillColor, DrawBox functions to work,when file is accessed using DAOpen().

I am using:  DEBENU PDF Library version: 12.11 ,win32 API and C/C++.

Regards
Lakkan.



Replies:
Posted By: Ingo
Date Posted: 14 Oct 16 at 2:58PM
Hi Lakkan,

you should NEVER mix DA- and non-DA-functions.
This won't work...
Please read about DaOpenFile:
http://www.debenu.com/docs/pdf_library_reference/DAOpenFile.php



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



Posted By: lakkan
Date Posted: 18 Oct 16 at 2:22PM
Hi Ingo,

Thanks for your information.

I require to implement FillColor and DrawBox functions, after opening the file with DAOpen API.

Are there any alternate DA functions, which fills the color  and draw the box in DAOpen Mode.

Please let me know, if you have any information on that.

Regards
Lakkan


Posted By: Ingo
Date Posted: 18 Oct 16 at 2:52PM
Hi Lakkan,

there aren't alternate DA functions for this.
In your case you should avoid DAOpen.
Use the similar LoadFromFile.
The DA-functions were made long ago - the library couldn't handle large files proper in the past...
Today you shouldn't need the DA-functions anymore.



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



Posted By: MyNameIsMyName
Date Posted: 07 Dec 16 at 11:24AM
Hi
I've prepared code below:

var
  QP: TDebenuPDFLibrary;
begin
  dlgSave.FileName := 'Rotated.pdf';
  if dlgSave.Execute then
  begin
    QP := TDebenuPDFLibrary.Create;
    try
      if QP.UnlockKey(edtLicenseKey.Text) = 1 then
      begin
        QP.SetPageSize('A4');
        QP.SetOrigin(1);
        QP.SetMeasurementUnits(1);

        QP.SetFillColor(230, 230, 230);

        QP.DrawBox(10, 10, 10, 10, 1);
        QP.CompressContent;
        QP.SaveToFile(dlgSave.FileName);
      end else
        MessageDlg('The license key is invalid or has expired.', mtError, [mbOK], 0);
    finally
      QP.Free;
    end;
  end;
end;

It seems, calling the command SetFillColor with those parameters doesn't cause drawing gray square like it should be done. Is there something am I doing wrong? I am very beginner with QuickPDF Library.


Posted By: Ingo
Date Posted: 07 Dec 16 at 9:32PM
Hi MyNameIsMyName,

did you read all about SetFillColor?
No... you didn't ;-)
http://www.debenu.com/docs/pdf_library_reference/SetFillColor.php
The values representing the colours has a range from 0 up to 1 ( SetFillColor(1,1,1) means black ).

Cheers and welcome here,
Ingo



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




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