We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

System.Exception is thrown while Generating and Saving new PDF file in C#

Hi,

When saving a PDF like this:

 using (var newPdfDocument = new Document())
{
      ....
     newPdfDocument.Save(newDocFilePath);
}

When it hits .Save, I got an error like this:
[2021-11-23T10:40:30.759Z] Exception: System.Exception: Exception of type ‘System.Exception’ was thrown.
[2021-11-23T10:40:30.759Z] at #=q5$PxgULa4xIc4W1xY29M4z4FrVrN7k9dxbTXG5oSxwU=.#=z3SRtahSjt2mzRr5vWkgQ9xlEE$xt(Byte[] #=zQZ8aPtcpZ2mecFvYXfQjjs0Cn7jq)
[2021-11-23T10:40:30.759Z] at #=q5$PxgULa4xIc4W1xY29M4z4FrVrN7k9dxbTXG5oSxwU=.#=zdg9fuz7BEaSP3RRdne1dGJhkob7U.#=zcvOF$xlBPREP4IfChOLkLaHseWv1(#=zm5M2JESGwrxyhFZtrrsmEw3J2C9X #=zZTUK0952zLjwyKYrva6IgyGEiUTB)
[2021-11-23T10:40:30.759Z] at #=q5$PxgULa4xIc4W1xY29M4z4FrVrN7k9dxbTXG5oSxwU=.#=zD5SKl0Z5yEEBZMs1l$rYdao=(String #=zqhTutcu2Eq9Ww1DZjqYeHKUKCOJB)
[2021-11-23T10:40:30.759Z] at #=qGHMqSFnlPMyzre5Y2SOM3LE1W29cIR5jxm2YA3KSSVg=.#=zdiGszyEo6kvIWjl6EH2SX987uR6T.#=z58mvvSXfsYCSP8pQSwrW4ZwfqVya(String #=zKW9_j_F$3UzrtUdNAvgJQgs=)
[2021-11-23T10:40:30.759Z] at #=qGHMqSFnlPMyzre5Y2SOM3LE1W29cIR5jxm2YA3KSSVg=.#=zdiGszyEo6kvIWjl6EH2SX987uR6T.#=z0NBF_QAED9coUjDj19RFMUGLek3_()
[2021-11-23T10:40:30.759Z] at #=qGHMqSFnlPMyzre5Y2SOM3LE1W29cIR5jxm2YA3KSSVg=.#=zlLZYt5Ff6fStvPM7yOynXncZ0ywQ(String #=zhtg0qEU=)
[2021-11-23T10:40:30.759Z] at #=qGHMqSFnlPMyzre5Y2SOM3LE1W29cIR5jxm2YA3KSSVg=.#=zPMeZ9rkdP8gA4GySH4J5vcs$H9gX(Object #=zCxeC0m7RR8Gr2mBs932rfno1XRCf, ResolveEventArgs #=z$2tHWDC57LVjfSbDwtp914wZySr0)
[2021-11-23T10:40:30.759Z] at System.Runtime.Loader.AssemblyLoadContext.InvokeResolveEvent(ResolveEventHandler eventHandler, RuntimeAssembly assembly, String name)
[2021-11-23T10:40:30.759Z] at System.Runtime.Loader.AssemblyLoadContext.OnResourceResolve(RuntimeAssembly assembly, String resourceName)
[2021-11-23T10:40:30.759Z] at System.Reflection.RuntimeAssembly.GetResource(QCallAssembly assembly, String resourceName, UInt32& length)
[2021-11-23T10:40:30.759Z] at System.Reflection.RuntimeAssembly.GetManifestResourceStream(String name)

Any ideas?

regards,

Wilan

@wilanbigay

Could you please ZIP and attach your input PDF here for testing? We will investigate the issue and provide you more information on it.