I can't use FilePdf.DrawPolyline

For some reason when I use FilePdf.DrawPolyline my pdf has nothing visible
If I use DrawLine I haven’t this problem ? Is it something with the fillColor ?
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_FileIO_FilePdf_DrawPolyline.htm
Part of my code,

     Rhino.DocObjects.CurveObject curveObject = objref.Object() as Rhino.DocObjects.CurveObject;

        if (curveObject != null)
        {
          Curve curve = curveObject.CurveGeometry;
          PolylineCurve plc = curve.ToPolyline(0.1, 0.1, 0.1, 100);
          Polyline pl = plc.ToPolyline();
          ppp.Add(pl);
          System.Drawing.PointF[] ptF = new PointF[pl.Count];
          for(int i = 0; i < pl.Count; i++)
          {
            ptF[i].X = (float) pl[i].X * coeff - (float) bboxAll.Min.X * coeff;
            ptF[i].Y = ((float) bboxAll.Diagonal.Y - (float) pl[i].Y + (float) bboxAll.Min.Y) * coeff;
          }

   for (int k = 0; k < (ptF.Length - 1); k++)
        {
          pdf.DrawLine(pagesNumber[j] + 1, ptF[k], ptF[k + 1], colors[j], (float) 0.5);
        }
//          pdf.DrawPolyline(pagesNumber[j] + 1, ptF, fillColor, strokeColor, (float) 0.5);
....
        }

if I open one page of my pdf in Rhino I get that

If I use DrawLine my pdf gives that

@stevebaer, can you look into this?

I’m just going to have to throw this on my bug list to look at. I’m pretty overloaded at the moment with some other projects.

https://mcneel.myjetbrains.com/youtrack/issue/RH-53709

Thanks for the answer, as there is a workaround it is not a big problem.

RH-53709 is fixed in the latest Service Release Candidate

1 Like