Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > General Discussion
  New Posts New Posts RSS Feed - Mac RenderPagetoFile yield 0 byte file
  FAQ FAQ  Forum Search   Register Register  Login Login

Mac RenderPagetoFile yield 0 byte file

 Post Reply Post Reply
Author
Message
eddy2099 View Drop Down
Beginner
Beginner


Joined: 08 Feb 10
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote eddy2099 Quote  Post ReplyReply Direct Link To This Post Topic: Mac RenderPagetoFile yield 0 byte file
    Posted: 28 Aug 14 at 8:08AM
I am a licensed user and running this code for the Mac under Delphi XE6 Firemonkey and using QuickPDF v10.16.

=
procedure TForm1.Button1Click(Sender: TObject);
var
orpdf : tdebenupdflibrary;
orpdfid,ordpageid,rendid : integer;
tdf,newfname : string;

begin
if OpenDialog1.execute then

begin
        tdf := OpenDialog1.FileName;
                        orpdf := TDebenuPDFLibrary.Create;
{$IFDEF MacOS}
orpdf.UnlockKey('[my mac key]’);
{$ELSE}
   orpdf.UnlockKey('[my win key]’);
{$ENDIF}
        orpdfid := orpdf.DAOpenFile(tdf,'');

                 
{$IFDEF MacOS}
            newfname := IncludeTrailingPathDelimiter(savein.Text)+'test'+'.jpg’;
{$ELSE}
              newfname := 'c:\test\test.jpg’;
{$ENDIF}
             ordpageid := orpdf.DAFindPage(orpdfid,1);
           rendid :=    orpdf.DARenderPageToFile(orpdfid,ordpageid,1,72,newfname);

ShowMessage(IntToStr(rendid));

                 end;
end;
=

Running under Windows, I can render my page to a JPG file and it works but when I compile for the Mac, I ended up getting a 0 byte JPEG file with nothing inside.

The same issue with rendering to TIFF or PNG. In the case of PNG, I do get a black page file.

I've tried the Dylib method with the same result.

==
type
   tsetkey = function(a : integer; key: pWidechar): integer; cdecl;
   tpdfcreate = function() : integer; cdecl;
    tpagecount = function(a : Integer) : Integer; cdecl;
    tdaopen =   function(a : Integer;filename : PWideChar;password : PWideChar) : integer; cdecl;
    tdafindpage = function(a : Integer; handle : integer; page : Integer) : integer; cdecl;
    trenderpagetofile = function(a : Integer; handle : Integer; pageref : integer;option : integer; dpi : Double; filename : PWideChar) : integer; cdecl;




procedure TForm1.dylibclickClick(Sender: TObject);
var

p, orpdfid,ordpageid : integer;
tdf,newfname : string;

setkey : tsetkey;
pdfcreate : tpdfcreate;
pagecount : tpagecount;
dafindpage : tdafindpage;
renderpagetofile : trenderpagetofile;
        openfile : tdaopen;
begin

    if OpenDialog1.execute then
        begin
            tdf := OpenDialog1.FileName;
ghandle := LoadLibrary(PChar('libDebenuPDFLibraryDylib1016.dylib')) ;

pdfcreate := GetProcAddress(ghandle,'DPLCreateLibrary');
    setkey := GetProcAddress(ghandle,'DPLUnlockKey');
    pagecount :=       GetProcAddress(ghandle,'DPLPageCount');
    dafindpage :=    GetProcAddress(ghandle,'DPLDAFindPage');
    renderpagetofile :=   GetProcAddress(ghandle,'DPLDARenderPageToFile');
        openfile := getprocaddress(ghandle,'DPLDAOpenFile');
   p := pdfcreate();
    setkey(p,PWideChar('[my mac key]'));
      newfname := IncludeTrailingPathDelimiter(ExtractFilePath(OpenDialog1.filename))+'test.png';
      orpdfid := openfile(p,PWideChar(tdf),PWideChar(''));
          ordpageid := dafindpage(p,orpdfid,1);
        renderpagetofile(p,orpdfid,ordpageid,5,72,PWideChar(newfname));

        end;

end;

==

I've contacted support about this matter and they reported that it worked without issue on their system so I am really at a lost. I am using Mac OS X 10.9.4 .

Am I doing anything wrong here ?

Thank you.

Edited by eddy2099 - 28 Aug 14 at 8:15AM
Back to Top
Kenneth488 View Drop Down
Beginner
Beginner
Avatar

Joined: 03 Oct 14
Location: DK
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kenneth488 Quote  Post ReplyReply Direct Link To This Post Posted: 03 Oct 14 at 12:15PM
I have the same issue! Debenu is talking about an add-on, but as far as I have seen, it's only for windows.

http://www.debenu.com/kb/use-rendering-printing-add-debenu-quick-pdf-library/


Edited by Kenneth488 - 03 Oct 14 at 12:17PM
Back to Top
Chopinke View Drop Down
Team Player
Team Player


Joined: 29 Apr 14
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote Chopinke Quote  Post ReplyReply Direct Link To This Post Posted: 08 Oct 14 at 8:20AM
Hi,

This is a little off topic, but why did they create a new rendering DLL? Why cannot they do the same stuff with the one built into the SDK?

I am heavily relying on the rendering part, so it would be a great disappointment if the DLL version could do something, that the SDK version couldn't.

Also many of us are not happy to include an additional to their distributable product.

Also a qestion: can I rename the DLL to MyProductRendering.DLL and still work?

Thanks!


Edited by Chopinke - 08 Oct 14 at 8:21AM
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store