Beiträge von Stephen

    I did think that and we have asked the user to disable anti virus for the folder containing the file but they say they still got the error at random times. The file is on a file server so if there was a temporary network issue I assume this could cause this error?

    We do actually need the resulting PDF as a file so would using a memory stream and then writing that stream to file reduce the likelihood of this error. I am a bit concerned regarding how much memory would get used if we did this and if there is more chance of running out of memory?

    A user of ours has suddenly starting getting random "Cannot start PDF Document!" error when a PDF file is created by our software. There doesn't appear to be any pattern to this, i.e. the file may be created 15 times successfully and then it will fail with this error the next time they create a PDF. What are the possible reasons for getting this error?

    I am using Delphi 2007 and have just upgraded from version 1 to version 3 and found that the AttachStream method no longer works, i.e. no page appears. The LoadFromStream method does work. For example,

    procedure TForm1.FormCreate(Sender: TObject);
    begin
    FileStream := TFileStream.Create('c:\temp\test.pdf', fmOpenRead);
    end;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    FileStream.Position := 0;
    wpviewpdf1.AttachStream(FileStream);
    end;

    doesn't display anything.

    I have just upgraded to version 3 (3.03.0) and am also having a lot of problems with the ViewControls property.

    For example, in the FormCreate or FormShow if I set ViewControls := [wpVertScrollBar,wpHorzScrollBar] then both scrollbars appear.

    However, if I set ViewControls to [wpViewPanel,wpVertScrollBar,wpHorzScrollBar] the vertical scrollbar disappears.

    If I set ViewControls to [wpViewPanel,wpNavigationPanel,wpVertScrollBar,wpHorzScrollBar] then the vertical scrollbar is now visible but now the horizontal scrollbar has disappeared.

    Hi

    I am using V1.46 of WPViewPDF and am trying to use the PrintHDC method to output a pdf to the printer canvas as shown below but I always get a blank page being output

    Printer.BeginDoc;
    WPViewPDF1.PrintHDC(1, Printer.Canvas.Handle, 600, 600);
    Printer.EndDoc;

    However the PrintPages method as shown below works fine.

    WPViewPDF1.BeginPrint('Microsoft Office Document Image Writer');
    WPViewPDF1.PrintPages(0, 0);
    WPViewPDF1.EndPrint;

    I need to use the PrintHDC as I want the contents of a pdf file to be output in the current print job, not a new print job.

    Any ideas?

    Regards

    Stephen

    Using version 2

    In order to generate a pdf document that is landscape, I swap the width and height parameters in the StartPage method. When I then open in Adobe Reader and go to the Print Setup dialog, the orientation is Portrait. Is this to be expected?

    I am also a little confused about the rotation parameter of the StartPage method. I was setting this to 1 if the pdf document was landscape but when I opened in Adobe Reader it was displayed in portrait mode so I always had ro rotate to view the page correctly. If I don't set it to 1 it displays correctly in Adobe Reader, i.e. landscape. I am unsure why I was setting it to 1 in the first place and am wondering if anything changed in the wPDF components at any time that may have affected this or maybe the latest version of Adobe Reader now handles this better.

    Hi

    This now works. Sorry but I may have been using the wrong version of the dll file before which may have explained why is wasn't working.

    I also had to fix a fault in the WPViewPDF1 unit. For TWPPDFViewOption it had values of wpPageSelection and wpPageMultiSelection but the code referred to wpShowPageSelection and wpShowPageMultiSelection.

    Regards

    Stephen

    Sorry, I should have been clearer. I am already doing this, e.g.

    WPVIEWPDF1.LoadFromFile('C:\TEMP\wPDFMan.PDF');
    ret := WPVIEWPDF1.CommandStr(COMPDF_MakeJPEG, '1=C:\TEMP\wPDFMan.jpg');

    ret is -1 and no file is created

    when I do

    ret := WPVIEWPDF1.CommandStr(COMPDF_MakeEMF, '1=C:\TEMP\wPDFMan.emf');

    ret returns 1 and the file is created

    Stephen