#1 PDF Engine » Bug fix in procedure TPdfEnum.SelectObjectFromIndex(iObject: integer) » 2017-07-03 22:24:41

vandrovnik
Replies: 1

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

#2 Re: PDF Engine » Writing Arc » 2017-05-17 13:46:04

I did not look in "unstable" version, before I started to program it, sorry :-(

Then it is up to you, which version to use - my creates 1 to 4 cubic Bezier curves as needed (similar to .Circle implementation).

#3 Re: PDF Engine » Writing Arc » 2017-05-17 09:14:46

Thank you for your answer.

Procedure TPdfCanvas.Arc and some notes are here: https://pastebin.com/1qU1jkdM

Kind regards,

Karel

#4 PDF Engine » Writing Arc » 2017-05-16 20:25:04

vandrovnik
Replies: 5

Hello,

I have created a procedure for writing Arc to PDF (it was unsupported in SynPdf.pas). I would like to contribute, but do not know how... Is there someone to who I could send my piece of code?

Kind regards,

Karel

Board footer

Powered by FluxBB