* You or someone else want to mantain it (so that we don't end with another
pdftoabw)

Sure, why not. (Spoken with genuine naïvité.)

But if there's a bug filed against pdftocairo in Bugzilla, somebody's gotta put me on CC, cause I don't monitor that.


  * Someone provides a cmake buildsystem patch (should be easy, maybe even i
could do that if previous ones are met)

Done. See attached.

I also wrote a simple manpage.


Cheers,

Stefan
>From 753ed9ac59e9f921f2e4baefacd4c9ceb1252865 Mon Sep 17 00:00:00 2001
From: Stefan Thomas <tho...@txtbear.com>
Date: Thu, 15 Jul 2010 16:24:42 +0100
Subject: [PATCH 1/2] pdftocairo: Added manpage.

---
 utils/Makefile.am  |    5 ++-
 utils/pdftocairo.1 |  125 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 129 insertions(+), 1 deletions(-)
 create mode 100644 utils/pdftocairo.1

diff --git a/utils/Makefile.am b/utils/Makefile.am
index ac08b5e..a551fe5 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -49,6 +49,8 @@ pdftocairo_LDADD = $(LDADD) $(CAIRO_LIBS) \
 
 pdftocairo_binary = pdftocairo
 
+pdftocairo_manpage = pdftocairo.1
+
 endif
 
 AM_LDFLAGS = @auto_import_flags@
@@ -71,7 +73,8 @@ dist_man1_MANS =                              \
        pdftops.1                               \
        pdftotext.1                             \
        pdftohtml.1                             \
-       $(pdftoppm_manpage)
+       $(pdftoppm_manpage)     \
+       $(pdftocairo_manpage)
 
 common = parseargs.c parseargs.h
 
diff --git a/utils/pdftocairo.1 b/utils/pdftocairo.1
new file mode 100644
index 0000000..376c133
--- /dev/null
+++ b/utils/pdftocairo.1
@@ -0,0 +1,125 @@
+.\" Copyright 2010 Stefan Thomas
+.TH pdftocairo 1 "17 July 2010"
+.SH NAME
+pdftocairo \- Portable Document Format (PDF) converter using Cairo
+converter (version 1.00)
+.SH SYNOPSIS
+.B pdftocairo
+[options]
+.I PDF-file Out-root
+.SH DESCRIPTION
+.B Pdftocairo
+converts Portable Document Format (PDF) files to vector based (PDF, PS, SVG) 
and
+non-vector based (PNG, JPEG) formats.
+.PP
+Pdftocairo reads the PDF file,
+.IR PDF-file ,
+and writes one output file for each page,
+.IR Out-root - nnnnnn .[format],
+where
+.I nnnnnn
+is the page number.
+.SH OPTIONS
+.TP
+.BI \-f " number"
+Specifies the first page to convert.
+.TP
+.BI \-l " number"
+Specifies the last page to convert.
+.TP
+.BI \-r " number"
+Specifies the X and Y resolution, in DPI.  The default is 150 DPI.
+.TP
+.BI \-rx " number"
+Specifies the X resolution, in DPI.  The default is 150 DPI.
+.TP
+.BI \-ry " number"
+Specifies the Y resolution, in DPI.  The default is 150 DPI.
+.TP
+.BI \-scale-to " number"
+Scales each page to fit in scale-to*scale-to pixel box.
+.TP
+.BI \-scale-to-x " number"
+Scales each page horizontally to fit in scale-to-x pixels.
+.TP
+.BI \-scale-to-y " number"
+Scales each page vertically to fit in scale-to-y pixels.
+.TP
+.BI \-x " number"
+Specifies the x-coordinate of the crop area top left corner
+.TP
+.BI \-y " number"
+Specifies the y-coordinate of the crop area top left corner
+.TP
+.BI \-W " number"
+Specifies the width of crop area in pixels (default is 0)
+.TP
+.BI \-H " number"
+Specifies the height of crop area in pixels (default is 0)
+.TP
+.BI \-sz " number"
+Specifies the size of crop square in pixels (sets W and H)
+.TP
+.B \-cropbox
+Uses the crop box rather than media box when generating the files
+.TP
+.B \-png
+Generates a PNG file
+.TP
+.B \-jpeg
+Generates a JPEG file
+.TP
+.B \-ps
+Generates a PS file
+.TP
+.B \-pdf
+Generates a PDF file
+.TP
+.B \-svg
+Generates a SVG file
+.TP
+.BI \-opw " password"
+Specify the owner password for the PDF file.  Providing this will
+bypass all security restrictions.
+.TP
+.BI \-upw " password"
+Specify the user password for the PDF file.
+.TP
+.B \-q
+Don't print any messages or errors.
+.TP
+.B \-v
+Print copyright and version information.
+.TP
+.B \-h
+Print usage information.
+.RB ( \-help
+and
+.B \-\-help
+are equivalent.)
+.SH EXIT CODES
+The poppler tools use the following exit codes:
+.TP
+0
+No error.
+.TP
+1
+Error opening a PDF file.
+.TP
+2
+Error opening an output file.
+.TP
+3
+Error related to PDF permissions.
+.TP
+99
+Other error.
+.SH AUTHOR
+The pdftocairo software and documentation are copyright 2009 Adrian Johnson 
and 2010 Stefan Thomas
+.SH "SEE ALSO"
+.BR pdftoppm (1),
+.BR pdftops (1),
+.BR pdftotext (1),
+.BR pdfinfo (1),
+.BR pdffonts (1),
+.BR pdfimages (1),
-- 
1.7.0.4

>From a6b51e9aca3516323e2df2171fc818e2af4430f7 Mon Sep 17 00:00:00 2001
From: Stefan Thomas <tho...@txtbear.com>
Date: Thu, 15 Jul 2010 16:24:55 +0100
Subject: [PATCH 2/2] pdftocairo: Added to CMake build system.

---
 utils/CMakeLists.txt |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index f8e8f4c..7bd982e 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -1,4 +1,3 @@
-
 set(common_srcs
   parseargs.c
 )
@@ -20,6 +19,26 @@ if (ENABLE_SPLASH)
   install(FILES pdftoppm.1 DESTINATION share/man/man1)
 endif (ENABLE_SPLASH)
 
+if (HAVE_CAIRO)
+  # pdftocairo
+  set(pdftocairo_SOURCES ${common_srcs}
+    pdftocairo.cc
+    ${CMAKE_SOURCE_DIR}/poppler/CairoFontEngine.cc
+    ${CMAKE_SOURCE_DIR}/poppler/CairoOutputDev.cc
+    ${CMAKE_SOURCE_DIR}/poppler/CairoRescaleBox.cc
+  )
+  include_directories(
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${CMAKE_CURRENT_BINARY_DIR}
+    ${CAIRO_INCLUDE_DIRS}
+  )
+  add_definitions(${CAIRO_CFLAGS})
+  add_executable(pdftocairo ${pdftocairo_SOURCES})
+  target_link_libraries(pdftocairo ${CAIRO_LIBRARIES} ${common_libs})
+  install(TARGETS pdftocairo DESTINATION bin)
+  install(FILES pdftocairo.1 DESTINATION share/man/man1)
+endif (HAVE_CAIRO)
+
 # pdffonts
 set(pdffonts_SOURCES ${common_srcs}
   pdffonts.cc
-- 
1.7.0.4

_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to