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!
Mac RenderPagetoFile yield 0 byte file |
Post Reply |
Author | |
eddy2099
Beginner Joined: 08 Feb 10 Status: Offline Points: 10 |
Post Options
Thanks(0)
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 |
|
Kenneth488
Beginner Joined: 03 Oct 14 Location: DK Status: Offline Points: 3 |
Post Options
Thanks(0)
|
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 |
|
Chopinke
Team Player Joined: 29 Apr 14 Status: Offline Points: 24 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store