Hi all,
I have a very strange problem using TMSFNCPlanner.
When I use it, everything is fine, I can populate elements, all looks good.
Then if I want to save the planner, I can export to PNG (as a srcreen shot) or to a PDF file using TMSFNCGraphicsPDFIO and TMSFNCPDFLib
What is amazing is that everything works fine under Windows. I get my PDF or my PNG.
If I deploy to macOS, then the PNG works fine, but the PDF doesn't and shows me dialog box:
It doesn't seem to be related to any Planner displayed window at all.
Otherwise exporting to PNG would cause the same problem.
Any idea?
Here is how I export to PNG
procedure TForm1.btnPNGClick(Sender: TObject);
var
theScreenShot : TBitmap ;
fileName : String ;
begin
if showDirectory then
begin
if SelectDirectory('Destination folder', destDirectory, destDirectory) then
showDirectory := False ;
end;
theScreenShot := planner.MakeScreenshot;
imgShot.Bitmap.Assign(theScreenShot) ;
fileName := FormatDateTime('yyyy-mm-dd', dateFrom.Date) + ' - ' + FormatDateTime('dd', dateTo.Date);
{$IF DEFINED(MACOS)}
Form1.Caption := destDirectory + '/' + fileName + '.png' ;
imgShot.Bitmap.SaveToFile(destDirectory + '/' + filename + '.png');
{$ELSE}
Form1.Caption := destDirectory + '' + fileName + '.png' ;
imgShot.Bitmap.SaveToFile(destDirectory + '' + fileName + '.png');
{$ENDIF}
end;
Now, for PDF, this works fine for Windows, not macOS
It's not related to the target directory. If hard coded with a correct path and filename, still get that Range check error message:
procedure TForm1.btnPDFClick(Sender: TObject);
var
theScreenShot : TBitmap ;
fileName : String ;
begin
if showDirectory then
begin
if SelectDirectory('Destination folder', destDirectory, destDirectory) then
showDirectory := False ;
end;
// Optional: Configure layout options before exporting
TMSFNCGraphicsPDFIO.Options.PageSize := TTMSFNCPDFLibPageSize.psA4 ;
TMSFNCGraphicsPDFIO.ExportObject := planner ;
TMSFNCGraphicsPDFIO.Options.OpenInPDFReader := True;
TMSFNCGraphicsPDFIO.Options.PageOrientation := poLandscape;
fileName := FormatDateTime('yyyy-mm-dd', dateFrom.Date) + ' - ' + FormatDateTime('dd', dateTo.Date);
{$IF DEFINED(MACOS)}
Form1.Caption := destDirectory + '/' + fileName + '.pdf' ;
TMSFNCGraphicsPDFIO.Save(destDirectory + fileName + '.pdf');
{$ELSE}
Form1.Caption := destDirectory + '\' + fileName + '.pdf' ;
TMSFNCGraphicsPDFIO.Save(destDirectory + '\' + fileName + '.pdf');
{$ENDIF}
end;
Any idea what could cause this strange error message?
RadStudio 13.1
FNC Core 4.3.1.3
FNC UIPack 7.2.0.0
FNC Planner 2.0.3.1
Thanks for any light,
Steve

