Ghostscript.NET icon indicating copy to clipboard operation
Ghostscript.NET copied to clipboard

Issue regarding fileupload to rasterizer in .net

Open dearwebmaker opened this issue 4 years ago • 5 comments

image

Hi Habjan,

I am trying to give input file from FILEUPLOAD.filename option in C#. But We are getting System.IO.FileNotFoundException: 'Could not find input file.'

dearwebmaker avatar Mar 24 '21 14:03 dearwebmaker

You need to use absolute path like "C:\MyFiles\CDP.pdf". Ghostscript doesn't know where CDP.pdf is.

jhabjan avatar Mar 24 '21 14:03 jhabjan

Actually we are giving input from FILEUPLOAD control (from UI)

dearwebmaker avatar Mar 24 '21 14:03 dearwebmaker

Did you save that file from FileUpload control to the disk before passing it to Ghostscript?

From what I see, you get file via FileUpload control and then just passing file's "client side" name to the Ghostscript.NET. You need to save that file to disk, get absolute path to that file and pass that absolute path Ghostcript.NET.

jhabjan avatar Mar 24 '21 14:03 jhabjan

Is there any way to pass file directly from FileUpload control to Ghostcript.NET , instead of saving file to folder. ?

dearwebmaker avatar Mar 24 '21 15:03 dearwebmaker

Yes, you can pass in byte array instead of filename and that would work but file will be saved to the disk anyway. Native Ghostscript requires random access to the file.

jhabjan avatar Mar 24 '21 15:03 jhabjan