PDF files do not have pixels (it's a vector format).
You can draw lines, circles, rectangles - or add a bitmap that only contains a pixel.
Вопрос
I want to draw pixels on PDF files randomly. I am using PDFsharp to create a PDF file. But I didn't get pixel draw option in PDFsharp. Is there any way to draw a pixel on PDF file using PDFsharp?
Решение
PDF files do not have pixels (it's a vector format).
You can draw lines, circles, rectangles - or add a bitmap that only contains a pixel.
Другие советы
This is a variation of what I do.
#region Helper that adds a rectangle to coordinates. Helps visualize container. Uncomment to see extents of container 'rect'.
XPen pen = new XPen(XColors.Black, 1);
gfx.DrawRectangle(pen, 0, 0, 0, 1.0);
#endregion
It creates a rectangle of size one pixel
You can also draw a line of length one pixel.