Possible to put vector graphics into PDF?

I know I can easily put bitmaps into a PDF. I know I can programmatically create vector art. But what I am looking for is an approach to embedding a vector artwork file into the PDF.

Comes down to logos and the tradeoff between size and resolution. If there were a way I could export vector art from Corel (my weapon of choice for logos) and export some format of vector file, rather than bitmap, I could reduce the size of the PDF file, and very likely improve the image quality throughout. Win-Win! Just don't know how to add an external vector format logo via PDFTron.
Lee Gillie, CCP
Online Data Processing, Inc.

Yes, this is definitely possible and there are multiple ways to do it.

One option is ElementBuilder/ElementWriter as shown in ElementBuilder sample:


ElementBuilder eb = new ElementBuilder();

ElementWriter writer = new ElementWriter();

page = doc.PageCreate(new Rect(0, 0, 612, 794));


eb.PathBegin(); // start constructing the path

eb.MoveTo(306, 396);

eb.CurveTo(681, 771, 399.75, 864.75, 306, 771);

eb.CurveTo(212.25, 864.75, -69, 771, 306, 396);


element = eb.PathEnd(); // the path is now finished


// Set the path color space and color

gstate = element.GetGState();


gstate.SetFillColor(new ColorPt(1, 0, 0, 0)); // cyan

gstate.SetTransform(0.5, 0, 0, 0.5, -20, 300);


Another option is to load vector graphics say from XAML (see Xaml2Pdf sample - http://www.pdftron.com/pdfnet/samplecode.html#Xaml2Pdf), EMF/WMF (pdftron.PDF.Convert.FromEmf()), or via GDI/GDI+ (see PDFDC sample http://www.pdftron.com/pdfnet/samplecode/PDFDCTest.cs).