Use photoshop in command window hiddenly - photoshop

Is there a way to use Photoshop to convert image from command line.
for example :
Photoshop.exe -convert c:/img1.tif c:/img1.png
I want to run this command from command line, without opening Photoshop application.
I don't want to see Photoshop window.

Photoshop.exe -convert c:/img1.tif c:/img1.png
Won't actually do anything. Photoshop Scripts work in three flavours; Visual Basic, JavaScript and Applescript. There are no commands to "convert" between file types. You can write a script to save a .tiff to a .png BUT it will involve opening the Photoshop application.
I think you're actually after imageMagick - which can do conversions like the one above.

You can use ImageMagick, which is available for Windows from here. The command you want is convert like this:
convert c:\img1.tif c:\img1.png

Related

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.

inkscape: multiple page pdf to multiple png

when I convert pdf to image in linux command line, it seems inkscape gets the best result (better quality than gs with same dpi). Unfortunately, it only converts the first page to png. How to convert every pdf page to different png file? Do I have to extract one PDF page and store to a new pdf file , then do inkscape concert, and so on?
This isn't solely using Inkscape, but you could use e.g. pdftk to split up the pdf-file into separate pages and convert every page into a png with Inkscape. For example, like this:
pdftk file.pdf burst;
l=$(ls pg_*.pdf)
for i in $l; do inkscape "$i" -z --export-dpi=300 --export-area-page --export-png="$i.png"; done
Note that pdftk burst creates pdf-files called pg_0001.pdf, etc., so if you have any files named like that, they'll be overwritten. You can remove them afterwards easily using
rm pg_*.pdf
Lu Kas' answer threw warnings for me without doing the conversion. Probably because I'm running Inkscape 1.1
However, i got it running by replacing some deprecated commands:
inkscape pdfFile.pdf --export-dpi=300 --export-area-page --export-filename=imageFile.png;
For batch processing rather than slowly looping through file by file inkscape has a shell mode for command file scripting. See https://wiki.inkscape.org/wiki/index.php/Using_the_Command_Line#Shell_mode
However like all other #file.txt scripts you need to write a custom text file. and for Windows users run against higher ranking inkscape.com not .exe
Since version 1.0 (currently 1.2) a multipage pdf of contents can be addressed for multiple outputs. for some other examples see https://inkscape.org/doc/inkscape-man.html#EXAMPLES
Commands get replaced over time so currently to export png use --export-type="xxx" to batch export a list of input files to type xxx. Thus in this case --export-type="png"
Also for pdf related inputs and support see https://wiki.inkscape.org/wiki/index.php/Using_the_Command_Line#New_options
For windows users there is a handy batchfile converter here https://gist.github.com/JohannesDeml/779b29128cdd7f216ab5000466404f11

Batch Convert .xls files and add background image | header/footer

i am running latest arch linux and tried to batch convert xls files to pdf which workes fine with the following command:
lowriter -convert-to pdf:writer_pdf_Export *.xls
But those xls files require an additional background image / header / footer stuff with the company information. Dont ask why they have done it that way ;). I just need to figure out a pretty and fast solution for this.
Any help is very appreciated.
Regards and thanks in advance
Sascha
I was able to figure out a simple and fast solution myself. Found a tool in the AUR of arch called pdftk which works as follows:
pdftk fg.pdf background bg.pdf output new.pdf
i just wrote a simple php script to execute it in a loop.
Done, thanks anyway.

How can I replace Image in PDF Programmatically (using command line ideally)

I'm looking for a method to replace an image in an existing PDF file (setup as a template).
In a perfect world I could just run a command (linux or windows will work, I'm not picky) at the command line, however, if need be, I could also implement something using a scripting language or even a full blown program at this point (I have visual studio).
I honestly can't believe how hard it has been to find an example of this being done somewhere.
We're running Windows w/ Cygwin and have Acrobat Pro XI as well as Illustrator CS6 from which the PDF file is originally created.
Essentially what we're looking for is an efficient way to replace images for PDF files that we're sending to the printing house.

Remove Layer with ghostscript

Is it possible to remove a specific layer in a pdf file with ghostscript ? (with linux command line)
You can use the gs command here to figure out where the OCRed text is and, as #LarsKotthof suggested here, use PDFCrop to remove the margins that contain text.
No. As far as I know, none of the Linux commandline tools to handle PDF files can do that.