read PDF information

Jan 8, 2014 at 8:23 AM
Hi
First giving thanks.It is a great library.I am successfully convert PDF to Raster.It is working fine.

I've been trying to read page size and other information of any PDF file. But not doing this. Is it possible to get paper size using Ghostscript.NET??

Thanks in advanced
Coordinator
Jan 13, 2014 at 3:17 PM
Edited Jan 13, 2014 at 3:28 PM
Hi,

You should be able to to get the paper size by running pdf_info.ps.

Switches for GhostscriptProcessor:
  -dNODISPLAY
  -q
  -sFile=c:\your.pdf
  -dDumpMediaSizes
  C:\path-to\pdf_info.ps
This will output paper size via StdOut.

You can get pdf_info.ps from here: http://git.ghostscript.com/?p=ghostpdl.git;a=blob;f=gs/toolbin/pdf_info.ps;h=f4728bdd8ae47f093462d02f0cee335cd1223aa1;hb=53cc9631a7725b0f6a20d815252c3a23b978d8ee

Cheers,
Josip
Aug 3, 2015 at 12:45 PM
Hi Josip,
Thanks for nice library and help.

I have ps file, and I need to get some information from it, for example customer name, emails, phone number etc.
My fast implementation was just to read ps file and line by line to check it by regular expression for required data.

Do you know if it is possible to use Ghostscript for such tasks or maybe other tools?

Best regards, Taras
Coordinator
Aug 3, 2015 at 2:40 PM
Hi TarasB.

What you are asking is not possible by using ghostscript. What you are looking for is something like iTextSharp: http://sourceforge.net/projects/itextsharp/

Cheers,
Josip