There have been questions on safe viewing of malicious PDFs on OS. I would like to know if it's okay to directly open them to view them in a Linux OS because the OS is said to be secure and malware-proof most of the times. I am working on a project to detect malicious PDFs. Should I work only on a VM or not open the file at all but work only on the source code?
To say Linux is malware-proof most of the times is incorrect, it's just that much malware focuses on other OS'es (but there is nothing preventing an attacker from targeting more than one OS). Avoid opening the PDF on your box unless you are absolutely sure the malware wasn't written for and won't execute in Linux.
If you are trying to perform analysis then use a sandbox, such as Cuckoo. With that said, some malware is sandbox aware and will try to avoid detection/analysis.
Whether or not the PDF is safe to open depends on whether or not your environment (i.e. Linux and your PDF software) is vulnerable to the exploit. Linux is not malware-proof; it just happens that most malware targets Windows.
However, conclusively determining whether or not an unknown, malicious PDF will affect you is difficult.
To do thorough research, you should probably view the PDF in a VM or sandbox, examine the exploit's behavior in a sandbox, and try to read their source code. The more the merrier! I wouldn't open them directly in your real OS; not worth the risk.
I would not say it is secure to open simply because it's on Linux. I suggest using a sandbox solution for automated analysis, like Cuckoo Sandbox (https://cuckoosandbox.org/) for example. It sounds that like could be a way forward for you.