We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Load PDF

Hi I want to use the control Pdf viewer using Web (Essential JS 2) and javascript (ES5).

But I can't manage make it work without us serviceURL.

I want to load the pdf using a path or with an ObjectURL but nothing work. Do you have any example which open a PDF without using the serviceUrl ?

Also I want to add icons into the PDF pages. (ex: add pin to a the map of a building). Can you provide an example about how I can achieve this?

Thank you

3 Replies

RT Ramya Thirugnanam Syncfusion Team April 30, 2019 05:21 AM UTC

Hi Bernard, 
 
Thank you for contacting Syncfusion support. 
 
Please find the details for your query in the following table. 
 
Query 
Details 
I want to use the control Pdf viewer using Web (Essential JS 2) and javascript (ES5). 
 
But I can't manage make it work without us serviceURL. 
 
I want to load the pdf using a path or with an ObjectURL but nothing work. Do you have any example which open a PDF without using the serviceUrl ? 
serviceUrl property of the PDF viewer control is used to specify the URL of the service to render PDF documents. Service is necessary for the PDF viewer control to load and process the PDF document. So that, the document can be rendered in the client side. 
 
PDF Viewer do not have support to load the PDF document from the blob URL or blob object directly. However, you can load the blob object of PDF document by converting the blob to base64 string using the client-side load() API in the sample level.  
  
Kindly refer the below forum for retrieving the Blob URL of PDF document and displaying the document in the PDF Viewer control.  
  
  
We can also retrieve the blob and convert the same as the base64 string from the server side.  
  
Please replace the provided GetDocument() method in the below provided KB ,for retrieving the Blob URL as the base64 string and for loading the same in the PDF Viewer control   
  
  
Server side :  
 
public string GetDocument ()  
        {  
CloudBlobContainer _cloudBlobContainer = _blobClient.GetContainerReference(_containerName);      
      CloudBlockBlob _blockBlob = _cloudBlobContainer.GetBlockBlobReference(referencename);        
      MemoryStream memoryStream = new MemoryStream();       
      _blockBlob.DownloadToStream(memoryStream)    
string docBase64 = "data:application/pdf;base64," + Convert.ToBase64String(memoryStream.ToArray());  
      return (docBase64);  
}  
  
Also I want to add icons into the PDF pages. (ex: add pin to a the map of a building). Can you provide an example about how I can achieve this? 
Currently, we do not provide support to add icons or images to the PDF pages using PDF Viewer control. However, we are already working on to implement comments with predefined sticky note icons and stamp annotation along with custom stamp. 
 
Can you please confirm us that you need to add the icon for adding comment or as stamp in the PDF document? If your requirement is different than the above details, please provide us more details about your requirements. So that it will be helpful for us to analyze further and assist you better. 
 
Regards, 
Ramya T 



BL BERNARD Ludovic April 30, 2019 07:09 AM UTC

Thank you for your response,

I need to add icons like marker in google map.
I have a PDF map and I want to pin the position(icon) of differents buildings on it.

Regards


RT Ramya Thirugnanam Syncfusion Team April 30, 2019 11:06 AM UTC

Hi Bernard, 
 
Thanks for your update. 
 
As we have updated earlier, we have plans to implement stamp annotation feature in PDF Viewer control. Now, you can now track the status of your request, review the proposed resolution timeline, and contact us for any further inquiries through below link.   
 
 
We can add images as custom stamps after this implementation. So, we can add the pin image as custom created stamp with this feature to the PDF document. Could you please confirm us whether this meets your requirement? 
 
Regards, 
Ramya T 


Loader.
Up arrow icon