What is actually stored in data? Is it raw image data or some image format (like PNG or JPEG)?
From: Ismael Schellemberg [mailto:isma...@gmail.com] Sent: Friday, August 31, 2012 11:22 AM To: podofo-users@lists.sourceforge.net Subject: [Podofo-users] problem drawing images Greetings, i'm having some problems when trying to draw an image on a PdfPainter object I'm trying to create an XObject for a stamp annotation, but I must be doing something wrong because the output looks buggy Also, the output size is about half the size of what it should be. I've tried hardcoding the sizes or duplicating them but it makes no difference ... Here's the code I use, and I attached a couple images, the one I'm trying to load and how it looks after I add it Notes: - data is a NSData object (objective-c) - document is a PdfMemDocument - width/height are the size of the annotation / image (unsigned int) - I'm absolutely sure the bits per component is 8 PdfPainter painter; PdfImage image(document); PdfRect rect(0, 0, width, width); PdfXObject xObj(rect, document); // copy bytes const char *bytes = (const char *)data.bytes; int lLen = data.length; PdfMemoryInputStream stream(bytes, lLen); TVecFilters filters; image.SetImageData(width, height, 8, &stream, filters); painter.SetPage(&xObj); painter.DrawImage(0.0, 0.0, &image); painter.FinishPage(); annot->SetAppearanceStream(&xObj); What am I missing here?? [cid:image001.jpg@01CD876C.6895FC10] [cid:image002.png@01CD876C.6895FC10]
<<inline: image001.jpg>>
<<inline: image002.png>>
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users