Aspose .NET PDF generator throw error - Incompatible unit types

We are experiencing an error message when converting HTML to PDF. Let me know what additional information you need to address this ASAP.

Thanks

System.ArgumentException
HResult=0x80070057
Message=Incompatible unit types.
Source=Aspose.PDF
StackTrace:
at #=z$BxkGEZ9CpFc3OfR74JHxBQ=.#=zYVcbFPtdNbJD[T](String #=zwc5hue8=)
at #=zVGCMs_r6saOSAz9OQI_eJLWIbgNQ7OirGA==.#=ziSZUjBg=.#=z8AUnF0Q=.#=zhvvYKGg4ldf7VYeh1pO71mE$gZ_I(#=zVGCMs_r6saOSAz9OQI_eJLWIbgNQ7OirGA== #=z2C$cuoM=, #=zVGCMs_r6saOSAz9OQI_eJLWIbgNQ7OirGA== #=znsI6Pgs=)
at #=zVGCMs_r6saOSAz9OQI_eJLWIbgNQ7OirGA==.op_Addition(#=zVGCMs_r6saOSAz9OQI_eJLWIbgNQ7OirGA== #=z2C$cuoM=, #=zVGCMs_r6saOSAz9OQI_eJLWIbgNQ7OirGA== #=znsI6Pgs=)
at #=zZDZLcglkyGsWoh3Y3dTKLuLSFWiBYHYibrXmeCU=.#=zg_FaDqb_mHCw()
at #=zTWfWpk4sXA8MN14LgIOjAEaaKuJC1RGmKQ==.#=zmTz$LORRLsiT(#=zknu59NBLI5RNe1o87UVBce2Gg1ONMpmNOw== #=zGngBsZ0=, Int32 #=zwFIw_JYCackJ, #=zw0yfY6v5uhSAkyd4mZBnftD65w1GkCJr1A== #=zB21qfjc=, #=zknu59NBLI5RNe1o87UVBcYGeVU3QRJVTCw== #=zqVRMuQI=, #=zknu59NBLI5RNe1o87UVBcYGeVU3QRJVTCw== #=z_uw0BsIyTytX, Single #=zGGQMj1C$TwgA, Boolean #=zLoJzjIM=)
at #=zTWfWpk4sXA8MN14LgIOjAEaaKuJC1RGmKQ==.#=z7S5sFalDIxxH(#=zknu59NBLI5RNe1o87UVBce2Gg1ONMpmNOw== #=zGngBsZ0=, Int32 #=zwFIw_JYCackJ, #=zw0yfY6v5uhSAkyd4mZBnftD65w1GkCJr1A== #=zB21qfjc=, #=zn0Xu9j7J8ghfH5tDEaq2AB6yEaN5xSzFixTKMXg= #=z5OjfLhU=, #=zknu59NBLI5RNe1o87UVBcYGeVU3QRJVTCw== #=z_uw0BsIyTytX, Boolean #=zLoJzjIM=)
at #=ze6bfjA$7cHDAkzPn3hlj8enBvydSWqlsjw==.#=zGYKFmIM=(#=zW0IsLoPSPa05q6ambINzUzs= #=zB30oW38=, #=zknu59NBLI5RNe1o87UVBce2Gg1ONMpmNOw== #=zGngBsZ0=, #=zknu59NBLI5RNe1o87UVBcYGeVU3QRJVTCw== #=zgRweDITKOjfq, #=z$NPLbcJpW_r8YOPymqEWNO6A_QZlCSoTXQ== #=zl9NsmXU=, Boolean #=zFG01LiM=, #=z8$IJxL7lsIIM3QHBjt9m1O59FCJ4 #=zJ6FW9_JGbjY$, Int32 #=zwFIw_JYCackJ, #=zo57gGQQpBLi7PEMsfzA$NNlmlREe #=zI_roxu8=, #=zGMFD016R9NFjp2uM_g46J5IE_fhY #=zecOrkt8=)
at #=ze6bfjA$7cHDAkzPn3hlj8enBvydSWqlsjw==.#=z$ocEyquChOIl(#=zW0IsLoPSPa05q6ambINzUzs= #=zB30oW38=, Int32 #=zlvT9yXg=, #=zknu59NBLI5RNe1o87UVBce2Gg1ONMpmNOw== #=zGngBsZ0=, #=zknu59NBLI5RNe1o87UVBcYGeVU3QRJVTCw== #=z5jlusdpEJHZq, #=zGMFD016R9NFjp2uM_g46J5IE_fhY #=zecOrkt8=)
at #=ze6bfjA$7cHDAkzPn3hlj8enBvydSWqlsjw==.#=zEQ4LRkvpTQh3WINX6g==.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at #=zdMlp2K0vDG_nKQ1MmosA6jK3LNNobrKQrg==.#=zYV_SwUE=(#=zW0IsLoPSPa05q6ambINzUzs= #=zB30oW38=, #=zknu59NBLI5RNe1o87UVBce2Gg1ONMpmNOw== #=zGngBsZ0=, #=zknu59NBLI5RNe1o87UVBcYGeVU3QRJVTCw== #=zgRweDITKOjfq, #=zGMFD016R9NFjp2uM_g46J5IE_fhY #=zecOrkt8=)
at #=zdMlp2K0vDG_nKQ1MmosA6jK3LNNobrKQrg==.#=zKo$eMBXbqtyM(#=zW0IsLoPSPa05q6ambINzUzs= #=zB30oW38=, #=zGMFD016R9NFjp2uM_g46J5IE_fhY #=znIdbFD7ByK20Zlvdqg==, #=zWNQB_34YtWomX1lN5bvaS6p_wCaD #=zWqj40kI=, #=z4rOn3QFqiZG4_o5i3HLJIIlXv2CM #=zTWeuVfg=, #=zeKDltqIt65zdH0iqMzPXPrxKXSdN59QaYi9bRxA= #=zIevfg2A4tQG9$pAfq5RcDSU=, #=z70M0EexJKt849SkS$_2o3Bo= #=zkV_MHeFRtS3Wst$9Kw==)
at #=zdMlp2K0vDG_nKQ1MmosA6jK3LNNobrKQrg==.#=zYV_SwUE=(#=zWNQB_34YtWomX1lN5bvaS6p_wCaD #=zWqj40kI=, #=z4rOn3QFqiZG4_o5i3HLJIIlXv2CM #=zTWeuVfg=)
at #=z4rOn3QFqiZG4_o5i3HLJIIlXv2CM.#=zYV_SwUE=(#=zWNQB_34YtWomX1lN5bvaS6p_wCaD #=zWqj40kI=)
at #=zNyZAhI9CE6pMHGR4SivhCKSZigM_AaTgyw==.#=zkAuIfBo=()
at #=zNyZAhI9CE6pMHGR4SivhCKSZigM_AaTgyw==.#=zdW66hUo=()
at #=zw6mS9TylrTjVvCqcWuXthylXxcOs$q0iGw==.#=zpivQScTE2dot(#=zWoKZNfiO2ifjOJVw3aWcuNo= #=zmBDZFu$8Hc93EHvBHw==, #=z4rOn3QFqiZG4_o5i3HLJIIlXv2CM[] #=zSmBdbqciCNIe, #=zWNQB_34YtWomX1lN5bvaS6p_wCaD #=zWqj40kI=, CancellationToken #=zDoyuSSY=)
at #=z1S_IWYpEo5ig_NJ8q6IWbzMQJuSl.Render(#=zWNQB_34YtWomX1lN5bvaS6p_wCaD #=zWqj40kI=, CancellationToken #=zDoyuSSY=, #=z2vZIJBbfj6tqWrcY5S$XX98=[] #=z0Gp0_As=, #=zW0IsLoPSPa05q6ambINzUzs=[] #=z9_lkGsI=)
at #=z1S_IWYpEo5ig_NJ8q6IWbzMQJuSl.Render(#=zWNQB_34YtWomX1lN5bvaS6p_wCaD #=zWqj40kI=, TimeSpan #=z95GV29I=, #=zW0IsLoPSPa05q6ambINzUzs=[] #=z9_lkGsI=)
at #=zE7yrKMmw4Af8XOSg4b63FsKzaXHB.Render(#=zWNQB_34YtWomX1lN5bvaS6p_wCaD #=zWqj40kI=, #=zAwicjNU= #=zB30oW38=, TimeSpan #=z95GV29I=)
at #=zE7yrKMmw4Af8XOSg4b63FsKzaXHB.Render(#=zWNQB_34YtWomX1lN5bvaS6p_wCaD #=zWqj40kI=, #=zAwicjNU= #=zB30oW38=)
at #=zPglRVwz7qJn5fxClc1CHSwOqsOYV.#=zRQL4DbyORCjg(Stream #=z2rvhxxa8qHPb, Document #=zkvm_m$IhOS9H, HtmlLoadOptions #=zXaETJcZdCQrX, String #=zMbzUewaU4Asj)
at #=zPglRVwz7qJn5fxClc1CHSwOqsOYV.#=z35zBNEU=(Stream #=z2rvhxxa8qHPb, Document #=zkvm_m$IhOS9H, HtmlLoadOptions #=zXaETJcZdCQrX, String #=zMbzUewaU4Asj)
at #=zPglRVwz7qJn5fxClc1CHSwOqsOYV.#=z35zBNEU=(Stream #=z2rvhxxa8qHPb, Document #=zkvm_m$IhOS9H, HtmlLoadOptions #=zXaETJcZdCQrX)
at Aspose.Pdf.Document.#=ztooJgw0=(Stream #=zacc7kJ8=, LoadOptions #=zecOrkt8=)
at Aspose.Pdf.Document…ctor(Stream input, LoadOptions options)

@ANDREA.FARRIS

Can you please provide the HTML content you are trying to convert to PDF and any specific settings you are using for the conversion?

I am attaching HTML and C# code that had HTML in it.
HtmlThatGeneratesTheIssue.zip (6.1 KB)

@ANDREA.FARRIS
thank you for providing files, I’ll investigate this issue and write back as soon as possible

@ANDREA.FARRIS
I tried code you provided on latest version (24.8), it generates document without error
out.pdf (293.6 KB)
what version of Aspose PDF you used to generate the error?

We are using Aspose version 23.8. Can you check if this issue is reproducible with 23.8 and fix it in 24.8? If fixed, any explanation of the fix will be helpful. Thanks

@ANDREA.FARRIS
I checked it with 24.8 , issue seems to be resolved already
I’ll check a bit later with 23.8 but I don’t think it will be possible to say why issue occured in the first place - I never came across such issue before and can’t say which version after 23.8 fixed it
and there are 12 versions issued since that moment

We created a console application to show this issue is not fixed in 24.8 for us. I am attaching the console application. Can you please check and let us know?
AsposeUnitIssue.zip (108.4 KB)

@ANDREA.FARRIS
It’s really strange situation - even with your console application code works correctly
Seems that it’s due to some other reasons
What OS you are using ?
I checked on Windows 10
test_output.jpg (156.5 KB)