Free Support Forum - groupdocs.com

UsePDF = true feature improves quality but degrade performance


#1

Hi


We are using usePDF = true which leads to create caching in PDF format.
there is no doubt that it actually sharpen the quality of document.
but it also put an extra burden of creating PDF files when caching other than PNG image files.

Could you please let us know 2 points.

1. What is the functionality and benefits of usePDF = true in groupdocs Viewer.
2. Suggest any possible implementation with or without usePDF = true to increase the performance of Viewer.

Thanks
Puneet Rajak

#2

Hi Puneet,


Thanks for posting your query.

“usePDF” parameter is used to get a better view of document in terms of quality. If there is some performance issue then you can use Jpeg image based rendering with increased quality. Please note that the API provides the feature to set the quality of Jpeg images in image based rendering. Please try the following code:

//Initialize ImageOptions Object
ImageOptions options = new ImageOptions();

imageOptions.ConvertImageFileType = ConvertImageFileType.JPG;
imageOptions.JpegQuality = 100;

Please try the above mentioned feature and share your thoughts.

Warm Regards

#3

Hi Usman,


we understand that using usePDF = true improves the quality of document.
though it also reduce the performance of the Viewer.
When we do not use usePDF parameter in config it appear to work much faster for big files.

Please share all possible way to improve performance without compromising quality of documents.

if it is going to be a fix from your side, please share expected delivery date of fixes also.

Thanks
Puneet Rajak

#4

Hi Puneet,


Yes, the performance of the API is very much improved in the current version (v3.3.0). However, we are still working to make it more faster to render the documents. The next version of the API will be released in second half of June and and you will find more improved performance in v3.4.0. Please stay in touch.

Thanks for your cooperation and patience.

Warm Regards

#5

Hi


Please let me know how to use Image Option in improving quality of image based rendering.

you mention the method in above post 12756

Please also consider that we are using web form front end example for groupdocs UI.
so how could i consume Image option in below code.

var docInfo = _imageHandler.GetDocumentInfo(new DocumentInfoOptions(request.Path));
foreach (var pageData in docInfo.Pages)
{
if (pageData.Height > maxHeight)
{
maxHeight = pageData.Height;
maxWidth = pageData.Width;
}
}
var fileData = new FileData
{
DateCreated = DateTime.Now,
DateModified = docInfo.LastModificationDate,
PageCount = docInfo.Pages.Count,
Pages = docInfo.Pages,
MaxWidth = maxWidth,
MaxHeight = maxHeight
};
result.documentDescription = new FileDataJsonSerializer(fileData, new FileDataOptions()).Serialize(true);
result.docType = docInfo.DocumentType;
result.fileType = docInfo.FileType;

DocumentInfoOptions documentInfoOptions = new DocumentInfoOptions(request.Path);
DocumentInfoContainer documentInfoContainer = _imageHandler.GetDocumentInfo(documentInfoOptions);

Note: _imageHandler.getPages method is not called from image based rendering for our scenario.

Thanks,
Puneet Rajak

#6

Hi Puneet,


Thanks sharing your issue with us.

Please note that ImageOptions is only applicable in image based rendering. You can set the Image quality in image options and then use _imageHandler.GetPages function like below:

//Initialize ImageOptions Object
ImageOptions options = new ImageOptions();

imageOptions.ConvertImageFileType = ConvertImageFileType.JPG;
imageOptions.JpegQuality = 100;

var pages = _imageHandler.GetPages(path, options);


In Webforms front end application, at first stage, image URLs are generated and then requests are posted from browser to the those URLs to generate images. You can check image generation code in GetDocumentPageImage.aspx.cs file.

Please feel free to ask if anything is yet not cleared.

Warm Regards