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

Free Support Forum - aspose.com

NullRef when convert PDF to SVG

We use Aspose.Pdf 21.1.0.

When saving a specific document under Debian to SVG format NullReferenceException is raised.

The document: http://www.qatarairways.com/docs/duty-free-catalogue35.pdf
Example and system info in the attachments svg_null_ref.zip (1.4 KB)
.

@boris.nikitin

Could you please share the complete Stack Trace information of the error with us. We will further proceed to assist you accordingly.

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at #=zkosqXJ91lGtPyLHtRuqNQgCs_DjXoeZ3m3CQON_0_qn4.#=z1yUTDBVqb7iz()
at #=zTqXlOYlaxvwI3cvKbLLdxP9WQmGaD8sGcm6Tz30FeYfwxmaxDQ==.#=zyWGBG9s=(#=zXu7BGZHPDNo6EkVq_lJdCq3H0KSkV4CHzl2IxXa$E2Oz #=zxWE$VIo=, #=z9eEytOfT0TpAoZw9oFq$iSO6TzCCGN9U2FFqBEFftZ1_ #=ziyVWFpeJfctX, #=zKcUUx2bOnR$Fl9_7Qli355oD1z7JF65jOA== #=zbDVmoBU=)
at #=ziCn8xkhpEvz81VUi9_dYA1eBwWp$ebBJYaIoeBurMVjcuowBqQ==.#=zyWGBG9s=(#=zXu7BGZHPDNo6EkVq_lJdCq3H0KSkV4CHzl2IxXa$E2Oz #=zxWE$VIo=, #=z9eEytOfT0TpAoZw9oFq$iSO6TzCCGN9U2FFqBEFftZ1_ #=ziyVWFpeJfctX)
at #=zxClYwO_U2PJlynuaEcNw59i4ZCXfxsI5uBkxRYG92ADB.#=zPXONLKXhd4jSF3vgAg==(#=zXu7BGZHPDNo6EkVq_lJdCq3H0KSkV4CHzl2IxXa$E2Oz #=zxWE$VIo=, List1 #=zua115wk=) at #=zxClYwO_U2PJlynuaEcNw59i4ZCXfxsI5uBkxRYG92ADB.#=zMl8HfyMsqx2jPXKW4Q==(#=zXu7BGZHPDNo6EkVq_lJdCq3H0KSkV4CHzl2IxXa$E2Oz #=zxWE$VIo=, List1 #=zua115wk=)
at #=zxClYwO_U2PJlynuaEcNw59i4ZCXfxsI5uBkxRYG92ADB.#=zoQ1ALybiVGzi(#=zXu7BGZHPDNo6EkVq_lJdCq3H0KSkV4CHzl2IxXa$E2Oz #=zxWE$VIo=, List1 #=zvIptTcSASNuD) at #=zxClYwO_U2PJlynuaEcNw59i4ZCXfxsI5uBkxRYG92ADB.#=zMCo3d1Y=(#=zFo_O7U1WR54g0PYhipqVWOxvRL$F #=zK25zLUg=, #=zmvoHFblCpZ9olTXtw_Ou08YJHZ6szFJ3FQ== #=z7355Kpg=, #=zXu7BGZHPDNo6EkVq_lJdCq3H0KSkV4CHzl2IxXa$E2Oz #=zxWE$VIo=) at #=zD5rcS9Wp2Z7Pg7XANNkb9fSZvHJJBa6EwQ==.#=z5g0mgYg=(Int32 #=zwCogwEM=, IList1 #=ze68kEkl_lEBnLm6Ksw==, #=zFg_JVLJmBS2U #=z2V92Q3o=)
at #=zD5rcS9Wp2Z7Pg7XANNkb9fSZvHJJBa6EwQ==.#=zMCo3d1Y=()
at #=zd1nLHnbc3Yzv6x4sMXo2xQUb2xDt.#=zOuqf51AXpco5(Document #=zK25zLUg=, #=zXu7BGZHPDNo6EkVq_lJdCq3H0KSkV4CHzl2IxXa$E2Oz& #=zp_1asTsnkMluPOKf1w==, UnifiedSaveOptions #=zlt9mhDo=, Int32& #=zlyYWPtpahnom, Boolean #=zXnlkq4E=)
at #=zd1nLHnbc3Yzv6x4sMXo2xQUb2xDt.#=zPu2Augdy0ciAxCeaqQ==(Document #=zb50g2w9M2HsL, #=zXu7BGZHPDNo6EkVq_lJdCq3H0KSkV4CHzl2IxXa$E2Oz& #=zxWE$VIo=, UnifiedSaveOptions #=zlt9mhDo=, Int32& #=zsU9AlIuS1Pvv, Boolean #=zXnlkq4E=)
at #=zwVSMed9n8rVHKVx9eS7oVtuPZjWw.#=zMEiIjQ6KgYH_(Document #=zb50g2w9M2HsL, String #=zjbNJdNwndyhT, Stream #=zw4bdJTw=, SvgSaveOptions #=zlt9mhDo=)
at Aspose.Pdf.Document.#=znMpv$NePL02D(String #=zjbNJdNwndyhT, SaveOptions #=zlt9mhDo=)
at Aspose.Pdf.Document.Save(String outputFileName, SaveOptions options)

@boris.nikitin

The issue seems related to some missing fonts which are required by the API during conversion. Would you please share if all MS Core fonts are installed in your system. Meanwhile, we are investigating the issue at our end and will share our feedback with you shortly.

With installed fonts problem is not reproduced. But it seems that NullRef is not very good exception for the case.

@boris.nikitin

Would you please share the sample code snippet which you used for conversion? We will log a ticket in our issue tracking system to implement valid exception in such cases and share the ID with you.

This was very simple. Like: new Aspose.Pdf.Document(PDF).Save(file, SVG)

@boris.nikitin

We have logged an investigation ticket to check the feasibility of implementing some meaningful Exception in cases like yours. The ticket has been logged as PDFNET-49556 in our issue tracking system and associated with this forum thread. You will be notified as soon as it is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.

@asad.ali

Currently we have one more (maybe related, maybe no) example with NullReferenceException on converting PDF to SVG under Debian 9.

Currently we use Aspose version 21.4.0.
On this file (synthetic one) 442.53823552-BP_FAIL.pdf (6.6 KB)
processing on Windows succeeds while on Debian 9 processing results in error mentioned above.

@usevalad.sauta

Have you tried to install the missing fonts as shared in this forum thread previously? We have updated the information of the earlier logged ticket to provide some meaningful exception in such scenarios where fonts are absent. We will surely update here as soon as the ticket is resolved.

We apologize for the inconvenience.

Yes, MS TrueType Core fonts are present (is confirmed with fc-list command).

@usevalad.sauta

Thanks for the feedback. We have updated the information of the logged ticket accordingly and will surely inform you as soon as we have some definite updates regarding its resolution. Please give us some time.

We are sorry for the inconvenience.