Print Page | Close Window

can't open pdf file,it's 374 MB File.

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=3558
Printed Date: 20 Apr 24 at 3:58AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: can't open pdf file,it's 374 MB File.
Posted By: hxg8202
Subject: can't open pdf file,it's 374 MB File.
Date Posted: 07 May 18 at 7:54AM
can't open pdf file,it's 374 MB File. 

    isuccess := FQP.LoadFromFile(PDFFile, '');
    if isuccess = 0 then
    begin
      ShowMessage(IntToStr(FQP.LastErrorCode));
      exit;
    end;

    LastErrorCode show 401.  why?

    handle := FQP.DAOpenFile(PDFFile, '');
    it can open,but functions DrawRotatedText、SetTransparency not works.

   What shall I do?  thanks.

   



Replies:
Posted By: Ingo
Date Posted: 07 May 18 at 8:06AM
Hi hxg8202 ;-)

you can use DAloadFromFile trying to avoid memory problems.
There's a subset of these DA-functionalities you can use.
Please keep in mind that it's not possible to mix DA- and non-DA-functions.
BTW: You can read here a lot using the search functions with "memory"...

Cheers and welcome here,
Ingo



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



Posted By: hxg8202
Date Posted: 07 May 18 at 9:16AM
thank you,
now i want load this 374M file,and use function DrawRotatedText to append Watermark,
but It failed。like this function "DrawRotatedText"  not in subset of these DA-functionalities
Is it the reason for memory? 

    isuccess := FQP.LoadFromFile(PDFFile, '');
    if isuccess = 0 then
    begin
      ShowMessage(IntToStr(FQP.LastErrorCode));
      exit;
    end;

    for i := 1 to FQP.PageCount do
    begin
      FQP.SelectPage(i);
      FQP.SetTextSize(FontSize);
      FQP.SetTextMode(1);
      FQP.SetTextColor(255, 0, 0);
      FQP.SetTransparency(Transparency);

      YSpac := Round(FQP.PageHeight) div 2;
      FQP.DrawRotatedText(10, 10, 45, sText);
      FQP.DrawRotatedText(10, 10 + YSpac, 45, sText);
      FQP.DrawRotatedText(10, 10 + YSpac * 2, 45, sText);
      FQP.DrawRotatedText(10, 10 + YSpac * 3, 45, sText);
      FQP.DrawRotatedText(10, 10 + YSpac * 4, 45, sText);
      FQP.DrawRotatedText(10, 10 - YSpac, 45, sText);
      FQP.DrawRotatedText(10, 10 - YSpac * 2, 45, sText);
      FQP.DrawRotatedText(10, 10 - YSpac * 3, 45, sText);
      FQP.DrawRotatedText(10, 10 - YSpac * 4, 45, sText);
    end;
    FQP.DASaveAsFile(handle, 'd:\newtest.pdf');



Posted By: Ingo
Date Posted: 07 May 18 at 10:19AM
Hi,

DA-functions are using a different technics regarding file handling.
A non-DA-function expects different file properties than DA-functions - so don't mix them.



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



Posted By: hxg8202
Date Posted: 07 May 18 at 11:04AM
thanks
i know. now i want to drawtext on this large file. what shall do?



Posted By: Ingo
Date Posted: 10 May 18 at 12:23PM
like i've told you already:
Don't mix the functions!
If you don't find a DrawText-function as a DA-version then there isn't any and you have to stop here :(
There are many discussions here regarding this issue...
What you can try is only load and save with another tool (perhaps this will change the structure for a better loading with normal QP-functions) but if this won't work you should stop here.



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



Posted By: tfrost
Date Posted: 10 May 18 at 10:39PM
Possible approaches:

1. Abandon DA functions if they do not include the features you need.
2. Experiment with smaller files to get a feeling for where the limit lies.
3. Use Process Explorer to find out more about what classes of memory you are short of.
4. Configure a larger swap file if you determine you are short of real memory.
5. Try using the 64-bit library and a 64-bit application, if your users can accept this.
6. If you have to use 32-bit and from the current limits you think it will help, configure your OS to permit a 3GB user space and set the PE flag to use this in your EXE. This needs testing, and also requires your users to configure for 3GB also.
7. If all this fails or is inapplicable to your situation, follow Ingo's suggestion and split up the PDF to allow you to process the sections separately, then merge them.



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