pdfPage.CopyToClipboard doesnot return the copied data when trying to access with Clipboard.GetImage

New Here ,
Feb 10, 2022 Feb 10, 2022

Copy link to clipboard

Copied

I had been using this function for more than a year now and this Clipboard.GetImage is returning null for me since one month.This is only for me and none of my teammates has this issue.We are using the same version as well.

Clipboard.SetImage(m) returns the image when I use Clipboard.GetImage().     

Please find the sample code below.

 

private void button1_Click(object sender, EventArgs e)

        {

            string sourceFileName = @"F:\Anu\orders\HAT7ucrBpMPDF\documents\Azure Stmts.pdf";

            string DestinationPath = @"F:\Anu\";

            //Image act = null;

            Image img = Image.FromFile(@"C:\Users\Anu\source\repos\Metafile Sample\Images\sample.png");

            //Clipboard.SetImage(m);

            //act = Clipboard.GetImage();

            ImageFormat imageFormat = new ImageFormat(Guid.Empty);

            imageFormat = ImageFormat.Png;

            if (pdfDoc.Open(sourceFileName))

            {

                pdfPage = (Acrobat.CAcroPDPage)pdfDoc.AcquirePage(0);

                pdfPoint = (Acrobat.AcroPoint)pdfPage.GetSize();

                pdfRect.Left = 0;

                pdfRect.right = pdfPoint.x;

                pdfRect.Top = 0;

                pdfRect.bottom = pdfPoint.y;

                pdfPage.CopyToClipboard(pdfRect, 0, 0, 100);

                //Clipboard.SetImage(img);

                string outimg = "";

                string filename = Path.GetFileNameWithoutExtension(sourceFileName);

                outimg = DestinationPath + "\\" + filename + "." + imageFormat.ToString();

                Clipboard.GetImage().Save(outimg, imageFormat);

                Dispose();

            }

        }

 

[Question moved to the Acrobat SDK forum]

TOPICS
Acrobat SDK and JavaScript

Views

53

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Feb 16, 2022 Feb 16, 2022

Copy link to clipboard

Copied

Hi,

 

Can I check the simple information first?

- Which version of Acrobat are you running?

- Which OS are you using?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 16, 2022 Feb 16, 2022

Copy link to clipboard

Copied

LATEST

Anupa23094086efk4_0-1645008386459.png

OS is Windows Server 2019.

Not sure what has changed once the adobe was reinstalled.

It was perfectly working fine for me sometime back.

I checked with my colleagues, all of us are working on the same code version but they are not having any issue.

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines