Error generating PDF


#1

Hi

Iam having an error when generating a PDF on a system. I attached a screenshot of the error.

Below is the current license that we have on the product and from the forums it seems we have not yet updated it in like 10 years. May you please assist us on resolving the issue and advise on which options we have

<?xml version="1.0" encoding="utf-8"?> IEMSYS Limited to 1 developer. This is a non-redistributable license. Aspose.Pdf Enterprise b58079d5-ac4f-4942-98bb-b2b1b214b7bd 20081209 2.1 lzuWI6yBA0MS5XSz9S55YgLcK51nNzTUYKeAO0bRB8SqNHT3hr4UM8Uz6EUg3GxuFqHLEI3HlOc3yDGIviUvmXkSlcrpIoIgpLVI7AOHNNonOqto2DDcL3wxm7A7hmJGvenrCJEpmPCdOXVImv5YHMSA5GDeFXpi8cyy+MixO7I=

image.png (3.1 KB)


#2

@Walieboy,

Please send us a ZIP of your source code and license file. We will investigate your scenario in our environment, and share our findings with you.


#3

Thank you. Below is the source code.

ReportPage.aspx.zip (4.1 KB)

Here below is the license

<?xml version="1.0" encoding="utf-8"?> IEMSYS Limited to 1 developer. This is a non-redistributable license. Aspose.Pdf Enterprise b58079d5-ac4f-4942-98bb-b2b1b214b7bd 20081209 2.1 lzuWI6yBA0MS5XSz9S55YgLcK51nNzTUYKeAO0bRB8SqNHT3hr4UM8Uz6EUg3GxuFqHLEI3HlOc3yDGIviUvmXkSlcrpIoIgpLVI7AOHNNonOqto2DDcL3wxm7A7hmJGvenrCJEpmPCdOXVImv5YHMSA5GDeFXpi8cyy+MixO7I=

#4

@Walieboy

Thanks for sharing sample code snippet.

We have checked the shared code snippet and found that it had involved Database calls as well as a lot of undefined/missing classes. We were unable to test this in our environment. However, could you please narrow down your scenario and share simple code snippet, which is able to replicate the said error in our environment. We will test the scenario in our environment and address it accordingly.


#5

Please see the code snippet attached.

      string strDirectory = "Forms/" + strReviewType.ToString().Replace("/", "_") + "/";
            if (!Directory.Exists(HttpContext.Current.Server.MapPath(strDirectory.ToString())))
                Directory.CreateDirectory(HttpContext.Current.Server.MapPath(strDirectory.ToString()));

            string strFileName = strReviewType.ToString() + "_" + strReviewDate.ToString() + "_" + strTraineeIDNumber.ToString() + "_" + DateTime.Now.ToString("HH:mm:ss").Replace(":", "") + ".pdf";
            strFileName = strFileName.Replace('/', '_').ToString().Replace('-', '_');

            string strFileLocation = HttpContext.Current.Server.MapPath(strDirectory.ToString()) + strFileName.ToString();

            if (File.Exists(strFileLocation.ToString())) File.Delete(strFileLocation);

            pdfDoc.Save(strFileLocation.ToString());
            strServerLocation = strFileLocation.ToString().Replace(HttpContext.Current.Server.MapPath("Forms/" + strReviewType.ToString().Replace("/", "_") + "/"), "Forms/" + strReviewType.ToString().Replace("/", "_") + "/");
            #endregion

#6

@Walieboy

Thanks for sharing a code snippet.

We have noticed that your code snippet can only be used to save PDF document at some physical location. However, we have tested code snippet by opening and saving one of our sample PDF documents and were unable to notice any issue.

We have used Aspose.PDF for .NET 18.6 for testing the scenario. Would you please try using latest version of the API and in case you still face any application, please share a sample console application, able to reproduce the error. We will again test the scenario in our environment and address it accordingly.


#7

We have are using the new version but can’t use Pdf pdfDoc = new Pdf();

  1. Must we now use Document pdfdoc = new Document?
  2. more properties can’t work using example:
    IsTruetypeFontMapCached, TextInfo, Segment segment = new Segment,Text txt = new Aspose.Pdf.Text()…

And we detected older version limits characters or rows (when we comment a few parts then the system works).

Please help us.
Thank you


#8

@Walieboy

Thanks for getting back to us.

Please refer to following useful articles and sections in API documentation, which will help you upgrading your existing code according to new DOM API.

In case you still face any issue while upgrading your code, please share complete code snippet with us. We will try to convert it according to new approach and share with you.


#9

professional.pdf (53.7 KB)
technical.pdf (84.9 KB)generatefilepdf.zip (22.0 KB)
@asad.ali:
Please check the file attached. When we split the technical and professional skills it works fine but when use both then the error comes up and we think there is a limit on characters or rows.

Please help us on how we can generate data of both 2 files pdfs (professional.pdf and technical.pdf) as one document.
Thank you very much.


#10

@Walieboy

Thanks for sharing sample PDFs and code snippet.

We have checked the code file which you have shared and noticed that there were a lot of Database calls in code snippet and it was quite complex to extract and modify the code snippet related only to Aspose.PDF. We request you to please share a simplified scenario, including API calls only. We will again check it and assist you accordingly.

As per my understandings, you need to merge/join two PDF documents and generate and new one. Please use following code snippet in order to achieve that:

Document resultDocument = new Document();

Document doc1 = new Document(dataDir + "doc1.pdf");
Document doc2 = new Document(dataDir + "doc2.pdf");

resultDocument.Pages.Add(doc1.Pages);
resultDocument.Pages.Add(doc2.Pages);

resultDocument.Save(dataDir + "ConcatenatedDocs.pdf");

Furthermore, please make sure to use a valid license before using latest version of the API. In case your existing license is not valid for latest release, you may please renew your subscription. Without a valid license, you will not be able to process more than 4 elements of any collection in the API because of trial version limitations.


#11

@asad.ali,
We can’t use both dll Aspose.PDF to generate 2 file pdfs after we merge them. We have an old license for the version of Aspose we are using but it still has limitations.

How can we use this version Aspose to generate a total of 2 pdf files?

thank you


#12

@Walieboy

I am afraid that we may not be able to resolve the issue which you are facing with older version of the API, because we have tested the scenario by merging both documents with Aspose.PDF for .NET 18.7 and were unable to observe any issue. We have use earlier shared code snippet to merge the documents and for your kind reference, an output PDF is also attached.

MergedDocs.pdf (141.7 KB)

Please note that you are using quite old version of our API, and we cannot provide support against an issue occurring only in older version(s) of the API. As requested earlier, please use latest version of the API. You can also apply 30-days temporary license, in order to use and evaluate latest version of Aspose.PDF for .NET.


#13

@asad.ali,

We agree using new version however we will not be using this system in the next 3 months so we wanted to know how much it is to get the temporary license?.


#14

@Walieboy

You can get a temporary license by following instruction given over “Temporary License” page of our website. You will get all pricing information over there as well. In case of any further query regarding pricing of the products, you can also post your inquiry in Aspose.Purchase forums. You will surely be assisted accordingly.