Hi!
I've got an exception when trying to export an excel file to pdf on one of my users' PC. It says "The specified path was not found". This exception raises only on one computer and doesn't appears on the others.
At
first I thought it was because of my incorrect using export utilities,
but the same error was occured when running demo project
(\Demo\Delphi\Modules\25.Printing and Exporting\30.ExportPdf).
I
think that the problem is most likely in the incorrect settings of a
particular computer, but I cannot find which settings causes it.
Unfortunately
I cannot run project on that computer in debug mode. So all I have
found out by now is that exception raises when executing function Canvas.MeasureStringEmptyHasHeight in unit _URenderMetrics.RenderMetrics. Here the stack I have by now:
DEMO unit UExportPdf;
procedure TFExportPdf.ActionExportAsPdfExecute
...
Pdf.ExportAllVisibleSheets(false, TPath.GetFileNameWithoutExtension(exportDialog.FileName));
...
↓
unit _UFlexCelPdfExport.FlexCelPdfExport;
procedure TFlexCelPdfExport.ExportAllVisibleSheets
...
ExportSheet(StartSheet, TotalPages);
...
↓
unit _UFlexCelPdfExport.FlexCelPdfExport;
procedure TFlexCelPdfExport.ExportSheet
...
FRenderer.GenericPrint(aCanvas,
PdfGraphics.ConvertToUnits(PdfCanvas.PageSize), MyPrintRange,
startPageToDisplay + i, PaintClipRect,
totalPagesToDisplay, ReallyExport, PagePrintRange, PrintArea);
...
↓
unit _UFlexCelRender.FlexCelRender;
procedure FlexCelRender.GenericPrint
...
//Draw Normal cells
DrawPage(PaintClipRectDat, PagePrintRange, true, SpawnedCells, DrawObjects, false, TArtifactType.None);
...
↓
unit _UFlexCelRender.FlexCelRender;
procedure FlexCelRender.DrawPage
...
DrawCells(PaintClipRect, PagePrintRange, SpawnedCells, BorderRect, Tag);
...
↓
unit _UFlexCelRender.FlexCelRender
procedure FlexCelRender.DrawCells
...
DrawInsideCells(PaintClipRect, PagePrintRange, SpawnedCells, BorderRect, Tag);
...
↓
unit _UFlexCelRender.FlexCelRender
procedure FlexCelRender.DrawInsideCells
...
DrawColumns(PaintClipRect, PagePrintRange, SpawnedCells, BorderRect, Row, Ch, Cw, Tag);
...
↓
unit _UFlexCelRender.FlexCelRender
procedure FlexCelRender.DrawColumns
...
DrawCell(Col, Row, Col, Row, ARect, BorderRect, SpawnedCells, true, false, TSpanDirection.Both, Tag);
...
↓
unit _UFlexCelRender.FlexCelRender
procedure FlexCelRender.DrawCell
...
DrawText(FWorkbook, Canvas, Cache.FontCache, Zoom100,
ReverseRightToLeftStrings, Self, aCol, aRow, CellRect0, PaintClipRect,
SpawnedCells,
ReallyDraw, OnlySpawned, Clp, MultiLine, HAlignGeneral,
HJustify, VJustify, Alpha, Vertical, DrawFont, DrawFontColor, SubData,
HAlign, VAlign, Indent,
OutTextInfo, Merged, IsText, ActualValue, AdaptativeFormats, ShrinkToFit, SheetIsRightToLeft);
...
↓
unit _UFlexCelRender.FlexCelRender
class procedure FlexCelRender.DrawText
...
TextPainter.CalcTextBox(Canvas, FontCache, Zoom100, CellRect1, Clp,
MultiLine, Alpha, Vertical, OutText, AFont, AF, TextExtent, TextLines,
MaxDescent);
...
↓
unit _UTextWriter.TextPainter
class procedure TextPainter.CalcTextBox
...
TextExtent := RenderMetrics.CalcTextExtent(Canvas, FontCache, Zoom100, AFont, OutText, mdx);
...
↓
unit _URenderMetrics.RenderMetrics
class function RenderMetrics.CalcTextExtent
...
exit(Canvas.MeasureStringEmptyHasHeight(Text, AFont, nil));
...
Do you have any idea what can cause "The specified path was not found" exception in function MeasureStringEmptyHasHeight and how to avoid it?
Thanks