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

Free Support Forum - aspose.com

Error converting pdf to pdf-a

Hi,
version aspose pdf for .net 19.3.0.0
I convert pdf file to pdf as follows:

var document = new Document(PDFFileName);
var options = new PdfFormatConversionOptions(LogFileName, PdfFormat.PDF_A_2A, ConvertErrorAction.None);
document.Convert(options);

And I get an error: index and length must refer to a location within the string. parameter name: length.

Some files with errors, some without. Unfortunately I can’t attach examples.
StackTrace:

in System.String.Substring(Int32 startIndex, Int32 length)
in #=zdcZDrO$CfWmPF8bE9CCtiZnJts0aHql9zM53KZfoT13gpCp6tR0Evcc=.#=zYsXftmWoDm3sVOuQKg==(String #=zoLu$1gis60Ze, Boolean #=zGEZuecQ=, Boolean #=zXLCGfsBKHAr6FQ_l5w==)
in #=zDfrLeQu7MCbAmnqNqqTFh9fEAglg_ZbNwOGw7UicAiDVuUUBM_lGW9s=.#=z9hgBmMg=(String #=z3bpnyFc=, Boolean #=zGEZuecQ=, Boolean #=zXLCGfsBKHAr6FQ_l5w==)
in #=zASXAsxoUvkkbTNSl1LHKIpRlcSOgcfGKjA==.#=zIYAGgLg=(Boolean #=zeISOBuQYruV3g5Xe5w==)
in #=zASXAsxoUvkkbTNSl1LHKIpRlcSOgcfGKjA==.#=z2BvHtkUFWA_a()
in #=zgp9CpQXG767U8n66dAdbAzJmu6UJtpTdAr0xckys396mfpj5GOilekI=.#=zPCCYHw0=(#=zKntWu1v$1AdU96gNr0n5OKaU9h0A9$XZhA== #=z6Lax306fEUmP)
in #=z8E6sfPfruhOHxqT0VnXFWbOmBwQ24OvytPe$ipbjMP5KGmUIRw==.#=ze8KKv_1cyztZ()
in #=z8E6sfPfruhOHxqT0VnXFWbOmBwQ24OvytPe$ipbjMP5KGmUIRw==…ctor(String #=zxE4BbH4=, #=zhXBv2d8= #=z28xpAdQ=, #=zhXBv2d8= #=zCFjTALshcszG, #=zLS0bXYESTwt6s9O9ge8mOG5CWfjBlbbtjf5sNLET9M_Q$$1Mm3hXyCM= #=znD4nYjSenMI6, #=zgf9C1gSR42g5X52RPwlR2exxIxh13bRDVx1Z2zs= #=zY1v5oSM=, #=zLS$9KpTyQQNMx5cEnWPJcIXno5UO5hu6M6eF8qx92darH99Kayr_q9o= #=zC6SroqJxCXH8r7ZkiA==, Double #=z4kMMiHg=, Double #=zWKBxJZY=, #=zGuSEinf51GwaWgcLur1eBvogNseW53R1TDBzD1VUTV4PRJAR6w== #=zKeaajUU=, #=zaZR1wjzIAmrTwhjwpoRW4vNQsR$bgxHrg9nD4hA7uPxQwkkh34DFsow= #=z8b4ME1Q=)
in #=zgp9CpQXG767U8n66dAdbAzJmu6UJtpTdAr0xckys396mfpj5GOilekI=.#=zw6lpKX_tyFQY(String #=zxE4BbH4=, #=zhXBv2d8= #=z28xpAdQ=, #=zhXBv2d8= #=zCFjTALshcszG, #=zLS0bXYESTwt6s9O9ge8mOG5CWfjBlbbtjf5sNLET9M_Q$$1Mm3hXyCM= #=znD4nYjSenMI6, #=zgf9C1gSR42g5X52RPwlR2exxIxh13bRDVx1Z2zs= #=zY1v5oSM=, #=zLS$9KpTyQQNMx5cEnWPJcIXno5UO5hu6M6eF8qx92darH99Kayr_q9o= #=zC6SroqJxCXH8r7ZkiA==, Double #=z4kMMiHg=, Double #=zWKBxJZY=, #=zGuSEinf51GwaWgcLur1eBvogNseW53R1TDBzD1VUTV4PRJAR6w== #=zKeaajUU=, #=zaZR1wjzIAmrTwhjwpoRW4vNQsR$bgxHrg9nD4hA7uPxQwkkh34DFsow= #=z8b4ME1Q=)
in #=zLS0bXYESTwt6s9O9ge8mOG5CWfjBlbbtjf5sNLET9M_Q$$1Mm3hXyCM=.#=zp7xjuPFdv3DI(Int32 #=zd2ZEBRA=, Int32 #=zpa43seQ2oA8H, Operator #=zuRNFWrY=, #=zGuSEinf51GwaWgcLur1eBvogNseW53R1TDBzD1VUTV4PRJAR6w== #=zKeaajUU=)
in #=zLS0bXYESTwt6s9O9ge8mOG5CWfjBlbbtjf5sNLET9M_Q$$1Mm3hXyCM=.#=zFXAffdp2aPBo(#=zhXBv2d8= #=z28xpAdQ=)
in #=zLS0bXYESTwt6s9O9ge8mOG5CWfjBlbbtjf5sNLET9M_Q$$1Mm3hXyCM=.#=zipKTVoQ=(Int32 #=zd2ZEBRA=, Operator #=zuRNFWrY=)
in #=zLS0bXYESTwt6s9O9ge8mOG5CWfjBlbbtjf5sNLET9M_Q$$1Mm3hXyCM=.#=zH7aVcts=()
in #=zUzM1wSMIs8X_Sy2lVGLgON1MAgj8lE28pvb5CJcOAd0y0KxK_7MUBJP2W2fq.#=zw_8SM7rprqhe(BaseOperatorCollection #=zoLJFgDs=, Resources #=zY1v5oSM=, Page #=zNue$NnU=)
in #=zUzM1wSMIs8X_Sy2lVGLgON1MAgj8lE28pvb5CJcOAd0y0KxK_7MUBJP2W2fq.#=zw_8SM7rprqhe(BaseOperatorCollection #=zoLJFgDs=, Resources #=zY1v5oSM=)
in #=zUzM1wSMIs8X_Sy2lVGLgON1MAgj8lE28pvb5CJcOAd0y0KxK_7MUBJP2W2fq.#=zoJfKJZI=()
in #=zUzM1wSMIs8X_Sy2lVGLgON1MAgj8lE28pvb5CJcOAd0y0KxK_7MUBJP2W2fq…ctor(Page #=zNue$NnU=, TextSearchOptions #=zBU9NOGlM9Prm, Resources #=zY1v5oSM=, BaseOperatorCollection #=z1OP_bWU=, Boolean #=z0x09WCxfHJCM)
in #=zUzM1wSMIs8X_Sy2lVGLgON1MAgj8lE28pvb5CJcOAd0y0KxK_7MUBJP2W2fq…ctor(Page #=zNue$NnU=, TextSearchOptions #=zBU9NOGlM9Prm, Resources #=zY1v5oSM=, BaseOperatorCollection #=z1OP_bWU=)
in #=zUzM1wSMIs8X_Sy2lVGLgON1MAgj8lE28pvb5CJcOAd0y0KxK_7MUBJP2W2fq…ctor(Page #=zNue$NnU=, Resources #=zY1v5oSM=, BaseOperatorCollection #=z1OP_bWU=)
in #=zD8DOzSCi_0OZxy26L1$cjCG$X$iRNz6sVNdSwYUSDRp059LUHQ54mQk=.#=zZxM1I0CIZSpX(Page #=zNue$NnU=, OperatorCollection #=zoLJFgDs=, Resources #=zY1v5oSM=, Int32 #=zGeOaJ9NxSDgt, #=zRvlXFCcDyPTV3pvrRHpLZOk3jNPOk_s6oBj914pzFKw6i0jxGA== #=zHq9C6zuowR9_)
in #=zD8DOzSCi_0OZxy26L1$cjCG$X$iRNz6sVNdSwYUSDRp059LUHQ54mQk=.#=zMiGcV$Pbd7WS(Page #=zNue$NnU=, #=zRvlXFCcDyPTV3pvrRHpLZOk3jNPOk_s6oBj914pzFKw6i0jxGA== #=zHq9C6zuowR9_)
in #=zD8DOzSCi_0OZxy26L1$cjCG$X$iRNz6sVNdSwYUSDRp059LUHQ54mQk=.#=z$EBIPVk=()
in #=zD8DOzSCi_0OZxy26L1$cjCG$X$iRNz6sVNdSwYUSDRp059LUHQ54mQk=.#=zLw_jRDs=()
in #=zhkrTlZM7b_o3jDh$ES4I3I1rqSDo$fLbUwzsUr4gu9b4Q0iBEneMOYg=.#=zx_SmOws=()
in #=zD8DOzSCi_0OZxy26L1$cjCG$X$iRNz6sVNdSwYUSDRp059LUHQ54mQk=.#=zoSyPaRg=(PdfFormatConversionOptions #=zkXdk0zk=)
in Aspose.Pdf.Document.#=zfvUnSbw=(PdfFormatConversionOptions #=zkXdk0zk=, Boolean #=zUopn82D8zfQL)
in Aspose.Pdf.Document.Convert(PdfFormatConversionOptions options)
in pdftest.Program.Main(String[] args) in D:\Stg\pdftest\pdftest\pdftest\Program.cs:line 49
in System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
in System.Threading.ThreadHelper.ThreadStart_Context(Object state)
in System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
in System.Threading.ThreadHelper.ThreadStart()

@Recnir

Thank you for contacting support.

Please note that we need some sample files to reproduce the problem and then resolve it. Therefore, kindly share the files via Google Drive, Dropbox etc. if files are bigger or drag and drop into post editor so that we may proceed to help you out.