debian/0000755000000000000000000000000012226610660007167 5ustar debian/examples0000644000000000000000000000007112213121263010716 0ustar tools/create_single_pdf.sh tools/get_WP_posts-example.sh debian/clean0000644000000000000000000000002412213121263010160 0ustar debian/webkit2pdf.1 debian/copyright0000644000000000000000000000227412213121263011117 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Webkit2pdf Upstream-Contact: Colin Leroy Source: http://webkit2pdf.sourceforge.net/ Files: * Copyright: 2009-2011 Colin Leroy License: GPL-2+ Files: debian/* Copyright: 2011-2012 Ricardo Mones License: GPL-2+ License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Comment: On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". debian/source/0000755000000000000000000000000012213121263010457 5ustar debian/source/format0000644000000000000000000000001412213121263011665 0ustar 3.0 (quilt) debian/changelog0000644000000000000000000000430612226610657011052 0ustar webkit2pdf (0.2-5ubuntu1) saucy; urgency=low * Use dh_autotools-dev to update config.{sub,guess} for new ports. -- Adam Conrad Sun, 13 Oct 2013 22:33:16 +0100 webkit2pdf (0.2-5) unstable; urgency=low * debian/patches/gthread-deprecation.patch - Add patch to fix FTBFS with glib >= 2.32 (Closes: #713630) * debian/control - Update Standards-Version to 3.9.4 (no other changes required) - Set canonical addresses on VCS-* headers - Fix typo in long description (thanks lintian!) * debian/control, debian/compat - Bump debhelper compat level to 9 to enable hardening flags -- Ricardo Mones Sun, 08 Sep 2013 17:52:08 +0200 webkit2pdf (0.2-4) unstable; urgency=low * debian/patches/hurd-i386-ftbfs.patch - Add patch to fix FTBFS in hurd-i386, original patch by Samuel Thibault (Closes: #677345) * debian/patches/poppler-0.18-fix.patch - Fix previous patch to remove core usage, patch by Pino Toscano (Closes: #677521) -- Ricardo Mones Thu, 14 Jun 2012 18:32:41 +0200 webkit2pdf (0.2-3) unstable; urgency=low * debian/patches/poppler-0.18.patch, debian/patches/series - Add patch to allow poppler 0.18 transition (Closes: #651856) * debian/copyright - Update to Copyright Format 1.0 * debian/control - Update Standards-Version to 3.9.3 (no other changes) - Include VCS headers (development moved to git.debian.org) -- Ricardo Mones Sat, 24 Mar 2012 21:08:54 +0100 webkit2pdf (0.2-2) unstable; urgency=low * debian/control - Fix build depends for webkit 1.3 transition (Closes: #635431) -- Ricardo Mones Sun, 31 Jul 2011 12:25:45 +0200 webkit2pdf (0.2-1) unstable; urgency=low * New upstream release * debian/control, debian/compat - Update Standards-Version to 3.9.2 (no other changes required) - Raise debhelper compat level to 8 * debian/copyright - Reformat accordingly latest DEP5 - Update to reflect upstream license change to GPL2+. -- Ricardo Mones Tue, 19 Apr 2011 22:54:19 +0200 webkit2pdf (0.1-1) unstable; urgency=low * Initial release (Closes: #611880) -- Ricardo Mones Thu, 31 Mar 2011 21:15:26 +0200 debian/compat0000644000000000000000000000000212213121263010355 0ustar 9 debian/rules0000755000000000000000000000043512226610624010251 0ustar #!/usr/bin/make -f DATE=$(shell date +%F) OP="\(" REL=$(shell head -1 debian/changelog | cut -d ${OP} -f 2 | cut -d '-' -f 1) MAN=debian/webkit2pdf %: dh $@ --with autotools_dev override_dh_auto_configure: pod2man -d ${DATE} -r ${REL} -c "" ${MAN}.pod ${MAN}.1 dh_auto_configure debian/control0000644000000000000000000000203012226610666010573 0ustar Source: webkit2pdf Section: web Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Ricardo Mones Build-Depends: debhelper (>= 9), autotools-dev, pkg-config, libglib2.0-dev, libgtk2.0-dev, libpoppler-glib-dev, libwebkitgtk-dev Standards-Version: 3.9.4 Homepage: http://webkit2pdf.sourceforge.net/ Vcs-Git: git://anonscm.debian.org/users/mones/webkit2pdf.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=users/mones/webkit2pdf.git Package: webkit2pdf Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: export web pages to PDF files or printer Webkit2pdf is a little GTK+ tool designed to fetch web pages and export them to numbered PDF files (or to print them directly). . Despite being small it sports a minimalistic GUI for previewing the final result before exporting or printing. It can also work without GUI if the right parameters are supplied on invocation. . Specifying paper size and output directory is also supported. debian/webkit2pdf.pod0000644000000000000000000000302712213121263011726 0ustar =head1 NAME webkit2pdf -- Export web pages to PDF files or printer =head1 SYNOPSIS webkit2pdf [options] [URLs] =head1 DESCRIPTION Webkit2pdf is a program that retrieves web pages from one or several URLs and generates a PDF document with them, using the webkit library. When no URLs or options are supplied a minimalistic but convenient GUI is launched, allowing preview of the document to be generated or printed. =head1 OPTIONS =over 4 =item B<-h> or B<--help> Shows a brief help screen. =item B<-o> I Sets the output directory. By default is current dir (F<.>). =item B<-f> I Sets the name format for the generated files. By default is a four digits sequence starting on F<0000.pdf>. =item B<-s> I Sets the paper size to use (e.g.: C). =back =head1 FILES =over 4 =item F Default paper size to use. =back =head1 BUGS Please report it to the Debian BTS using the reportbug tool. =head1 SEE ALSO reportbug(1), papersize(5). =head1 AUTHOR The webkit2pdf program was written by Colin Leroy . This manual page was written by Ricardo Mones for the Debian system (and may be used by others). =head1 LICENSE Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or (at your option) any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in F. =cut debian/manpages0000644000000000000000000000002412213121263010671 0ustar debian/webkit2pdf.1 debian/watch0000644000000000000000000000007412213121263010211 0ustar version=3 http://sf.net/webkit2pdf/webkit2pdf-(.*)\.tar\.gz debian/docs0000644000000000000000000000001412213121263010025 0ustar NEWS README debian/patches/0000755000000000000000000000000012213121263010606 5ustar debian/patches/poppler-0.18-fix.patch0000644000000000000000000000203212213121263014455 0ustar Author: Pino Toscano Description: No poppler core usage in the poppler >= 0.17 compatibility code The compatibility code for poppler-glib >= 0.17 copies a block of the dropped poppler-glib code; unfortunately, that code adds a dependency on the private poppler headers. Replace the GBool usage with gboolean. Last-Update: 2012-06-14 --- a/src/main.c +++ b/src/main.c @@ -54,7 +54,6 @@ gboolean enable_scripts = TRUE; gboolean print_backgrounds = FALSE; #ifndef POPPLER_WITH_GDK -#include static void copy_cairo_surface_to_pixbuf (cairo_surface_t *surface, @@ -102,7 +101,7 @@ _poppler_page_render_to_pixbuf (PopplerP int src_width, int src_height, double scale, int rotation, - GBool printing, + gboolean printing, GdkPixbuf *pixbuf) { cairo_t *cr; @@ -183,7 +182,7 @@ poppler_page_render_to_pixbuf (PopplerPa _poppler_page_render_to_pixbuf (page, src_x, src_y, src_width, src_height, scale, rotation, - gFalse, + FALSE, pixbuf); } #endif debian/patches/gthread-deprecation.patch0000644000000000000000000000120512213121263015536 0ustar Description: fix "ld: main.o: undefined reference to symbol 'g_thread_init'" Author: Ricardo Mones Bug-Debian: http://bugs.debian.org/713630 diff --git a/src/main.c b/src/main.c index 864afd0..d96ce38 100644 --- a/src/main.c +++ b/src/main.c @@ -616,7 +616,10 @@ int main(int argc, char *argv[]) bind_textdomain_codeset (PACKAGE, "UTF-8"); textdomain(PACKAGE); - g_thread_init(NULL); +#if !GLIB_CHECK_VERSION(2,32,0) + if (!g_thread_supported()) + g_thread_init(NULL); +#endif gtk_init(&argc, &argv); window =gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_set_size_request(GTK_WIDGET(window), 800, 600); debian/patches/poppler-0.18.patch0000644000000000000000000001072212213121263013676 0ustar Subject: fix build with poppler >= 0.17 If building with a poppler >= 0.17, provide our own poppler_page_render_to_pixbuf() function. Author: Martin Pitt Bug-Debian: http://bugs.debian.org/651856 Forwarded: yes Applied-Upstream: yes Last-Update: 2011-12-12 --- webkit2pdf.orig/src/main.c 2011-12-12 16:42:39.662892000 +0100 +++ webkit2pdf/src/main.c 2011-12-12 17:29:41.403366937 +0100 @@ -53,6 +53,141 @@ gboolean enable_scripts = TRUE; gboolean print_backgrounds = FALSE; +#ifndef POPPLER_WITH_GDK +#include + +static void +copy_cairo_surface_to_pixbuf (cairo_surface_t *surface, + GdkPixbuf *pixbuf) +{ + int cairo_width, cairo_height, cairo_rowstride; + unsigned char *pixbuf_data, *dst, *cairo_data; + int pixbuf_rowstride, pixbuf_n_channels; + unsigned int *src; + int x, y; + + cairo_width = cairo_image_surface_get_width (surface); + cairo_height = cairo_image_surface_get_height (surface); + cairo_rowstride = cairo_image_surface_get_stride (surface); + cairo_data = cairo_image_surface_get_data (surface); + + pixbuf_data = gdk_pixbuf_get_pixels (pixbuf); + pixbuf_rowstride = gdk_pixbuf_get_rowstride (pixbuf); + pixbuf_n_channels = gdk_pixbuf_get_n_channels (pixbuf); + + if (cairo_width > gdk_pixbuf_get_width (pixbuf)) + cairo_width = gdk_pixbuf_get_width (pixbuf); + if (cairo_height > gdk_pixbuf_get_height (pixbuf)) + cairo_height = gdk_pixbuf_get_height (pixbuf); + for (y = 0; y < cairo_height; y++) + { + src = (unsigned int *) (cairo_data + y * cairo_rowstride); + dst = pixbuf_data + y * pixbuf_rowstride; + for (x = 0; x < cairo_width; x++) + { + dst[0] = (*src >> 16) & 0xff; + dst[1] = (*src >> 8) & 0xff; + dst[2] = (*src >> 0) & 0xff; + if (pixbuf_n_channels == 4) + dst[3] = (*src >> 24) & 0xff; + dst += pixbuf_n_channels; + src++; + } + } +} + +static void +_poppler_page_render_to_pixbuf (PopplerPage *page, + int src_x, int src_y, + int src_width, int src_height, + double scale, + int rotation, + GBool printing, + GdkPixbuf *pixbuf) +{ + cairo_t *cr; + cairo_surface_t *surface; + + surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, + src_width, src_height); + cr = cairo_create (surface); + cairo_save (cr); + switch (rotation) { + case 90: + cairo_translate (cr, src_x + src_width, -src_y); + break; + case 180: + cairo_translate (cr, src_x + src_width, src_y + src_height); + break; + case 270: + cairo_translate (cr, -src_x, src_y + src_height); + break; + default: + cairo_translate (cr, -src_x, -src_y); + } + + if (scale != 1.0) + cairo_scale (cr, scale, scale); + + if (rotation != 0) + cairo_rotate (cr, rotation * G_PI / 180.0); + + if (printing) + poppler_page_render_for_printing (page, cr); + else + poppler_page_render (page, cr); + cairo_restore (cr); + + cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OVER); + cairo_set_source_rgb (cr, 1., 1., 1.); + cairo_paint (cr); + + cairo_destroy (cr); + + copy_cairo_surface_to_pixbuf (surface, pixbuf); + cairo_surface_destroy (surface); +} + +/** + * poppler_page_render_to_pixbuf: + * @page: the page to render from + * @src_x: x coordinate of upper left corner + * @src_y: y coordinate of upper left corner + * @src_width: width of rectangle to render + * @src_height: height of rectangle to render + * @scale: scale specified as pixels per point + * @rotation: rotate the document by the specified degree + * @pixbuf: pixbuf to render into + * + * First scale the document to match the specified pixels per point, + * then render the rectangle given by the upper left corner at + * (src_x, src_y) and src_width and src_height. + * This function is for rendering a page that will be displayed. + * If you want to render a page that will be printed use + * poppler_page_render_to_pixbuf_for_printing() instead + * + * Deprecated: 0.16 + **/ +void +poppler_page_render_to_pixbuf (PopplerPage *page, + int src_x, int src_y, + int src_width, int src_height, + double scale, + int rotation, + GdkPixbuf *pixbuf) +{ + g_return_if_fail (POPPLER_IS_PAGE (page)); + g_return_if_fail (scale > 0.0); + g_return_if_fail (pixbuf != NULL); + + _poppler_page_render_to_pixbuf (page, src_x, src_y, + src_width, src_height, + scale, rotation, + gFalse, + pixbuf); +} +#endif + static WebKitNavigationResponse navigation_requested(WebKitWebView *view, WebKitWebFrame *frame, WebKitNetworkRequest *netreq, debian/patches/hurd-i386-ftbfs.patch0000644000000000000000000000737212213121263014373 0ustar Subject: fix FTBFS on hurd-i386 due to rpath Author: Samuel Thibault Bug-Debian: http://bugs.debian.org/677345 --- a/m4/libtool.m4 2012-06-13 11:49:43.520816999 +0100 +++ b/m4/libtool.m4 2012-06-13 11:50:22.980078366 +0100 @@ -2334,16 +2334,6 @@ esac ;; -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -2445,7 +2435,7 @@ ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux need_lib_prefix=no need_version=no @@ -3046,10 +3036,6 @@ fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -3084,7 +3070,7 @@ ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; @@ -3705,7 +3691,7 @@ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -3989,7 +3975,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -5702,9 +5688,6 @@ _LT_TAGVAR(ld_shlibs, $1)=yes ;; - gnu*) - ;; - hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: @@ -5861,7 +5844,7 @@ _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler --- a/configure 2012-06-13 11:50:45.527656118 +0100 +++ b/configure 2012-06-13 11:51:08.663222721 +0100 @@ -5793,10 +5793,6 @@ fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -5831,7 +5827,7 @@ ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; @@ -8131,7 +8127,7 @@ lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -10047,16 +10043,6 @@ esac ;; -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -10158,7 +10144,7 @@ ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux need_lib_prefix=no need_version=no debian/patches/series0000644000000000000000000000013212213121263012017 0ustar poppler-0.18.patch poppler-0.18-fix.patch hurd-i386-ftbfs.patch gthread-deprecation.patch debian/menu0000644000000000000000000000020112213121263010037 0ustar ?package(webkit2pdf):needs="X11" section="Applications/Network/Web Browsing"\ title="webkit2pdf" command="/usr/bin/webkit2pdf"