Copy link to clipboard
Copied
The documentation for the DCSDK shows that you can specify a url to load a PDF, but the rendering is very slow and causes 1 layer at a time to be rendered. We are displaying watermarked documents, so we don't want to have a half second where the watermark is not visible during rendering process. Is there a way to pre-render before showing the document or potentially load from memory instead of from a url?
The documentation say you can use a File blob by specifying a promise, but I see no code examples. I was hoping I could retrieve the PDF bytes from a server and then pass it to the PDF library to render and perhaps speed up the render process.
let adobeDCView = new AdobeDC.View({ clientId: clientId, divId: "adobe-dc-view" });
adobeDCView.previewFile({
// content: { location: { url: "server.com/my_file.pdf" } }, // works but slow render
content: { promise: promise }, // does not work when resolving this promise with a Blob of type 'application/pdf'
metaData: { fileName: "my_file.pdf" }
}, { showAnnotationTools: false, showDownloadPDF: false, showPrintPDF: false });
I have an example of loading a PDF from a Promise and then waiting until APP_RENDERING_DONE fires before displaying the PDF. It also shows how to display your own loading animation during that time. Look at this CodePen.
Copy link to clipboard
Copied
I have an example of loading a PDF from a Promise and then waiting until APP_RENDERING_DONE fires before displaying the PDF. It also shows how to display your own loading animation during that time. Look at this CodePen.
Copy link to clipboard
Copied
Hi is this suppose to still works? I tried the same exact code in your pen using my brochure, but I can still see the rendering process. Am I missing something? thank you
Copy link to clipboard
Copied
Can you share the PDF?
Copy link to clipboard
Copied
yes of course
https://anekitalia.com/catalogo-soggiorni
I have replied exactly the same code in your codepen with my pdf brochure and ID(except that I want the view mode as SINGLE_PAGE ). You will notice for sure in the mobile version, that you can clearly see the rendering of all pages. I simply would like that the rendering phase during the scrolling not be visible, I don't care if the initial load of the pdf is longer. In the desktop version seems ok due to higher hardware performance, but if you scroll very fast you will notice the rendering even on desktops.
Copy link to clipboard
Copied
Ok - I see it now.
Copy link to clipboard
Copied
I made a video from my android 11 device with latest chrome, you can see the rendering of the page after scrolling
https://drive.google.com/file/d/1VoH4EWXE8fUPjyssJug33reo6hkcduzx/view?usp=sharing
Copy link to clipboard
Copied
That looks like a memory limitation. I think Embed API is rendering as much as it can and then stops until you get to a page that hasn't been rendered. I doubt there is anything you can do about it.
Copy link to clipboard
Copied
thank you anyway for your support