Hi,
I'm having a bit of trouble creating a blank PDF document and adding pages using PDF Viewer. I get an exception document is not open. See source code below. Am I not using it correctly? Is there is a work around that would be great.
thanks very much.
regards
Paul
{ Load source image into IEView. }
IEViewSrc := TImageEnView.Create( PnlLft );
IEViewSrc.Parent := PnlLft;
IEViewSrc.Align := TAlign.alClient;
IEViewSrc.IO.LoadFromFile( FileOpenDlg.FileName );
{ Create doc generator IEView, create the PDF doc and add the loaded image as a page. }
IEViewDocGen := TImageEnView.Create( PnlRht );
IEViewDocGen.Parent := PnlRht;
IEViewDocGen.Align := TAlign.alClient;
IEViewDocGen.PdfViewer.Enabled := True;
IEViewDocGen.IO.CreatePDFFile( 'D:\Projects\FOCUS\Media\Test\GenTestDoc.PDF' );
IEViewDocGen.PdfViewer.AddPage( IEViewSrc.IEBitMap, TIOPDFPaperSize.iepA4, TIEPageLayout.ielPortrait, -1, 0, True, True );
IEViewDocGen.IO.SaveToPDF;