Q: I am trying to see if PDFNet can supprt .fax files. I’m trying to embed a fax file using the following code:
PDFNet.Initialize();
PDFDoc doc = new PDFDoc();
ElementBuilder bld = new ElementBuilder(); // Used to build new Element objects
ElementWriter writer = new ElementWriter(); // Used to write Elements to the page
ObjSet objset = new ObjSet();
Obj jbig2_hint = objset.CreateName(“JBIG2”);
Bitmap bmp = new System.Drawing.Bitmap(MapPath(“Images/PDFTron/03194002.fax”));
pdftron.PDF.Page page = doc.PageCreate(new Rect(0, 0, 612, 794)); // Start a new page
writer.Begin(page); // Begin writing to this page
pdftron.PDF.Image img = pdftron.PDF.Image.Create(doc, bmp, jbig2_hint);
Element element = bld.CreateImage(img, 100, 300, 300, 300);
writer.WritePlacedElement(element);
writer.End(); // save changes to the current page
doc.PagePushBack(page);
// Calling Dispose() results in increased performance and lower memory consumption.
bld.Dispose();
writer.Dispose();
doc.Save(PDFloc, SDFDoc.SaveOptions.e_linearized);
doc.Close();
But it gets hung up on the line Bitmap bmp = new System.Drawing.Bitmap(MapPath(“Images/PDFTron/03194002.fax”));. The error says parameter not valid. Do you know if PDFnet can handle .fax files? and if so, can you point me to an example?
A: