Winnovative, PdfConverter same code showing two different quality of Pdf in locally and after deploying in server

299 views Asked by At

I am using the below code which is giving good quality of pdf locally but after deploying the API in the azure app service and consuming the same method using swagger, the quality of Pdf decreases(size of file also decreasing). Here parameter htmlContent is HTML data in string format.

PdfConverter pdfConverter = new PdfConverter();
pdfConverter.LicenseKey = Key;
pdfConverter.PdfDocumentOptions.EnhancedGraphicsQuality = true;
pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;
pdfConverter.PdfDocumentOptions.PdfPageOrientation = PdfPageOrientation.Portrait;
pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.NoCompression;

byte[] downloadBytes = pdfConverter.GetPdfBytesFromHtmlString(htmlContent);

downloadBytes value I am saving it to blob storage.

BlobAccess.WriteBlob(blobConnectionString, blobContainerName, storagePath, downloadBytes);

Let me know what is causing this issue in the server.

1

There are 1 answers

3
AjayKumarGhose On

Based on the DOC| Deployment to Azure Cloud states that ,

Winnovative HTML to PDF Converter for .NET library can be used in web roles and worker roles of Azure Cloud Services and in applications running in Azure Virtual Machines. For Azure App Service there is a special solution because this type of applications impose some restrictions incompatible with the library requirements. There is an example of Azure Cloud Service Application in the Samples\Azure folder of software installation.

For Azure App Service there is a separate solution consisting in a service that can be installed as an Azure Cloud Service or Azure Service Fabric application and a client library for .NET or .NET Core that can be linked directly into your applications to call that service completely transparent for you. The API of the client library is almost identical to the regular .NET library API.

Please refer this below links for more information:

. Winnovative Software - Questions and Answers

. SO THREAD