Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Windows 8.1, 10, WindowsPhone, Windows UWP

Add an Image on PDF

More
IP: 192.168.0.71 9 years 3 months ago - 9 years 3 months ago #12427 by Pja
Add an Image on PDF was created by Pja
Hi,

I want to add an image on pdf.
I have used the below method for iOS :
struct PDFV_POS pos;
[m_view vGetPos:&pos :imagePoint.x * m_scale :imagePoint.y * m_scale];


// Create the cache file
NSString *tp = NSTemporaryDirectory();
tp = [tp stringByAppendingPathComponent:@"cache.dat"];
[m_doc setCache:tp];

// Create the PDFPage instance of the current page
PDFPage *page = [m_doc page:pageNo];

// Create the CGImageRef of the image
CGImageRef ref = [[UIImage imageWithData:imageData] CGImage];

// Get PDFDocImage instance from CGImageRef (keeping alpha channel)
PDFDocImage *i = [m_doc newImage:ref :YES];


// Define the image rect
PDF_RECT rect;

rect.left = pos.x;
rect.right = pos.x + imageRect.size.width;
rect.top = pos.y;
rect.bottom = pos.y + imageRect.size.height;

// Add the image

[page addAnnotBitmap:i :&rect];

// Re-render the current page
[m_view vRenderSync:pageNo];
[self refresh];
Can you provide me the same implementation for windows.?
Last edit: 9 years 3 months ago by Pja.
More
IP: 192.168.0.71 9 years 3 months ago #12428 by nermeen
Replied by nermeen on topic Add an Image on PDF
Please check this article Add Bitmap annotation to a page (Windows)

You can change the part that loads the image based on your requirements.
Time to create page: 0.398 seconds
Powered by Kunena Forum