You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm using this function to "compress" PDF files. If the filename has Asian language (Japanese and Vietnamese) and the number of characters in filename is longer 15, the error "'gsapi_init_with_args' is made -100" will be appear.
Example:
Input Filename: "こんにちは、私の名前は.pdf" or "Xin chào, tôi tên là. Xin chào, tôi tên là.pdf"
Output Filename: "こんにち.p" or "Xin cháo, tôi tơn lá". They're without extension in filename, zero size and incorrect filename.
Expected Filename: "こんにちは、私の名前は.pdf" or "Xin chào, tôi tên là. Xin chào, tôi tên là.pdf" with smaller size.
If the filename has Asian language (Japanese and Vietnamese) and the number of characters in filename is shorter 15, it's OK to use.
I also use the PDF to TIFF conversion using Ghostscript.NET. When using this feature with PDF files as above, there is no problem. Code below with PDF files as above is OK:
var InputStream = File.Open(strFilePath, FileMode.Open);
using (var rasterizer = new GhostscriptRasterizer())
{
rasterizer.Open(InputStream,gvi,false);
int PdfPages = rasterizer.PageCount;
for (int pageNumber = 1; pageNumber <= rasterizer.PageCount; pageNumber++)
{
string outputPNGPath = Path.Combine(strOutput, strFileNameOnly + pageNumber.ToString() + ".tiff");
Image pdf2PNG = rasterizer.GetPage(iDPI, pageNumber);
pdf2PNG.Save(outputPNGPath, ImageFormat.Tiff);
}
rasterizer.Close();
}
InputStream.Dispose();
My environment:
Windows 11 English US 64-bit (Locale in Settings is Japanese)
Ghostscript version: 9.55.0 32-bit
Ghostscript.NET v1.2.3 (latest)
Please help me fix this. Thank you in advance.
This code with PDF files as above is not working and errors:
I had the same problem,when I printpdf on win11 using Ghostscript.NET v1.2.3。When printing a pdf file, multiple tasks appeared in the printer queue.the cod is following,The code is shown below:
public static void PrintReceipt(string pdfFilePath,string printerName)
{
try
{
var path = "";
if (Environment.Is64BitOperatingSystem)
{
path = Path.Combine(AppContext.BaseDirectory, "GSDll/gsdll64.dll");
}
else
{
path = Path.Combine(AppContext.BaseDirectory, "GSDll/gsdll32.dll");
}
var gvi = new GhostscriptVersionInfo(path);
Ghostscript.NET.Processor.GhostscriptProcessor processor = new Ghostscript.NET.Processor.GhostscriptProcessor(gvi, true);
var switches = new List();
switches.Add("-empty");
switches.Add("-dPrinted");
switches.Add("-dBATCH");
switches.Add("-dNOPAUSE");
switches.Add("-dNOSAFER");
switches.Add("-dNoCancel");
switches.Add("-dNOPROMPT");
switches.Add("-dNOPAGEPROMPT");
switches.Add("-dPDFFitPage");
switches.Add("-dQueryUser=3");
switches.Add("-dNumCopies=1");
switches.Add("-dSubsetFonts=false");
switches.Add("-sDEVICE=mswinpr2");
switches.Add("-f");
switches.Add(Convert.ToString("-sOutputFile=%printer%") + printerName);
switches.Add(pdfFilePath);
processor.StartProcessing(switches.ToArray(), null);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
My environment:
Windows 11 Chinese 64-bit
Ghostscript version: 10.0.0 64-bit
Ghostscript.NET v1.2.3 (latest)
Hello,
I'm using this function to "compress" PDF files. If the filename has Asian language (Japanese and Vietnamese) and the number of characters in filename is longer 15, the error "'gsapi_init_with_args' is made -100" will be appear.
Example:
Input Filename: "こんにちは、私の名前は.pdf" or "Xin chào, tôi tên là. Xin chào, tôi tên là.pdf"
Output Filename: "こんにち.p" or "Xin cháo, tôi tơn lá". They're without extension in filename, zero size and incorrect filename.
Expected Filename: "こんにちは、私の名前は.pdf" or "Xin chào, tôi tên là. Xin chào, tôi tên là.pdf" with smaller size.
If the filename has Asian language (Japanese and Vietnamese) and the number of characters in filename is shorter 15, it's OK to use.
I also use the PDF to TIFF conversion using Ghostscript.NET. When using this feature with PDF files as above, there is no problem. Code below with PDF files as above is OK:
My environment:
Please help me fix this. Thank you in advance.
This code with PDF files as above is not working and errors:
The text was updated successfully, but these errors were encountered: