Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Sun Aug 29, 2021 5:24 pm

Code: Select all
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(path);
doc.Print();


gives:

Code: Select all
Unhandled exception. System.ArgumentException: Parameter is not valid.
   at sprប.ᜀ(PrintPageEventArgs A_0, PdfPageBase A_1, RectangleF A_2)
   at sprប.ᜃ(PrintPageEventArgs A_0)
   at sprប.ᜀ(Object A_0, PrintPageEventArgs A_1)
   at System.Drawing.Printing.PrintDocument.OnPrintPage(PrintPageEventArgs e)
   at System.Drawing.Printing.PrintDocument.Print()
   at sprប.ᜅ()
   at Spire.Pdf.PdfDocument.Print()


attaching the file.

ilyasemenov
 
Posts: 2
Joined: Sun Aug 29, 2021 5:19 pm

Sun Aug 29, 2021 5:29 pm

OK it's crashing for other PDFs as well so it's not about the particular file.

ilyasemenov
 
Posts: 2
Joined: Sun Aug 29, 2021 5:19 pm

Mon Aug 30, 2021 8:47 am

Hello,

Thank you for your inquiry.
I tested your file with our latest version of Spire.PDF Pack (Hot Fix) Version: 7.8.8, but did not encounter the exception on my side. If you were not using the latest version, please first give it a try. If the issue still exists after trying, please provide the following information for us to investigate further. Thanks in advance.
1) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).
2) Your application type, such as Console app (. Net Framework 4.5).
3) Your Printer name, such as Microsoft XPS Document Writer.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Fri Sep 03, 2021 10:07 am

Hello,

Hope you're doing well!
How is your issue going? Has it been resolved? If not, please provide the following information to help us further investigate your problem. Thanks in advance.
1) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).
2) Your application type, such as Console app (. Net Framework 4.5).
3) Your Printer name, such as Microsoft XPS Document Writer.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Mon Jun 19, 2023 7:12 am

Hi Team,

We are having trouble converting word documents to pdf when they contain graphics. Exception ("Parameter is not valid") randomly thrown by spire.pdf library during export (let's say 1 in 10). Our current versions of spire.pdf and spire.doc are 8.7.1 and 10.9.1, respectively.

Environment : .net framework.

Stack trace:

Parameter is not valid., Error Details : at System.Drawing.Imaging.Metafile.GetMetafileHeader()
at Spire.Pdf.Graphics.PdfMetafile.?(Metafile A_0)
at Spire.Pdf.Graphics.PdfMetafile..ctor(Metafile metafile)
at Spire.Pdf.Graphics.PdfImage.FromImage(Image image)
at spr?.?(spr? A_0)
at spr?.?(Document A_0)
at Spire.Doc.Document.?(Stream A_0)
at NAVCR.Reporting.Module.ReportFormatting.PDFFunctionsBLL.GetByteArrayOfPDF(String tempFile, ReportToExport reportObject)
at NAVCR.Reporting.Module.ExportFormats.PDFExport.GetByteArrayBeforePostOperation()
at NAVCR.Reporting.Module.ExportFormats.PDFExport.ExportReport()


Please provide us a quick solution at earliest.

navconsulting
 
Posts: 1
Joined: Thu Sep 29, 2022 1:37 pm

Mon Jun 19, 2023 7:54 am

navconsulting wrote:Hi Team,

We are having trouble converting word documents to pdf when they contain graphics. Exception ("Parameter is not valid") randomly thrown by spire.pdf library during export (let's say 1 in 10). Our current versions of spire.pdf and spire.doc are 8.7.1 and 10.9.1, respectively.

Environment : .net framework.

Stack trace:

Parameter is not valid., Error Details : at System.Drawing.Imaging.Metafile.GetMetafileHeader()
at Spire.Pdf.Graphics.PdfMetafile.?(Metafile A_0)
at Spire.Pdf.Graphics.PdfMetafile..ctor(Metafile metafile)
at Spire.Pdf.Graphics.PdfImage.FromImage(Image image)
at spr?.?(spr? A_0)
at spr?.?(Document A_0)
at Spire.Doc.Document.?(Stream A_0)
at NAVCR.Reporting.Module.ReportFormatting.PDFFunctionsBLL.GetByteArrayOfPDF(String tempFile, ReportToExport reportObject)
at NAVCR.Reporting.Module.ExportFormats.PDFExport.GetByteArrayBeforePostOperation()
at NAVCR.Reporting.Module.ExportFormats.PDFExport.ExportReport()


Please provide us a quick solution at earliest.

Hello,

Thanks for your inquiry.
According to the information you provided, we suggest that you use the latest version of Spire.Doc(Spire.Doc Pack(hot fix) Version:11.6.1) and Spire.PDF(Spire.PDF Pack(Hot Fix) Version:9.6.0) for testing first. If the issue still exists after testing, please provide your input Word file(If the file size is too large, you can provide us with an online download link) and complete executable code for our further investigation. You could attach them here or send them to us via email ([email protected]). Thanks in advance.

Sincerely
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Return to Spire.PDF

cron