ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 how to open a *.PDF file and save all pages to im
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Pawel

Poland
33 Posts

Posted - Jun 02 2016 :  09:49:42  Show Profile  Reply
Can anyone show me, how to open a *.PDF file and save all pages to images?
I've installed ImageMagic and GhostScript and I don't know what to do next.

w2m

USA
1990 Posts

Posted - Jun 02 2016 :  10:08:35  Show Profile  Reply
See This topic: http://www.imageen.com/ieforum/topic.asp?TOPIC_ID=1464

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

Pawel

Poland
33 Posts

Posted - Jun 02 2016 :  12:24:03  Show Profile  Reply
I read the topic and I can't open pdf file.
In ImageMagic demo I see 32bit Plug-In NOT FOUND, but it is installed.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jun 02 2016 :  12:30:35  Show Profile  Reply
I have not used imagemagic much except for some testing years ago. I get the same result... "32bit Plugin not found". My dll was from 2005 so maybe the latest dll is required. I too installed imagemagick and ghostscript. I will be discussing this with Nigel to see if we can get this working correctly.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

Pawel

Poland
33 Posts

Posted - Jun 03 2016 :  02:14:54  Show Profile  Reply
I downloaded imagemagic and ghostscript 2 days ago, so a version is the latest.
Go to Top of Page

xequte

38615 Posts

Posted - Jun 03 2016 :  03:46:16  Show Profile  Reply
Hi

Are you sure you downloaded the 32bit version of the ImageMagick DLL and not the 64bit one?

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

Pawel

Poland
33 Posts

Posted - Jun 03 2016 :  06:52:21  Show Profile  Reply
Yes, I've installed 32bit version
Go to Top of Page

xequte

38615 Posts

Posted - Jun 06 2016 :  23:10:02  Show Profile  Reply
Hi

It looks like the filenames have been changed in the latest version of ImageMagick, we will fix soon.

In the meantime, you should download the last known good version, which was 6.9.0.

This should be the correct one:

http://ftp.icm.edu.pl/packages/ImageMagick/binaries/ImageMagick-6.9.0-10-Q16-x86-dll.exe

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

Pawel

Poland
33 Posts

Posted - Jun 07 2016 :  03:01:14  Show Profile  Reply
I've installed older version of ImageMagic and now demo program works.
But when I open any pdf file pages are poor quality (low resolution).
How to increase quality?
Go to Top of Page

xequte

38615 Posts

Posted - Jun 08 2016 :  16:22:17  Show Profile  Reply
Try setting the PDF Density:

http://www.imageen.com/help/TIOParams.Dict.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

xequte

38615 Posts

Posted - Jun 08 2016 :  16:32:41  Show Profile  Reply
Also, we have a fix available for ImageMagick 7 support.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

xequte

38615 Posts

Posted - Jun 08 2016 :  21:46:11  Show Profile  Reply
Also, the ImageMagick version we tested against was:

ImageMagick-7.0.1-10-Q16-x86-dll.exe

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

Pawel

Poland
33 Posts

Posted - Jun 09 2016 :  05:14:50  Show Profile  Reply
OK, now I can open a one page of *.pdf file.

    ImageEnView1.IO.Params.ImageIndex := 1;
    ImageEnView1.IO.Params.Dict.Insert('PDF:Density', 200);
    ImageEnView1.IO.LoadFromFile(OpenDialog1.FileName);

But how to read count of pages from pdf file?
Is it possible to load all pages at once?
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jun 09 2016 :  09:49:15  Show Profile  Reply
It is not possible to load all pdf pages or any multi-frame image into TImageEnView. TImageEnView can display only one image at a time. TImageEnMView was designed to hold multiple bitmaps of a multi-frame image, so this should be used instead of TImageEnView for this purpose. When you select a frame in TImageEnMView it can be displayed in TImageEnView by copying the selected bitmap to TImageEnView for editing or viewing.

To load a multi-frame image into TImageEnMView:
ImageEnMView1.MIO.LoadFromFile(iFileName);

To display a TImageEnMView selected frame in TimageEnView:
procedure TForm1.ImageEnMView1ImageSelect(Sender: TObject; idx: Integer);
begin
  ImageEnMView1.CopyToIEBitmap(idx, ImageEnView1.IEBitmap);
  ImageEnView1.Update;
end;

How to read count of pages from pdf file?
ImageEnMView1.ImageCount = count of pages.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

Pawel

Poland
33 Posts

Posted - Jun 20 2016 :  03:28:41  Show Profile  Reply
Is I have to install imagemagick and ghostscript on all client machines or only once on a server machine where an exe file is?
Go to Top of Page

xequte

38615 Posts

Posted - Jun 20 2016 :  17:34:07  Show Profile  Reply
Hi

ImageMagick and GhostScript need to be installed on each system to use PDF.

However we are expecting to see a new PDF DLL soon from a third party which you can just ship with your exe.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

aruest

Canada
11 Posts

Posted - Jul 15 2016 :  20:39:33  Show Profile  Reply
I've also installed the older version of ImageMagic but the demo still gives the message that the plug-in cannot be found.

Any ideas?
Go to Top of Page

aruest

Canada
11 Posts

Posted - Jul 16 2016 :  09:52:33  Show Profile  Reply
I've solved the issue. I just rebooted the computer and now the demo does recognize the ImageMagick plug-in!
Go to Top of Page

xequte

38615 Posts

Posted - Jul 18 2016 :  01:24:08  Show Profile  Reply
Yes, that is true. I will add a reminder to restart to the install instructions.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

aruest

Canada
11 Posts

Posted - Jul 19 2016 :  11:31:40  Show Profile  Reply
>function GetPDFPageCount(const FileName: WideString): Integer;
>var
> iop : TIOParams;
>begin
> Result := -1;
> iop := TIOParams.Create( Nil );
> If iop.ParamsFromFile( FileName ) then
> Result := iop.ImageCount;
> iop.Free;
>end;



Unfortunately, this code does not work.

iop.Imagecount always returns a value of 1 even if there are multiple pages in the PDF file.

Is there a way through the ImageMagick PlugIn to get the page count of a PDF file?

Thank you.
Go to Top of Page

xequte

38615 Posts

Posted - Jul 25 2016 :  05:38:33  Show Profile  Reply
Hi

For performance reasons, ImageCount isn't set when using the ImageMagick plug-in.

Either use IEGetFileFramesCount():

http://www.imageen.com/help/IEGetFileFramesCount.html

(Which does not support all PDF file types).

Or TIEMiscPluginsImageMagick_PDFFrameCount().


From v6.3.1, you will be able to use IEGetFileFramesCount for all PDF types using whatever plug-in is available (Ghostscript or the new WP PDF support).



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: