after searching i found that i can convert to pdf any document using command line tool as -
libreoffice --headless --convert-to pdf filename
but how do i set the permissions for restricting print, editing, etc that come under the security tab of the export as pdf option using command line tool