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 > I need help - I can help
  New Posts New Posts RSS Feed - DARenderPageToStream
  FAQ FAQ  Forum Search   Register Register  Login Login

DARenderPageToStream

 Post Reply Post Reply
Author
Message
bb46970 View Drop Down
Team Player
Team Player


Joined: 06 Mar 06
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote bb46970 Quote  Post ReplyReply Direct Link To This Post Topic: DARenderPageToStream
    Posted: 13 Apr 11 at 6:58PM
Hi,

I have a problem merging PDFs.  I have tried several different tools.  However, on occasion, one of the PDFs may have a problem with a text object or an image object.  The resulting PDF may display fine with the Foxit Reader, but Adobe Acrobat reports an error and does not display the page.

I tried the following.  The functions all show valid handles or return 1 (for true), but Acrobat reports an error and Foxit displays blank pages.
  for iPage := iInvCount downto 1 do
    begin
      iRecNewPage := QP.DANewPage(iRec);
      iRecFirstPage := QP.DAFindPage(iRec, 1);
      iInvPage := QP.DAFindPage(iInv, iPage);
      iInvCap := QP.DACapturePage(iInv, iInvPage);
      if iResult = 0 then
        ShowMessage('Did not render');}
      iHeight := QP.DAGetPageHeight(iInv, iInvPage);
      iWidth := QP.DAGetPageWidth(iInv, iInvPage);
      iResult := QP.DADrawCapturedPage(iRec, iInvCap, iRecNewPage, 0, 0, iWidth, iHeight);
      if iResult = 0 then
        ShowMessage('Did not draw');
      iResult := QP.DAMovePage(iRec, iRecNewPage, iRecFirstPage, 0);
      if iResult = 0 then
        ShowMessage('Did not move');
    end;
      iResult := QP.DASaveAsFile(iRec, RecordsFileSave);
      if iResult = 0 then
        ShowMessage('Did not save');
   QP.DACloseFile(iInv);
   QP.DACloseFile(iRec);

QP.DARenderPageToFile(iInv, iInvPage, 7, 300, 'F:\Development\Projects\Test\Delphi\D2010\PDFs\FoxItMerge\test.tiff'); works fine. 

Is there a way to call DARenderPageToStream and then go from the stream to a new page?

Thanks,

David
Back to Top
Wheeley View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Oct 05
Location: United States
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote Wheeley Quote  Post ReplyReply Direct Link To This Post Posted: 13 Apr 11 at 8:07PM
Why not try one of the merge functions instead? MergeFilesFast could be faster than your method above.

Wheeley
Back to Top
bb46970 View Drop Down
Team Player
Team Player


Joined: 06 Mar 06
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote bb46970 Quote  Post ReplyReply Direct Link To This Post Posted: 15 Apr 11 at 6:57PM
Hi,

I did not expect that to work, but it did.  I used to use QuickPDF for merging PDFs, but I had to stop, because some of the resulting PDFs were corrupted or zero byte files.  Our PDFs come from different sources and do not necessarily have proper structures or may have different compression algorithms.  I have been using Acrobat with OLE Automation.  This is the first time that I tried MergeFilesFast.  It worked on my first test.  I even tried Foxit's DLL SDK to merge these two PDFs and got a PDF that Acrobat would not display.  I am going to test it with some known problem PDFs and see how it works.

Thanks,

David
Back to Top
Wheeley View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Oct 05
Location: United States
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote Wheeley Quote  Post ReplyReply Direct Link To This Post Posted: 15 Apr 11 at 9:18PM
Be sure to use the latest version because Debenu has added better support for reading corrupt PDFs and more compression formats such as JBIG2.

Wheeley
Back to Top
bb46970 View Drop Down
Team Player
Team Player


Joined: 06 Mar 06
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote bb46970 Quote  Post ReplyReply Direct Link To This Post Posted: 16 Apr 11 at 9:55PM
It failed.
I upgraded from 7.19 to 7.24 and ran a test on another set of PDFs.  The first PDF is two pages, created by XFRX.  The second PDF is 228 pages of images, created by BlackIce PDF print driver.

The resulting PDF displays fine with the Foxit Reader.  It does not care about structure.  It just displays what it finds.  Acrobat displays the pages from PDF 1 fine (pages 1-2).  However, it blows-up the first three pages from PDF 2 (pages 3-5) to over 6000% to display blank pages, and reports an error.  Acrobat displays pages 6 to the end okay.  We have had similar problems with PDF generated with VeryPDF's PDFCamp, instead of BlackIce.  There may be problems with the PDFs generated by XFRX, but it must be a combination of problems from both PDFs, because not all PDFs have these merging problems.  Just looking for a way to merge these PDFs without errors.

XFRX is created by Eqeus.  It is a print listener that compiles into Visual FoxPro apps and prints VFP reports to PDF.  XFRX produces text PDFs.  The BlackIce print driver is just a Windows printer that prints to PDF.  BlackIce is set to produce PDF pages as images.

Thanks,

David
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