I\'m using Ghostscript library API (wrapping from C#) to print PDF documents from my application.
With the \'-dFirstPage\' and \'-dLastPage\' parameter
I tried to make this script:
gswin32c ^
-q ^
-c "(input.pdf) (r) file runpdfbegin pdfpagecount =" ^
-f input.pdf
work in a c# wrapped solution and kept getting error "/undefinedfilename". In this case ensure that your filepath has Slashes "/" as DirectorySeperator and not Backslashes "\". I know Kurt Pfeifle already wrote it, but it happened to me i just overlooked it.