Post Reply 

xcf2pdf - command line interface

Aug 31, 2011, 11:08
Post: #1
xcf2pdf - command line interface
Hi all,
I'm looking for a way to transform 200 xcf files directely into pdf files.

I had some try with convert command, but my 300ko xcf file becomes 20.0Mb pdf file Angry

Does anyone have some advices ? Is it possible to use gimp directly from CLI ?

Thanks a lot in advance!
Find all posts by this user
Quote this message in a reply
Aug 31, 2011, 11:47
Post: #2
RE: xcf2pdf - command line interface
Well,
Code:
$ convert a.xcf a.png
$ convert a.png a.pdf
and
Code:
$ convert -compress jpeg a.xcf a.pdf
gives smaller pdf than the input xcf file, but lower quality...
Find all posts by this user
Quote this message in a reply
Aug 31, 2011, 14:07
Post: #3
RE: xcf2pdf - command line interface
The usual PDF is small because it contain vector graphics. But Gimp only produces bitmaps and if you want a quality bitmap image at 300DPI at Letter/A4 size, it's going to be big (8MPx)(still a 2Mpx image @150DPI).

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Aug 31, 2011, 14:14
Post: #4
RE: xcf2pdf - command line interface
Ok, so what you suggest is to use a program like Inkscape which can deal which vector graphics ?

I got (old) PDF in which I have to change some text and I choose to do it with Gimp.
Find all posts by this user
Quote this message in a reply
Aug 31, 2011, 16:03
Post: #5
RE: xcf2pdf - command line interface
Yes, InkScape is likely better suited

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Aug 31, 2011, 18:57
Post: #6
RE: xcf2pdf - command line interface
Gimp is not really the tool for batch converting other than regular file types and using maybe DBP

Normally I too would say Imagemagick and 'convert' but it does seem to produce large pdf's

You could try instead, nconvert from XnView site, I'm using the linux one here and it says it is

** NCONVERT v4.85 © 1991-2007 Pierre-E Gougelet (Dec 18 2007/13:29:01) **
Version for Linux x86 (X11) (All rights reserved)
** This is a freeware software (for non commercial use)

But there is one for windows either as a separate download or (I think) in with the XnView 1.9x package.

Easiest way is to put the .xcf files and nconvert all in the same folder and run nconvert from that folder with the command (one reason I prefer IM is the syntax).


nconvert -in xcf -o %.pdf -out pdf -c 5 *.xcf

that is
-in xcf input format
-o %.pdf output filename format
-out pdf output format
-c 5 compression type for the pdf 5=jpeg
*.xcf process all the xcf files in the folder.

Probably relies on ghostscript being installed but then AFAIK so does IM. A quick test and it outputs much the same size pdf as a 90% jpeg. Apart from being smaller than the IM pdf, one difference is the IM pdf is ver 1.4 and the nconvert is ver 1.3 pdf. Have not tried this as yet in windows.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Sep 1, 2011, 07:45 (This post was last modified: Sep 1, 2011 08:14 by rich2005.)
Post: #7
RE: xcf2pdf - command line interface
When I got round to it, the compression options are there in the IM docs and ponfrilus is spot on.
http://www.imagemagick.org/Usage/formats/#pdf
pdf options about 2/3 down thge page so for better quality maybe the LZW option.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Can't draw a clean line freehand Dave54 3 392 Jul 12, 2014 16:21
Last Post: Dave54
  command-line optimizing wmichaelv 7 1,004 Jun 11, 2014 08:26
Last Post: rich2005
  How do I erase in a straight line? Terry50 2 677 May 12, 2014 03:11
Last Post: Terry50
  Can I make a line a specific size? jitter1127 3 931 Apr 25, 2014 08:58
Last Post: rich2005
  How to make line thicker? (Need advise) rangdaz 2 585 Feb 3, 2014 13:28
Last Post: rangdaz

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS