does anybody know how to disable print/save pdf file? i'm making an application that enable user to view pdf file in an iframe. but i've just been ordered to make it to be as 'viewable but not printable'. now, what i can do is removing the toolbar button, but user still can right click and choose the print option. i had also disabling right click, but id doesn't work in iframe.
Please help.
When you create the PDF,
set an admin password
set an EMPTY user password
set printing document permission to false
If you do not create the PDFs or cannot edit them, then you cannot make the document view-only.
You can use the CFPDF tag to set print permissions. Create copies of all your document and batch process them (or cache them as needed).
<cfpdf action="protect" newOwnerPassword="IHaveCoolPasswords" source="cooldocument.pdf"
destination="protected_cooldocument.pdf" overwrite="yes" permissions="AllowScreenReaders">
Related
This question is about PDF format files, not JS or HTML. Inside a PDF file, I'd like to create a link to another page within the same file. This is useful for Table of Contents type page that needs to link to other pages. But the "Add Link" item in PDF editor in Acrobat doesn't seem to have this as an option -- only the opening of web links, or "documents" (external files, not the current one), etc. Welcome any pointers.
Of course, that's possible.
In the Link tool, you first set the active area (that's where you click to go to the destination.
In a first dialog, Acrobat asks for the properties of the active area. In the Link Action area, select Go to a page view. After clicking on Next, you get a next dialog, directing you to navigate to the target view (page and zoom factor). Confirm, and you have set up your linkā¦
I'm showing pdf document in an iframe. The pdf resides in the same domain. I don't want to allow users to download, save or print the document.
I've removed Print and Download option from the top toolbar by applying CSS but still user can save or print the document on right click. I tried disabling right click using below code but it's not working on the iframe.
document.addEventListener('contextmenu', event => event.preventDefault());
Is there any way to disallow users to download, save or print document shown in an iframe? Any help will be appreciated.
My problem is that we have made an block that opens a page witha a mform on it. And we use the editor element to start the tinyMCE editor, on the page. But when we save the output, the images oploaded to the text field is only viewable to the admin (the person who uploaded it) and in the mdl_files it sets it to be a draft file. I have been through the documentation, and i might have lost the context on the new page, but im not sure.
In Moodle, files uploaded to a form (either to a filemanager element or a text editor) are stored in a temporary 'draft' area while the form is being edited.
This is so that the actual files are not changed until the form is submitted (e.g. if an admin changed the image embedded in some text, deleting the original, you do not want anyone viewing the page during the editing to see a broken image link).
When working with files embedded in a text editor in Moodle, you need to make sure you copy all existing files into the 'draft' area before you show the form, then copy the 'draft' images into the real area, after the form is submitted.
See https://docs.moodle.org/dev/Using_the_File_API_in_Moodle_forms#editor for details about how to do this.
Please also note that your plugin will also need a PLUGINTYPE_PLUGINNAME_pluginfile() function in its lib.php, in order to authenticate any file requests from the user's browser and return the file contents. See any of the core activities for examples of this (e.g. mod/data/lib.php - function data_pluginfile()).
I've worked on a requirement that allows me to show a PDF file inside a browser by doingo a Response.ContentType = "application/pdf".
The problem is that the default view of the PDF is always showing the bookmarks menu at the left, is there a way by using HTTP headers or something to tell the PDF viewer not to show the bookmarks section?
Thanks in advance.
There's two ways that you can do it. The way that I would recommend is to actually open the PDF in Adobe Acrobat and go to File, Properties. On the Initial View tab you'll see a lot of options for how to display the PDF. The second way I haven't tested but Adobe says you can pass various querystring options to the PDF. The one you'd probably want is http://example.org/doc.pdf#pagemode=none
The way how a PDF document is displayed can be configured inside the PDF document.
There are a lot of PDF editors that can modify the "viewer preferences" as it is mostly called. One free example is BeCyPDFMetaEdit.
We have a downloadable PDF file which looks great at 72% magnification in Adobe Reader and not so good at 101%. When downloaded and opened in the reader, its default magnification is 101%.
Is there a way to define the default magnification in the PDF file itself so that we ensure the best user experience?
Thank you!
If you can control the URL used to download, you can put parameters in the URL to control how the built-in reader will display the file.
For example, http://example.org/doc.pdf#zoom=50 will set the magnification to 50%.
See: https://www.evermap.com/AutoBookmark/Manual/OpenParameters.htm
The above applies to the built-in reader supplied by Adobe. Other readers may not honor the parameters. In particular, see the answer to this question regarding Chrome.
An example of how to define magnification when opening a file (regardless of the default one):
AcroRd32 /A "zoom=50=OpenActions" sh.pdf
First, this is a programming website, so you should identify a programming context. This question will probably be closed because it belongs on the soon to be launched serverfault.com
To set the default magnification, you need Adobe Acrobat Standard or Professional not Reader to have the ability to edit pdfs. Then when you open the document, click File | Properties. Click the Initial View tab and enter 72% in the magnification text box and click ok. Save your pdf and reopen it. It should default to 72% magnification when it is opened.
Note: I am unsure if other open source pdf editors provide this type of functionality.
Update: Standard doesn't work for saving magnifications.
For Adobe Standard, go to "Edit" then "Preferences."
When you click on the "Page Display" tab on the left, you'll see a panel with a field called "Zoom," where you can select a percentage from a drop-down menu.
If the above suggestions are not working it may be because the bookmarks can contain zoom instructions in their properties. To look at the bookmark properties select a bookmark in the bookmark panel and right click it to open properties. Choose actions. There should be a description of actions that will be applied when clicking on the bookmark.
The best solution I have found is that you can add a subsequent property for zoom instructions that will execute following the initial one, and set the page zoom to your specifications. To do this, select all of the bookmarks, right click to open properties, then actions, then choose the add function. After choosing add, find the zoom instruction that is the best fit for what you are looking for.
If you want to edit the initial zoom instruction through the edit function in bookmark properties on all bookmarks, you cannot select all, because, although the zoom will be set correctly, every bookmark will be set to one bookmark page. If you wish to edit the properties this way you must edit each, one by one.