You are not logged in.
Pages: 1
Hi everyone.
Below is a copy of my post which was placed in 'SynPdf library 1.18' thread - wrong place, I think. So I copy it here.
First, I would like to thank you for you great work! Arnaud, I know that you had to spend a lot of time to develop such a great library.
Now, go back to my problem. I tried to create a pdf file using SynPDF and everything went great ... untill I used PolyDraw. It is crucial for me because the PolyDraw method is a base of my framework. So my question is: is it possible to use the method in PDF files created by SyPDF? If so, how to do that? If not, are you going to implement the method in the near future?
Once again, thank you for your great work!
Piotr
Offline
EMR_POLYDRAW record is indeed not handled yet in function EnumEMFFunc() of SynPDF.
Please create a ticket to ask for this implementaiton.
http://synopse.info/fossil/reportlist
Offline
Here is my implementation of PolyDraw. As Arnaud wrote, the code must be put into EnumEMFFunc() function. I would like someone to check it out.
EMR_POLYDRAW: begin
if not pen.null then
E.NeedPen;
types := Pointer(Integer(@PEMRPolyDraw(R)^.aptl[0]) + PEMRPolyDraw(R)^.cptl * SizeOf(TPoint));
i := 0;
while i < PEMRPolyDraw(R)^.cptl do begin
case types^[i] of
PT_LINETO: E.Canvas.LineToI(PEMRPolyDraw(R)^.aptl[i].X,PEMRPolyDraw(R)^.aptl[i].Y);
PT_BEZIERTO: begin
E.Canvas.CurveToCI(PEMRPolyDraw(R)^.aptl[i+1].X,PEMRPolyDraw(R)^.aptl[i+1].Y,
PEMRPolyDraw(R)^.aptl[i+2].X,PEMRPolyDraw(R)^.aptl[i+2].Y,
PEMRPolyDraw(R)^.aptl[i+3].X,PEMRPolyDraw(R)^.aptl[i+3].Y);
Inc(i, 3);
end;
PT_MOVETO: begin
E.Canvas.MoveToI(PEMRPolyDraw(R)^.aptl[i].X,PEMRPolyDraw(R)^.aptl[i].Y);
Moved := PEMRPolyDraw(R)^.aptl[i];
end;
else // PT_CLOSEFIGURE
E.Canvas.LineToI(PEMRPolyDraw(R)^.aptl[i].X,PEMRPolyDraw(R)^.aptl[i].Y);
E.Canvas.LineToI(Moved.X, Moved.Y);
Moved := PEMRPolyDraw(R)^.aptl[i];
end;
Inc(i);
end;
Moved := PEMRPolyDraw(R)^.aptl[PEMRPolyDraw(R)^.cptl - 1];
if not E.Canvas.FNewPath then
if not pen.null then
E.Canvas.Stroke else
E.Canvas.NewPath;
end;
EMR_POLYDRAW16: begin
if not pen.null then
E.NeedPen;
types := Pointer(Integer(@PEMRPolyDraw16(R)^.apts[0]) + PEMRPolyDraw16(R)^.cpts * SizeOf(TSmallPoint));
i := 0;
while i < PEMRPolyDraw16(R)^.cpts do begin
case types^[i] of
PT_LINETO: E.Canvas.LineToI(PEMRPolyDraw16(R)^.apts[i].X,PEMRPolyDraw16(R)^.apts[i].Y);
PT_BEZIERTO: begin
E.Canvas.CurveToCI(PEMRPolyDraw16(R)^.apts[i+1].X,PEMRPolyDraw16(R)^.apts[i+1].Y,
PEMRPolyDraw16(R)^.apts[i+2].X,PEMRPolyDraw16(R)^.apts[i+2].Y,
PEMRPolyDraw16(R)^.apts[i+3].X,PEMRPolyDraw16(R)^.apts[i+3].Y);
Inc(i, 2);
end;
PT_MOVETO: begin
E.Canvas.MoveToI(PEMRPolyDraw16(R)^.apts[i].X,PEMRPolyDraw16(R)^.apts[i].Y);
Moved := Point(PEMRPolyDraw16(R)^.apts[i].X, PEMRPolyDraw16(R)^.apts[i].Y);
end;
else // PT_CLOSEFIGURE
E.Canvas.LineToI(PEMRPolyDraw16(R)^.apts[i].X,PEMRPolyDraw16(R)^.apts[i].Y);
E.Canvas.LineToI(Moved.X, Moved.Y);
Moved := Point(PEMRPolyDraw16(R)^.apts[i].X, PEMRPolyDraw16(R)^.apts[i].Y);
end;
Inc(i);
end;
Moved := Point(PEMRPolyDraw16(R)^.apts[PEMRPolyDraw16(R)^.cpts - 1].X, PEMRPolyDraw16(R)^.apts[PEMRPolyDraw16(R)^.cpts - 1].Y);
if not E.Canvas.FNewPath then
if not pen.null then
E.Canvas.Stroke else
E.Canvas.NewPath;
end;
Offline
Is there really no one who could check it out?
Offline
I've added EMR_POLYDRAW, EMR_POLYDRAW16 process, including ORed PT_CLOSEFIGURE types, as stated by http://msdn.microsoft.com/en-us/library … p/dd162813
Offline
Pages: 1