Display PDF

I am having trouble getting a a PDF to display correctly first time.
My Code:
With this code is displays per Image1
When I drag on the dialog grip to resize the the PDF displays correctly per Image2
Please advise how I rectify this.
TIA
My Code:
- Code: Select all
ip_FRM := TiwcgjqfrmPrint.Create(WebApplication);
ip_FRM.Parent := WebApplication.ActiveForm as TWinControl;
ip_FRM.Name := ip_Name;
ip_FRM.Top := ip_Top;
ip_FRM.Left := ip_Left;
ip_FRM.iwcgjqdlgx1.JQDialogOptions.Title := lv_Title;
lv_FN := '\wwwroot\Sites\' + UserSession.gv_Site.SiteID + '\' + UserSession.gv_User.UserNumberStr + '\Temp\RepsOut\' + lv_FN;
lv_FN := ReplaceText(lowercase(lv_FN), '\wwwroot\', '');
lv_FN := ReplaceStr(lv_FN, '\', '/');
lv_FN := ReplaceStr(lv_FN, '{', '%7B');
lv_FN := ReplaceStr(lv_FN, '}', '%7D');
ip_FRM.iwcgjqdt1.Text := lv_FN;
ip_FRM.iwcgjqpdfvwr1.JQPDFViewerOptions.PDFFileName := lv_FN;
ip_FRM.iwcgjqdlgx1.JQDialogOptions.Modal := False;
lv_FRM1.iwcgjqdlgx1.AjaxReRender(True, False);
With this code is displays per Image1
When I drag on the dialog grip to resize the the PDF displays correctly per Image2
Please advise how I rectify this.
TIA