Knowledge Base - Add Bitmap annotation to a page (Windows)

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();
      }
}
Applies To

RadaeePDF SDK for Windows 10

Details

Created : 2017-05-25 09:18:02, Last Modified : 2017-05-25 09:30:47

Order history

Login to handle your order history.