Free Support Forum - aspose.com

Cannot convert a specific PCL file to PDF using Aspose.PDF for .NET

Hi Aspose Team,

I tried converting the attached pcl file (uploaded the pcl in zip format21308.zip (7.9 MB)
) to pdf using Aspose.Pdl.dll 17.6, the sample program i wrote got stuck. This think this pcl has a tiff image inside.
My sample program converts other simple pcl’s successfully. Please help.

@prasanna.sk

We tested the scenario with Aspose.PDF for .NET 20.8 and noticed that API generated a blank PDF.

Aspose.Pdf.PclLoadOptions loadopt = new Aspose.Pdf.PclLoadOptions(){ ConversionEngine = Aspose.Pdf.PclLoadOptions.ConversionEngines.NewEngine };
loadopt.SupressErrors = true;
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(dataDir + "21308.pcl", loadopt);
            
doc.Save(dataDir + "21308.pdf");

21308.pdf (17.8 KB)

We have logged an issue as PDFNET-48701 in our issue tracking system. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

Hi Aspose team,

Any update on this request, the issue PDFNET-48701 resolved? is the issue faced in 21308.pcl resolved?

I updated my sample application to use Aspose.PDF .Net client dll’s version 20.8, now in my testing i am not able to convert some 30+ pcl jobs, should i create a separate ticket here and upload the jobs, and what is the possibility to attaching those pcl jobs here, is there any limit in attachment size? do you have any other method to upload attachments?

@prasanna.sk

Regretfully, the earlier logged ticket is not yet investigated. We will surely investigate and resolve it on first come first serve basis. Furthermore, you can please share your files in this forum thread in case you are facing some issue. The maximum supported attachment size is 10M and in case your file size is greater, you can please upload it to Dropbox or Google Drive and share the link with us.

Thanks Aspose team for your response.

Let me attach the zip of files (total 58 files) Failed_PCL_Jobs.zip (5.6 MB)
which failed when i tried to convert using a sample application which uses Aspose.PDF .Net client dll’s version 20.8. Please let me know if this is expected in 20.8 version and the next steps.

@prasanna.sk

We tested the scenario using Aspose.PDF for .NET 20.10 by converting some of your files into PDF. We did not notice any issues.

Would you kindly share what type of issue you are facing? OR how it is failing to convert at your end? Would you please share that sample application with us with which you are facing issue? Also, please try using 20.10 version as well at your side.

Hi Team,

I tried converting one file from the previously shared zip consisting of 58 failed pcl files now using .NET 20.10, and it failed once again, file name is 90degree_rotation.pcl 90degree_rotation.zip (271 Bytes)

I will try converting other files and let you know. In the meantime, output log for this 90degree_rotation.pcl is as below.

The return log i get is as below, hope this helps:
11/9/2020 4:43:36 PM : Conversion failed!!System.Exception: Object reference not set to an instance of an object. —> System.NullReferenceException: Object reference not set to an instance of an object.
at #=zYA_fIQSr$o1zfNhDeB41PLkm4QPLITsbQGf2G45KTAiHQfpxDQ==.#=z1xwMeAs=(Exception #=zRXDEVF8=)
at #=zmsjuzEjZzFaDv6d8bj7a0KFLg0nT5il$79R20nHXlkjO9cfwyw==.#=zeBUcVSk=(#=z9WuORys9aTZtxxNFWnZgjGPrDefk #=z0xKVC4OjRWDm)
at #=z7rJSYy2mJyS1SMTC8gskvHAp1NbDY1HX2ESm5L$38dhgsBm6ivQS2XNlp8oU.#=zJRztq2E=()
— End of inner exception stack trace —
at #=zWdZhSFujsegcwbXliYjPc1U=.#=zJRztq2E=()
at #=zC2Ls1OHaRSiuElJYv4_j4aNIyEfL.#=zzXDgHOODpTofKuBSBpSccgs=(IList1 #=zbohvyVIzk$GD, Document #=zKNAWYnCsxjFA, LoadOptions #=zPZopgMI=, Boolean #=zxOUlCkq78SZq) at #=zC2Ls1OHaRSiuElJYv4_j4aNIyEfL.#=zzXDgHOODpTofKuBSBpSccgs=(IList1 #=zbohvyVIzk$GD, Document #=zKNAWYnCsxjFA, LoadOptions #=zPZopgMI=)
at #=zHJZVplUXF9CAoAe$HNvcxL8oGziu.#=zgyvd8Sb3qo5S(Stream #=z7pMypycpJkNw, Document #=zKNAWYnCsxjFA, PclLoadOptions #=zPZopgMI=)
at Aspose.Pdf.Document.#=zfTJMaFY=(Stream #=zP0x_GKk=, LoadOptions #=zPZopgMI=)
at Aspose.Pdf.Document…ctor(String filename, LoadOptions options)
at MSOfficeConverter.CAspose.ConvertFileToPDF(String& spoolFilePath, String& pdfFilePath, String& resolution)
11/9/2020 4:43:36 PM : Conversion failed!!

@prasanna.sk

Please check following code snippet which we used at our side and did not notice any exception. An output is also attached for your kind reference.

Aspose.Pdf.PclLoadOptions loadopt = new Aspose.Pdf.PclLoadOptions() { ConversionEngine = Aspose.Pdf.PclLoadOptions.ConversionEngines.NewEngine };
loadopt.SupressErrors = true;
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(dataDir + "90degree_rotation.pcl", loadopt);
            
doc.Save(dataDir + "90degree_rotation.pdf");

90degree_rotation.pdf (28.1 KB)

Would you please make sure that you are using the same code snippet? Also, please make sure to install all windows essential fonts in your system.

Hi Aspose Team,

Thanks for providing the code snippet. I replaced your code and i can see the converted pdf getting created for 90degree_rotation.pcl file. similarly i will try for the other 57 files and let you know.

I was using below code snippet. Is something wrong with below code, it worked for lot of pcl’s. Below code was failing for these 58 files only, can you explain?
Aspose.Pdf.LoadOptions options1 = new Aspose.Pdf.PclLoadOptions();
Aspose.Pdf.Document document1 = new Aspose.Pdf.Document(spoolFilePath, options1);
document1.Save(pdfFilePath);

@prasanna.sk

There is nothing wrong with the code snippet that you were using. Except, the code snippet which we shared earlier is using new conversion engine and suppressing the errors that occur during the conversion process.

Hi Aspose Team,

I tested the code snipped that you shared, and i was able to convert 55 files our of the 58. Now 3 files are failing the conversion Failed_PCL_Jobs_V2.zip (215.5 KB)

The return log says generic error for all the 3 failed job.
Below is the log for one of the job, hope this helps:
11/19/2020 3:19:39 PM : Conversion failed!!System.Exception: A generic error occurred in GDI+. —> System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)
at #=zDK6wt2kXHNdFUBBqoKLgUzjwfrfrOb0kF7OLp0yyBdhS.#=z8iy_EPB6HPz51H_QVJLFfqo=(#=zDWe2FTRnprvie3JUaTMGCQFIuQSB #=zeIykdnA=, Page #=zBdVDYsQ=, #=zn_1nuYw9WA1UfybehPGOCJeG4KWP #=z2yh21vZ07A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DGFAh7k=)
at #=zArlpnprIUe26SGdjduRzX7QEdHsdWn3pAQ==.#=zJRztq2E=()
— End of inner exception stack trace —
at #=zWdZhSFujsegcwbXliYjPc1U=.#=zJRztq2E=()
at #=zC2Ls1OHaRSiuElJYv4_j4aNIyEfL.#=zzXDgHOODpTofKuBSBpSccgs=(IList1 #=zbohvyVIzk$GD, Document #=zKNAWYnCsxjFA, LoadOptions #=zPZopgMI=, Boolean #=zxOUlCkq78SZq) at #=zC2Ls1OHaRSiuElJYv4_j4aNIyEfL.#=zzXDgHOODpTofKuBSBpSccgs=(IList1 #=zbohvyVIzk$GD, Document #=zKNAWYnCsxjFA, LoadOptions #=zPZopgMI=)
at #=zHJZVplUXF9CAoAe$HNvcxL8oGziu.#=zgyvd8Sb3qo5S(Stream #=z7pMypycpJkNw, Document #=zKNAWYnCsxjFA, PclLoadOptions #=zPZopgMI=)
at Aspose.Pdf.Document.#=zfTJMaFY=(Stream #=zP0x_GKk=, LoadOptions #=zPZopgMI=)
at Aspose.Pdf.Document…ctor(String filename, LoadOptions options)
at MSOfficeConverter.CAspose.ConvertFileToPDF(String& spoolFilePath, String& pdfFilePath, String& resolution)
11/19/2020 3:19:39 PM : Conversion failed!!

@prasanna.sk

We were able to reproduce the issue in our environment while using Aspose.PDF for .NET 20.11 and logged following tickets in our issue tracking system:

  • PDFNET-49060 (gloves.pcl)
  • PDFNET-49061 (tp11600.pcl)
  • PDFNET-49062 (BRel_51.pcl)

We will further look into tickets detail and keep you posted with the status of their correction. Please be patient and spare us some time.

We are sorry for the inconvenience.