CreateGdPictureImageFromByteArray doesn't work with PDF?

General discussions about GdPicture.NET.
Post Reply
nyalim
Posts: 8
Joined: Mon May 01, 2017 9:01 am

CreateGdPictureImageFromByteArray doesn't work with PDF?

Post by nyalim » Thu May 04, 2017 9:34 am

Hello,

In my WPF application the following code doesn't work for creating and displaying PDF images.

Code: Select all

 if (evrak.EvrakResim != null)
                    {                       
                        AktifImageID = gdPictureImaging.CreateGdPictureImageFromByteArray(evrak.EvrakResim);
                    }
                    YedekImageID = gdPictureImaging.CreateClonedGdPictureImage(AktifImageID);
                    
                    mGDViewer.ZoomMode = ViewerZoomMode.ZoomModeFitToViewer;
                    mGDViewer.DisplayFromGdPictureImage(AktifImageID);
                    mGDViewer.Refresh();
I can resolve around this by using DisplayFromByteArray() instead of DisplayFromGdPictureImage(AktifImageID) method and directly load it from byte[] and it shows the image but then my undo implementation becomes broken and therefore lose my ability to make changes on the image.

Code: Select all

mGDViewer.DisplayFromGdPictureImage(YedekImageID);
            gdPictureImaging.ReleaseGdPictureImage(AktifImageID);
            AktifImageID = gdPictureImaging.CreateClonedGdPictureImage(YedekImageID);
this and many other changes on the image doesn't work anymore if I do that, screen completely goes blank obviously whatever I click that can make a change on the image. I checked and noticed that AktifImageID returns 0 from that method and getstat() says "UnsupportedImageFormat". So this implementation was originally designed for TIFF images but we want to make it work with PDF also. Is there any other way?

I appreciate any kind of help.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: CreateGdPictureImageFromByteArray doesn't work with PDF?

Post by Loïc » Thu May 04, 2017 1:47 pm

Hello,

The GdPictureImaging class deals with image as input. To use PDF the GdPicturePDF class must be used.

Please let me know if you need further info.

With best regards,

Loïc

nyalim
Posts: 8
Joined: Mon May 01, 2017 9:01 am

Re: CreateGdPictureImageFromByteArray doesn't work with PDF?

Post by nyalim » Wed May 10, 2017 3:40 pm

but can I use cropping text bolding and other stuffs on PDF if I use GdPicturePDF class like I did on TIFF images through GdPictureImaging class?

Gabriela
Posts: 436
Joined: Wed Nov 22, 2017 9:52 am

Re: CreateGdPictureImageFromByteArray doesn't work with PDF?

Post by Gabriela » Fri Jan 18, 2019 9:56 am

Hello,

All methods of the GdPicturePDF class are listed here:
https://www.gdpicture.com/guides/gdpicture/web ... thods.html
All methods of the GdPictureImaging class are listed here:
https://www.gdpicture.com/guides/gdpicture/web ... thods.html
Please take into account that images need to be handled in another way as PDF documents because of their fundamental differences.

Gabriela
Posts: 436
Joined: Wed Nov 22, 2017 9:52 am

Re: CreateGdPictureImageFromByteArray doesn't work with PDF?

Post by Gabriela » Fri Feb 22, 2019 11:37 am

Hi,

What do you mean by this? The PDF format and image formats are completely different from the basics, so you need to use appropriate methods to achieve your goals based on the format's principles. There is no other answer to this question.

LordVishnu
Posts: 1
Joined: Tue Dec 06, 2022 2:11 pm
Contact:

Re: CreateGdPictureImageFromByteArray doesn't work with PDF?

Post by LordVishnu » Tue Dec 06, 2022 2:23 pm

No, the GdPictureImageFromByteArray method cannot be used to create an image from a PDF file. To work with PDFs, you need to use the GdPicturePDF library.GB Whatsapp

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest