Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Jul 02, 2018 1:23 am

I've place a certain image using by PdfImage.FromFile

print image is just fine. but select the image in the output pdf and Ctrl+C/V the other graphic tool(such as Windows Paint)

it always show black rectangle. and even size doesn't match with the region i set.(Canvas.DrawImage(PdfImage,Rectangle)

other Pdf solutions support this.(with custom region)

i've search your Examples. and Articles. still there are no clues.

isn't there any way?

Fast Feedback is Very appreciate. :roll:

dahami
 
Posts: 21
Joined: Thu Jun 28, 2018 4:39 am

Mon Jul 02, 2018 2:43 am

Dear dahami,

Thanks for your inquiry.
After testing, I have noticed the black rectangle and size issue, and posted them to our Dev team. They are looking into your issue now and we will let you know once there is any update.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Jul 02, 2018 2:51 am

okay. waiting for that.
thanks for feedback.

dahami
 
Posts: 21
Joined: Thu Jun 28, 2018 4:39 am

Fri Jul 06, 2018 9:28 am

Dear dahami,

Thanks for your waiting.
After further investigation, we found the black rectangle issue is a bug, and due to its complexity I am afraid it is not be fixed in a short time. Anyway, we will try our best to find the solution, we will let you know once there is any good news.
As for the size issue, the final image size is not related to the size when drawing. Our Spire.PDF follows Adobe standard, draw the image with custom size, the size will not be changed when copying the image to other graphic tool. If there is any update to this issue, we will also let you know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Sun Jul 08, 2018 10:54 pm

glad to hear that.

so first one is bug. second one is not bug, just follow the adobe standard. okay.
but could you customize this one too?

thanks for the feedback again. many thanks

dahami
 
Posts: 21
Joined: Thu Jun 28, 2018 4:39 am

Mon Jul 09, 2018 2:52 am

Dear dahami,

Thanks for your information.
Regarding the custom size issue, we found there was a solution that was loading a image and changing its size, then drawing the changed image on PDF via Spire. Sample code for your reference:

Code: Select all
            RectangleF rec = new RectangleF(5, 10, 300, 300);
            System.Drawing.Image img = System.Drawing.Image.FromFile(@"F:\image\image1.jpg");
            Bitmap bitmap = new Bitmap((int)rec.Width, (int)rec.Height);
            using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmap))
            {
                g.Clear(System.Drawing.Color.White);
                g.DrawImage(img, new RectangleF(0, 0, rec.Width, rec.Height), new RectangleF(0, 0, img.Width, img.Height), GraphicsUnit.Pixel);
            }
            img.Dispose();

            PdfDocument doc = new PdfDocument();
            PdfPageBase page = doc.Pages.Add();
            PdfImage image = PdfImage.FromImage(bitmap);
            page.Canvas.DrawImage(image, rec);

            doc.SaveToFile(@"14282-customSize.pdf");
            doc.Close();

Hope this could meet your requirement.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Jul 09, 2018 4:36 am

that's work. but that way has twice routine of CreateImage. (Image.Fromfile,PdfImage.FromImage)
but i guess there are only way so far.
thanks

dahami
 
Posts: 21
Joined: Thu Jun 28, 2018 4:39 am

Mon Jul 09, 2018 5:57 am

Dear dahami,

Thanks for your response.
Yes, there are no other solution at present. Regarding the black rectangle issue, we will inform you as soon as there is any good news.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Aug 21, 2018 2:03 am

hello.

i've been waited almost two months about this issue.
so i just wondering how it going.
still progress?
i wrote this because there are probability to forgetness over times.

dahami
 
Posts: 21
Joined: Thu Jun 28, 2018 4:39 am

Tue Aug 21, 2018 8:04 am

Dear dahami,

So sorry that there is still no update due to the complexity of the issue. We had given your issue the hightest priority and our Dev team is still working on it, we will let you know as soon as there is any good news.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Aug 21, 2018 8:36 am

okay.
i just need to sure.
now i knew the situation, i won't bothering you until problems solved.
thanks.

dahami
 
Posts: 21
Joined: Thu Jun 28, 2018 4:39 am

Tue Aug 28, 2018 7:54 am

Dear dahami,

After the in-depth investigation, I am afraid that it is difficult to solve your issue in a short time. Anyway, we will continue finding a solution to fix your issue. Once there is any good news, we will inform you.
We apologize for the inconvenience.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Aug 28, 2018 11:04 pm

understood. i've really appreciate on your support
and hope there are answer on your way.

dahami
 
Posts: 21
Joined: Thu Jun 28, 2018 4:39 am

Wed Aug 29, 2018 2:39 am

Dear dahami,

We will let you know as soon as there is any good news.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Oct 31, 2018 7:39 am

now i'm worrying the problem will be ever fixed.

my customer's keep complaining about Cannot Copy Image because this bug.

i know you try to best but i need asap solution.

dahami
 
Posts: 21
Joined: Thu Jun 28, 2018 4:39 am

Return to Spire.PDF