We are looking for a PS to PDF converter and are currently trying AposePdf.
Every Ps file we try is giving a Incorrect File Header".
Even a Ps file created with tour online tool is giving the error.
Used code: var document = new Aspose.Pdf.Document(fileNaam);
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Aspose.PDF
StackTrace:
at #=z8kQPmMCMQiqYwLLtpxARbtg8nbUt.#=zf$tdttQ=(Document #=zev7n9N8=, Stream #=zTMIvp0u$XC5b, PsLoadOptions #=zjqkcKb_AEEKT)
at Aspose.Pdf.Document.#=zNLf_q1I=(Stream #=zgnMJO48=, LoadOptions #=zEKblAOo=)
at Aspose.Pdf.Document…ctor(String filename, LoadOptions options)
at AsposePdf.Form1.ConvertToPdf(String fileNaam) in C:\Dev\TestApps\AsposePdf\AsposePdf\Form1.cs:line 58
What is the difference between your en mine environment.
We tested the scenario using the API with a valid license in an environment i.e. Windows 10 EN x64, VS 2019, Console Application x64 debug mode. Could you please share the environment details where you are facing this error. We will further proceed to assist you accordingly.
I have tried the conversion with a Console Application, but the result is the same…
A screenshot of the app + error is attached.AsposePdfConsole.jpg (512.0 KB)
using (var converter = new Aspose.Pdf.Facades.PdfConverter())
{
converter.BindPdf(dataDir + "px.pdf");
// initiate conversion
converter.DoConvert();
// create TiffSettings & set compression type
var settings = new Aspose.Pdf.Devices.TiffSettings()
{
Compression = Aspose.Pdf.Devices.CompressionType.CCITT4,
};
// save PDF as TIFF
converter.SaveAsTIFF(dataDir + "output.tiff", settings);
I did some further testing with some previous versions of AsposePDF.
When trying version 20.10.0.0 the conversion of a PS file works correct.
All the newer versions are giving the “Object reference not set to an instance of an object” error
Would you please make sure that you are using a valid license with the latest version of the API? In case you do not have one, please consider applying for a free 30-day temporary license and use it at your end to evaluate the API without any restrictions. Please share a sample console application that is able to replicate the issue if it still persists.