I’m trying to display PDFs using Google Docs viewer in a new window. Right now, I’m using JavaScript to open the viewer like this:
let pdfUrl = 'https://example.com/sample.pdf';
let viewerUrl = `https://docs.google.com/viewer?url=${encodeURIComponent(pdfUrl)}`;
window.open(viewerUrl, '_blank', 'width=800,height=600,scrollbars=1');
The viewer works great, but it’s showing everything in English. I need to change the interface language to Dutch. Specifically, I want the ‘Next’ and ‘Previous’ buttons to be in Dutch instead of English.
Is there a way to set the language for the Google Docs viewer? Maybe a parameter I can add to the URL? I’ve looked through the documentation but couldn’t find anything about language settings. Any help would be appreciated!
hey, i had similar issue. google docs viewer doesnt let u change language easily. maybe try pdf.js instead? its pretty good for customizing stuff. or u could make ur own buttons in dutch that work with the viewer. not perfect but might do the trick. good luck!
I’ve actually encountered this issue before when working on a multilingual project. Unfortunately, Google Docs viewer doesn’t provide a straightforward way to change the interface language through URL parameters or any other simple method.
One workaround I found was to use the user’s browser language settings. If you set your browser’s preferred language to Dutch, the Google Docs viewer should automatically display in Dutch. However, this isn’t ideal for most situations as it affects the entire browser.
Another option I explored was using a different PDF viewer altogether. I had success with PDF.js, which is open-source and allows for easy language customization. It took some extra work to implement, but it gave me full control over the interface language.
If you absolutely need to stick with Google Docs viewer, you might consider using a custom overlay with translated buttons that interact with the viewer. It’s not perfect, but it could solve your specific need for Dutch ‘Next’ and ‘Previous’ buttons.
I’ve explored this issue extensively in my work with international clients. Unfortunately, Google Docs viewer doesn’t offer language customization options through URL parameters or API settings. This limitation is frustrating for multilingual projects.
One alternative I’ve successfully implemented is using Mozilla’s PDF.js library. It’s highly customizable and supports multiple languages out of the box. You can easily set up Dutch translations for the interface elements.
If you must use Google Docs viewer, consider creating a custom wrapper around it. You could overlay your own Dutch navigation buttons that interact with the viewer’s functions. It’s not ideal, but it can work as a stopgap solution.
Ultimately, for full language control, you might need to look into self-hosted PDF viewing solutions. They require more setup but offer complete flexibility for internationalization.