How to use PDF viewer in VueJS

Hello,

I am trying to use PDF viewer in VueJS, I need assistance in setting up the backend service, as the documentation is not clear.

I found this in the documentation of JS ES5, with a docker image but the docker image does not exists in the Docker Hub.

Can you let me know where can I find the documentation on setting the backend service?

Thanks

8 Replies 1 reply marked as answer

MS Mohan Selvaraj Syncfusion Team August 24, 2020 12:42 PM UTC

Hi Francois , 

Please refer the below link for creating the web service in the .NET core application 




Kindly run the Web service project first and provide that URL to the serviceURL property of the PDF Viewer. So that the PDF Viewer control will render the PDF pages. 

As of now, If you want to use pdfviewer service docker image, Please use the below image  
 

Regards, 
Mohan S

Marked as answer

FS Francois Sauvageau September 3, 2020 07:23 AM UTC

The docker image seems to be working for now.

Is this an official docker image? 
It would be better if we would have our own docker image to maintain it?
Do you have a repository for this docker image?

Thanks


AA Akshaya Arivoli Syncfusion Team September 4, 2020 05:18 PM UTC

Hi Francois ,   

Thank you for your update. 

We have shared our PDF Viewer web service project with the Docker file in the below link, with reference to it we you can create your own Docker image. 


Note: The above project is the updated one, so kindly use it. 



Please try it and revert us with more details if you still need assistance.  

Regards,   
Akshaya  





FS Francois Sauvageau September 7, 2020 10:19 AM UTC

ok, thank you


FS Francois Sauvageau September 29, 2020 02:21 PM UTC

Hi,

I have an issue with the service you have provided. For some files I receive an error: "Document Reference pointer does not exist in the cache". This is just for some pdf files and is always happening for the same files. Otherwise, the files open correctly in any other program like Adobe or Chrome.

I have found a related issue here: https://www.syncfusion.com/forums/149004/server-side-error-when-rendering-pdf-pages , but it seems that the code there is older than what you have provided and I am not sure what's the difference.

Can you provide a working version or let me know what would be the fix?

Thank you


AA Akshaya Arivoli Syncfusion Team September 30, 2020 10:20 AM UTC

Hi Francois, 
 
Thank you for your update. 
 
We were unable to reproduce the issue with the provided details. We have shared the sample with the Redis in which we have tried to reproduce the issue in the below link, 
 
 
Note: Kindly run the web service project first and provide that URL to the serviceUrl. 
 
 
Also, the reported issue may occur due to the Memory Cache in production environment. However, we can resolve this by using the IDistributedCache in our PDF Viewer Controller. Kindly follow the below steps for using the Redis Cache,    
Kindly follow the below steps for using the Redis Cache,      
   
STEP 1: To use Redis cache in PDF Viewer service, install the following NuGet package,        
                             Microsoft.Extensions.Caching.Redis        
       
STEP 2: To configure the Redis cache in PDF Viewer service, you have to add the following changes in Startup.cs        
        
services.AddMemoryCache();        
services.AddDistributedRedisCache(options =>        
{        
  options.Configuration = Configuration.GetConnectionString("Redis");                        
});        
   
   
      
STEP 3: We have to use IDistributedCache instead of IMemoryCache in PdfViewerController.cs. Please find the PDF Viewer service sample and code snippet below.        
       
       
PdfViewerController.cs       
private IDistributedCache _cache;       
public PdfViewerController(IHostingEnvironment hostingEnvironment, IDistributedCache cache)       
        {       
            _hostingEnvironment = hostingEnvironment;       
            _cache = cache;       
        }       
   
  Please try it and if you still have concerns, revert us with the modified sample with replication procedure, PDF Document , Essential Studio Version. These details will be helpful for us to investigate further and assist you better. 
 
 
 
 
Regards, 
Akshaya  



AT atul replied to Akshaya Arivoli December 8, 2021 05:22 AM UTC

"Document Reference pointer does not exist in the cache" asp.net mvc  

how can resolve 



DM Dhivyabharathi Mohan Syncfusion Team December 8, 2021 01:39 PM UTC

Hi Atul, 
 
In the load balancing environment, the request will be sent to different server machines, in which the cache data will not be available. However, we have implemented the feature ‘Achieve load balancing environment in MVC framework’ and shared the PDF Viewer web-service sample. Kindly download it from the below link. Please find the steps to configure the cache in your application to get the issue resolved. 
 
    
 
      
Kindy refer the below documentation for more details about using the Redis cache in your end.   
 
    
 
 
Kindly try this and let us know if you have any concerns about this. 
 
 
Regards, 
Dhivya. 


Loader.
Up arrow icon