• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

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

397

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
Community Expert ,
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?

Votes

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.

 

 

Votes

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