PDF to picture( TParallel.For)
Some pictures were found to be blank
Can I use it like this?
Var
PDFView: TImageEnView;
.....
Begin
PDFView.PdfViewer.AllowFormEditing := false;//True;
PDFView.PdfViewer.Enabled := True;
ImageEnMView1.AttachedImageEnView := PDFView;
.....
PDFView.PdfViewer.Enabled := True;
try
PDFView.IO.LoadFromFile( OpenPDF.Filename );
Self.Hint:=OpenPDF.Filename;
PDFView.MouseInteractGeneral := [ miScroll, miZoom ];
except
on e:Exception do
MessageDlg( 'Error encountered loading PDF file: ' + e.message, mtError, [ mbOK ], 0 );
end;
..........
tmpiTask:=TTask.Run(
procedure
Begin
TParallel.For(0,ImageEnMView1.ImageCount - 1,
procedure (Hidx: Integer)
var
tmpIENView:TImageEnView;
tmpFileName_Back,
tmpFileName_Do:String;
begin
tmpFileName_Do :=...
tmpIENView:=TImageEnView.Create(Nil);
Try
ImageEnMView1.CopyToIEBitmap( Hidx, tmpIENView.IEBitmap,TRUE );
Try
tmpIENView.IO.SaveToFileIEN(tmpFileName_Do);
Except
TInterlocked.Increment(TInterlocked_Err_Count);
End;
Finally
tmpIENView.Free;
End;
end);
End);
......
TTask.WaitForAll([tmpiTask]);
......
Some pictures were found to be blank