Using Texmaker, I want to lock the PDF file created so others cannot copy text or print the file - pdf

I'm creating PDFs using Texmaker. I would like to create some of the PDF files so that when I give the PDF to others, they are not able to print the file or to copy the text. I know I can do this with some PDF creator applications, but can I do that from some command like program I have with Latex, MikTex and TexMaker?

It wouldn't be effective anyway. There are bits in the pdf format that purport to forbid the user from doing this, but they are really just suggestions that the reader application may or may not act on. There is nothing to stop a user from removing the code that inspects the bits from a free/libre PDF reader, or just to run a tool over the file to remove the restrictions.

Related

Convert ppt to pdf and protect the file

The below is the line of code I'm using it currently which converts ppt to pdf, however I want to protect pdf , Is there any possibility
PowerPointapp.ActivePresentation.SaveAs path & pdffileNm & ".pdf", 32
This is not possible with the default vba functions available!
See this, not tested by me, example of using an external library to save pdf with password in the past.
Protecting a PDF is not permanent, once the file is opened (using the users decryption key provided by handing over the password), the contents are available to the new owner to add comment or fill forms or otherwise modify by print or text edit or remove watermarks.
Adobe reader will use different parts of those keys to reduce user writes, but no other editor has to.
Browsers need to edit PDF in exactly the same way so my Firefox pdf reader allows me to correct / change web page content or the embedded pdf contents, exactly the same as any other browser or pdf viewer or editor can. The only protected PDF is an unpublished one.

executing a Linux command from PDF file in a PDF viewer

Is it possible to execute a Linux command from a PDF file shown in a PDF viewer?
More specific: I generate PDF files from LaTeX using pdflatex. What I would like to do is to include some symbol or text in the PDF file which starts a Linux command when the user clicks on it. Typically I'm using evince to show PDF files.
I'm not sure whether it is at all possible to execute commands from PDF files in a viewer, and if it is possible, which packages and LaTeX commands would be required to include the symbol or text and the associated command in the PDF file?
(Alternatively, is there at least a way to obtain the number of the current page shown in the PDF viewer? That would help to some extent.)
Thanks a lot!
Unfortunately and rather fortunately you cant do that.The pdf standard doesnt allow to run shell scripts. That would be a HUGE security oversight.

What do I should use for saving a text like a pdf in gdscript

I want to make a multi-device software with godot engine and I want to make it as lite as I can, so I just want to use a Line edit node and a button for saving the text but, is there any way to save it as .txt and .pdf files with code or I need an extra plugin?
Writing a plain text file is relatively easy:
var file = File.new()
file.open("user://some_file.txt", File.WRITE)
file.store_string("Some text")
file.close()
PDF is more difficult. I don't think that there are any out of the box solutions. But remember that PDF is also just a text file with specific commands embedded into the text. You would have to study the specifications of a PDF file and then generate the required structures yourself via the method described above.

Print to pdf that is searchable and selectable from existing pdf that is selectable and searchable

I am trying to print a section of an existing pdf to a new pdf. The original is searchable and selectable but the new pdf cannot do either. I am using "adobe acrobat reader DC" and print via "Microsoft Print to PDF". Unsure if there is any other relevant information.
After searching for a period of time I could not find an answer that allows for direct PDF to PDF print.
I did find a workaround however.
I downloaded a free software called PrimoPDF. Once installed, PrimoPDF becomes a printer option within Adobe acrobat reader. I then selected my desired pages and printed to PrimoPDf instead of Microsoft Print to PDF. This Generated a .ps file. I then imported the .ps file into PrimoPDF application and was able to generate a .pdf from that. The newly generated pdf was searchable and selectable and exactly what I needed.
Hopefully someone else finds this useful in the future.
Generally refrying (printing to PostScript then converting back to PDF) is a bad idea. The reason that Microsoft Print to PDF created a file that wasn't searchable is because when Adobe Reader detects that the printer it is targeting isn't capable of rendering the PDF correctly because of any number of reasons, like it doesn't have the right fonts for example, it will render the PDF itself and send an image to the printer. A simpler PDF probably would have worked just fine.
You are much better off getting a tool that will simply allow you to extract the pages you need to a new file rather than printing.

[Steganography ]Hiding Data in PDF files

I'm trying to hide a file in a PDF file code. I've already search some information to help me. I've tried to uncompress the pdf using pdftk ( pdftk pdf.pdf output uncompress.pdf uncompress ). Then I tried different things such as :
Insert commentary : I put " %TEXT_TO_HIDE " in the uncompress pdf file code.
add new object : I put " 0 0 obj << TEXT_TO_HIDE << endobj " in the uncompress pdf file code.
modify an existing object
then i compress it using pdftk again
In each case, I obtain a new pdf, which is looking different from the original. It's not corrupted but images have different colors, and some original text are missing.
So, do you know some rules to change a pdf code without anyone notice ?
(PS : Sorry if my english is bad ^^ )
You cannot modify a PDF file in a text editor and expect the file to be still compliant in general. PDF is a binary format and you need to read the PDF specification to figure out how to modify it.
That said, there are heaps of places where you can "hide" information in a PDF document, the real question is how much data you want to hide, and to what purpose. The purpose typically links to how secure exactly this needs to be.
As some examples:
1) PDF allows embedding complete files in the actual PDF file. This is not really secure as anyone with decent software can extract these files (but the file itself could still be secured of course).
2) PDF allows adding arbitrary objects anywhere (or almost anywhere) in the file. This is a great way to hide information, but someone with the right tools can browse the object tree (even if the file is compressed) and see what you did.
3) PDF allows adding for example white text on a white background or text behind other objects. Again, there are ways around this for people with the right software.
4) Adobe's PDF spec allows at least 1K of fluff after the %%EOF marker (although ISO 32000 does not). Keep in mind that this is visible to anyone opening the file with a decent text or binary editor. (Thanks Jongware).
In short, you need to define much better what exactly you want to accomplish and how "secure" secure is in your use case.
You should also consider how "robust" the method must be. Should someone be able to save your PDF file with Acrobat for example with the hidden code intact? Some of the above methods may not be robust enough to ensure that with absolute certainty.