Updated October 11, 2006
Problem: The CSS property, list-style-image, is not working.
Resolution: In htmlsubs.pas, the TImageObj.SimpleCreate constructor, add the two lines shown so that it reads:
constructor TImageObj.SimpleCreate(MasterList TSectionList; const AnURL string); begin inherited Create; ParentSectionList = MasterList; ObjAlign = ABottom; {default} Source = AnURL; NoBorder = True; BorderSize = 0; SpecHeight = -1; {<-- add this} SpecWidth = -1; {<-- add this} end;
Problem: Table headers and footers (<thead>, <tbody>, and <tfoot>) are not being printed.
Resolution: In htmlsubs.pas, the ThtmlTable.Draw method, change the line that reads
if ParentSectionList.Printing and (ParentSectionList.TableNestLevel = 0) to: if ParentSectionList.Printing and (ParentSectionList.TableNestLevel = 1)
The only change is a 0 to a 1.
Problem: Text files (LoadTextFile and LoadTextStrings) do not scroll horizontally in a correct manner.
Resolution: Download DoText.zip which gives a new DoText procedure to replace the existing one in ReadHTML.pas.
Problem: Undefining NoMetafile so as to display Metafile images results in exceptions. Fixed in Version 9.4a released March 22, 2006.
Resolution: In htmlun2.pas, add the statements to the code as shown:
function GetImageHeight(Image: TGpObject): integer; begin if Image is TBitmap then Result := TBitmap(Image).Height else if Image is TGpImage then Result := TGpImage(Image).Height else if Image is TGifImage then Result := TGifImage(Image).Height else if Image is ThtMetaFile then {<-- add this} Result := ThtMetaFile(Image).Height else Raise(EGDIPlus.Create('Not a TBitmap, TGifImage, of TGpImage')); end; function GetImageWidth(Image: TGpObject): integer; begin if Image is TBitmap then Result := TBitmap(Image).Width else if Image is TGpImage then Result := TGpImage(Image).Width else if Image is TGifImage then Result := TGifImage(Image).Width else if Image is ThtMetaFile then {<--add this} Result := ThtMetaFile(Image).Width else Raise(EGDIPlus.Create('Not a TBitmap, TGifImage, of TGpImage')); end;
Problem: Some tables with complex colspan attributes are not formatted correctly. (Version 9.27 was replaced by 9.27a May 29).
Resolution: In htmlsubs.pas, the ThtmlTable.AddDummyCells method, comment out the line of code which reads:
ColSpan := IntMin(ColSpan, MaxCells-Cl); {So ColSpan can't expand number of cols}
Problem: Slow response when using WinXP manifest for themes. TFrameViewer may appear transparent when loaded.
Resolution: In htmlview.pas, framview.pas, and frambrwz.pas, locate the code that reads:
{$ifDef ver150} {Delphi 7} ParentBackground := False; {$endif}
Add similar code for Delphi 2005 to each of these three locations.
{$ifDef ver170} {Delphi 2005} ParentBackground := False; {$endif}
Problem: The value, "Normal", is not understood in the line-height stylesheet property and causes a line height of zero.
Resolution: In styleun.pas, the TProperties.GetLineHeight method, change the line that reads:
Result = LengthConv(Props[LineHeight], True, EmSize, EmSize, ExSize, 0); to Result = LengthConv(Props[LineHeight], True, EmSize, EmSize, ExSize, -1);
Problem: In Win98/95/ME, HTML Components version 9.2 and 9.21, table cells which exceed a pixel height of 32000 fail to display or have parts missing. This applies to printing also.
Resolution: Download tallcellpatch.zip which contains a source code patch for this problem.
Problem: There are a number of Win98/95 (and probably ME) printer drivers which can't handle wide character text in Print Preview.
Resolution: Apparently, it's not necessary to use the printer driver for Print Preview, so the following change can be made. In MetaFilePrinter.pas, change the statement in TMetaFilePrinter.NewPage that reads:
NewCanvas := TMetaFileCanvas.Create(MetaFile, Printer.Handle); to: NewCanvas := TMetaFileCanvas.Create(MetaFile, 0);
Problem: There is an unnecessary 32K restriction on clipboard output in TFrameViewer and TFrameBrowser.
Resolution: In framview.pas, change the TFVBase.CopyToClipboard method to read:
procedure TFVBase.CopyToClipboard; var AViewer: ThtmlViewer; begin AViewer := GetActiveViewer; if Assigned(AViewer) and (AViewer.SelLength <> 0) then AViewer.CopyToClipboard; end;
Problem: A rather serious resource leak occurs with font changes when the character set used is other than Default_Charset.
Resolution: Download getfont.zip which contains a revised TProperties.GetFont method.
Problem: Some nested tables are misformatted.
Resolution: In htmlsubs.pas, the ThtmlTable.GetMinMaxAbs method, comment out the line shown:
{Find the total min and max width} 2: (*ThisCycle = ParentSectionList.CycleNumber; *) {<-- this line} TotalMaxWidth = 0; TotalMinWidth = 0; for I = 0 to NumCols-1 do begin
Do this only in the ThtmlTable.GetMinMaxAbs method. This problem will be fixed in an upcoming 9.2a version.
Problem: If a bad stream or Nil is used as a parameter in a call to ThtmlViewer.InsertImage, an access violation may result.
Resolution: In htmlsubs.pas, change the lines that reads:
if NeedDoImageStuff and (BGImage.Image <> DefBitmap) then to: if NeedDoImageStuff and (BGImage.Image <> DefBitmap) and (BGImage.Image <> ErrorBitmap) then
Change this line in both the TBlock.Draw and TCellObj.Draw methods.
Problem: Copy To Clipboard does not work in Win95/98/ME.
Resolution: In htmlun2.pas, change the ClipBuffer.Terminate method to read:
function ClipBuffer.Terminate: integer; begin Buffer[Leng] := #0; Result := Leng+1; if IsWin32Platform then Clipboard.AsText := Buffer else CopyToClipboard; end;
Problem: The HTML Components and the new Theme Manager in Delphi 7 disagree resulting in a hang when an XP manifest file is used.
Resolution 1: Compile with one of the other Delphi's if a manifest file is to be used.
Resolution 2: The file Delphi7Theme.txt has patches which will prevent the lockup.
Problem: There is a possible conflict if a TTabControl is used in an application with ThtmlViewer.
Resolution: "TTabControl" was used for another object definition in htmlsubs.pas. Replace all occurances of TTabControl with ThtTabControl in htmlsubs.pas.
Problem: HTML Documents with many hundreds of links can be very slow in loading.
Resolution: If you expect documents of this sort, turn off link tabbing by defining NoTabLink in htmlcons.inc. Version 9.1 and future versions will have a limit on the number of links where tabbing will be allowed.
Problem: Occasional serious mis-formatting of the display or print output. Some output may be off screen. Sensitive to font selection.
Resolution: The Windows 2000 API call, GetTextExtentPoint32W, ocasionally and unpredictably returns results that have no relation to reality. This function may be replaced with the GetTextExtentExPointW function for Windows versions where it is available. Download the source patch file, win2000fix.zip.
Problem: The routines used to convert Unicode text to Upper and Lower case do nothing in Win95, 98, ME. This primarily effects the text search methods, Find and FindEx. These methods will only find text where the case matches.
Resolution: No quick fix. Version 9.01 will be released shortly.
Problem: Very large animated GIFs cause an OutOfMemory or similar error. This problem can occur if the product of the Gif width and number of frames exceeds about 21,000.
Resolution: The problem is caused by experimental code that was mistakenly left in the source. In htmlgif2.pas, the TMyBitmap.StretchDraw procedure, there is code that reads:
if MyTransparent then begin Save := 0; MaskDC := 0; try MaskDC := CreateCompatibleDC(0); {LDB} {<-- remove} Save := SelectObject(MaskDC, MaskHandle); {<-- remove} TransparentStretchBlt(ACanvas.Handle, Left, Top, Right - Left, Bottom - Top, Canvas.Handle, SrcRect.Left, SrcRect.Top, SrcRect.Right - SrcRect.Left, SrcRect.Bottom - SrcRect.Top, MyMask.Canvas.Handle, SrcRect.Left, SrcRect.Top); {LDB} finally if Save <> 0 then SelectObject(MaskDC, Save); if MaskDC <> 0 then DeleteDC(MaskDC); end; end
Remove or comment out the two lines marked "Remove"
Problem: ThtmlViewer will not load a file which is open elsewhere.
Resolution: In htmlview.pas, in the LoadFile method, change the line that reads:
FS := TFileStream.Create(FName, fmOpenRead); to: FS := TFileStream.Create(FName, fmOpenRead or fmShareDenyWrite);
Problem: The new OnObjectFocus, OnObjectBlur, and OnObjectChange events were inadvertently omitted from the TFrameBrowser component.
Resolution: In frambrwz.pas, at approximately line 617, add the three lines shown:
Viewer.OnObjectClick := FOnObjectClick; Viewer.OnObjectFocus := FOnObjectFocus; {<-- add this} Viewer.OnObjectBlur := FOnObjectBlur; {<-- add this} Viewer.OnObjectChange := FOnObjectChange; {<-- add this} Viewer.ServerRoot := ServerRoot;
Problem: Animated GIFs only animate initially.
Resolution: In htmlsubs.pas, the TSectionList.DoLogic method, add the Self indentifier as shown:
for I := 0 to AGifList.Count-1 do with TGifImage(AGifList.Items[I]) do begin CurrentFrame := 1; Animate := False; if not Self.IsCopy then {<-- Add the "Self." here} Animate := True; end;
Problem: Borland "improvements" in version 6.01 don't agree with the HTML Components. Most margin spacings are missing in the display.
Resolution: If you're not using Delphi 6.01, do nothing. For Delphi 6.01, version 8.25b is available now. There is also a patch kit, patch601.zip, available. This contains substitute modules for version 8.25 and instruction for source code changes for earlier versions.
Problem: CSS table cell padding-left/top/right/bottom incorrect unless all sides were uniform.
Resolution:In htmlsubs.pas, the TCellList.DrawLogic1 method, change the following:
if VSize + HzSpace > SpecHt then TmpSize = VSize + HzSpace to: if VSize + VrSpace > SpecHt then TmpSize = VSize + VrSpace
Problem: Images used as backgrounds in tables sometimes print poorly.
Resolution:The following code occurs in htmlsubs.pas in two locations, the TCellObj.Draw and the TBlock.DrawBlock methods. Change:
else if NoMask then BitBlt(Canvas.Handle, PL, FT, PR-PL, IH, TiledImage.Canvas.Handle, 0, IT, SrcCopy) else if HasBackgroundColor then to: else if NoMask then PrintBitmap(Canvas, PL, FT, PR-PL, IH, TiledImage.Handle) else if HasBackgroundColor then
in both locations.
Problem: Word wrapping of lines containing <br> tags is not correct if the wrap must occur before the <br> tag. This tends to show as text overflow in table cells.
Resolution:In htmlsubs.pas, the TSection.FindCountThatFits1 method, change the last statement:
Result := Cnt; if FoundBreak then Inc(Result); end; to: Result := Cnt; if FoundBreak and (Cnt = Max) then {<-- change this} Inc(Result); end;
Problem: Non-local fonts cannot be accessed.
Resolution:In StyleUn.pas, the TProperties.AssignCharSet method, change:
begin {the following makes sure the CharSet is available. It also translates "Default_CharSet" into the actual local character set} Font := TFont.Create; Font.CharSet := CS; to: begin {the following makes sure the CharSet is available. It also translates "Default_CharSet" into the actual local character set} Font := TFont.Create; Font.Name := 'Arial'; {<-- add this} Font.CharSet := CS;
Problem: Justified text with only one word on a line will give a divide exception when the mouse passes over.
Resolution: Sorry, no simple solution. Wait for version 8.11
Problem: Using an ID= attribute in a Frame definition document may cause an exception.
Resolution: In readhtml.pas, add a line that reads:
MasterList := Nil;
right after the Begin statement in both the FrameParseFile procedure and IsFrameFile function.
Problem: Some documents with Japanese fonts may have extra characters at the end
Resolution:In ReadHTML.pas, the TranslateCharset function, change the following:
if not HaveTranslated then begin N := Buff-PChar(DocS); DocS := EUCToShiftJis(DocS); {translate to ShiftJis} Buff := PChar(DocS)+N; {DocS probably moves} BuffEnd := Buff+Length(DocS); {<-- change this} HaveTranslated := True; end; to: if not HaveTranslated then begin N := Buff-PChar(DocS); DocS := EUCToShiftJis(DocS); {translate to ShiftJis} Buff := PChar(DocS)+N; {DocS probably moves} BuffEnd := PChar(Docs)+Length(DocS); {<-- to this} HaveTranslated := True; end;
Problem: A floating image in a table cell with NoWrap set may cause a hang.
Resolution:In htmlsubs.pas, the TSection.MinMaxWidth method, change the following:
if not PercentWidth then if ObjAlign in [ALeft, ARight] then Max := Max + ImageWidth + HSpaceL + HSpaceR else Min := IntMax(Min, ImageWidth); to: if not PercentWidth then if ObjAlign in [ALeft, ARight] then begin Max := Max + ImageWidth + HSpaceL + HSpaceR; Brk[Pos+1] := 'y'; {allow break after floating image} end else Min := IntMax(Min, ImageWidth);
Problem: Justified text crammed into a narrow space causes a GPF.
Resolution: In htmlsubs.pas, the TSection.Draw method, change
if LR.Extra = 0 then {<--} SetTextJustification(Canvas.Handle, 0, 0) else SetTextJustification(Canvas.Handle, LR.Extra, LR.Spaces); to: if LR.Spaces = 0 then {<--} SetTextJustification(Canvas.Handle, 0, 0) else SetTextJustification(Canvas.Handle, LR.Extra, LR.Spaces);
Problem: Some characters of mulibyte fonts are not correct
Resolution: In htmlsubs.pas, the TSection.ProcessText method, change:
I := Pos(#173, BuffS); {soft hyphen won't show} while I > 0 do begin Remove(I); I := Pos(#173, BuffS); end; to: if not Multibyte then {<--} begin I := Pos(#173, BuffS); {soft hyphen won't show} while I > 0 do begin Remove(I); I := Pos(#173, BuffS); end; end;
Problem: Calling TFrameViewer.Clear or TFrameBrowser.Clear can sometimes cause an exception.
Resolution: Add the Assigned test near the end of the TFrameViewer.Clear and TFrameBrowser.Clear methods in framview.pas and frambrwz.pas.
if Assigned(FViewerList) then {<-- add this} FViewerList.Clear;
Problem: The <body> attributes are not interpreted when <body> is not the first display tag. This is most apparent when no background image is displayed when <basefont> is used earlier.
Resolution: In the DoBody procedure in readhtml.pas, change the code that reads:
BodySy: begin if (BodyBlock.MyCell.Count = 0) and (PropStackIndex = 0) then {make sure we're at beginning} begin to: BodySy: begin if (BodyBlock.MyCell.Count = 0) then {make sure we're at beginning} begin
Problem: Occasional GPFs or OutofMemory errors with Print Preview or Printing.
Resolution: In the BitmapToRegion procedure in htmlun2.pas, make two changes.
Change: { alloc initial region data } maxRects := AllocUnit; GetMem(RgnData,SizeOf(TRgnDataHeader) + (SizeOf(TRect) * maxRects)); to: { alloc initial region data } maxRects := AllocUnit; GetMem(RgnData,SizeOf(TRgnDataHeader) + (SizeOf(TRect) * maxRects)); FillChar(RgnData^, SizeOf(TRgnDataHeader) + (SizeOf(TRect) * maxRects), 0); {<--Add} Also Change: begin Inc(maxRects,AllocUnit); ReallocMem(RgnData,SizeOf(TRgnDataHeader) + (SizeOf(TRect) * MaxRects)); end; to: begin Inc(maxRects,AllocUnit); ReallocMem(RgnData,SizeOf(TRgnDataHeader) + (SizeOf(TRect) * MaxRects)); pr := @RgnData^.Buffer; {<-- Add} FillChar(pr^[maxRects-AllocUnit], AllocUnit*SizeOf(TRect), 0); {<-- Add} end;
Problem: Transparent images with a height of 1 pixel cause a floating point error when printed or previewed.
Resolution: In the PrintTransparentBitmap2 procedure in htmlun2.pas, change the line that reads:
YStep := (biHeight-1)/(NewH-1); to: YStep := (biHeight)/(NewH) - 0.000001;
Problem: An inner nested table displays the background color of the outer table rather than its own.
Resolution: In the ThtmlTable.AddDummyCells method in htmlsubs.pas around line 5388, remove the first statement:
Begin (*if not ParentSectionList.Printing and not BkGnd and (MyCell.BkGnd) then begin {Transfer any Background colors} BkGnd := True; BkColor := MyCell.BkColor; end; *) {<-- remove this statement} RowCount := Rows.Count; if not ListsProcessed then
Problem: There are two uninitialized variables in the code for the <pre> tag. This can cause occasional random memory access exceptions.
Resolution: In the DoPreSy procedure in readhtml.pas around line 1621, add the statements:
begin InForm := False; {<-- add this statement} InP := False; {<-- add this statement} S := TokenObj.Create; FormBlock := Nil; try SectionList.Add(Section);
Problem: In some situations, links located in tables cannot be accessed or their sensitive area is not correct.
Resolution: In htmlsubs.pas, the TCellObj.Draw method, add the line shown:
else PrintTransparentBitmap1(Canvas, X1, Y1, W1, H1, bmImage, bmMask, dcImage, dcMask); end; Cell.Draw(Canvas, ARect, Wd-PadLeft-PadRight-CellSpacing, X+PadLeft+CellSpacing, Y+PadTop+YIndent, 1000, 1000); Cell.DrawYY := Y; {<-- add this statement} if Border then
Problem: The OnInclude event sometimes inserts an extra '>' character in the displayed text.
Resolution: In the DoInclude procedure in readhtml.pas near line 409, add the statement:
while GetAttribute(Sym, SymStr, AttrStr, L) do SL.Add(SymStr+'="'+AttrStr+'"'); DoDashDash; Comment := True; {<-- add this} IncludeEvent(CallingObject, S, SL, IBuff, BuffSize); if BuffSize > 0 then
Problem:The BorderColor attribute for the <table> tag was omitted.
Resolution: In the ThtmlTable.Create method in htmlsubs.pas, add two lines:
for I := 0 to Attr.Count-1 do with TAttribute(Attr[I]) do case Which of BorderSy: Border := Value > 0; {Border=0 is no border} CellSpacingSy: if Value >= 0 then CellSpacing := IntMin(Value, 40); CellPaddingSy: if Value >= 0 then CellPadding := IntMin(Value, 50); BorderColorSy: {<-- Add this} BdrOn := ColorFromString(Name, False, BdrColor); {<-- Add this} end;
Problem: Rapid repeated clicking on a link sometimes causes exceptions.
Resolution: In htmlview.pas, the HTMLMouseUp method, change the code that reads:
URLAction; {Note: Self pointer may not be valid after URLAction call (TFrameViewer, HistoryMaxCount=0)} end; end; LeftButtonDown := False; end; end; to: URLAction; {Note: Self pointer may not be valid after URLAction call (TFrameViewer, HistoryMaxCount=0)} end; end else LeftButtonDown := False; end; end;
Problem: Occasional serious mis-formatting of the display or print output. Some output may be off screen. Sensitive to font selection.
Resolution: The Windows 2000 API call, GetTextExtentPoint32, ocasionally and unpredictably returns results that have no relation to reality. This function may be replaced with the GetTextExtentExPoint function. The change has no effect in other Windows versions:
In htmlun2.pas, change the call that reads GetTextExtentPoint32(DC, P, N, ExtS); to: GetTextExtentExPoint(DC, P, N, 0, Nil, Nil, ExtS); In htmlsubs.pas, replace GetTextExtentPoint32(Canvas.Handle, Start, I+1, ExtS); with: GetTextExtentExPoint(Canvas.Handle, Start, I+1, 0, Nil, Nil, ExtS); This call appears in two places in htmlsubs.pas.
Problem: The TFrameBrowser MarginWidth and MarginHeight Properties are set at 0 by default and behave in a confusing manner.
Resolution: In FramBrwz.pas, the TFrameBrowser.Create constructor, add the lines shown:
FPrintMarginTop = 2.0; FPrintMarginBottom = 2.0; FMarginWidth = 10; {<-- add this} FMarginHeight = 5; {<-- add this} {$ifdef ver100_plus} {Delphi 3,4,5, C++Builder 3, 4}
Problem: The HTML Components have a name conflict with the new Delphi 5 TFrame component. This causes problems when using Delphi's TFrame.
Resolution: In the Uses clause of the Delphi Frame file, make sure that "framview" precedes "forms", as:
Uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Readhtml, FramView, Forms, Dialogs, StdCtrls;
Problem: Images don't display and possible exceptions.
Resolution: In ditherunit.pas, the InitializeBitmapInfoHeader procedure, change the following:
procedure InitializeBitmapInfoHeader(Bitmap: HBITMAP; var Info: TBitmapInfoHeader; PixelFormat: TPixelFormat); // From graphics.pas, "optimized" for our use var DIB : TDIBSection; Bytes : Integer; begin DIB.dsbmih.biSize := 0; Bytes := GetObject(Bitmap, SizeOf(DIB), @DIB); to: procedure InitializeBitmapInfoHeader(Bitmap: HBITMAP; var Info: TBitmapInfoHeader; PixelFormat: TPixelFormat); // From graphics.pas, "optimized" for our use var DIB : TDIBSection; Bytes : Integer; begin FillChar(DIB, sizeof(DIB), 0); {<-- Change this line } Bytes := GetObject(Bitmap, SizeOf(DIB), @DIB);
Problem: Active images and mouseover links work only if the ThtmlViewer has the focus.
Resolution: In htmlview.pas, the ThtmlViewer.HTMLMouseMove method, change the following:
if ((NextCursor = HandCursor) or (SectionList.ActiveImage <> Nil)) and (PtInRect(ClientRect, Point(X, Y)) and Focused) then SetCapture(PaintPanel.Handle) else if not (ssLeft in Shift) then begin ReleaseCapture; SectionList.CancelActives; end; to: if ((NextCursor = HandCursor) or (SectionList.ActiveImage <> Nil)) and (WindowFromPoint(ClientToScreen(Point(X, Y))) = PaintPanel.Handle) then SetCapture(PaintPanel.Handle) else if not (ssLeft in Shift) then begin ReleaseCapture; SectionList.CancelActives; end;
Problem: The cursor does not change into a hand when over an image with mapped links.
Resolution: In htmlview.pas, the ThtmlViewer.HTMLMouseMove method, change the following:
if ((NextCursor = HandCursor) or (SectionList.ActiveImage <> Nil)) and (PtInRect(ClientRect, Point(X, Y))) then SetCapture(PaintPanel.Handle) else begin ReleaseCapture; SectionList.CancelActives; end; to: if ((NextCursor = HandCursor) or (SectionList.ActiveImage <> Nil)) and (WindowFromPoint(ClientToScreen(Point(X, Y))) = PaintPanel.Handle) then SetCapture(PaintPanel.Handle) else if not (ssLeft in Shift) then begin ReleaseCapture; SectionList.CancelActives; end;
Problem: In the demo programs, when a Print Preview is followed by a Print from the menu, an access violation occurs. (Printing from the Preview dialog does not have this problem.)
Resolution: In PrintStatusForm.Pas, change both the TPrnStatusForm.DoPreview and TPrnStatusForm.DoPrint methods by adding a line:
Viewer.OnPageEvent := PageEvent; PostMessage(Handle, Wm_StartPreview, 0, 0); Abort := ShowModal = mrCancel; Viewer.OnPageEvent := Nil; {<-- add this line} end;
Problem: The TFrameViewer.Clear method does not clear.
Resolution: In FramView.Pas, change the TSubFrameSet.Clear method to read as follows:
procedure TSubFrameSet.Clear; var I: integer; X: TFrameBase; begin for I := List.Count-1 downto 0 do begin X := List.Items[I]; List.Delete(I); RemoveControl(X); X.Free; end; DimCount := 0; First := True; Rows := False; FillChar(Fixed, Sizeof(Fixed), 0); FillChar(Lines, Sizeof(Lines), 0); DisposeStr(FBase); FBase := NullStr; DisposeStr(FBaseTarget); FBaseTarget := NullStr; end;