Frequently Asked Question
Add Bitmap annotation to a page (Windows)
Last Updated 11 months ago
To add an annotation bitmap to a page, you can add the following code to PDFView.cs: (Professional license is needed)
PDFPage page = m_doc.GetPage(pageno); if (page != null) { StorageFolder storageFolder = ApplicationData.Current.LocalFolder; StorageFile imageFile = await storageFolder.GetFileAsync("bitmap.jpg"); IRandomAccessStream streamImage = await imageFile.OpenAsync(FileAccessMode.Read); WriteableBitmap writeableBitmap = new WriteableBitmap(1, 1); writeableBitmap.SetSource(streamImage); PDFDocImage image = m_doc.NewImage(writeableBitmap, true); if (image != null) { PDFView.PDFPos pos = m_view.vGetPos((float)point.X, (float)point.Y); PDFRect rect = new PDFRect(); rect.left = pos.x; rect.top = pos.y; rect.right = pos.x + writeableBitmap.PixelWidth; rect.bottom = pos.y + writeableBitmap.PixelHeight; page.AddAnnotBitmap(image, rect); vRenderSync(vGetPage(pageno)); vDraw(); } }