Question
Clipboard.SetDataObject seems not to work in Adobe Acrobat Protected Mode
public void CopyToClipboard()
{
try
{
Size s = tape.GetPrintSize(0);
if ((s.Width > 0) && (s.Height > 0))
{
const int margin = 20;
s.Width += margin + margin;
s.Height += margin + margin;
Bitmap bmp = new Bitmap(s.Width, s.Height);
Graphics gcs = Graphics.FromImage(bmp);
gcs.FillRectangle(Brushes.White, 0, 0, s.Width, s.Height);
gcs.DrawRectangle(Pens.Black, 0, 0, s.Width - 1, s.Height - 1);
tape.Print(gcs, new Point(margin, margin), 0);
Clipboard.SetDataObject(bmp);
}
}
catch (Exception)
{
DisplayError("Error saving image to clipboard");
}
}Issue while i am trying to copy a bmp object to clipboard from a windows form ,my code works perfectly fine in non-protected mode ,but fails in protected mode.
