#1 2017-07-03 22:24:41

vandrovnik
Member
From: Czech Republic
Registered: 2017-05-16
Posts: 4

Bug fix in procedure TPdfEnum.SelectObjectFromIndex(iObject: integer)

Hello,

I had problems creating a simple PDF - result was not a valid PDF (Adobe Reader complained when trying to print, online validator complained too.).
I have solved it making following change to procedure TPdfEnum.SelectObjectFromIndex(iObject: integer):

procedure TPdfEnum.SelectObjectFromIndex(iObject: integer);
...
        NULL_PEN: begin
          if fInLined and ((pen.style<>PS_NULL) or (pen.null<>true)) then begin
            fInLined := False;
            if not pen.null then Canvas.Stroke;
          end;
          pen.style := PS_NULL;
          pen.null := true;
        end;
        WHITE_PEN, BLACK_PEN: begin
          if fInLined and ((pen.color<>STOCKPENCOLOR[iObject]) or (pen.null<>false)) then begin
            fInLined := False;
            if not pen.null then Canvas.Stroke;
          end;
          pen.color := STOCKPENCOLOR[iObject];
          pen.null := false;
        end;
...

If you find it usefull and correct, please use it. Kind regards,

Karel

Offline

#2 2017-07-04 06:38:09

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,656
Website

Re: Bug fix in procedure TPdfEnum.SelectObjectFromIndex(iObject: integer)

Please check https://synopse.info/fossil/info/6453a6ad46

Thanks for the feedback!

Online

Board footer

Powered by FluxBB