pdfmod-0.9.1/0000777000175000001440000000000011533760021013111 5ustar00gabeusers00000000000000pdfmod-0.9.1/missing0000755000175000001440000002557711147724431014532 0ustar00gabeusers00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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, 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. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: pdfmod-0.9.1/intltool-merge.in0000644000175000001440000000000011453151740016367 0ustar00gabeusers00000000000000pdfmod-0.9.1/data/0000777000175000001440000000000011533760021014022 5ustar00gabeusers00000000000000pdfmod-0.9.1/data/Makefile.in0000644000175000001440000004276711533760014016105 0ustar00gabeusers00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = data DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/pdfmod.desktop.in.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = pdfmod.desktop.in SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(desktopdir)" desktopDATA_INSTALL = $(INSTALL_DATA) DATA = $(desktop_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUNDLE_ASSEMBLIES = @BUNDLE_ASSEMBLIES@ BUNDLE_FILES = @BUNDLE_FILES@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GCONF_SHARP_20_CFLAGS = @GCONF_SHARP_20_CFLAGS@ GCONF_SHARP_20_LIBS = @GCONF_SHARP_20_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ HELP_DIR = @HELP_DIR@ HYENA_ASSEMBLIES = @HYENA_ASSEMBLIES@ HYENA_CFLAGS = @HYENA_CFLAGS@ HYENA_FILES = @HYENA_FILES@ HYENA_GUI_ASSEMBLIES = @HYENA_GUI_ASSEMBLIES@ HYENA_GUI_CFLAGS = @HYENA_GUI_CFLAGS@ HYENA_GUI_FILES = @HYENA_GUI_FILES@ HYENA_GUI_LIBS = @HYENA_GUI_LIBS@ HYENA_LIBS = @HYENA_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@ INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@ INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@ INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@ INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@ INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@ INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@ INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@ INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@ INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@ INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@ INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@ INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@ INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POPPLER_ASSEMBLIES = @POPPLER_ASSEMBLIES@ POPPLER_CFLAGS = @POPPLER_CFLAGS@ POPPLER_LIBS = @POPPLER_LIBS@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = \ icons desktopdir = $(datadir)/applications desktop_in_files = $(wildcard *.desktop.in) desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) EXTRA_DIST = $(desktop_in_files) CLEANFILES = $(desktop_DATA) MAINTAINERCLEANFILES = \ Makefile.in all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign data/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign data/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh pdfmod.desktop.in: $(top_builddir)/config.status $(srcdir)/pdfmod.desktop.in.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-desktopDATA: $(desktop_DATA) @$(NORMAL_INSTALL) test -z "$(desktopdir)" || $(MKDIR_P) "$(DESTDIR)$(desktopdir)" @list='$(desktop_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(desktopDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(desktopdir)/$$f'"; \ $(desktopDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(desktopdir)/$$f"; \ done uninstall-desktopDATA: @$(NORMAL_UNINSTALL) @list='$(desktop_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(desktopdir)/$$f'"; \ rm -f "$(DESTDIR)$(desktopdir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(desktopdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-desktopDATA install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-desktopDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic ctags \ ctags-recursive distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-desktopDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-desktopDATA @INTLTOOL_DESKTOP_RULE@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pdfmod-0.9.1/data/pdfmod.desktop.in0000644000175000001440000000066211533760017017300 0ustar00gabeusers00000000000000[Desktop Entry] Name=PDF Mod _Comment=Remove, extract, and rotate pages in PDF documents _GenericName=PDF Modifier TryExec=pdfmod Exec=pdfmod %U StartupNotify=true Type=Application Terminal=false Icon=pdfmod X-GNOME-Bugzilla-Bugzilla=GNOME X-GNOME-Bugzilla-Product=pdfmod X-GNOME-Bugzilla-Component=general X-GNOME-Bugzilla-Version=0.9.1 Categories=GNOME;GTK;Utility; MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf; pdfmod-0.9.1/data/Makefile.am0000644000175000001440000000043611233641651016061 0ustar00gabeusers00000000000000SUBDIRS = \ icons desktopdir = $(datadir)/applications desktop_in_files = $(wildcard *.desktop.in) desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) @INTLTOOL_DESKTOP_RULE@ EXTRA_DIST = $(desktop_in_files) CLEANFILES = $(desktop_DATA) MAINTAINERCLEANFILES = \ Makefile.in pdfmod-0.9.1/data/pdfmod.desktop.in.in0000644000175000001440000000066611237576135017720 0ustar00gabeusers00000000000000[Desktop Entry] Name=PDF Mod _Comment=Remove, extract, and rotate pages in PDF documents _GenericName=PDF Modifier TryExec=pdfmod Exec=pdfmod %U StartupNotify=true Type=Application Terminal=false Icon=pdfmod X-GNOME-Bugzilla-Bugzilla=GNOME X-GNOME-Bugzilla-Product=pdfmod X-GNOME-Bugzilla-Component=general X-GNOME-Bugzilla-Version=@VERSION@ Categories=GNOME;GTK;Utility; MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf; pdfmod-0.9.1/data/icons/0000777000175000001440000000000011533760021015135 5ustar00gabeusers00000000000000pdfmod-0.9.1/data/icons/pdfmod-256.png0000644000175000001440000012014711234355622017434 0ustar00gabeusers00000000000000PNG  IHDR\rfsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org< IDATxy}̺Fݸ$"(RHԭa]yҘX{xfyx=<^:)uRH@ >*#22 ~+322232/~!ִ%-:EВ͓%W%-E-iU,-hIKbi@KZrKZҒXZВ\"*%W%-E-iU,-hIKbi@KZrKZҒXZВ\"*%W%-E-iU,-hIKbi@KZrKZҒXZВ\"*%W%-E-iU,-hIKbi@KZrKZҒX7,B7Z~jq5yEo>ϸJӍηȡ9+M MVF-WY:mq,J@p~wP(|F8UU3x8 qkrQsFQApau̜9ȱcG}G^-H'Rhɯ2wrRJP˝:|~j¥4@k ʶ PA.JN8OC~P!,@s>ӻݶdg# ^N}_!RZXKlAkRf }};44/{q#M՚A( zgeYoS^UA?gB`6lvRRh yRԁ_3yeL-$ -"XLl@nddR^ 8o^__-A({jm "2P&iu~Ǿ|'GQ!nH`nU'HpH@[' 2==M>_!DFE#0BbP̔塟/w}&M60-!W&+S,]BGGG|""0  ARtGٍ!i>"+ |eyX{SM=lz1b6RJ.\ua@hH),;6 #dP(Ї>cǎ~cJ 9 ; WVٸ|+EW\,8oK젯O&!㠵fll c!Eek6R::گmNZD7 =Vsؽ{̌nR*wg.wƵF~aMey;*u*իa_NIOwJgձ}!wd\ vЫwZRW6!v)Yb!Ah>zXu e~e6PZ7G86\煉/7v[!xKZJP(e5dgt/],'mg,e!aL5:}XJZ'MPzDk^AV-Zzsw,\WJe׵%`Ӟel2Ė"fŐ(M%> 4$ 幃cLoܰ}R\u]H)Ytݳv b-~x)aۙ X2mP!z`vRMF<ݞs?C5(i|zۯ!jW!3GO{|±$V/XmBi 療KvJv7$G^>Do[{x+>)J)lݽҌ jDZ@@$~`dd ŲmRZS :S {! ^]J2n=o`O4 >Z_gv%VYҙ#oSdm ےؖZQWZKV=皔%_{ulѭ)XBffOnJJUmI>~&:OQʸhІDx/آ{pC {⧯Gz9 ,)mDZe dsBMthݻs] tў#]9Ճ֪ȹd[@uAme!KƖ|Md+2W&<F@6+05x[!;u./Eג$iM1%rv*4u3@lάcz_Wގ, vp9DM*y?M,tcu2Y !抩U+`n! @=- \wnDj-ڋ#5/Z*~X'!A$Ԥ%f3Y~}h_N,:޽ےvzڲ}FA8~0^5Vҭu%r1E0c AZUaiþ|OܾAP -D= !<`;6⽟o.K}7gm +.|dc퓿X̪]hp»X}<}a^%mJQ-CC-A_Wܸ?iބFG" %ZQ& /F:!Q"!e6ea]Mi/:s\J(if(,f޸m_}PS}5h]!+fϤ!PkM1M-a44¡g^±$w{31!lHiTaHjJى$5 J|BqNZn\,*x%GJI֑rv#bHGh|m|kbcM+=.F$߲D}Bh/*$[5JW`v*^2گ47b]%e_ѫ"@ceY{00)?ՕJcRB-JZ}RHk"?VN@D f H|t^Qm H i"*S( ZIeD2H?t 0{E?0R`~66(Q B!"^De*/:bkMAR&Ƌu񟹮8-I0Q#uqq@vQjfYR k]": dצ[FyDsAR ƛ0S<[ v{0 *GYh`*!I_NM} Zƛ 5`ą!ЩSh-/UXK 0жB"KB$ ([&5@hHTRHY{Y'ՃRZ ADFO[ :u[XƑG Mr܀NL n$i 4^\ZULL}D_.4J@LHū@HJmUߒƈh[! B +-<6R5~`~ oi%[/? 4^1 5{QNvSهȑH8dXZ"K VqCiLπ-Q"@ a"*'"m6 O}5MǼ ªUj;v"4 B%K`YKHKcYT;@Z] ʀ?P@͐S(+,Km@4PDoڔT$lD6zESd2r+-ujBl6:f?N#e~4KyZկk Pl'~p,m  wlL'J+S+E4n`=@]+F)I.r@>_ګj"|J*a(q몥 P0EeYePȪ7ۨk?C R+٤M^3?YH-7$$jZƱ$%dlp cm vog+lHIV- 4ny\_cK\%|4`}m|Q0f}5 BԒpÆ%<A d1 fȰ0I~O'4EK[Bͪ04kt'{ -KI>r sVh':D JfUρe, m4U[@LRV 4J(%SaX'Eko`WUXOm2_URR4X\CY!4 ((8ie(¶kC8*l ʞIvaMb"g}}M`n}grrZ-@trtx2H(ZH1|G# rko4GH^X7RM22G*]toڒ˒8/H2Ad3ٌ 8d RTK5@K3e)BcI*&%h4|}:M8W3`6iDSSSH e G 5B_K] xgb2u Q"UJ'mV;#ߨyrYC$gC1@hy!B%F)o aI}4V\G&7C @U'Ҵuz Zɑq˕}oEraH򎤐2BVs͖#g&o ilFx]֑=3 c puxB}o2v<Ϝ g1GF8u4L}tQ_L=PO g-t:ǟ1*$A>80@&JTdݗ }%)J(В@X$߀7/~/喛8wnɩ):G\vioo|͛6P.:l grڐB)P$ZK@$@Pv5Ӯb ӮfӔ<|u\.Ө^;Z399Ϟfs$9XGGl.~t r.7 7*sSSFSû۸M˗&^%T'WNS8摏) lͲ̈A[^(dHf0 F 25ZjIS4fny]-R8g4ȦHkQZ:|o|pMs1:;:dkm~ lWξ_O|kf~t35nwkX0+YQ+ߌ4 3Fa-H|6 4Rk2\DGƗ|9f^H)'~ m9s\}{xgyA6o-7ߌeYw=/S*a7k}r G-TLcdXEb (?k'- S mD%q%xOn24o>U`Uho>5~E7$(j0.f5W)t&Z'$Z+S 4Q iSp6ZmZ@2|9q1UGH-(L' &<* Jy4)/^6'V |]}~",O㇞5F'VeXF@_@ZH3Ԗ|lKt (/} OG]8C5PM~7KJ:2\I3@rM61/33`^W+i|o(OޣNz5~`.9tji/@*$!Dd(TXplЊ0 23OJ+T"yN?laXu_Jgm4D79T*mmmkRAPcE!ր58cdήx$~jO="0ϧVIkY IDAT\F\+TЉXDw.3O `t-ÃB'"SY\RD'mPF' ku9PjB<޸VGmvr /iF^\wv|7ǎ}z+p)V,_0˖AGG<֮Y7–[xu߫LO -㦻dI?8q]n/?z .]055[.s_ٰa#w?FܹsEnr͙39s lemu.~7Ogk9~== Q.!159LĪU8rBFFG#|3etl|. ˗/N-DZOVWU;45sF>‰ɭ{YۆOx*،Oib"u3=<ʔK%>r:d_w@穰tyE5p$"AdOצqXdKHGI'F 2,CIAnJ| ]@&M4~ ],U:ב?wNn 0 O2MYHAf4a)|NDlrN‰QԻxͳ~ʠկ}{﹇իܿ(Of֭d+7uM)Nsfff^F=0Z2$Cm*Y𓚞)éH.M\m\+a ~mXO&~\KP>N:m! \XJ@&_Q 泄,50s﹚x@sAК#Gn:&rY:r\e8rAsiظa3wϟ[o#;v`q=ukksw`=,>}w=qLLNpiϲs :u%0::xO<3^ qaVLOO;_"͚'+U STWw'/>eB͒ N(,e\F|do-.Dm1Nkjȥ_T E*M BLOٴi3R]7_w|> 9z(X6Iqz}kl޼pΝJez{ؼy3eɒ%?xq/'6"P(P,^u֯_t]:t}^]>mƊ+pak"_cLOOWybUB2~t?$i Je%.sQOj Gjn>\5}rdud2-.-;xE.Uexgр+K: ֮[uxU??y*jөJzL/@BR*v2,ܩh2©(5ƝPu@\]OTu]<ϣ\.#GJeY(^n&mG(_|etd#iokqٺu+{_ IC.\gڵ|_㦛ކu-?qkmȑ#y=Go󎻸w^T3!Q|f? x"5G3)ڪIT5vMՏMRI 8[zy^u=:a;0^?^ z6+xe\-<|. /`o HiR 9p`?/EV?'NgI^z%lG?drr!Gxfβi&\RTvHBt>{"N>"p66?*$1ci?/==[L53v-}{UEڱmvlK/,_cǏ8Fu.>dضwN::;Xbe/_e\"=K7-cfzޞ˂7W, V[C' !hgsa)◿H ?s:@WM_U%-&.~!D‰W[¼Gxʕу?t zmlٲ5v۸q[nömaY]]f\u^"9}X-kVw5kص떋ȃKPT_5t9\QMb@SϚF5ME=%wmݢf嗨qÚ ,[|X[46WQ.EEV@8 ճP] "hsIUTZQEcUJH_h_5QHwq2|aW1-,Ce4&򶦷#m-\l3eVhGcjmzs]/K6IJ|=Z@ 4Ư4Qh` ]2\WƯ*ו*mݺq>-b>飵~\\ץPhܹq} @foD344)-y8ߜoTL ڶ?J#SzRMe00eA7Xv9d24:w^-aٲ9k~%iGXgz*D}U4+Sٕk@\'i )*v)(K+)soӖ¶,\Oyy7lnGD>zX"e6v mcYf iIlM7.l3n| 5~JWN9!(C <LHkSvٚ5~@{ŀ~T ɠ7"{ѣظqCtJUW/ѵWd|#/Uk~{xb>k)jM 48s /;w켨$'Od͚55Z[Fkb5 M,͛tM_Z"I #4M,vM=G =qjY;+Bۂ`&mk+~&J)E hk*iv-&~Z25i;,DmfњyBJ9Sngs W7igml6K>Pȓϛ-ͱfvi H!̰_)Z",,fhDZCVc̞MƩkp(sAV_im& QJW[\*3S) WxB)IGg;yW]EDWkC-YcXGl"3wMuU𵫲߲̐h2@L̘5~Mצ. ͳ _H lfGłn]E~Q;=m6cErUQɜw)= <-gJӔKnNDyny}]{|ї{868ı% 4~@JG捨ޯ]i!,e9X8H;r̻&N5ݏ~^!Z$iT@ua%J qtY2p*3 XL sDah3=?SXEYPG>e nHffwH5\w,26:~gJW~8LJ2b'<eN3<#|CZ v*pGR9AiZbG!BcK(*>%bhJ"&>I@ XVij|Q9'NE&Ps,~ׅ'T6_|=WĤ(0==dLLLP,v04t_<4w~炛B>tC?ŢYat9)ȢH*_E(xXOũ Ҵ9kt ;4+k*Pf`P x@W. T5bmXuBeF ZpnKsq8x[-) Ygjj"~hm;a%_ ,: 2hfi7  3,&S/,4ue ؏/(F zAzя+I{.7" _IY|R+dϞ_dI?~\.l^薧IJeJڊ&v:ʳ@\C'A|O(NY! =ϭ RՒ1\MɪxԊ?s?uKLOkKzMJ^y_[D#ٔ0;+@ZVj.f?ymdi47VQZ U[z8&)j^+U1:@Gn{妼n^b fL]jaϏǣc5qR##L ] S(A4VmQ6)%˖ fRDl)vf?`=td: X?Y DUڕ7q!%m@@ ny&С Ph?\(s6QJqa^zy'OdK{qaFFF+_&es9{G>~|9s/q)oڌ?v(Gyb8šCW>ض89xڏI- 2 gΜ\.6tuu?~pN'Òb*JRltt]7_Vm7===J݃*UD%?J璀/f.ܒoic xU?? &9jVa-UEy9ӧx׻XT*qY֮]/;gj3W8Ö-[9}4Ǐ~}cfkaټy < oWɓyfvq֮]Gp^l6+L\o?`tt[vÇYn 6xYœO=zJ9֬^C&ah31U,‹sˮi̷)`ȤoBU+W^:::R8fڱsq { bffk<0V}ژd{Ϟ)dhdX"TJ,E ĥ[k'/Xy$1D'K~1'o{ 'OPhk݌  f o|>OoOo_g~d!%}}{Zs)>7p#_gU>rIMÇ,[Li+Wqq055繩GKґZ1,޴HRq\FE- bv1dž~˽ Ϭ9?XbRa3<7OnZ}L-2[w\n)N<֭j`W19zޞ:;;ٵ63y '2==͡CmOP.ZsI~7;^6r֭[Ggg'099 i LOf(8~8+W.]遘M<_G,v&K&rX8HfEw>"KFh& Ty>gEW $4R|I$mŨk5i ys颔snq -̚}۵k\%Vdɒk׮ 5Iho?/=_M@Ν׳o߫ ffbuRٙeضî9P(*d횵vmtwu;"a#aq[}!IOǪV:axz ~!8CkE4C8ͳ>K\"$ӧOS;?#52lٲe9s)nyLLj8A$s-UҮkէ*nU,ɂ@k7V)|+ E>ޝ_}}=ݹܲmXRfwplf>[,@T4 =qK~t^ujdkqy,wt2&'&dlڴkְifvlIgg']]s9ص.\8Μ9=>яt2<l[uwmڵkַ31>}}/g``^<{^CqȆؼi3< [6oC,_d||⡇bhhr̶m( ao|\63UVcy?ny'<!Xvy311ikk[<'d6U~| ERq!4sDQ5B\g`j gXS\-æ?=+;:رt)ߺu`٩?|x @S?5,Lw^*㥝CPi4wNa"5s##`,#mȺ[߿?cϳ]L?)wyd玝~oܸ)ܟ{G>nF>9hEmI&''qB/S( ~!DftMecA䯰x"jjCBT VD߀x I\8Ɇs)7Me!L2DZQ"$ѾA![ KhD|_goRI"0 A tvvnzΟql,KbMRH3q8XEkT8Voy(=O#l-ФD6ض~&pe"G&ѶlA}B Jg?}xS hV/@tR]&/ Tp?Ay=W*X,2338<&''y'1=31xgxRW??^0?~x™39O<?<=c=yAք}7칳LLsϰc,+V\.300'a: EN9K/$Wfҥ{:̳w}fCjH1Lcx=޵|,Z,HA$`9u|9U?nUz_BWݪuߏ7z۶yg~3gΒyW6|CΠkR*׿sO9M}ǭ΍/rMctdťE !O?4wf~~پ};D?O.cp`۶|2==ؑupǰ#$cc[±$ b y8s%DPB!hTr|MTBPJqޝR`HciuN|9rVw;X#[onE媪eYhJRA lf9*$I3tg|\> XRP(ȁR=0 |>a~4|>~~H$BX$LD}y [R*, EU( E{zX^Zb}7^gvv1=3\x?x[#,//qyyWxػg/\f]ttto EQatdcrj1??G?1nߺž}1 f޲l~Koc)эL`l*NٖcWewy6œKl-.H" b(8a UD(%x eUQi&b 7utQEk"+WA.7n8LOOh"Бӟ4  /:TXuq*VUs`%~tV!k c^in{ 99J%\7 f9enݾoO`Dq;.//QVǥKp8n %{dY6己Ѝf(nPuMQTA*SļL; 1O QqDt]?[$A߂WzNoZcH;s{{{kxawX@ *XCYA߻OQ4ʿ}ڨQiY Dz>%E*q/Q앉Kk nUo]ݜ>}ox( -8tΟjY,,7M 癟8yP(Ğ={|wڽ{FyWbffUUgjza_w_K>tЙfxh' |_#8twa=sƮ.ReNsÇDM6!^%kn^zE}]np\x,έ۷yy챣Mjq90`hp27n\4Clݺ9FFy?fxx.3}* 6)rHラL %BI$?G1M9-N,."Yis pZ39lbx\q4CS@UuifTR;wp`_8{ 5;{u ~Lܿw{5o)5^lz{b||6ms+DQaC[yس$ CBQϱe$ea"='yF( [6o!ɰatCCCLMO8t;JX,.Ž8pC7s/ͱgյ" B+lڸ._biibHRaӦMRW7"7msE&nNpcbT*?.6o\aÏpgA8,Cӧس{O"L)!6ւԞ:8B:|l2q.-C!BretZr{ׂ2"{3;GPeQ](]CIiXC(\E3BlÛ(T \&`J--Ҵh%Xl7zz:Пtx0{&J툆YU,t4dξ^-bH$hge]~i"a9M+ZSonnu+ tl6 Uk_$w~P*tutep؟4 ]YN/TePV &IY?XVOf+?/M%AF]-*D&B(|!X0"w {ЌahLĤm3Z :TM@ H8?b]e2r/⫸úuk|FI A dv&&࿷vVg,ԧ>Р"A*<"B8rYD" 17簪U~iڪiQ\g" ]|{n~? @WWW/jяeBB88f[iOnXt$b',ò-یj&a"uU])EESTPD(PT7` fT.G5FCuL}`oM: M{|@^(IXTatvv Hͥ4BA.c|2۶4ʽhٲRPµHvݴaooRo~|#'5@+kuYh,BTdy۲)vOUf8dgn$zzNd$]~U3j(B4"et! | EUQ]^\1Fd sEusj ע8u 4:? o xr`2R),'Os9\ r^P`rr9EZ@#@yV/ кx,+Ӄh 22<¥˗xW9tb?4 ̲ahVZxfJ\5j)YeNa~BQTU:ˈ|^n岯OF:Ʀä=F7$tM$WToP3+qPPPxG mOvES=v$=8q= ASFS^2Ӭ׏ s-:;;9qyTymuK6Ν;'0MG}l6(o\ ^.ՃPu7n_cI6msgdll3 CCu 4避RPT TDyL5+T΍4Y8׮]s,..P,)eQ˶bo&BF"ﺫUU l [7L*jMWH"@N9vcř*5AovwwFU re5,ęf{OoQ?pO=wQ %6oZ|l6~xeZݹJB'j.R EQ(dJao3B!?ݤťE'q EH I9r Aq.o7|V(PMڞ_|7$||=vn\aëBm=N 6UǙOWfXo xګ_hF_/9 ª]ܫxqD'O25=]8u4tuvro۷8>N8|9z(};aܾå˗y'X\Zdiq[/~ǎ<J yl4 J"pwO#߶mnܼNGGkȨi7 jˇy])k@q$lWxW(QMtlUCh:cMtXT0U#$-@;vW΄ -Lr`0 vb\Z=M@4fЮZq[9} H7o} yCLOO#A_,)n;lذwIMgD,]ܺu1*RɮىgEm$vqqB$CCds9}:Lz{ZroO5^wwa-2}}}Lܐz&&nJ8\i\lh IDATrgĢ1fgR,/I\xJLJ)8u4R}{JrQWE!  D"Ιsٻ{_[Mo?aE!ɧ?zMGwWo-khBKlL_[J%VEb䩈w@U4aTBQV$N5 KQb,M_"@/I!mд'm'd*Su#5 Ё{~ A);Gֵ',/gGOO7Ü:.۶n/}1^{53=5m[dsʥɎ0t^{5i&cƹxx9 ~w>i]l*'Od߾}r9zmt]e˖-<}y'f3\t~_Ʊgq?zIM̯~0XwQUݻ8C8COw>z|>oE&d22P.s ƈFtF DB!irvDZ9uW^f|lcs'Kwp%fffM jmfk(X*h'*p,)ӞϟG!b!RBqlB1UE5Sӏ*p'gYSut.w奥vTcNS,KCuZ\/ÃG4䵺1I JOO/'9xсm[/}bHj.EWW7$ 4]EL&&&X\\dΝܹspa{9qt}c(GbY.]BSu?֭(tvtOG&mlټnKKK 37'#޵jG(W{3"AXUrBeҙ4LL&rZMN< z{dHp$B$i='"!v;o3=3EoO_]yc\ ?Kb1y#ҩ#կ}h$DJA̲6F`,J3iѨ;W?3B d;JeЬVP7=Ϊcm TqߠAXSge7n@OoWCz{]_oB,L2)/IӾxI&$I7 LjD1Ll݀x~qd3:#cD#Qn޾pHu@s0Xo%]=M !78|];5w_Xe~ a&Jp ?gN1Pb}c-jn:p׭|o'(o}IN+wkWB6obl8BBAᙴ Ng!FtvvEGG۶m'Lґ L'u}Ufƺ6mWCt=˥2 COOOOkFP$Tg89UCz6Av b> UF)p*o| n$| Ϸ> _# |Z0ڧbxhbT*4MknnBz--/&Ifd$ȳ ljJ4%K;LvIWW']Qd+. w;n{mc``t6$)4N[q&ߡP,p|.O/.u3^,BGGtzVk]Av׶|N`b5 @N~Cv=1 J +_z~'N022J*5K*¶O^t]I/ٿaΞ;Kcl8do|CN?qq)>瘙fy9ͅصsO'184={dҔt]#Q,~PRmYXnکPHZʣ(HnhXLdg{֨#/W"ힱR[l#;<}fՍ|qfff~*tb$ڒFCY(Pz@w|coW5{& ,X nnZ&3IM_ Zz_QkuAsW(t.k:*O>i@&%HP*Hg<?2aΟ#'$HN.z #r2nX^z%ppp8Ν#MqX'GVU_ ٳk/'yL6M"`vf!dt&͝2r.>Jљx^1òͧ>%sMԁ#nPV",Q.ߘKd -?~Fq FHW&}9L7ns.(vСhaE%+|?m;p>A,Bu$۷`aadx<Vm+Aqv״*#4i{N=abqfgSD"ZC)Jfh$J2`dd~lف20a6uG7p[ j{AAUTVզR6X4kPiEu~PUNVUUC=؋EHj9H ֦p cܾs~y9TGCI&:ꔶ%z{^w62vt]wvRʄ*%jPY.aZY*`" (*e- H3]@ A`Q!.J0?޹{~K`~/= aI$tuuqmB07ػg/3ܾ}Y.\G>11pC[&tBbhp\.GTM!57GOO7J Չb[p/Ar,||>O {D=ΝQU ظq#i##&ʐ{.̡ZdƍJe9,.->b#1HӜ>}G(*f(P4?0tTM&4XL-Eο+jd*1y>qPm(D ƨVߺ@v$ehM Oj|qy_mV{Hӌb&a.gppw0==ͱgq=,]]]LNNēO<֭*b1]R()}6FщFl{Pa i8ͺ`)bĠaLLKjڵMS}kaRv7飠e_<;(TUi9{ wfrr ˪288\.1q&?v)&۷s FGG)˔bDd2FygǶm7ӱC%fff81`(9sl.{Iͥy&X iFc̤fu3,$g^}>[3煊Rd@O73(D-lč hkh*aNn ^Y?W`Qe`_/ d'OH##:}U~,3ۻJ͛}6x ˶RY7M\/‘#G\tA eTr $)Z۶)!ݍE X,.-㕊_4p5 o3HHQ۪n<(WI..Da2HCBؽ{77oޤga:}d2 l߾1EJ ===:}Y.]ȑ#G^3H$$L$l޼\>GgG'?O=4KN8!=0ufR3 mx"/l,smYtP,͒FѨ TQdT_My6h)7&bopPd$cvZ<3b&6xju4&Po|Z޺ul6K&eܼuEQIɸ i$Po7ٹc'/Hgϰcʕ27oayiW]a::( زe |?G\W_&0=3C6aǎL Ecb(\4 eG_X  =g>sO?ʸVCښ{( }ضcx9Ni8K5uVW7C D93{(? T=s'Vj__GQT \q8o+O=^S嗴,/,&BRGAz|X=[r|hIDh, ǎ9o<<>%6p|9Bh /3q&Dl6bgI h 0 9a2 eġCTt b,Cmetd͛7ٽ{7<RSܸ/#ؑ#rY::ضCoO/xdBl߾̻W,UUtɖ_W#5"晨@jcu\o=b?3?c:!jIP mry;rz ,cc(V `h`Pc ^6c:Ut0ǽ (R݂^XY-A |zļt Ev $w>wuv) B]@4ُlseftww8۷mCe{[RѣĢ1WshheXnK)p;@ @ JEOԶիH`=н>6)n Loo?[lKB!XoarծlU-2 'f8|_8((kijYPo8w?6ehhɻm>{m9aB6HnIFڮP}K<0# ~Mlڹ !$?{:n-q 3ӌa&1 e.,gc(+Np~5g`Uo9`8~S+5H c nArJè4kW 麃ӈbNΝ;]]]l߶[9{Nfgg9p .]dbl&"?R}`tt-A7Tp#;sLLqF>y3 r3gCg Iߦ3ț{q0j P ^z~l@YYsu^W_yQuE7ӊc+Ftdxg|q<ĥKٷa Cfssb't߿H$Lrm $Ho;}>ުM!BDSFUؽ{/gN/oX<[>Jg'|nK;]N"x:3:ޠ ԭ!5_iרSMF h-`x߮F(}WP8ئG$=)@&aGA0يBqڃ-7-/_Ş~ct YFn6Ž$t j 7J hu5k'+uh;|s\_J %oW6ĥXϯd[+7#(oJ%:gfb=-]r߮8F =~_u!aw]*g QX[~=&WZ=?I7]yPBr?mzSIj7 tKKMM뀤` ~g?29RZ^lWKLTUMESTPTiWZ<>4)x\G Vzf x>X>|DkcׇBB}s}t~Zv-lTG2iB4 0 ͇=nv=˳VE1T~ +jO}Z_ ЬEkj@pZ' Ui8~qVBݳk|{%099龆`qqE癙`ff?S,9o }moQT3y_Lr~*.]2ׯ_-ݕJq+ nﳴ~6ia:`32T*r+k2]0pH4F(=;q 媼Z[pZ-}װ*m#"Tjyl+㷟u)k.ˊZ_QiF>;"v씉?i?S~MǢ|;ڹ U׿F"}Ng 099(ƛ'ر}/}8D>ennё l۶ qxI&;B˜p}{3:: d~n۷ni:7n칳{X.oK_6=uW CJ#np0èa wP/C]A4-2 IDATZ;/pcr%d2;~Rk BQw%DQT]*!")Udf ;>Rv31)(^ KR ?~̣?f1{9R8r^Ro -\۲t]πڵn(%ݷt2II8P '}(Z@uضMX(*di6SQ8)}ò_q{&r/B“ff ¹s{%2*niu:)B^\y{+Wgк{޺u ˲fF-iV/צtvtŖ[HvԹ&I 7nyn۶m_4m݆(l߶ݷP?r^mZp'fF jj@/㳳-3ig.Q@P M$R4^=ٚ(*;V2yi>q0ppK _UJ>"ٵ+_4$*jSD ~d8RJ6~h4'?ɶț {sZr޵KXxDq*0 ]zoC*hM3dGEDcq8f,r!*hv"C"U`)/6\VRqqLp 𽭪VKEs~m-WQC^6֫_w+kU wDnslsE{OQ4]E4t(DbIbg6+[PP:JSlmĞ JfIFjmFJڀo1Wh~ "`ibNC8M%ށ-ekjKYA54륀[6fpg_GV\\c%HH,F$&ɞ'8׎(NW348a#A6S ~h+~HZ<R l*4-(':ˮWAAOB!L3idz{Iut8pidf=rbw<+rjJ41C!hLJG7u7N "Bb%6=r ۲E1ӱmikv@շZQ&7G  ⩛T|/V~Ƀ\ \B`ry˖sEv^FБosjѿ+ @] Miժ .gL%d{_\ $xЮE֣44 mv,XZH/!p7UA%`o0 \i 'ҀW=ѻ iE>߃ㄑ9K< Jq>j%1Z XM'@nkujVZWJEuc |Mt8URy$n- lꢷ#^{0o)T*QT,BBK8fOr |M60#~jԦ{QXUQ꒶hW?­d7yD\{^;!ϱÇW_y5jC?q/xthwZ;5޼Шe龾q RQ!5ai:f *cT:g za5}״ }ol+\hRk#Z[~5u}o,pcɰFd=U?+ Up ےa+"rrk*E2#P73NDns%@QR_ EBp}')ˣ.h64} bw_WS?H  mRGt@%m'P4=~_:U+TUEaۖkqj\"jj_P֠kq^m kmNYiWǴkz'征ߪQ ۱2BJHXR.EM4} W.שhVx_o8 w~/ZݗZ__< c>4~c)tma[rrHX,)CaD_NmUK$S%:?˾o~S?(FUуEȵ%(r'*-ʵKiU/I&V@Qjފ XCǏS' @Kຯ(J;@# nm r[S{\ֱ ¥2Њ@ />w-1r~kw]Sq0MT DZ$VBH !9b !>H$|CJb( ű$o$$dFi,LOrꞞjEqjzv%~!Vb \O_s0q})*?E z"kқ*_38R #QׇxW)ŷWr1)q7qr`E*bU[YH)^Qo]5bz/~e}% \Tk50JB)gBvnEܯ+*}XJ_\=2:pRO3x5oq8Iwœ98x±$#V<%W^=r1N]0UeM@N9?`[µ|H,hE2,ʛ2 >t/W~c|D ,Qz7E=Ok;BHƯJ~p-ﱿWy.-פH\ٔ +E|F W=%nV R{M|^}懐Ҝ {by_yUqAb /O?ksF䄐D]䔋7Xٷ.76n 's:>x[%~צΩc0KNji%>A iQğ:ɨΆZwrDzD^!~ބ\wF|yG{D̬:sMpo384OSXRNǞ~,qkpkEP:$}$pq"I_ٸY*e\OǓ"c ,E)j#ү>#&>^نjzho~H_.j;/.6yS5#>Wp䃏<}1X&Ķ R1y mo |{pN)(9; 3 >{<4ABfBP7 ;A]"ʱI"Ip2^I5Sg9sw_\ϻH|%n_=^O=$>}o  vZ+i|d+Ma.,(9Sh7?H&lHٗŗq|VN t^[ ^n0di8d)WR@xjz63+YkCxүҜv J4ƓoȞymWuϹ=#EPM"\xt1gpG9& go@4MR&>Sϕ (G_}~|Axys67\/]SÀ ;p[ :n)N?mlG!~ϣbvįL2 w\ /.H~㯔1upQ]&7(DNU yldO|1"IbQ0 !S/͚tρ3st< CTTPP@MI ,0f95Pi7|Nnb &3gPl<;*EK nxB脺l^?;)[00 ꍟ-1yJAOl1`>L~ 3nB &`{J,D8ɚËOم f.Ay6$uK8#-à]χw8zUKM!|(v+' 4KDU}YW/u ajmkOA>rX.39(:~έXy <[权<&L1'G#[ǃg /DsDdr_ /KE-P;0# &[cu,qČ) fAY_9zU x2 )ѥHO? J56dEvlgq46)6iLIU h SlҘeqbqqXm]}DS*F u s밯_ɏ !$#p2AFx88@ ' QG P_WVT[OUj)$ɆskIm <-K><= kL'Fo^W#|zQhsK7*M6AbmIr0p" 4Ia%)~pw& $}ׅ r)KϜw _Q,EH7os ]W+000]mn^AUJ{sh*Xlv;o|GVV1XZF߇*GԻ.#Nũ+ٔ?33: *AW=WJYiU]'MUCE|Ĉðx8 (¡g1 v{i ht8ź›GGg/cu6et8c Mqfst72HVNX~ I"Py/2Nm۾;=G>](eaE2ഀ~\uY:s\iW<۟hŲUz5o %x;drp6JMǙ p?yG8`wi V+!x ǰ!=B`Yv gi 牯yDIeJ6R眓lۺZzj)PǝybP۶u:k_ }`0L~R(Bxch ꄟ:W{gՂI~CjYU CUcYβy'>|=ܡcaȯW/oF0MSYݗė}R_W AO L]ǟu" ;݊sؔRgY;Kg;0Ial8J {Y~ yumY P[ P/Zݯk :J r߲SJ<1?ID] =jJa>hy ݄Yăf[ݯw~u`ԚZr'W֫#y ?fJvi30ar]:5[ [mR߈݌q5 PR%u""њ&u{u;|fԓh<@{!Pg^Eۚ-k#,E6P׈Lވj^n"ly ϖ˷ image/svg+xml pdfmod-0.9.1/data/icons/pdfmod-16.png0000644000175000001440000000134711233641651017345 0ustar00gabeusers00000000000000PNG  IHDRasBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<dIDAT8MHUQ}z_O$2_mhD$FIAM5~H+ AIeE IID3JD+_νiѨ9{%|9ЀذH&Gso}Qb|}`` M;w0DDFhc[>}*`nW{R\!nк:I ֳvp4ַ}IqYםSǶ7 SR)d!-sKϙ:Iۼڀ_VD4uimRb(+S*Ĕ  rn܅{Fhjskx ]8@& ޳,[M.`#X)ҙs){Gw346B`R(&J_#M A4 &\p?QW5# ?"1f0J90;ZFqM!pEªAS6DRQޔKq8[FDloha0IENDB`pdfmod-0.9.1/data/icons/pdfmod-32.png0000644000175000001440000000461711233641651017346 0ustar00gabeusers00000000000000PNG  IHDR szzsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org< IDATXŗpT?6l$~KpT]Q"c8팎vQ- "(NZĎ[ eZTj  Pl6&޽cޙ3~{< jP($+**R322mD"4MޮY   O~ÞO{%$ZkNn37e:mcZkΞgn<xps4i>[rsiPUą~#)h(^۶ii9G}1:;#̞= )ƍV?γj邒@kZ{6u]47r9tHOEY%x^?~0d}#ko }$̖.0ܝ9NI}4XupI8j B HOO'//! ^ ?ZQJIW߮T^p_k-Lol. HŶV,kd44ͩBkŧx;۹8 (bŠ;{F!P8mKHMt{W )40@3ϳv$ @Ip\}/ߏbwɁ, 6k41 09; Z/jáCr!0V[mfbpM-kÎ7qzs~LTox{@ ]`TZRNRƁOq>Ci0MwÎ7w?v&J0D2eH:ְ~POö1R /5$ZSs/X*qQSXP@<ʥa6B@S{/XZpHi^!l}U\Pe98QOvvK/`?G.n[]Vh Dhw(0Pi N;2(i>U`_6ṣ~A@cL[.#3#^HMm-̊H *Jk3 ЮҚHD"R <}HC0r.e%#ݻǶIɖ0gj *q\ڐz0rlƔ%OP\T2BhwuѼw/w殮WQnO$ҍΚCeߵB&ɶ,EɆER BpH(˝̾0J*׭]Л1?(^֣GfKK0h0IVR%5.RVR1sFЪUL&/};Քϝ˹={NIpb:N÷YYu(Z0 (U, DvމvK/NV4ȫc/rj4OiG3[v;vA5 YfךG `|q}#7.*R_MA JkxM8$hy/^ 39=cz>u8twpc 8:%.+ eXz}V田ʇ4:)4uQA+֊չROŸ榲RJ3gebڤ1H'rs&O}gOG@zt kSZ#!@'hV&hM:Q|nY3륷sojJ|-gz혱cBLS==?4Q)\e|0TI[lc$v}`,i+R !1hfE0d g\:~c Ч;8ǃXIENDB`pdfmod-0.9.1/data/icons/Makefile.am0000644000175000001440000000107711234355742017202 0ustar00gabeusers00000000000000theme = hicolor themedir = $(datadir)/icons/$(theme) theme_icons = \ apps,pdfmod-16.png \ apps,pdfmod-22.png \ apps,pdfmod-24.png \ apps,pdfmod-32.png \ apps,pdfmod-256.png \ apps,pdfmod.svg install_icon_exec = $(top_srcdir)/icon-theme-installer \ -t "$(theme)" \ -s "$(srcdir)" \ -d "x$(DESTDIR)" \ -b "$(themedir)" \ -m "$(mkinstalldirs)" \ -x "$(INSTALL_DATA)" install-data-local: @-$(install_icon_exec) -i $(theme_icons) uninstall-hook: @-$(install_icon_exec) -u $(theme_icons) MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = $(wildcard *.png *.svg) pdfmod-0.9.1/data/icons/pdfmod-22.png0000644000175000001440000000262411233641651017341 0ustar00gabeusers00000000000000PNG  IHDRĴl;sBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<IDAT8Le_(BB&iF寠uB͚F'Xl,bA]h:OD9xCcR=k?{?|GR盕e50dLvR2eҝOX\nE4*T @"-[ʹo'T9MDz%"pj h!eOs,9ݟH,hkr`5lv\nꛏ $m PUej>{'\LGu =X^l B( .:(~sprmYFg%\<&67o@ʒFLD;~y&%%%A[[PQ~7g|._F%o"L`ĖMYU:mGBض͖nKQ-루TT;]H~Jᩪ2SBM(KdCPG< ##KG Vâ@Jۦ t*4Џ y}Oii%̙=)2c4 XM?@?EMM :m'' q4%tww("w+87b>7>NJ;XrֿE$g0z)MiP+Fll؄a6 *gH$/7{|o֭cK;g45!6ֿM`x"oa"U `IRLDJ6;v`sfX*6ÑGɛz_q7,* dv}ht["B"  `&t2gν7o;q9.CISAU-FA֭ ?@z^bM:`XdO,c<:bp_k]li r5ڊ6}:)=|'Aڿ4bQhii]ym!mkǧW|56bcV]Mv4 ǿmǃ3wwϞK)Dwt4.ssI /`Bv6z$'2H^0`bVHjAA@@d߾^}CnHUtץ8F42ș a$KUTBW#~Uw"L<5844'zd2\:;䳲&ǔo0~ 2[G---n aR/KSժ~j,p8&ݬiʀe7O ?)BIENDB`pdfmod-0.9.1/data/icons/pdfmod-24.png0000644000175000001440000000274611233641651017350 0ustar00gabeusers00000000000000PNG  IHDRw=sBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<cIDATHkpﻻI%\X Pilv' -,*3Ԧ 2.tDD0(c q!fIvY2!O̜/9F2Ro̱U{ZrKZ xΚ}ce{hBDhHRd433XݹcZy^~0l¶x+ PJM⇫ "3"K,JLӒϸպA<^xƍ)I*-_q7ʶgt2ޏ ˏҚOtd2,\*x}s!F:8=cs[&PTTD~~>eLS"~鷬aGYR)֔EV,J)1p]kc,+]V6FY9~"JOs!EPQ^A[{;&^4,L,Zf}6`VFJ9GsS"L)|2rMe%zc;^ߴ C!pA.^&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: pdfmod-0.9.1/Makefile.in0000644000175000001440000005502311533760015015162 0ustar00gabeusers00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure \ $(top_srcdir)/src/PdfMod/Core/Defines.cs.in AUTHORS COPYING \ NEWS install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = src/PdfMod/Core/Defines.cs SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = lib/PdfSharp lib/poppler-sharp src po docs data DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUNDLE_ASSEMBLIES = @BUNDLE_ASSEMBLIES@ BUNDLE_FILES = @BUNDLE_FILES@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GCONF_SHARP_20_CFLAGS = @GCONF_SHARP_20_CFLAGS@ GCONF_SHARP_20_LIBS = @GCONF_SHARP_20_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ HELP_DIR = @HELP_DIR@ HYENA_ASSEMBLIES = @HYENA_ASSEMBLIES@ HYENA_CFLAGS = @HYENA_CFLAGS@ HYENA_FILES = @HYENA_FILES@ HYENA_GUI_ASSEMBLIES = @HYENA_GUI_ASSEMBLIES@ HYENA_GUI_CFLAGS = @HYENA_GUI_CFLAGS@ HYENA_GUI_FILES = @HYENA_GUI_FILES@ HYENA_GUI_LIBS = @HYENA_GUI_LIBS@ HYENA_LIBS = @HYENA_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@ INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@ INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@ INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@ INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@ INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@ INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@ INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@ INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@ INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@ INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@ INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@ INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@ INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POPPLER_ASSEMBLIES = @POPPLER_ASSEMBLIES@ POPPLER_CFLAGS = @POPPLER_CFLAGS@ POPPLER_LIBS = @POPPLER_LIBS@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ #Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@SUBDIRS = lib/PdfSharp lib/poppler-sharp src po docs data @ENABLE_RELEASE_TRUE@SUBDIRS = lib/PdfSharp lib/poppler-sharp src po docs data INSTALL_DIR_RESOLVED = $(firstword $(subst , $(pkglibdir), $(INSTALL_DIR))) EXTRA_DIST = \ lib/poppler-sharp/poppler-sharp/poppler-sharp.dll.config \ gnome-doc-utils.make \ icon-theme-installer \ intltool-extract.in \ intltool-merge.in \ intltool-update.in \ AUTHORS \ HACKING CLEANFILES = \ intltool-extract \ intltool-update \ intltool-merge DISTCLEANFILES = \ gnome-doc-utils.make \ *.bak \ *~ \ *.pidb MAINTAINERCLEANFILES = \ compile \ INSTALL \ config.h.in \ aclocal.m4 \ ltmain.sh \ Makefile.in \ depcomp \ missing \ install-sh \ configure \ config.sub \ config.guess \ intltool-extract.in \ intltool-merge.in \ intltool-update.in \ mkinstalldirs all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) src/PdfMod/Core/Defines.cs: $(top_builddir)/config.status $(top_srcdir)/src/PdfMod/Core/Defines.cs.in cd $(top_builddir) && $(SHELL) ./config.status $@ # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-data-am install-strip uninstall-am .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-local ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \ distclean distclean-generic distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-hook run: cd bin; mono --debug PdfMod.exe; install-data-hook: for ASM in $(BUNDLE_ASSEMBLIES); do \ $(INSTALL) -m 0755 $$ASM $(DESTDIR)$(INSTALL_DIR_RESOLVED); \ done; \ for ASM in $(BUNDLE_FILES); do \ $(INSTALL) -m 0644 $$ASM $(DESTDIR)$(INSTALL_DIR_RESOLVED); \ done; uninstall-hook: for ASM in $(BUNDLE_ASSEMBLIES); do \ rm -f $(DESTDIR)$(INSTALL_DIR_RESOLVED)/`basename $$ASM`; \ done; for ASM in $(BUNDLE_FILES); do \ rm -f $(DESTDIR)$(INSTALL_DIR_RESOLVED)/`basename $$ASM`; \ done; clean-local: rm -rf $(top_builddir)/bin # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pdfmod-0.9.1/po/0000777000175000001440000000000011533760020013526 5ustar00gabeusers00000000000000pdfmod-0.9.1/po/POTFILES.skip0000644000175000001440000000015111240370571015637 0ustar00gabeusers00000000000000lib/PdfSharp/PdfSharp.Pdf.IO/Parser.cs lib/PdfSharp/PdfSharp.Pdf/PdfDictionary.cs data/pdfmod.desktop.in pdfmod-0.9.1/po/bn_IN.po0000644000175000001440000002210611274372763015067 0ustar00gabeusers00000000000000# Bengali (India) translation of pdfmod. # Copyright (C) 2009 pdfmod's COPYRIGHT HOLDER # This file is distributed under the same license as the pdfmod package. # # sankarshan mukhopadhyay , 2009. msgid "" msgstr "" "Project-Id-Version: pdfmod master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug." "cgi?product=pdfmod&component=general\n" "POT-Creation-Date: 2009-08-02 21:56+0000\n" "PO-Revision-Date: 2009-08-04 14:48+0530\n" "Last-Translator: sankarshan mukhopadhyay \n" "Language-Team: Bengali (India) \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Lokalize 0.3\n" #: ../data/pdfmod.desktop.in.h:1 msgid "PDF Modifier" msgstr "PDF পরিবর্তক" #: ../data/pdfmod.desktop.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "PDF ডকুমেন্ট থেকে পৃষ্ঠা অপসারণ, এক্সট্র্যাক্ট ও আবর্তন করুন" #: ../src/PdfMod/PdfMod.Actions/MoveAction.cs:28 msgid "Error trying to unmove pages" msgstr "" #: ../src/PdfMod/PdfMod.Actions/MoveAction.cs:38 msgid "Error trying to move pages" msgstr "পৃষ্ঠা অপসারণ করতে ত্রুটি হয়েছে" #: ../src/PdfMod/PdfMod.Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "ডকুমেন্ট থেকে পৃষ্ঠা মুছে ফেলতে ত্রুটি হয়েছে" #: ../src/PdfMod/PdfMod/GlobalActions.cs:46 msgid "Open a document" msgstr "ডকুমেন্ট খুলুন" #: ../src/PdfMod/PdfMod/GlobalActions.cs:47 msgid "_Insert From..." msgstr "সন্নিবেশ করুন(_I)..." #: ../src/PdfMod/PdfMod/GlobalActions.cs:47 msgid "Insert pages from another document" msgstr "অন্য ডকুমেন্ট থেকে পৃষ্ঠা সন্নিবেশ করুন" #: ../src/PdfMod/PdfMod/GlobalActions.cs:48 msgid "Save changes to this document, overwriting the existing file" msgstr "" "উপস্থিত ফাইলটিকে নতুন করে লিখে ডকুমেন্টের পরিবর্তন সংরক্ষণ করুন" #: ../src/PdfMod/PdfMod/GlobalActions.cs:49 msgid "Save this document to a new file" msgstr "এই ডকুমেন্টটি একটি নতুন ফাইলে সংরক্ষণ করুন" #: ../src/PdfMod/PdfMod/GlobalActions.cs:51 msgid "_File" msgstr "ফাইল(_F)" #: ../src/PdfMod/PdfMod/GlobalActions.cs:52 msgid "Recent _Files" msgstr "তৎকাল ফাইল (_F)" #: ../src/PdfMod/PdfMod/GlobalActions.cs:56 msgid "Rotate Right" msgstr "ডানদিকে ঘুরিয়ে নিন" #: ../src/PdfMod/PdfMod/GlobalActions.cs:56 msgid "Rotate right" msgstr "ডানদিকে ঘুরিয়ে নিন" #: ../src/PdfMod/PdfMod/GlobalActions.cs:57 msgid "Rotate Left" msgstr "বাঁদিকে ঘুরিয়ে নিন" #: ../src/PdfMod/PdfMod/GlobalActions.cs:57 msgid "Rotate left" msgstr "বাঁদিকে ঘুরিয়ে নিন" #: ../src/PdfMod/PdfMod/GlobalActions.cs:58 msgid "Export Images..." msgstr "ছবি এক্সপোর্ট করুন..." #: ../src/PdfMod/PdfMod/GlobalActions.cs:60 msgid "_Edit" msgstr "সম্পাদনা করুন(_E)" #: ../src/PdfMod/PdfMod/GlobalActions.cs:62 msgid "Select Even Pages" msgstr "জোড় পৃষ্ঠা বেছে নিন" #: ../src/PdfMod/PdfMod/GlobalActions.cs:63 msgid "Select Odd Pages" msgstr "বেজোড় পৃষ্ঠা বেছে নিন" #: ../src/PdfMod/PdfMod/GlobalActions.cs:64 msgid "Select Matching..." msgstr "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:68 msgid "_View" msgstr "প্রদর্শন(_V)" #: ../src/PdfMod/PdfMod/GlobalActions.cs:72 msgid "_Help" msgstr "সহায়িকা(_H)" #: ../src/PdfMod/PdfMod/GlobalActions.cs:73 msgid "_Contents" msgstr "বিষয়বস্তু(_C)" #: ../src/PdfMod/PdfMod/GlobalActions.cs:80 msgid "View and edit the title, keywords, and more for this document" msgstr "" "এই ডকুমেন্টের টাইটেল, কী-ওয়ার্ড ও অন্যান্য পড়ুন ও সম্পাদনা করুন" #: ../src/PdfMod/PdfMod/GlobalActions.cs:82 msgid "Toolbar" msgstr "টুলবার" #: ../src/PdfMod/PdfMod/GlobalActions.cs:158 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "পৃষ্ঠাটি মুছে ফেলুন" msgstr[1] "{0} পৃষ্ঠা মুছে ফেলুন" #: ../src/PdfMod/PdfMod/GlobalActions.cs:161 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "" msgstr[1] "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:164 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "" msgstr[1] "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:167 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "" msgstr[1] "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:175 #: ../src/PdfMod/PdfMod/GlobalActions.cs:194 msgid "Select PDF" msgstr "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:177 #: ../src/PdfMod/PdfMod/GlobalActions.cs:196 #: ../src/PdfMod/PdfMod/GlobalActions.cs:225 msgid "All Files" msgstr "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:219 msgid "Save as..." msgstr "" #. Translators: {0} is the number of pages (always 1), and {1} is the page number, eg Page 1, or Page 5 #: ../src/PdfMod/PdfMod/GlobalActions.cs:284 #, csharp-format msgid "Page {1}" msgid_plural "Page {1}" msgstr[0] "" msgstr[1] "" #. Translators: {0} is the number of pages, and {1} is the first page, {2} is the last page, #. eg Pages 3 - 7 #: ../src/PdfMod/PdfMod/GlobalActions.cs:288 #, csharp-format msgid "Pages {1} - {2}" msgid_plural "Pages {1} - {2}" msgstr[0] "" msgstr[1] "" #. Translators: {0} is the number of pages, {1} is a comma separated list of page numbers, eg Pages 1, 4, 9 #: ../src/PdfMod/PdfMod/GlobalActions.cs:293 #, csharp-format msgid "Pages {1}" msgid_plural "Pages {1}" msgstr[0] "" msgstr[1] "" #. Translators: {0} is the number of pages, eg 12 Pages #: ../src/PdfMod/PdfMod/GlobalActions.cs:296 #, csharp-format msgid "{0} Page" msgid_plural "{0} Pages" msgstr[0] "" msgstr[1] "" #. Translators: This is used for creating a folder name, be careful! #: ../src/PdfMod/PdfMod/GlobalActions.cs:313 #, csharp-format msgid "{0} - Images for {1}" msgstr "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:380 msgid "Error opening help" msgstr "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:381 msgid "Would you like to open PDF Mod's online documentation?" msgstr "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:402 msgid "Visit Website" msgstr "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:414 msgid "translator-credits" msgstr "সঙ্কর্ষণ মুখোপাধ্যায় (sankarshan@randomink.org)" #: ../src/PdfMod/PdfMod/PdfListStore.cs:55 #: ../src/PdfMod/PdfMod/PdfListStore.cs:63 #, csharp-format msgid "Page {0}" msgstr "" #: ../src/PdfMod/PdfMod/PdfMod.cs:64 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/PdfMod/PdfMod.cs:158 msgid "Save the changes made to this document?" msgstr "" #: ../src/PdfMod/PdfMod/PdfMod.cs:161 msgid "Close _Without Saving" msgstr "" #: ../src/PdfMod/PdfMod/PdfMod.cs:194 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "" msgstr[1] "" #: ../src/PdfMod/PdfMod/PdfMod.cs:198 msgid "Open _First" msgstr "" #: ../src/PdfMod/PdfMod/PdfMod.cs:199 msgid "Open _All" msgstr "" #: ../src/PdfMod/PdfMod/PdfMod.cs:228 #, csharp-format msgid "Loading {0}" msgstr "" #: ../src/PdfMod/PdfMod/PdfMod.cs:248 msgid "Error Loading Document" msgstr "" #: ../src/PdfMod/PdfMod/PdfMod.cs:249 #, csharp-format msgid "There was an error loading {0}" msgstr "" #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/PdfMod/PdfMod.cs:272 #, csharp-format msgid "{0} (originally {1})" msgstr "" #: ../src/PdfMod/PdfMod/PdfMod.cs:277 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "" msgstr[1] "" #: ../src/PdfMod/PdfMod/QueryBox.cs:26 msgid "Select Matching" msgstr "" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:46 msgid "_Title:" msgstr "" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:47 msgid "_Author:" msgstr "" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:48 msgid "_Keywords:" msgstr "" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:49 msgid "_Subject:" msgstr "" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:69 msgid "_Revert Properties" msgstr "" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:70 msgid "Change the document's properties back to the original values" msgstr "" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:75 msgid "_Close" msgstr "" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:76 msgid "Hide the document's properties" msgstr "" pdfmod-0.9.1/po/es.po0000644000175000001440000003007511511422704014476 0ustar00gabeusers00000000000000# Spanish translation for PDF Mod # Copyright (C) 2009 THE PDFMOD'S COPYRIGHT HOLDER # This file is distributed under the same license as the pdfmod package. # # Andreu Correa Casablanca , 2009. # Jorge González , 2009, 2010. # msgid "" msgstr "" "Project-Id-Version: pdfmod.master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=pdfmod&component=general\n" "POT-Creation-Date: 2010-10-25 19:26+0000\n" "PO-Revision-Date: 2010-10-26 10:49+0200\n" "Last-Translator: Jorge González \n" "Language-Team: Español \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "Modificador de PDF" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Quita, extrae y rota páginas en documentos PDF" #: ../src/PdfMod/Pdf/Actions/ExportImagesAction.cs:136 #: ../src/PdfMod/Pdf/Page.cs:36 #, csharp-format msgid "Page {0}" msgstr "Página {0}" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Mover {1}" msgstr[1] "Mover {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "Error intentando deshacer movimiento de páginas" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "Error intentando mover páginas" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Error intentando eliminar páginas del documento" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "_File" msgstr "_Archivo" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Open a document" msgstr "Abrir un documento" #: ../src/PdfMod/Gui/Actions.cs:67 msgid "Save changes to this document, overwriting the existing file" msgstr "" "Guardar los cambios en este documento, sobreescribiendo el archivo actual" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "Save this document to a new file" msgstr "Guardar este documento como un nuevo archivo" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "Archivos _recientes" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "_Insert From..." msgstr "_Insertar desde…" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "Insert pages from another document" msgstr "Insertar páginas desde otro documento" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Edit" msgstr "_Editar" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate Left" msgstr "Rotar a la izquierda" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate left" msgstr "Rotar hacia la izquierda" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate Right" msgstr "Rotar a la derecha" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate right" msgstr "Rotar hacia la derecha" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "Select Odd Pages" msgstr "Seleccionar páginas impares" #: ../src/PdfMod/Gui/Actions.cs:83 msgid "Select Even Pages" msgstr "Seleccionar páginas pares" #: ../src/PdfMod/Gui/Actions.cs:84 msgid "Select Matching..." msgstr "Seleccionar correspondencia…" #: ../src/PdfMod/Gui/Actions.cs:85 msgid "_Invert Selection" msgstr "_Invertir selección" #: ../src/PdfMod/Gui/Actions.cs:87 msgid "_View" msgstr "_Ver" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in Viewer" msgstr "Abrir en un visor" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in viewer" msgstr "Abrir en un visor" #: ../src/PdfMod/Gui/Actions.cs:92 ../src/PdfMod/Gui/BookmarkView.cs:346 msgid "_Bookmarks" msgstr "_Marcadores" #: ../src/PdfMod/Gui/Actions.cs:93 msgid "_Add Bookmark" msgstr "_Añadir marcador" #: ../src/PdfMod/Gui/Actions.cs:94 msgid "Re_name Bookmark" msgstr "Re_nombrar marcador" #: ../src/PdfMod/Gui/Actions.cs:95 msgid "_Change Bookmark Destination" msgstr "_Cambiar el destino del marcador" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/Actions.cs:96 ../src/PdfMod/Gui/BookmarkView.cs:383 #, csharp-format msgid "_Remove Bookmark" msgid_plural "_Remove Bookmarks" msgstr[0] "_Quitar marcador" msgstr[1] "_Quitar marcadores" #: ../src/PdfMod/Gui/Actions.cs:97 msgid "_Edit Bookmarks" msgstr "_Editar marcadores" #: ../src/PdfMod/Gui/Actions.cs:99 msgid "_Help" msgstr "Ay_uda" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "_Contents" msgstr "Índ_ice" #: ../src/PdfMod/Gui/Actions.cs:107 msgid "_Add" msgstr "_Añadir" #: ../src/PdfMod/Gui/Actions.cs:108 msgid "_Remove" msgstr "_Quitar" #: ../src/PdfMod/Gui/Actions.cs:111 msgid "View and edit the title, keywords, and more for this document" msgstr "Ver y editar el título, las palabras clave, y más para este documento" #: ../src/PdfMod/Gui/Actions.cs:113 msgid "Toolbar" msgstr "Barra de herramientas" #: ../src/PdfMod/Gui/Actions.cs:114 msgid "Bookmarks" msgstr "Marcadores" #: ../src/PdfMod/Gui/Actions.cs:115 msgid "Fullscreen" msgstr "Pantalla completa" #: ../src/PdfMod/Gui/Actions.cs:186 #, csharp-format msgid "Export Image" msgid_plural "Export {0} Images" msgstr[0] "Exportar imagen" msgstr[1] "Exportar {0} imágenes" #: ../src/PdfMod/Gui/Actions.cs:189 #, csharp-format msgid "Save image from the selected pages to a new folder" msgid_plural "Save {0} images from the selected pages to a new folder" msgstr[0] "Guardar en una carpeta nueva la imagen de las páginas seleccionadas" msgstr[1] "" "Guardar en una carpeta nueva las {0} imágenes de las páginas seleccionadas" #: ../src/PdfMod/Gui/Actions.cs:196 msgid "_Undo" msgstr "_Deshacer" #: ../src/PdfMod/Gui/Actions.cs:197 #, csharp-format msgid "Undo {0}" msgstr "Deshacer {0}" #: ../src/PdfMod/Gui/Actions.cs:201 msgid "_Redo" msgstr "_Rehacer" #: ../src/PdfMod/Gui/Actions.cs:202 #, csharp-format msgid "Redo {0}" msgstr "Rehacer {0}" #: ../src/PdfMod/Gui/Actions.cs:210 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Quitar página" msgstr[1] "Quitar {0} páginas" #: ../src/PdfMod/Gui/Actions.cs:213 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Quitar la página seleccionada" msgstr[1] "Quitar las {0} páginas seleccionadas" #: ../src/PdfMod/Gui/Actions.cs:216 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Extraer página" msgstr[1] "Extraer {0} páginas" #: ../src/PdfMod/Gui/Actions.cs:219 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Extraer la página seleccionada" msgstr[1] "Extraer las {0} páginas seleccionadas" #: ../src/PdfMod/Gui/Actions.cs:229 ../src/PdfMod/Gui/Actions.cs:316 msgid "Select PDF" msgstr "Seleccionar PDF" #: ../src/PdfMod/Gui/Actions.cs:258 msgid "Unable to Save Document" msgstr "Imposible guardar el documento" #: ../src/PdfMod/Gui/Actions.cs:264 msgid "Save as..." msgstr "Guardar como…" #: ../src/PdfMod/Gui/Actions.cs:333 ../src/PdfMod/Gui/Client.cs:308 msgid "Error Loading Document" msgstr "Error al cargar el documento" #: ../src/PdfMod/Gui/Actions.cs:334 ../src/PdfMod/Gui/Client.cs:309 #, csharp-format msgid "There was an error loading {0}" msgstr "Hubo un error al cargar {0}" #: ../src/PdfMod/Gui/Actions.cs:510 msgid "Error opening help" msgstr "Error al abrir la ayuda" #: ../src/PdfMod/Gui/Actions.cs:511 msgid "Would you like to open PDF Mod's online documentation?" msgstr "¿Quiere abrir la documentación en línea de PDF Mod?" #: ../src/PdfMod/Gui/Actions.cs:532 msgid "Visit Website" msgstr "Visitar la página web del proyecto" #: ../src/PdfMod/Gui/Actions.cs:534 msgid "Primary Development:" msgstr "Desarrollo inicial:" #: ../src/PdfMod/Gui/Actions.cs:537 msgid "Contributors:" msgstr "Contribuidores:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:555 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" "Copyright {0} Novell Inc.\n" "Copyright {1} Otros colaboradores de PDF Mod" #: ../src/PdfMod/Gui/Actions.cs:558 msgid "translator-credits" msgstr "" "Jorge González , 2009-2010\n" "Andreu Correa Casablanca , 2009" #. Add it to the PDF document #: ../src/PdfMod/Gui/BookmarkView.cs:90 msgid "New bookmark" msgstr "Marcador nuevo" #: ../src/PdfMod/Gui/BookmarkView.cs:113 msgid "Add Bookmark" msgstr "Añadir marcador" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/BookmarkView.cs:137 #, csharp-format msgid "Remove Bookmark" msgid_plural "Remove Bookmarks" msgstr[0] "Quitar marcador" msgstr[1] "Quitar marcadores" #: ../src/PdfMod/Gui/BookmarkView.cs:285 ../src/PdfMod/Gui/BookmarkView.cs:323 msgid "Rename Bookmark" msgstr "Renombrar marcador" #: ../src/PdfMod/Gui/BookmarkView.cs:417 #, csharp-format msgid "Bookmark links to page {0}" msgstr "El marcador enlaza a la página {0}" #: ../src/PdfMod/Gui/Client.cs:86 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:207 msgid "Save the changes made to this document?" msgstr "¿Guardar los cambios realizados en este documento?" #: ../src/PdfMod/Gui/Client.cs:210 msgid "Close _Without Saving" msgstr "Salir _sin guardar" #: ../src/PdfMod/Gui/Client.cs:240 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "¿Continuar abriendo {0} documento en ventanas separadas?" msgstr[1] "¿Continuar abriendo todos los {0} documentos en ventanas separadas?" #: ../src/PdfMod/Gui/Client.cs:244 msgid "Open _First" msgstr "Abrir p_rimero" #: ../src/PdfMod/Gui/Client.cs:245 msgid "Open _All" msgstr "Abrir _todos" #: ../src/PdfMod/Gui/Client.cs:276 msgid "Loading document..." msgstr "Cargando documento…" #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:338 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (originalmente {1})" #: ../src/PdfMod/Gui/Client.cs:343 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} página" msgstr[1] "{0} páginas" #: ../src/PdfMod/Gui/Client.cs:364 msgid "Document is Encrypted" msgstr "El documento está cifrado" #: ../src/PdfMod/Gui/Client.cs:365 msgid "Enter the document's password to open it:" msgstr "Introducir la contraseña del documento para abrirlo:" #: ../src/PdfMod/Gui/Client.cs:395 msgid "PDF Documents" msgstr "Documentos pdf" #: ../src/PdfMod/Gui/Client.cs:396 msgid "All Files" msgstr "Todos los archivos" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "Seleccionar correspondencia" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "_Título:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "_Autor:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "Palabras c_lave:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "_Género:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "_Revertir propiedades" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "Cambiar las propiedades del documento a los valores originales" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "_Cerrar" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "Ocultar las propiedades del documento" #~ msgid "Pages {1} - {2}" #~ msgid_plural "Pages {1} - {2}" #~ msgstr[0] "Páginas {1} - {2}" #~ msgstr[1] "Páginas {1} - {2}" #~ msgid "Pages {1}" #~ msgid_plural "Pages {1}" #~ msgstr[0] "Páginas {1}" #~ msgstr[1] "Páginas {1}" #~ msgid "{0} Page" #~ msgid_plural "{0} Pages" #~ msgstr[0] "{0} página" #~ msgstr[1] "{0} páginas" #~ msgid "/Subtype" #~ msgstr "/Subtipo" #~ msgid "{0} - Images for {1}" #~ msgstr "{0} - Imágenes para {1}" #~ msgid "Loading {0}" #~ msgstr "Cargando {0}" pdfmod-0.9.1/po/pt_BR.po0000644000175000001440000002761311511422704015101 0ustar00gabeusers00000000000000# Portuguese translations for pdfmod package. # Copyright (C) 2009 THE PDFMOD'S COPYRIGHT HOLDER # This file is distributed under the same license as the pdfmod package. # Og Maciel , 2009. # Mateus Zenaide , 2010. # msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=pdfmod&component=general\n" "POT-Creation-Date: 2010-11-24 21:50+0000\n" "PO-Revision-Date: 2010-12-16 07:45-0300\n" "Last-Translator: Mateus Zenaide \n" "Language-Team: Brazilian Portuguese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "Modificador de PDF" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Remove, extrai e rotaciona páginas em documentos PDF" #: ../src/PdfMod/Pdf/Actions/ExportImagesAction.cs:136 #: ../src/PdfMod/Pdf/Page.cs:36 #, csharp-format msgid "Page {0}" msgstr "Página {0}" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Mover {1}" msgstr[1] "Mover {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "Erro tentando retornar páginas" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "Erro tentando mover páginas" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Erro tentando remover páginas do documento" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "_File" msgstr "_Arquivo" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Open a document" msgstr "Abrir um documento" #: ../src/PdfMod/Gui/Actions.cs:67 msgid "Save changes to this document, overwriting the existing file" msgstr "Salvar modificações neste documento, sobrescrevendo o arquivo atual" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "Save this document to a new file" msgstr "Salvar este documento como um novo arquivo" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "Arquivos _recentes" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "_Insert From..." msgstr "_Inserir de..." #: ../src/PdfMod/Gui/Actions.cs:70 msgid "Insert pages from another document" msgstr "Inserir páginas de outro documento" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Edit" msgstr "_Editar" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate Left" msgstr "Rotacionar para a esquerda" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate left" msgstr "Rotacionar para a esquerda" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate Right" msgstr "Rotacionar para a direita" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate right" msgstr "Rotaciona para a direita" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "Select Odd Pages" msgstr "Selecionar páginas ímpares" #: ../src/PdfMod/Gui/Actions.cs:83 msgid "Select Even Pages" msgstr "Selecionar páginas pares" #: ../src/PdfMod/Gui/Actions.cs:84 msgid "Select Matching..." msgstr "Selecionar combinando..." #: ../src/PdfMod/Gui/Actions.cs:85 msgid "_Invert Selection" msgstr "_Inverter seleção" #: ../src/PdfMod/Gui/Actions.cs:87 msgid "_View" msgstr "_Visualizar" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in Viewer" msgstr "Abrir no visualizador" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in viewer" msgstr "Abre no visualizador" #: ../src/PdfMod/Gui/Actions.cs:92 ../src/PdfMod/Gui/BookmarkView.cs:346 msgid "_Bookmarks" msgstr "_Marcadores" #: ../src/PdfMod/Gui/Actions.cs:93 msgid "_Add Bookmark" msgstr "_Adicionar marcador" #: ../src/PdfMod/Gui/Actions.cs:94 msgid "Re_name Bookmark" msgstr "Re_nomear marcador" #: ../src/PdfMod/Gui/Actions.cs:95 msgid "_Change Bookmark Destination" msgstr "_Alterar destino do marcador" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/Actions.cs:96 ../src/PdfMod/Gui/BookmarkView.cs:383 #, csharp-format msgid "_Remove Bookmark" msgid_plural "_Remove Bookmarks" msgstr[0] "_Remover marcador" msgstr[1] "_Remover marcadores" #: ../src/PdfMod/Gui/Actions.cs:97 msgid "_Edit Bookmarks" msgstr "_Editar marcadores" #: ../src/PdfMod/Gui/Actions.cs:99 msgid "_Help" msgstr "Aj_uda" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "_Contents" msgstr "_Conteúdo" #: ../src/PdfMod/Gui/Actions.cs:107 msgid "_Add" msgstr "_Adicionar" #: ../src/PdfMod/Gui/Actions.cs:108 msgid "_Remove" msgstr "_Remover" #: ../src/PdfMod/Gui/Actions.cs:111 msgid "View and edit the title, keywords, and more for this document" msgstr "Visualize e edite o título, palavras-chave, e mais para este documento" #: ../src/PdfMod/Gui/Actions.cs:113 msgid "Toolbar" msgstr "Barra de ferramentas" #: ../src/PdfMod/Gui/Actions.cs:114 msgid "Bookmarks" msgstr "Marcadores" #: ../src/PdfMod/Gui/Actions.cs:115 msgid "Fullscreen" msgstr "Tela cheia" #: ../src/PdfMod/Gui/Actions.cs:186 #, csharp-format msgid "Export Image" msgid_plural "Export {0} Images" msgstr[0] "Exportar imagem" msgstr[1] "Exportar {0} imagens" #: ../src/PdfMod/Gui/Actions.cs:189 #, csharp-format msgid "Save image from the selected pages to a new folder" msgid_plural "Save {0} images from the selected pages to a new folder" msgstr[0] "Salvar imagem das páginas selecionadas para uma nova pasta" msgstr[1] "Salvar {0} imagens das páginas selecionadas para uma nova pasta" #: ../src/PdfMod/Gui/Actions.cs:196 msgid "_Undo" msgstr "_Desfazer" #: ../src/PdfMod/Gui/Actions.cs:197 #, csharp-format msgid "Undo {0}" msgstr "Desfazer {0}" #: ../src/PdfMod/Gui/Actions.cs:201 msgid "_Redo" msgstr "_Refazer" #: ../src/PdfMod/Gui/Actions.cs:202 #, csharp-format msgid "Redo {0}" msgstr "Refazer {0}" #: ../src/PdfMod/Gui/Actions.cs:210 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Remover página" msgstr[1] "Remover {0} páginas" #: ../src/PdfMod/Gui/Actions.cs:213 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Remover a página selecionada" msgstr[1] "Remover as {0} páginas selecionadas" #: ../src/PdfMod/Gui/Actions.cs:216 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Extrair página" msgstr[1] "Extrair {0} páginas" #: ../src/PdfMod/Gui/Actions.cs:219 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Extrair a página selecionada" msgstr[1] "Extrair as {0} páginas selecionadas" #: ../src/PdfMod/Gui/Actions.cs:229 ../src/PdfMod/Gui/Actions.cs:316 msgid "Select PDF" msgstr "Selecionar PDF" #: ../src/PdfMod/Gui/Actions.cs:258 msgid "Unable to Save Document" msgstr "Não foi possível salvar o documento" #: ../src/PdfMod/Gui/Actions.cs:264 msgid "Save as..." msgstr "Salvar como..." #: ../src/PdfMod/Gui/Actions.cs:333 ../src/PdfMod/Gui/Client.cs:308 msgid "Error Loading Document" msgstr "Erro carregando o documento" #: ../src/PdfMod/Gui/Actions.cs:334 ../src/PdfMod/Gui/Client.cs:309 #, csharp-format msgid "There was an error loading {0}" msgstr "Houve um erro carregango {0}" #: ../src/PdfMod/Gui/Actions.cs:510 msgid "Error opening help" msgstr "Erro abrindo a ajuda" #: ../src/PdfMod/Gui/Actions.cs:511 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Você gostaria abrir a documentação online do PDF Mod?" #: ../src/PdfMod/Gui/Actions.cs:532 msgid "Visit Website" msgstr "Visitar a página do projeto na web" #: ../src/PdfMod/Gui/Actions.cs:534 msgid "Primary Development:" msgstr "Desenvolvimento principal:" #: ../src/PdfMod/Gui/Actions.cs:537 msgid "Contributors:" msgstr "Contribuidores:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:555 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" "Copyright {0} Novell Inc.\n" "Copyright {1} Outros contribuidores do PDF Mod" #: ../src/PdfMod/Gui/Actions.cs:558 msgid "translator-credits" msgstr "" "Og Maciel \n" "Mateus Zenaide " #. Add it to the PDF document #: ../src/PdfMod/Gui/BookmarkView.cs:90 msgid "New bookmark" msgstr "Novo marcador" #: ../src/PdfMod/Gui/BookmarkView.cs:113 msgid "Add Bookmark" msgstr "Adicionar marcador" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/BookmarkView.cs:137 #| msgid "Remove Bookmark" #| msgid_plural "Remove {0} Bookmarks" msgid "Remove Bookmark" msgid_plural "Remove Bookmarks" msgstr[0] "Remover marcador" msgstr[1] "Remover marcadores" #: ../src/PdfMod/Gui/BookmarkView.cs:285 ../src/PdfMod/Gui/BookmarkView.cs:323 msgid "Rename Bookmark" msgstr "Renomear marcador" #: ../src/PdfMod/Gui/BookmarkView.cs:417 #, csharp-format msgid "Bookmark links to page {0}" msgstr "Links das páginas dos marcadores {0}" #: ../src/PdfMod/Gui/Client.cs:86 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:207 msgid "Save the changes made to this document?" msgstr "Salvar as modificações feitas neste documento?" #: ../src/PdfMod/Gui/Client.cs:210 msgid "Close _Without Saving" msgstr "Fechar _sem aviso" #: ../src/PdfMod/Gui/Client.cs:240 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Continue, abrindo {0} documento em janelas separadas?" msgstr[1] "Continue, abrindo todos {0} documentos em janelas separadas?" #: ../src/PdfMod/Gui/Client.cs:244 msgid "Open _First" msgstr "Abrir _primeiro" #: ../src/PdfMod/Gui/Client.cs:245 msgid "Open _All" msgstr "Abrir _todos" #: ../src/PdfMod/Gui/Client.cs:276 msgid "Loading document..." msgstr "Carregando o documento..." #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:338 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (originalmente {1})" #: ../src/PdfMod/Gui/Client.cs:343 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} página" msgstr[1] "{0} páginas" #: ../src/PdfMod/Gui/Client.cs:364 msgid "Document is Encrypted" msgstr "O documento está criptografado" #: ../src/PdfMod/Gui/Client.cs:365 msgid "Enter the document's password to open it:" msgstr "Digite a senha do documento para abrí-lo:" #: ../src/PdfMod/Gui/Client.cs:395 msgid "PDF Documents" msgstr "Documentos PDF" #: ../src/PdfMod/Gui/Client.cs:396 msgid "All Files" msgstr "Todos arquivos" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "Selecionar combinação" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "_Título:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "_Autor:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "_Palavra-chave:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "A_ssunto" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "_Reverter propriedades" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "Reverte as propriedades do documento de volta aos valores originais" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "_Fechar" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "Ocultar as propriedades do documento" #~ msgid "/Subtype" #~ msgstr "/Subtipo" #~ msgid "Pages {1} - {2}" #~ msgid_plural "Pages {1} - {2}" #~ msgstr[0] "Páginas {1} - {2}" #~ msgstr[1] "Páginas {1} - {2}" #~ msgid "{0} Page" #~ msgid_plural "{0} Pages" #~ msgstr[0] "{0} página" #~ msgstr[1] "{0} páginas" #~ msgid "{0} - Images for {1}" #~ msgstr "{0} - Imagens para {1}" #~ msgid "Loading {0}" #~ msgstr "Carregando {0}" pdfmod-0.9.1/po/Makefile.in.in0000644000175000001440000001536111453151740016206 0ustar00gabeusers00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ DATADIRNAME = @DATADIRNAME@ itlocaledir = $(prefix)/$(DATADIRNAME)/locale subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep ^$$lang$$`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info tags TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pdfmod-0.9.1/po/zh_CN.po0000644000175000001440000002631011511422704015065 0ustar00gabeusers00000000000000# Chinese (China) translation for pdfmod. # Copyright (C) 2010 Free Software Foundation, Inc. # This file is distributed under the same license as the pdfmod package. # Aron Xu , 2010. # GrayWaLL , 2010. # Dean Lee , 2010. msgid "" msgstr "" "Project-Id-Version: pdfmod master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=pdfmod&component=general\n" "POT-Creation-Date: 2010-10-25 19:26+0000\n" "PO-Revision-Date: 2010-10-29 21:16+0800\n" "Last-Translator: Dean Lee \n" "Language-Team: Chinese (China) \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: \n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "PDF 修改者" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "在 PDF 文档中移除、提取或转动页面" #: ../src/PdfMod/Pdf/Actions/ExportImagesAction.cs:136 #: ../src/PdfMod/Pdf/Page.cs:36 #, csharp-format msgid "Page {0}" msgstr "页面 {0}" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "移动 {1}" msgstr[1] "移动 {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "试图取消移动页面时发生错误" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "试图移动页面时发生错误" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "试图从文档中移除页面时发生错误" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "_File" msgstr "文件(_I)" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Open a document" msgstr "打开文档" #: ../src/PdfMod/Gui/Actions.cs:67 msgid "Save changes to this document, overwriting the existing file" msgstr "保存当前文档,覆盖原来的文件" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "Save this document to a new file" msgstr "保存到新文件" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "最近打开的文件(_F)" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "_Insert From..." msgstr "从文件插入(_I)..." #: ../src/PdfMod/Gui/Actions.cs:70 msgid "Insert pages from another document" msgstr "从另一个文档中插入页面" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Edit" msgstr "编辑(_E)" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate Left" msgstr "向左翻转" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate left" msgstr "向左翻转" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate Right" msgstr "向右翻转" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate right" msgstr "向右翻转" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "Select Odd Pages" msgstr "选择奇数页面" #: ../src/PdfMod/Gui/Actions.cs:83 msgid "Select Even Pages" msgstr "选择偶数页面" #: ../src/PdfMod/Gui/Actions.cs:84 msgid "Select Matching..." msgstr "选择匹配页面" #: ../src/PdfMod/Gui/Actions.cs:85 msgid "_Invert Selection" msgstr "插入选择(_I)" #: ../src/PdfMod/Gui/Actions.cs:87 msgid "_View" msgstr "查看(_V)" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in Viewer" msgstr "在阅读器中打开" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in viewer" msgstr "在阅读器中打开" #: ../src/PdfMod/Gui/Actions.cs:92 ../src/PdfMod/Gui/BookmarkView.cs:346 msgid "_Bookmarks" msgstr "书签(_B)" #: ../src/PdfMod/Gui/Actions.cs:93 msgid "_Add Bookmark" msgstr "添加书签(_A)" #: ../src/PdfMod/Gui/Actions.cs:94 msgid "Re_name Bookmark" msgstr "重命名书签(_N)" #: ../src/PdfMod/Gui/Actions.cs:95 msgid "_Change Bookmark Destination" msgstr "更改书签存放位置(_C)" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/Actions.cs:96 ../src/PdfMod/Gui/BookmarkView.cs:383 #, csharp-format msgid "_Remove Bookmark" msgid_plural "_Remove Bookmarks" msgstr[0] "移除书签(_R)" msgstr[1] "移除书签(_R)" #: ../src/PdfMod/Gui/Actions.cs:97 msgid "_Edit Bookmarks" msgstr "编辑书签(_E)" #: ../src/PdfMod/Gui/Actions.cs:99 msgid "_Help" msgstr "帮助(_H)" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "_Contents" msgstr "目录(_C)" #: ../src/PdfMod/Gui/Actions.cs:107 msgid "_Add" msgstr "添加(_A)" #: ../src/PdfMod/Gui/Actions.cs:108 msgid "_Remove" msgstr "移除(_R)" #: ../src/PdfMod/Gui/Actions.cs:111 msgid "View and edit the title, keywords, and more for this document" msgstr "查看并编辑此文档的标题、关键字及更多信息" #: ../src/PdfMod/Gui/Actions.cs:113 msgid "Toolbar" msgstr "工具栏" #: ../src/PdfMod/Gui/Actions.cs:114 msgid "Bookmarks" msgstr "书签" #: ../src/PdfMod/Gui/Actions.cs:115 msgid "Fullscreen" msgstr "全屏" #: ../src/PdfMod/Gui/Actions.cs:186 #, csharp-format msgid "Export Image" msgid_plural "Export {0} Images" msgstr[0] "导出图像" msgstr[1] "导出 {0} 张图像" #: ../src/PdfMod/Gui/Actions.cs:189 #, csharp-format msgid "Save image from the selected pages to a new folder" msgid_plural "Save {0} images from the selected pages to a new folder" msgstr[0] "将所选页面中的图像保存到一个新文件夹" msgstr[1] "将所选页面中的 {0} 张图像保存到一个新文件夹" #: ../src/PdfMod/Gui/Actions.cs:196 msgid "_Undo" msgstr "撤销(_U)" #: ../src/PdfMod/Gui/Actions.cs:197 #, csharp-format msgid "Undo {0}" msgstr "撤销 {0}" #: ../src/PdfMod/Gui/Actions.cs:201 msgid "_Redo" msgstr "重做(_R)" #: ../src/PdfMod/Gui/Actions.cs:202 #, csharp-format msgid "Redo {0}" msgstr "重做 {0}" #: ../src/PdfMod/Gui/Actions.cs:210 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "移除页面" msgstr[1] "移除 {0} 张页面" #: ../src/PdfMod/Gui/Actions.cs:213 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "移除所选页面" msgstr[1] "移除所选中的 {0} 张页面" #: ../src/PdfMod/Gui/Actions.cs:216 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "提取页面" msgstr[1] "提取 {0} 张页面" #: ../src/PdfMod/Gui/Actions.cs:219 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "提取所选页面" msgstr[1] "提取所选中的 {0} 张页面" #: ../src/PdfMod/Gui/Actions.cs:229 ../src/PdfMod/Gui/Actions.cs:316 msgid "Select PDF" msgstr "选择 PDF 文件" #: ../src/PdfMod/Gui/Actions.cs:258 msgid "Unable to Save Document" msgstr "无法保存文档" #: ../src/PdfMod/Gui/Actions.cs:264 msgid "Save as..." msgstr "另存为..." #: ../src/PdfMod/Gui/Actions.cs:333 ../src/PdfMod/Gui/Client.cs:308 msgid "Error Loading Document" msgstr "载入文档时发生错误" #: ../src/PdfMod/Gui/Actions.cs:334 ../src/PdfMod/Gui/Client.cs:309 #, csharp-format msgid "There was an error loading {0}" msgstr "载入 {0} 时发生错误" #: ../src/PdfMod/Gui/Actions.cs:510 msgid "Error opening help" msgstr "打开帮助时发生错误" #: ../src/PdfMod/Gui/Actions.cs:511 msgid "Would you like to open PDF Mod's online documentation?" msgstr "您要打开 PDF 修改者的在线文档吗?" #: ../src/PdfMod/Gui/Actions.cs:532 msgid "Visit Website" msgstr "访问网站" #: ../src/PdfMod/Gui/Actions.cs:534 msgid "Primary Development:" msgstr "主要开发人员:" #: ../src/PdfMod/Gui/Actions.cs:537 msgid "Contributors:" msgstr "贡献者:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:555 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" "版权所有 {0} Novell Inc.\n" "版权所有 {1} 其它 PDF Mod 贡献者" #: ../src/PdfMod/Gui/Actions.cs:558 msgid "translator-credits" msgstr "" "GrayWaLL , 2010\n" "Aron Xu , 2010\n" "Dean Lee , 2010" #. Add it to the PDF document #: ../src/PdfMod/Gui/BookmarkView.cs:90 msgid "New bookmark" msgstr "新建书签" #: ../src/PdfMod/Gui/BookmarkView.cs:113 msgid "Add Bookmark" msgstr "添加书签" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/BookmarkView.cs:137 #, csharp-format msgid "Remove Bookmark" msgid_plural "Remove Bookmarks" msgstr[0] "移除书签" msgstr[1] "移除书签" #: ../src/PdfMod/Gui/BookmarkView.cs:285 ../src/PdfMod/Gui/BookmarkView.cs:323 msgid "Rename Bookmark" msgstr "重命名书签" #: ../src/PdfMod/Gui/BookmarkView.cs:417 #, csharp-format msgid "Bookmark links to page {0}" msgstr "将指向页面 {0} 的链接存为书签" #: ../src/PdfMod/Gui/Client.cs:86 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:207 msgid "Save the changes made to this document?" msgstr "保存对当前文档所作出的更改吗?" #: ../src/PdfMod/Gui/Client.cs:210 msgid "Close _Without Saving" msgstr "不保存而关闭(_W)" #: ../src/PdfMod/Gui/Client.cs:240 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "在新窗口中打开 {0} 份文档,继续吗?" msgstr[1] "在新窗口中打开所有 {0} 份文档,继续吗?" #: ../src/PdfMod/Gui/Client.cs:244 msgid "Open _First" msgstr "打开第一个(_F)" #: ../src/PdfMod/Gui/Client.cs:245 msgid "Open _All" msgstr "打开所有(_A)" #: ../src/PdfMod/Gui/Client.cs:276 msgid "Loading document..." msgstr "载入文档..." #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:338 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (原为 {1})" #: ../src/PdfMod/Gui/Client.cs:343 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} 张页面" msgstr[1] "{0} 张页面" #: ../src/PdfMod/Gui/Client.cs:364 msgid "Document is Encrypted" msgstr "文档已加密" #: ../src/PdfMod/Gui/Client.cs:365 msgid "Enter the document's password to open it:" msgstr "请输入该文档的密码:" #: ../src/PdfMod/Gui/Client.cs:395 msgid "PDF Documents" msgstr "PDF 文档" #: ../src/PdfMod/Gui/Client.cs:396 msgid "All Files" msgstr "所有文件" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "选择匹配" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "标题(_T):" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "作者(_A):" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "关键字(_K):" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "主题(_S):" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "恢复属性(_R)" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "恢复所有属性到原始值" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "关闭(_C)" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "隐藏文档的属性" pdfmod-0.9.1/po/it.po0000644000175000001440000002240211241070373014477 0ustar00gabeusers00000000000000# Italian translation of pdfmod. # Copyright (C) 2009 pdfmod's COPYRIGHT HOLDER # This file is distributed under the same license as the pdfmod package. # Gianni Lerro , 2009. # msgid "" msgstr "" "Project-Id-Version: pdfmod\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=pdfmod&component=general\n" "POT-Creation-Date: 2009-08-13 18:05+0000\n" "PO-Revision-Date: 2009-08-13 00:43+0100\n" "Last-Translator: Gianni Lerro \n" "Language-Team: Italian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "Editor di PDF" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Elimina, estrae e ruota le pagine nei documenti PDF" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Muovi {1}" msgstr[1] "Muovi {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "Errore cercando di ripristinare le pagine" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "Errore cercando di muovere le pagine" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Errore cercando di eliminare le pagine dal documento" #: ../src/PdfMod/Gui/Actions.cs:46 msgid "Open a document" msgstr "Apre un documento" #: ../src/PdfMod/Gui/Actions.cs:47 msgid "_Insert From..." msgstr "_Inserisci da..." #: ../src/PdfMod/Gui/Actions.cs:47 msgid "Insert pages from another document" msgstr "Inserisce pagine da un altro documento" #: ../src/PdfMod/Gui/Actions.cs:48 msgid "Save changes to this document, overwriting the existing file" msgstr "" "Salvare le modifiche a questo documento, sovrascrivendo il file esistente" #: ../src/PdfMod/Gui/Actions.cs:49 msgid "Save this document to a new file" msgstr "Salva questo documento in un nuovo file" #: ../src/PdfMod/Gui/Actions.cs:51 msgid "_File" msgstr "_File" #: ../src/PdfMod/Gui/Actions.cs:52 msgid "Recent _Files" msgstr "_File recenti" #: ../src/PdfMod/Gui/Actions.cs:56 msgid "Rotate Right" msgstr "Ruota in senso orario" #: ../src/PdfMod/Gui/Actions.cs:56 msgid "Rotate right" msgstr "Ruota in senso orario" #: ../src/PdfMod/Gui/Actions.cs:57 msgid "Rotate Left" msgstr "Ruota in senso antiorario" #: ../src/PdfMod/Gui/Actions.cs:57 msgid "Rotate left" msgstr "Ruota in senso antiorario" #: ../src/PdfMod/Gui/Actions.cs:58 msgid "Export Images" msgstr "Esporta immagini" #: ../src/PdfMod/Gui/Actions.cs:58 msgid "Save all images in this document to a new folder" msgstr "Salva tutte le immagini nel documento in una nuova cartella" #: ../src/PdfMod/Gui/Actions.cs:60 msgid "_Edit" msgstr "_Modifica" #: ../src/PdfMod/Gui/Actions.cs:62 msgid "Select Even Pages" msgstr "Seleziona le pagine pari" #: ../src/PdfMod/Gui/Actions.cs:63 msgid "Select Odd Pages" msgstr "Seleziona le pagine dispari" #: ../src/PdfMod/Gui/Actions.cs:64 msgid "Select Matching..." msgstr "Seleziona corrispondenze..." #: ../src/PdfMod/Gui/Actions.cs:68 msgid "_View" msgstr "_Visualizza" #: ../src/PdfMod/Gui/Actions.cs:72 msgid "_Help" msgstr "A_iuto" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Contents" msgstr "_Sommario" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Open in Viewer" msgstr "Apri nel visualizzatore" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Open in viewer" msgstr "Apre nel visualizzatore" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "View and edit the title, keywords, and more for this document" msgstr "" "Visualizza e modifica il titolo, le parole chiave e altro per questo " "documento" #: ../src/PdfMod/Gui/Actions.cs:84 msgid "Toolbar" msgstr "Barra degli strumenti" #: ../src/PdfMod/Gui/Actions.cs:155 msgid "_Undo" msgstr "_Annulla" #: ../src/PdfMod/Gui/Actions.cs:156 #, csharp-format msgid "Undo {0}" msgstr "Annulla {0}" #: ../src/PdfMod/Gui/Actions.cs:160 msgid "_Redo" msgstr "_Ripeti" #: ../src/PdfMod/Gui/Actions.cs:161 #, csharp-format msgid "Redo {0}" msgstr "Ripeti {0}" #: ../src/PdfMod/Gui/Actions.cs:169 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Elimina la pagina" msgstr[1] "Elimina {0} pagine" #: ../src/PdfMod/Gui/Actions.cs:172 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Elimina la pagina selezionata" msgstr[1] "Elimina le {0} pagine selezionate" #: ../src/PdfMod/Gui/Actions.cs:175 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Estrai la pagina" msgstr[1] "Estrai {0} pagine" #: ../src/PdfMod/Gui/Actions.cs:178 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Estrae la pagina selezionata" msgstr[1] "Estrae le {0} pagine selezionate" #: ../src/PdfMod/Gui/Actions.cs:186 ../src/PdfMod/Gui/Actions.cs:215 msgid "Select PDF" msgstr "Seleziona PDF" #: ../src/PdfMod/Gui/Actions.cs:187 msgid "PDF Documents" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:188 ../src/PdfMod/Gui/Actions.cs:217 #: ../src/PdfMod/Gui/Actions.cs:247 msgid "All Files" msgstr "Tutti i file" #: ../src/PdfMod/Gui/Actions.cs:241 msgid "Save as..." msgstr "Salva come..." #: ../src/PdfMod/Gui/Actions.cs:382 msgid "Error opening help" msgstr "Errore nel caricamento della guida" #: ../src/PdfMod/Gui/Actions.cs:383 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Aprire la documentazione in linea di PDF Mod?" #: ../src/PdfMod/Gui/Actions.cs:404 msgid "Visit Website" msgstr "Visita il sito web" #: ../src/PdfMod/Gui/Actions.cs:406 msgid "Primary Development:" msgstr "Sviluppo primario:" #: ../src/PdfMod/Gui/Actions.cs:409 msgid "Contributors:" msgstr "Collaboratori:" #: ../src/PdfMod/Gui/Actions.cs:422 msgid "translator-credits" msgstr "Gianni Lerro " #: ../src/PdfMod/Gui/Client.cs:64 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:171 msgid "Save the changes made to this document?" msgstr "Salvare le modifiche a questo documento?" #: ../src/PdfMod/Gui/Client.cs:174 msgid "Close _Without Saving" msgstr "Chiudi senza sal_vare" #: ../src/PdfMod/Gui/Client.cs:203 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Continuare aprendo {0} documento in una finestra separata?" msgstr[1] "Continuare aprendo tutti i {0} documenti in finestre separate?" #: ../src/PdfMod/Gui/Client.cs:207 msgid "Open _First" msgstr "Apri il _primo" #: ../src/PdfMod/Gui/Client.cs:208 msgid "Open _All" msgstr "Apri _tutti" #: ../src/PdfMod/Gui/Client.cs:236 msgid "Loading document..." msgstr "Caricamento del documento..." #: ../src/PdfMod/Gui/Client.cs:259 msgid "Error Loading Document" msgstr "Errore nel caricamento del documento" #: ../src/PdfMod/Gui/Client.cs:260 #, csharp-format msgid "There was an error loading {0}" msgstr "Si è verificato un errore durante il caricamento di {0}" #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:287 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (originariamente {1})" #: ../src/PdfMod/Gui/Client.cs:292 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} Pagina" msgstr[1] "{0} Pagine" #: ../src/PdfMod/Gui/Client.cs:308 msgid "Document is Encrypted" msgstr "Documento cifrato" #: ../src/PdfMod/Gui/Client.cs:309 msgid "Enter the document's password to open it:" msgstr "Inserire la password del documento per aprirlo:" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:26 msgid "Select Matching" msgstr "Seleziona corrispondenze" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:48 msgid "_Title:" msgstr "_Titolo:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:49 msgid "_Author:" msgstr "_Autore:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:50 msgid "_Keywords:" msgstr "_Parole chiave:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:51 msgid "_Subject:" msgstr "Oggetto:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:71 msgid "_Revert Properties" msgstr "_Ripristina proprietà" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:72 msgid "Change the document's properties back to the original values" msgstr "Ripristina le proprietà del documento ai valori originari" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:77 msgid "_Close" msgstr "_Chiudi" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:78 msgid "Hide the document's properties" msgstr "Nascondi le proprietà del documento" #~ msgid "Page {1}" #~ msgid_plural "Page {1}" #~ msgstr[0] "Pagina {1}" #~ msgstr[1] "Pagina {1}" #~ msgid "Pages {1} - {2}" #~ msgid_plural "Pages {1} - {2}" #~ msgstr[0] "Pagine {1} - {2}" #~ msgstr[1] "Pagine {1} - {2}" #~ msgid "Pages {1}" #~ msgid_plural "Pages {1}" #~ msgstr[0] "Pagine {1}" #~ msgstr[1] "Pagine {1}" #~ msgid "{0} Page" #~ msgid_plural "{0} Pages" #~ msgstr[0] "{0} pagina" #~ msgstr[1] "{0} pagine" #~ msgid "Page {0}" #~ msgstr "Pagina {0}" #~ msgid "Loading {0}" #~ msgstr "Caricamento di {0}" #~ msgid "{0} - Images for {1}" #~ msgstr "{0} - Immagini per {1}" #~ msgid "/Subtype" #~ msgstr "/Subtype" pdfmod-0.9.1/po/ta.po0000644000175000001440000002335311235371613014501 0ustar00gabeusers00000000000000# Tamil translation for PDF Mod, a PDF modifier # Copyright (C) 2009 # This file is distributed under the same license as the PDF Mod package. # # # Dr.T.Vasudevan , 2009. msgid "" msgstr "" "Project-Id-Version: 0.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-07-27 02:13+0200\n" "PO-Revision-Date: 2009-07-28 21:22+0530\n" "Last-Translator: Dr.T.Vasudevan \n" "Language-Team: Tamil \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: Lokalize 0.3\n" #: ../src/PdfMod/pdfmod.desktop.in.h:1 ../src/PdfMod/PdfMod/PdfMod.cs:62 msgid "PDF Mod" msgstr "பிடிஎஃப் மோட்" #: ../src/PdfMod/pdfmod.desktop.in.h:2 msgid "PDF Modifier" msgstr "பிடிஎஃப் திருத்தர்" #: ../src/PdfMod/pdfmod.desktop.in.h:3 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "பிடிஎஃப் ஆவணங்கள் இல் பக்கங்கள் ஐ நீக்கு, பிரி மற்றும் சுழற்று" #: ../src/PdfMod/PdfMod.Actions/ExportImagesAction.cs:85 msgid "/Subtype" msgstr "/துணை வகைகள்" #: ../src/PdfMod/PdfMod.Actions/MoveAction.cs:27 msgid "Error trying to unmove pages" msgstr "பக்கங்கள் ஐ நகர்வு நீக்கலில் பிழை" #: ../src/PdfMod/PdfMod.Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "பக்கங்கள் ஐ நகர்த்துகையில் பிழை" #: ../src/PdfMod/PdfMod.Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "ஆவணத்தில் பக்கங்கள் ஐ நீக்குதலில் பிழை" #: ../src/PdfMod/PdfMod/GlobalActions.cs:45 msgid "Open a document" msgstr "ஒரு ஆவணத்தை திற" #: ../src/PdfMod/PdfMod/GlobalActions.cs:46 msgid "Save changes to this document, overwriting the existing file" msgstr "இருப்பிலுள்ள கோப்பு ஐ மேலெழுதி இந்த ஆவணத்தில் மாற்றங்களை சேமி." #: ../src/PdfMod/PdfMod/GlobalActions.cs:47 msgid "Save this document to a new file" msgstr "இந்த ஆவணத்தை ஒரு புதிய கோப்பு ஆக சேமி." #: ../src/PdfMod/PdfMod/GlobalActions.cs:49 msgid "_File" msgstr "_F கோப்பு" #: ../src/PdfMod/PdfMod/GlobalActions.cs:50 msgid "Recent _Files" msgstr "_F சமீபத்திய ஆவணங்கள்" #: ../src/PdfMod/PdfMod/GlobalActions.cs:54 msgid "Rotate Right" msgstr "வலது பக்கம் சுழற்று" #: ../src/PdfMod/PdfMod/GlobalActions.cs:54 msgid "Rotate right" msgstr "வலது பக்கம் சுழற்று" #: ../src/PdfMod/PdfMod/GlobalActions.cs:55 msgid "Rotate Left" msgstr "இடது பக்கம் சுழற்று" #: ../src/PdfMod/PdfMod/GlobalActions.cs:55 msgid "Rotate left" msgstr "இடது பக்கம் சுழற்று" #: ../src/PdfMod/PdfMod/GlobalActions.cs:56 msgid "Export Images..." msgstr "பிம்பங்களை ஏற்றுமதி செய்க..." #: ../src/PdfMod/PdfMod/GlobalActions.cs:58 msgid "_Edit" msgstr "_E திருத்து" #: ../src/PdfMod/PdfMod/GlobalActions.cs:60 msgid "Select Even Pages" msgstr "இரட்டைப்படை பக்கங்கள் ஐ தேர்வுசெய்க " #: ../src/PdfMod/PdfMod/GlobalActions.cs:61 msgid "Select Odd Pages" msgstr "ஒற்றைப்படை பக்கங்கள் ஐ தேர்வுசெய்க" #: ../src/PdfMod/PdfMod/GlobalActions.cs:62 msgid "Select Matching..." msgstr "பொருந்துவதை தேர்வுசெய்க ..." #: ../src/PdfMod/PdfMod/GlobalActions.cs:66 msgid "_View" msgstr "_V காட்டுக" #: ../src/PdfMod/PdfMod/GlobalActions.cs:70 msgid "_Help" msgstr "_H உதவி" #: ../src/PdfMod/PdfMod/GlobalActions.cs:71 msgid "_Contents" msgstr "_C உள்ளடக்கங்கள்" #: ../src/PdfMod/PdfMod/GlobalActions.cs:78 msgid "View and edit the title, keywords, and more for this document" msgstr "இந்த ஆவணத்தை பார்; தலைப்பு, விசைச்சொல் ஆகியவற்றை திருத்து, மேலும் பலதும் செய்" #: ../src/PdfMod/PdfMod/GlobalActions.cs:152 #, csharp-format msgid "Remove Page " msgid_plural "Remove {0} Pages" msgstr[0] "பக்கம் நீக்கு" msgstr[1] "{0} பக்கங்கள் நீக்கு" #: ../src/PdfMod/PdfMod/GlobalActions.cs:155 #, csharp-format msgid "Remove the selected Page " msgid_plural "Remove the {0} selected pages" msgstr[0] "தேர்வுசெய்த பக்கத்தை நீக்கு" msgstr[1] "தேர்வுசெய்த {0} பக்கங்கள் ஐ நீக்கு" #: ../src/PdfMod/PdfMod/GlobalActions.cs:158 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "பக்கத்தை பிரி" msgstr[1] "{0} பக்கங்கள் ஐ பிரி" #: ../src/PdfMod/PdfMod/GlobalActions.cs:161 #, csharp-format msgid "Extract the selected Page " msgid_plural "Extract the {0} selected pages" msgstr[0] "தேர்வு செய்த பக்கத்தை பிரி" msgstr[1] "தேர்வு செய்த {0} பக்கங்கள் ஐ பிரி" #: ../src/PdfMod/PdfMod/GlobalActions.cs:169 msgid "Select PDF" msgstr "பிடிஎஃப் ஐ தேர்வுசெய்க" #: ../src/PdfMod/PdfMod/GlobalActions.cs:171 #: ../src/PdfMod/PdfMod/GlobalActions.cs:199 msgid "All Files" msgstr "எல்லா ஆவணங்கள்" #: ../src/PdfMod/PdfMod/GlobalActions.cs:194 msgid "Save as..." msgstr "இப்படி சேமி ..." #. Translators: {0} is the number of pages (always 1), and {1} is the page number, eg Page 1, or Page 5 #: ../src/PdfMod/PdfMod/GlobalActions.cs:258 #, csharp-format msgid "Page {1}" msgid_plural "Page {1}" msgstr[0] "பக்கம் {1}" msgstr[1] "பக்கம் {1}" #. Translators: {0} is the number of pages, and {1} is the first page, {2} is the last page, #. eg Pages 3 - 7 #: ../src/PdfMod/PdfMod/GlobalActions.cs:262 #, csharp-format msgid "Pages {1} - {2}" msgid_plural "Pages {1} - {2}" msgstr[0] "பக்கங்கள் {1} - {2}" msgstr[1] "பக்கங்கள் {1} - {2}" #. Translators: {0} is the number of pages, {1} is a comma separated list of page numbers, eg Pages 1, 4, 9 #: ../src/PdfMod/PdfMod/GlobalActions.cs:267 #, csharp-format msgid "Pages {1}" msgid_plural "Pages {1}" msgstr[0] "பக்கங்கள் {1}" msgstr[1] "பக்கங்கள் {1}" #. Translators: {0} is the number of pages, eg 12 Pages #: ../src/PdfMod/PdfMod/GlobalActions.cs:270 msgid "{0} Page" msgid_plural "{0} Pages" msgstr[0] "{0} பக்கம்" msgstr[1] "{1} பக்கங்கள்" #. Translators: This is used for creating a folder name, be careful! #: ../src/PdfMod/PdfMod/GlobalActions.cs:287 #, csharp-format msgid "{0} - Images for {1}" msgstr "{0} - பிம்பங்கள் {1} க்கு" #: ../src/PdfMod/PdfMod/GlobalActions.cs:354 msgid "Error opening help" msgstr "உதவி திறப்பதில் பிழை " #: ../src/PdfMod/PdfMod/GlobalActions.cs:355 msgid "Would you like to open PDF Mod's online documentation?" msgstr "பிடிஎஃப் மோட் இன் வலை ஆவணத்தை திறக்க விருப்பமா?" #: ../src/PdfMod/PdfMod/GlobalActions.cs:376 msgid "Visit Website" msgstr "வலைப்பக்கத்துக்கு விஜயம் செய்க" #: ../src/PdfMod/PdfMod/PdfListStore.cs:55 #: ../src/PdfMod/PdfMod/PdfListStore.cs:63 #, csharp-format msgid "பக்கம் {0}" msgstr "பக்கம் {0}" #: ../src/PdfMod/PdfMod/PdfMod.cs:149 msgid "Save the changes made to this document?" msgstr "ஆவணத்தில் மாற்றங்களை சேமிக்கவா?" #: ../src/PdfMod/PdfMod/PdfMod.cs:152 msgid "Close _Without Saving" msgstr "_W சேமிக்காமல் மூடுக" #: ../src/PdfMod/PdfMod/PdfMod.cs:182 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "தொடர்ந்து, ஆவணம் {0} ஐ தனி சாளரத்தில் திறக்கவா?" msgstr[1] "தொடர்ந்து, அனைத்து {0} ஆவணங்கள் ஐயும் தனி சாளரங்களில் திறக்கவா?" #: ../src/PdfMod/PdfMod/PdfMod.cs:186 msgid "Open _First" msgstr "_F முதலாவதை திற" #: ../src/PdfMod/PdfMod/PdfMod.cs:187 msgid "Open _All" msgstr "_A அனைத்தையும் திற" #: ../src/PdfMod/PdfMod/PdfMod.cs:216 #, csharp-format msgid "Loading {0}" msgstr "{0} ஐ ஏற்றுகிறது" #: ../src/PdfMod/PdfMod/PdfMod.cs:236 msgid "Error Loading Document" msgstr "ஆவணத்தை ஏற்றுவதில் பிழை" #: ../src/PdfMod/PdfMod/PdfMod.cs:237 #, csharp-format msgid "There was an error loading {0}" msgstr "{0} ஐ ஏற்றுவதில் பிழை" #: ../src/PdfMod/PdfMod/PdfMod.cs:254 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (முன்னே {1})" #: ../src/PdfMod/PdfMod/QueryBox.cs:26 msgid "Select Matching" msgstr "பொருந்துவதை தேர்வுசெய்க" pdfmod-0.9.1/po/nl.po0000644000175000001440000002240111375021272014475 0ustar00gabeusers00000000000000# Dutch translation for Pdfmod # # This file is distributed under the same license as the pdfmod package. # # Wouter Bolsterlee , 2010 # msgid "" msgstr "" "Project-Id-Version: pdfmod\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-05-17 22:11+0200\n" "PO-Revision-Date: 2010-05-17 22:12+0200\n" "Last-Translator: Wouter Bolsterlee \n" "Language-Team: Dutch \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "PDF Modifier" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Pagina's in PDF-documenten verwijderen, loshalen en roteren" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "{1} verplaatsen" msgstr[1] "{1} verplaatsen" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "Fout bij terugplaatsen van pagina's" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "Fout bij verplaatsen van pagina's" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Fout bij verwijderen van pagina's uit het document" #: ../src/PdfMod/Pdf/Page.cs:36 #, csharp-format msgid "Page {0}" msgstr "Pagina {0}" #: ../src/PdfMod/Gui/Actions.cs:63 msgid "Open a document" msgstr "Document openen" #: ../src/PdfMod/Gui/Actions.cs:64 msgid "_Insert From..." msgstr "_Invoegen vanuit…" #: ../src/PdfMod/Gui/Actions.cs:64 msgid "Insert pages from another document" msgstr "Pagina's vanuit een ander document invoegen" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "Save changes to this document, overwriting the existing file" msgstr "Wijzigingen in dit document opslaan door het bestaande bestand te overschrijven" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Save this document to a new file" msgstr "Dit document als een nieuw bestand opslaan" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "_File" msgstr "_Bestand" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "Recente _bestanden" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "Rotate Right" msgstr "Naar rechts draaien" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "Rotate right" msgstr "Naar rechts draaien" #: ../src/PdfMod/Gui/Actions.cs:74 msgid "Rotate Left" msgstr "Naar links draaien" #: ../src/PdfMod/Gui/Actions.cs:74 msgid "Rotate left" msgstr "Naar links draaien" #: ../src/PdfMod/Gui/Actions.cs:75 msgid "Export Images" msgstr "Afbeeldingen exporteren" #: ../src/PdfMod/Gui/Actions.cs:75 msgid "Save all images in this document to a new folder" msgstr "Alle afbeeldingen in dit document in een nieuwe map opslaan" #: ../src/PdfMod/Gui/Actions.cs:77 msgid "_Edit" msgstr "Be_werken" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Select Even Pages" msgstr "Even pagina's selecteren" #: ../src/PdfMod/Gui/Actions.cs:80 msgid "Select Odd Pages" msgstr "Oneven pagina's selecteren" # Hmmm… is dit zinnig? (Komt twee keer voor!) — Wouter Bolsterlee #: ../src/PdfMod/Gui/Actions.cs:81 msgid "Select Matching..." msgstr "Selecteren…" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "_Invert Selection" msgstr "Selectie _omkeren" #: ../src/PdfMod/Gui/Actions.cs:86 msgid "_View" msgstr "Beel_d" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "_Help" msgstr "_Hulp" #: ../src/PdfMod/Gui/Actions.cs:91 msgid "_Contents" msgstr "I_nhoud" #: ../src/PdfMod/Gui/Actions.cs:96 msgid "Open in Viewer" msgstr "In viewer openen" #: ../src/PdfMod/Gui/Actions.cs:96 msgid "Open in viewer" msgstr "In viewer openen" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "View and edit the title, keywords, and more for this document" msgstr "De titel, sleutelwoorden en andere eigenschappen van dit document bekijken en wijzigen" #: ../src/PdfMod/Gui/Actions.cs:102 msgid "Toolbar" msgstr "Werkbalk" #: ../src/PdfMod/Gui/Actions.cs:103 msgid "Fullscreen" msgstr "Volledig scherm" #: ../src/PdfMod/Gui/Actions.cs:172 msgid "_Undo" msgstr "_Ongedaan maken" #: ../src/PdfMod/Gui/Actions.cs:173 #, csharp-format msgid "Undo {0}" msgstr "{0} ongedaan maken" #: ../src/PdfMod/Gui/Actions.cs:177 msgid "_Redo" msgstr "Op_nieuw" #: ../src/PdfMod/Gui/Actions.cs:178 #, csharp-format msgid "Redo {0}" msgstr "Opnieuw {0}" #: ../src/PdfMod/Gui/Actions.cs:186 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Pagina verwijderen" msgstr[1] "{0} Pagina's verwijderen" #: ../src/PdfMod/Gui/Actions.cs:189 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "De geselecteerde pagina verwijderen" msgstr[1] "De {0} geselecteerde pagina's verwijderen" #: ../src/PdfMod/Gui/Actions.cs:192 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Pagina loshalen" msgstr[1] "{0} pagina's loshalen" #: ../src/PdfMod/Gui/Actions.cs:195 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "De geselecteerde pagina loshalen" msgstr[1] "De {0} geselecteerde pagina's loshalen" #: ../src/PdfMod/Gui/Actions.cs:203 ../src/PdfMod/Gui/Actions.cs:244 msgid "Select PDF" msgstr "PDF selecteren" #: ../src/PdfMod/Gui/Actions.cs:261 ../src/PdfMod/Gui/Client.cs:289 msgid "Error Loading Document" msgstr "Fout bij laden van document" #: ../src/PdfMod/Gui/Actions.cs:262 ../src/PdfMod/Gui/Client.cs:290 #, csharp-format msgid "There was an error loading {0}" msgstr "Er is een fout opgetreden bij het laden van {0}" #: ../src/PdfMod/Gui/Actions.cs:276 msgid "Save as..." msgstr "Opslaan als…" #: ../src/PdfMod/Gui/Actions.cs:413 msgid "Error opening help" msgstr "Fout bij openen van hulp" #: ../src/PdfMod/Gui/Actions.cs:414 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Wilt u de online documentatie voor PDF Mod openen?" #: ../src/PdfMod/Gui/Actions.cs:435 msgid "Visit Website" msgstr "Website bezoeken" #: ../src/PdfMod/Gui/Actions.cs:437 msgid "Primary Development:" msgstr "Hoofdontwikkeling:" #: ../src/PdfMod/Gui/Actions.cs:440 msgid "Contributors:" msgstr "Bijdragen van:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:458 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" #: ../src/PdfMod/Gui/Actions.cs:461 msgid "translator-credits" msgstr "Wouter Bolsterlee" #: ../src/PdfMod/Gui/Client.cs:85 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:190 msgid "Save the changes made to this document?" msgstr "De wijzigingen aan dit document opslaan?" #: ../src/PdfMod/Gui/Client.cs:193 msgid "Close _Without Saving" msgstr "Sluiten _zonder opslaan" #: ../src/PdfMod/Gui/Client.cs:223 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Doorgaan met openen van {0} document in aparte vensters" msgstr[1] "Doorgaan met openen van {0} documenten in aparte vensters" #: ../src/PdfMod/Gui/Client.cs:227 msgid "Open _First" msgstr "_Eerste openen" #: ../src/PdfMod/Gui/Client.cs:228 msgid "Open _All" msgstr "_Alle openen" #: ../src/PdfMod/Gui/Client.cs:259 msgid "Loading document..." msgstr "Document laden…" #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:315 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (oorspronkelijk {1})" #: ../src/PdfMod/Gui/Client.cs:320 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} pagina" msgstr[1] "{0} pagina's" #: ../src/PdfMod/Gui/Client.cs:343 msgid "Document is Encrypted" msgstr "Document is versleuteld" #: ../src/PdfMod/Gui/Client.cs:344 msgid "Enter the document's password to open it:" msgstr "Geef het wachtwoord om dit documents te openen:" #: ../src/PdfMod/Gui/Client.cs:377 msgid "PDF Documents" msgstr "PDF-documenten" #: ../src/PdfMod/Gui/Client.cs:378 msgid "All Files" msgstr "Alle bestanden" # Hmmm… is dit zinnig? (Komt twee keer voor!) — Wouter Bolsterlee #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "Selecteren" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "_Titel:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "_Auteur:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "_Sleutelwoorden:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "_Onderwerp:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "Eigenschappen _terugzetten" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "De documenteigenschappen terugzetten naar de oorspronkelijke waardes" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "Sl_uiten" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "De documenteigenschappen verbergen" pdfmod-0.9.1/po/ru.po0000644000175000001440000002306411274372763014534 0ustar00gabeusers00000000000000# translation of Pdflmod into Russian # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: pdfmod 0.5\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-08-10 14:29+0400\n" "PO-Revision-Date: 2009-08-10 17:00+0400\n" "Last-Translator: Alexandre Prokoudine \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" "10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: ../data/pdfmod.desktop.in.h:1 msgid "PDF Modifier" msgstr "" #: ../data/pdfmod.desktop.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/PdfMod.Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "" msgstr[1] "" msgstr[2] "" #: ../src/PdfMod/PdfMod.Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "" #: ../src/PdfMod/PdfMod.Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "" #: ../src/PdfMod/PdfMod.Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:45 msgid "Open a document" msgstr "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:46 msgid "_Insert From..." msgstr "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:46 msgid "Insert pages from another document" msgstr "Вставить страницы из другого документа" #: ../src/PdfMod/PdfMod/GlobalActions.cs:47 msgid "Save changes to this document, overwriting the existing file" msgstr "Сохранить изменения в документе, перезаписав существующий файл" #: ../src/PdfMod/PdfMod/GlobalActions.cs:48 msgid "Save this document to a new file" msgstr "Сохранить этот документ в новый файл" #: ../src/PdfMod/PdfMod/GlobalActions.cs:50 msgid "_File" msgstr "_Файл" #: ../src/PdfMod/PdfMod/GlobalActions.cs:51 msgid "Recent _Files" msgstr "_Недавние файлы" #: ../src/PdfMod/PdfMod/GlobalActions.cs:55 msgid "Rotate Right" msgstr "Повернуть вправо" #: ../src/PdfMod/PdfMod/GlobalActions.cs:55 msgid "Rotate right" msgstr "Повернуть вправо" #: ../src/PdfMod/PdfMod/GlobalActions.cs:56 msgid "Rotate Left" msgstr "Повернуть влево" #: ../src/PdfMod/PdfMod/GlobalActions.cs:56 msgid "Rotate left" msgstr "Повернуть влево" #: ../src/PdfMod/PdfMod/GlobalActions.cs:57 msgid "Export Images" msgstr "Экспортировать изображения" #: ../src/PdfMod/PdfMod/GlobalActions.cs:57 msgid "Save all images in this document to a new folder" msgstr "Сохранить все изображения этого документа в новую папку" #: ../src/PdfMod/PdfMod/GlobalActions.cs:59 msgid "_Edit" msgstr "_Правка" #: ../src/PdfMod/PdfMod/GlobalActions.cs:61 msgid "Select Even Pages" msgstr "Выбрать четные страницы" #: ../src/PdfMod/PdfMod/GlobalActions.cs:62 msgid "Select Odd Pages" msgstr "Выбрать нечетные страницы" #: ../src/PdfMod/PdfMod/GlobalActions.cs:63 msgid "Select Matching..." msgstr "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:67 msgid "_View" msgstr "_Вид" #: ../src/PdfMod/PdfMod/GlobalActions.cs:71 msgid "_Help" msgstr "_Справка" #: ../src/PdfMod/PdfMod/GlobalActions.cs:72 msgid "_Contents" msgstr "_Содержание" #: ../src/PdfMod/PdfMod/GlobalActions.cs:79 msgid "View and edit the title, keywords, and more for this document" msgstr "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:81 msgid "Toolbar" msgstr "Панель инструментов" #: ../src/PdfMod/PdfMod/GlobalActions.cs:152 msgid "_Undo" msgstr "_Отменить" #: ../src/PdfMod/PdfMod/GlobalActions.cs:153 #, csharp-format msgid "Undo {0}" msgstr "Отменить {0}" #: ../src/PdfMod/PdfMod/GlobalActions.cs:157 msgid "_Redo" msgstr "Ве_рнуть" #: ../src/PdfMod/PdfMod/GlobalActions.cs:158 #, csharp-format msgid "Redo {0}" msgstr "Вернуть {0}" #: ../src/PdfMod/PdfMod/GlobalActions.cs:166 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Удалить {0} страницу" msgstr[1] "Удалить {0} страницы" msgstr[2] "Удалить {0} страниц" #: ../src/PdfMod/PdfMod/GlobalActions.cs:169 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Удалить {0} выбранную страницу" msgstr[1] "Удалить {0} выбранных страницы" msgstr[2] "Удалить {0} выбранных страниц" #: ../src/PdfMod/PdfMod/GlobalActions.cs:172 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "" msgstr[1] "" msgstr[2] "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:175 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "" msgstr[1] "" msgstr[2] "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:183 #: ../src/PdfMod/PdfMod/GlobalActions.cs:202 msgid "Select PDF" msgstr "Выберите PDF" #: ../src/PdfMod/PdfMod/GlobalActions.cs:185 #: ../src/PdfMod/PdfMod/GlobalActions.cs:204 #: ../src/PdfMod/PdfMod/GlobalActions.cs:233 msgid "All Files" msgstr "Все файлы" #: ../src/PdfMod/PdfMod/GlobalActions.cs:227 msgid "Save as..." msgstr "Сохранить как..." #. Translators: {0} is the number of pages (always 1), and {1} is the page number, eg Page 1, or Page 5 #: ../src/PdfMod/PdfMod/GlobalActions.cs:292 #, csharp-format msgid "Page {1}" msgid_plural "Page {1}" msgstr[0] "" msgstr[1] "" msgstr[2] "" #. Translators: {0} is the number of pages, and {1} is the first page, {2} is the last page, #. eg Pages 3 - 7 #: ../src/PdfMod/PdfMod/GlobalActions.cs:296 #, csharp-format msgid "Pages {1} - {2}" msgid_plural "Pages {1} - {2}" msgstr[0] "" msgstr[1] "" msgstr[2] "" #. Translators: {0} is the number of pages, {1} is a comma separated list of page numbers, eg Pages 1, 4, 9 #: ../src/PdfMod/PdfMod/GlobalActions.cs:301 #, csharp-format msgid "Pages {1}" msgid_plural "Pages {1}" msgstr[0] "" msgstr[1] "" msgstr[2] "" #. Translators: {0} is the number of pages, eg 12 Pages #: ../src/PdfMod/PdfMod/GlobalActions.cs:304 #, csharp-format msgid "{0} Page" msgid_plural "{0} Pages" msgstr[0] "" msgstr[1] "" msgstr[2] "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:392 msgid "Error opening help" msgstr "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:393 msgid "Would you like to open PDF Mod's online documentation?" msgstr "" #: ../src/PdfMod/PdfMod/GlobalActions.cs:414 msgid "Visit Website" msgstr "Посетить сайт проекта" #: ../src/PdfMod/PdfMod/GlobalActions.cs:430 msgid "translator-credits" msgstr "Александр Прокудин , 2009" #: ../src/PdfMod/PdfMod/PdfMod.cs:68 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/PdfMod/PdfMod.cs:162 msgid "Save the changes made to this document?" msgstr "" #: ../src/PdfMod/PdfMod/PdfMod.cs:165 msgid "Close _Without Saving" msgstr "" #: ../src/PdfMod/PdfMod/PdfMod.cs:198 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "" msgstr[1] "" msgstr[2] "" #: ../src/PdfMod/PdfMod/PdfMod.cs:202 msgid "Open _First" msgstr "" #: ../src/PdfMod/PdfMod/PdfMod.cs:203 msgid "Open _All" msgstr "" #: ../src/PdfMod/PdfMod/PdfMod.cs:236 msgid "Loading document..." msgstr "Загружается документ..." #: ../src/PdfMod/PdfMod/PdfMod.cs:263 msgid "Error Loading Document" msgstr "Ошибка при загрузке документа" #: ../src/PdfMod/PdfMod/PdfMod.cs:264 #, csharp-format msgid "There was an error loading {0}" msgstr "При загрузке {0} возникла ошибка" #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/PdfMod/PdfMod.cs:291 #, csharp-format msgid "{0} (originally {1})" msgstr "" #: ../src/PdfMod/PdfMod/PdfMod.cs:296 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "" msgstr[1] "" msgstr[2] "" #: ../src/PdfMod/PdfMod/PdfMod.cs:312 msgid "Document is Encrypted" msgstr "Документ зашифрован" #: ../src/PdfMod/PdfMod/PdfMod.cs:313 msgid "Enter the document's password to open it:" msgstr "Введите пароль для открытия документа:" #: ../src/PdfMod/PdfMod/QueryBox.cs:26 msgid "Select Matching" msgstr "" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:46 msgid "_Title:" msgstr "_Название:" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:47 msgid "_Author:" msgstr "_Автор:" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:48 msgid "_Keywords:" msgstr "_Ключевые слова:" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:49 msgid "_Subject:" msgstr "_Тема:" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:69 msgid "_Revert Properties" msgstr "" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:70 msgid "Change the document's properties back to the original values" msgstr "" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:75 msgid "_Close" msgstr "_Закрыть" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:76 msgid "Hide the document's properties" msgstr "Скрыть свойства документа" pdfmod-0.9.1/po/hu.po0000644000175000001440000002725111511422704014505 0ustar00gabeusers00000000000000# Hungarian translation for pdfmod. # Copyright (C) 2010. Free Software Foundation, Inc. # This file is distributed under the same license as the pdfmod package. # # György Balló , 2010. # Gabor Kelemen , 2010. msgid "" msgstr "" "Project-Id-Version: pdfmod master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-11-14 15:34+0100\n" "PO-Revision-Date: 2010-11-14 15:33+0100\n" "Last-Translator: Gabor Kelemen \n" "Language-Team: Hungarian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: KBabel 1.11.4\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "PDF-módosító" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Oldalak eltávolítása, kibontása és forgatása PDF dokumentumokban" #: ../src/PdfMod/Pdf/Actions/ExportImagesAction.cs:136 #: ../src/PdfMod/Pdf/Page.cs:36 #, csharp-format msgid "Page {0}" msgstr "{0}. oldal" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "{1} áthelyezése" msgstr[1] "{1} áthelyezése" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "Hiba az oldalak visszahelyezésekor" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "Hiba az oldalak áthelyezésekor" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Hiba az oldalak dokumentumból történő eltávolításakor" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "_File" msgstr "_Fájl" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Open a document" msgstr "Dokumentum megnyitása" #: ../src/PdfMod/Gui/Actions.cs:67 msgid "Save changes to this document, overwriting the existing file" msgstr "Módosítások mentése ebbe a dokumentumba, felülírva a meglévő fájlt" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "Save this document to a new file" msgstr "Dokumentum mentése új fájlba" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "_Legutóbbi fájlok" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "_Insert From..." msgstr "Be_szúrás…" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "Insert pages from another document" msgstr "Oldalak beszúrása másik dokumentumból" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Edit" msgstr "S_zerkesztés" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate Left" msgstr "Forgatás balra" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate left" msgstr "Forgatás balra" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate Right" msgstr "Forgatás jobbra" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate right" msgstr "Forgatás jobbra" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "Select Odd Pages" msgstr "Páratlan oldalak kijelölése" #: ../src/PdfMod/Gui/Actions.cs:83 msgid "Select Even Pages" msgstr "Páros oldalak kijelölése" #: ../src/PdfMod/Gui/Actions.cs:84 msgid "Select Matching..." msgstr "Találatok kijelölése…" #: ../src/PdfMod/Gui/Actions.cs:85 msgid "_Invert Selection" msgstr "_Kijelölés megfordítása" #: ../src/PdfMod/Gui/Actions.cs:87 msgid "_View" msgstr "_Nézet" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in Viewer" msgstr "Megnyitás megjelenítőben" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in viewer" msgstr "Megnyitás megjelenítőben" #: ../src/PdfMod/Gui/Actions.cs:92 ../src/PdfMod/Gui/BookmarkView.cs:346 msgid "_Bookmarks" msgstr "_Könyvjelzők" #: ../src/PdfMod/Gui/Actions.cs:93 msgid "_Add Bookmark" msgstr "Könyvjelző _hozzáadása" #: ../src/PdfMod/Gui/Actions.cs:94 msgid "Re_name Bookmark" msgstr "Könyvjelző á_tnevezése" #: ../src/PdfMod/Gui/Actions.cs:95 msgid "_Change Bookmark Destination" msgstr "Könyvjelző helyének _módosítása" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/Actions.cs:96 ../src/PdfMod/Gui/BookmarkView.cs:383 #, csharp-format msgid "_Remove Bookmark" msgid_plural "_Remove Bookmarks" msgstr[0] "Könyvjelző _eltávolítása" msgstr[1] "Könyvjelzők _eltávolítása" #: ../src/PdfMod/Gui/Actions.cs:97 msgid "_Edit Bookmarks" msgstr "Könyvjelzők _szerkesztése" #: ../src/PdfMod/Gui/Actions.cs:99 msgid "_Help" msgstr "_Súgó" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "_Contents" msgstr "_Tartalom" #: ../src/PdfMod/Gui/Actions.cs:107 msgid "_Add" msgstr "_Hozzáadás" #: ../src/PdfMod/Gui/Actions.cs:108 msgid "_Remove" msgstr "_Eltávolítás" #: ../src/PdfMod/Gui/Actions.cs:111 msgid "View and edit the title, keywords, and more for this document" msgstr "" "A dokumentum címének, kulcsszavainak és további jellemzőinek megtekintése és " "szerkesztése" #: ../src/PdfMod/Gui/Actions.cs:113 msgid "Toolbar" msgstr "Eszköztár" #: ../src/PdfMod/Gui/Actions.cs:114 msgid "Bookmarks" msgstr "Könyvjelzők" #: ../src/PdfMod/Gui/Actions.cs:115 msgid "Fullscreen" msgstr "Teljes képernyő" #: ../src/PdfMod/Gui/Actions.cs:186 #, csharp-format msgid "Export Image" msgid_plural "Export {0} Images" msgstr[0] "Kép exportálása" msgstr[1] "{0} kép exportálása" #: ../src/PdfMod/Gui/Actions.cs:189 #, csharp-format msgid "Save image from the selected pages to a new folder" msgid_plural "Save {0} images from the selected pages to a new folder" msgstr[0] "Kép mentése a kijelölt oldalakról egy új könyvtárba" msgstr[1] "{0} kép mentése a kijelölt oldalakról egy új könyvtárba" #: ../src/PdfMod/Gui/Actions.cs:196 msgid "_Undo" msgstr "_Visszavonás" #: ../src/PdfMod/Gui/Actions.cs:197 #, csharp-format msgid "Undo {0}" msgstr "Visszavonás: {0}" #: ../src/PdfMod/Gui/Actions.cs:201 msgid "_Redo" msgstr "Új_ra" #: ../src/PdfMod/Gui/Actions.cs:202 #, csharp-format msgid "Redo {0}" msgstr "Mégis: {0}" #: ../src/PdfMod/Gui/Actions.cs:210 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Oldal eltávolítása" msgstr[1] "{0} oldal eltávolítása" #: ../src/PdfMod/Gui/Actions.cs:213 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "A kijelölt oldal eltávolítása" msgstr[1] "A kijelölt {0} oldal eltávolítása" #: ../src/PdfMod/Gui/Actions.cs:216 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Oldal kiemelése" msgstr[1] "{0} oldal kiemelése" #: ../src/PdfMod/Gui/Actions.cs:219 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "A kijelölt oldal kiemelése" msgstr[1] "A kijelölt {0} oldal kiemelése" #: ../src/PdfMod/Gui/Actions.cs:229 ../src/PdfMod/Gui/Actions.cs:316 msgid "Select PDF" msgstr "Válasszon PDF-et" #: ../src/PdfMod/Gui/Actions.cs:258 msgid "Unable to Save Document" msgstr "A dokumentum nem menthető" #: ../src/PdfMod/Gui/Actions.cs:264 msgid "Save as..." msgstr "Mentés másként…" #: ../src/PdfMod/Gui/Actions.cs:333 ../src/PdfMod/Gui/Client.cs:308 msgid "Error Loading Document" msgstr "Hiba a dokumentum betöltésekor" #: ../src/PdfMod/Gui/Actions.cs:334 ../src/PdfMod/Gui/Client.cs:309 #, csharp-format msgid "There was an error loading {0}" msgstr "Hiba történt a(z) {0} betöltésekor" #: ../src/PdfMod/Gui/Actions.cs:510 msgid "Error opening help" msgstr "Hiba a súgó megnyitásakor" #: ../src/PdfMod/Gui/Actions.cs:511 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Meg szeretné nyitni a PDF Mod online dokumentációját?" #: ../src/PdfMod/Gui/Actions.cs:532 msgid "Visit Website" msgstr "Honlap felkeresése" #: ../src/PdfMod/Gui/Actions.cs:534 msgid "Primary Development:" msgstr "Elsődleges fejlesztő:" #: ../src/PdfMod/Gui/Actions.cs:537 msgid "Contributors:" msgstr "Közreműködők:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:555 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" "Copyright {0} Novell Inc.\n" "Copyright {1} A PDF Mod további közreműködői" #: ../src/PdfMod/Gui/Actions.cs:558 msgid "translator-credits" msgstr "Balló György " #. Add it to the PDF document #: ../src/PdfMod/Gui/BookmarkView.cs:90 msgid "New bookmark" msgstr "Új könyvjelző" #: ../src/PdfMod/Gui/BookmarkView.cs:113 msgid "Add Bookmark" msgstr "Hozzáadás a könyvjelzőkhöz" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/BookmarkView.cs:137 #, csharp-format msgid "Remove Bookmark" msgid_plural "Remove Bookmarks" msgstr[0] "Könyvjelző eltávolítása" msgstr[1] "Könyvjelzők eltávolítása" #: ../src/PdfMod/Gui/BookmarkView.cs:285 ../src/PdfMod/Gui/BookmarkView.cs:323 msgid "Rename Bookmark" msgstr "Könyvjelző átnevezése" #: ../src/PdfMod/Gui/BookmarkView.cs:417 #, csharp-format msgid "Bookmark links to page {0}" msgstr "A könyvjelző a(z) {0}. oldalra hivatkozik" #: ../src/PdfMod/Gui/Client.cs:86 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:207 msgid "Save the changes made to this document?" msgstr "Menti a dokumentum módosításait?" #: ../src/PdfMod/Gui/Client.cs:210 msgid "Close _Without Saving" msgstr "Bezárás mentés _nélkül" #: ../src/PdfMod/Gui/Client.cs:240 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "{0} dokumentum fog megnyílni külön ablakban. Folytatja?" msgstr[1] "" "Mind a(z) {0} dokumentum meg fog nyílni külön ablakokban. Folytatja?" #: ../src/PdfMod/Gui/Client.cs:244 msgid "Open _First" msgstr "_Első megnyitása" #: ../src/PdfMod/Gui/Client.cs:245 msgid "Open _All" msgstr "Az ö_sszes megnyitása" #: ../src/PdfMod/Gui/Client.cs:276 msgid "Loading document..." msgstr "Dokumentum betöltése…" #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:338 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (eredetileg {1})" #: ../src/PdfMod/Gui/Client.cs:343 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} oldal" msgstr[1] "{0} oldal" #: ../src/PdfMod/Gui/Client.cs:364 msgid "Document is Encrypted" msgstr "A dokumentum titkosított" #: ../src/PdfMod/Gui/Client.cs:365 msgid "Enter the document's password to open it:" msgstr "A megnyitáshoz adja meg a dokumentum jelszavát:" #: ../src/PdfMod/Gui/Client.cs:395 msgid "PDF Documents" msgstr "PDF-dokumentumok" #: ../src/PdfMod/Gui/Client.cs:396 msgid "All Files" msgstr "Minden fájl" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "Találatok kijelölése" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "_Cím:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "_Szerző:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "_Kulcsszavak:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "_Tárgy:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "Tulajdonságok _visszaállítása" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "A dokumentum tulajdonságainak visszaállítása az eredeti értékekre" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "_Bezárás" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "A dokumentum tulajdonságainak elrejtése" pdfmod-0.9.1/po/pt.po0000644000175000001440000002112611251747444014523 0ustar00gabeusers00000000000000# pdfmod's Portuguese translation. # Copyright © 2007 pdfmod # This file is distributed under the same license as the beagle package. # # Filipe Gomes , 2007, 2009. # msgid "" msgstr "" "Project-Id-Version: beagle\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-09-06 16:36+0100\n" "PO-Revision-Date: 2009-09-04 15:25+0100\n" "Last-Translator: Filipe Gomes \n" "Language-Team: Portuguese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "Modificador PDF" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Remover, extrair, e rodar páginas em documentos PDF" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Mover {1}" msgstr[1] "Mover {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "Erro ao tentar des-mover páginas" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "Erro ao tentar mover páginas" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Erro ao tentar remover páginas do documento" #: ../src/PdfMod/Gui/Actions.cs:46 msgid "Open a document" msgstr "Abrir um documento" #: ../src/PdfMod/Gui/Actions.cs:47 msgid "_Insert From..." msgstr "_Inserir De..." #: ../src/PdfMod/Gui/Actions.cs:47 msgid "Insert pages from another document" msgstr "Inserir páginas de outro documento" #: ../src/PdfMod/Gui/Actions.cs:48 msgid "Save changes to this document, overwriting the existing file" msgstr "Guardar alterações deste documento, sobrepondo o ficheiro existente" #: ../src/PdfMod/Gui/Actions.cs:49 msgid "Save this document to a new file" msgstr "Gravar este documento para um novo ficheiro" #: ../src/PdfMod/Gui/Actions.cs:51 msgid "_File" msgstr "_Ficheiro" #: ../src/PdfMod/Gui/Actions.cs:52 msgid "Recent _Files" msgstr "_Ficheiros Recentes" #: ../src/PdfMod/Gui/Actions.cs:56 msgid "Rotate Right" msgstr "Rodar para a Direita" #: ../src/PdfMod/Gui/Actions.cs:56 msgid "Rotate right" msgstr "Rodar para a direita" #: ../src/PdfMod/Gui/Actions.cs:57 msgid "Rotate Left" msgstr "Rodar para a Esquerda" #: ../src/PdfMod/Gui/Actions.cs:57 msgid "Rotate left" msgstr "Rodar para a esquerda" #: ../src/PdfMod/Gui/Actions.cs:58 msgid "Export Images" msgstr "Exportar Imagens" #: ../src/PdfMod/Gui/Actions.cs:58 msgid "Save all images in this document to a new folder" msgstr "Gravar todas as imagens deste documento para uma nova pasta" #: ../src/PdfMod/Gui/Actions.cs:60 msgid "_Edit" msgstr "_Editar" #: ../src/PdfMod/Gui/Actions.cs:62 msgid "Select Even Pages" msgstr "Seleccionar Páginas Pares" #: ../src/PdfMod/Gui/Actions.cs:63 msgid "Select Odd Pages" msgstr "Seleccionar Páginas Impares" #: ../src/PdfMod/Gui/Actions.cs:64 msgid "Select Matching..." msgstr "Seleccionar Correspondentes..." #: ../src/PdfMod/Gui/Actions.cs:68 msgid "_View" msgstr "_Ver" #: ../src/PdfMod/Gui/Actions.cs:72 msgid "_Help" msgstr "_Ajuda" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Contents" msgstr "_Conteúdo" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Open in Viewer" msgstr "Abrir com Visualizador" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Open in viewer" msgstr "Abrir com visualizador" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "View and edit the title, keywords, and more for this document" msgstr "Ver e editar o título, palavras-chave, e mais deste documento" #: ../src/PdfMod/Gui/Actions.cs:84 msgid "Toolbar" msgstr "Barra de Ferramentas" #: ../src/PdfMod/Gui/Actions.cs:85 msgid "Fullscreen" msgstr "Ecrã completo" #: ../src/PdfMod/Gui/Actions.cs:156 msgid "_Undo" msgstr "_Desfazer" #: ../src/PdfMod/Gui/Actions.cs:157 #, csharp-format msgid "Undo {0}" msgstr "Desfazer {0}" #: ../src/PdfMod/Gui/Actions.cs:161 msgid "_Redo" msgstr "_Refazer" #: ../src/PdfMod/Gui/Actions.cs:162 #, csharp-format msgid "Redo {0}" msgstr "Refazer {0}" #: ../src/PdfMod/Gui/Actions.cs:170 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Remover Página" msgstr[1] "Remover {0} Páginas" #: ../src/PdfMod/Gui/Actions.cs:173 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Remove a página seleccionada" msgstr[1] "Remove as {0} páginas seleccionadas" #: ../src/PdfMod/Gui/Actions.cs:176 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Extrair Página" msgstr[1] "Extrair {0} Páginas" #: ../src/PdfMod/Gui/Actions.cs:179 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Extrai a página seleccionada" msgstr[1] "Extrai as {0} páginas seleccionadas" #: ../src/PdfMod/Gui/Actions.cs:187 ../src/PdfMod/Gui/Actions.cs:227 msgid "Select PDF" msgstr "Seleccione PDF" #: ../src/PdfMod/Gui/Actions.cs:188 msgid "PDF Documents" msgstr "Documentos PDF" #: ../src/PdfMod/Gui/Actions.cs:189 ../src/PdfMod/Gui/Actions.cs:229 #: ../src/PdfMod/Gui/Actions.cs:259 msgid "All Files" msgstr "Todos os ficheiros" #: ../src/PdfMod/Gui/Actions.cs:253 msgid "Save as..." msgstr "Gravar como..." #: ../src/PdfMod/Gui/Actions.cs:394 msgid "Error opening help" msgstr "Erro ao abrir a ajuda" #: ../src/PdfMod/Gui/Actions.cs:395 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Deseja abrir a documentação na web do PDF Mod?" #: ../src/PdfMod/Gui/Actions.cs:416 msgid "Visit Website" msgstr "Visitar Página Web" #: ../src/PdfMod/Gui/Actions.cs:418 msgid "Primary Development:" msgstr "Desenvolvimento Primário:" #: ../src/PdfMod/Gui/Actions.cs:421 msgid "Contributors:" msgstr "Contribuintes:" #: ../src/PdfMod/Gui/Actions.cs:437 msgid "translator-credits" msgstr "Filipe Gomes " #: ../src/PdfMod/Gui/Client.cs:64 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:171 msgid "Save the changes made to this document?" msgstr "Gravar as alterações feitas a este documento?" #: ../src/PdfMod/Gui/Client.cs:174 msgid "Close _Without Saving" msgstr "Fechar _Sem Gravar" #: ../src/PdfMod/Gui/Client.cs:203 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Continuar, abrir {0} documento em janelas separadas?" msgstr[1] "Continuar, abrir {0} documentos em janelas separadas?" #: ../src/PdfMod/Gui/Client.cs:207 msgid "Open _First" msgstr "Abrir _Primeiro" #: ../src/PdfMod/Gui/Client.cs:208 msgid "Open _All" msgstr "_Abrir Todos" #: ../src/PdfMod/Gui/Client.cs:236 msgid "Loading document..." msgstr "A carregar documento..." #: ../src/PdfMod/Gui/Client.cs:266 msgid "Error Loading Document" msgstr "Erro ao Carregar Documento" #: ../src/PdfMod/Gui/Client.cs:267 #, csharp-format msgid "There was an error loading {0}" msgstr "Ocorreu um erro ao carregar {0}" #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:294 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (originalmente {1})" #: ../src/PdfMod/Gui/Client.cs:299 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} página" msgstr[1] "{0} páginas" #: ../src/PdfMod/Gui/Client.cs:315 msgid "Document is Encrypted" msgstr "Documento está Encriptado" #: ../src/PdfMod/Gui/Client.cs:316 msgid "Enter the document's password to open it:" msgstr "Introduza a senha do documento para abri-lo:" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:26 msgid "Select Matching" msgstr "Seleccionar Correspondentes" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:48 msgid "_Title:" msgstr "_Título:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:49 msgid "_Author:" msgstr "_Autor:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:50 msgid "_Keywords:" msgstr "_Palavras-Chave:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:51 msgid "_Subject:" msgstr "A_ssunto:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:71 msgid "_Revert Properties" msgstr "_Reverter Propriedades" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:72 msgid "Change the document's properties back to the original values" msgstr "Alterar as propriedades do documento de volta às originais" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:77 msgid "_Close" msgstr "_Fechar" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:78 msgid "Hide the document's properties" msgstr "Ocultar as propriedades do documento" pdfmod-0.9.1/po/fr.po0000644000175000001440000002755011511422704014502 0ustar00gabeusers00000000000000# French translation for PDF Mod, a PDF modifier # Copyright (C) 2009-2010 Listed translators # This file is distributed under the same license as the PDF Mod package. # # # Olivier Lê Thanh Duong , 2009. # Bruno Brouard , 2010. # Claude Paroz , 2010. # Laurent Coudeur , 2010. msgid "" msgstr "" "Project-Id-Version: pdfmod master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=pdfmod&component=general\n" "POT-Creation-Date: 2010-10-25 19:26+0000\n" "PO-Revision-Date: 2010-10-16 22:58+0200\n" "Last-Translator: Bruno Brouard \n" "Language-Team: GNOME French Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n>1;\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "Éditeur de PDF" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Supprimer, extraire et pivoter des pages dans les documents PDF" #: ../src/PdfMod/Pdf/Actions/ExportImagesAction.cs:136 #: ../src/PdfMod/Pdf/Page.cs:36 #, csharp-format msgid "Page {0}" msgstr "Page {0}" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Déplacer {1}" msgstr[1] "Déplacer {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "Erreur lors de l'annulation du déplacement des pages" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "Erreur lors du déplacement des pages" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Erreur lors de la suppression de pages du document" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "_File" msgstr "_Fichier" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Open a document" msgstr "Ouvre un document" #: ../src/PdfMod/Gui/Actions.cs:67 msgid "Save changes to this document, overwriting the existing file" msgstr "" "Enregistre les modifications de ce document en écrasant le fichier existant" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "Save this document to a new file" msgstr "Enregistre ce document dans un nouveau fichier" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "Fichiers _récents" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "_Insert From..." msgstr "_Insérer..." #: ../src/PdfMod/Gui/Actions.cs:70 msgid "Insert pages from another document" msgstr "Insère des pages d'un autre document" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Edit" msgstr "É_dition" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate Left" msgstr "Tourner vers la gauche" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate left" msgstr "Tourne vers la gauche" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate Right" msgstr "Tourner vers la droite" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate right" msgstr "Tourne vers la droite" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "Select Odd Pages" msgstr "Sélectionner les pages impaires" #: ../src/PdfMod/Gui/Actions.cs:83 msgid "Select Even Pages" msgstr "Sélectionner les pages paires" #: ../src/PdfMod/Gui/Actions.cs:84 msgid "Select Matching..." msgstr "Sélectionner les occurrences..." #: ../src/PdfMod/Gui/Actions.cs:85 msgid "_Invert Selection" msgstr "_Inverser la sélection" #: ../src/PdfMod/Gui/Actions.cs:87 msgid "_View" msgstr "_Affichage" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in Viewer" msgstr "Ouvrir dans le visionneur" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in viewer" msgstr "Ouvre dans le visionneur" #: ../src/PdfMod/Gui/Actions.cs:92 ../src/PdfMod/Gui/BookmarkView.cs:346 msgid "_Bookmarks" msgstr "_Signets" #: ../src/PdfMod/Gui/Actions.cs:93 msgid "_Add Bookmark" msgstr "_Ajouter un signet" #: ../src/PdfMod/Gui/Actions.cs:94 msgid "Re_name Bookmark" msgstr "Re_nommer un signet" #: ../src/PdfMod/Gui/Actions.cs:95 msgid "_Change Bookmark Destination" msgstr "Modi_fier la destination du signet" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/Actions.cs:96 ../src/PdfMod/Gui/BookmarkView.cs:383 #, csharp-format msgid "_Remove Bookmark" msgid_plural "_Remove Bookmarks" msgstr[0] "S_upprimer le signet" msgstr[1] "S_upprimer les signets" #: ../src/PdfMod/Gui/Actions.cs:97 msgid "_Edit Bookmarks" msgstr "Mo_difier les signets" #: ../src/PdfMod/Gui/Actions.cs:99 msgid "_Help" msgstr "Aid_e" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "_Contents" msgstr "_Sommaire" #: ../src/PdfMod/Gui/Actions.cs:107 msgid "_Add" msgstr "_Ajouter" #: ../src/PdfMod/Gui/Actions.cs:108 msgid "_Remove" msgstr "_Supprimer" #: ../src/PdfMod/Gui/Actions.cs:111 msgid "View and edit the title, keywords, and more for this document" msgstr "" "Affiche et permet de modifier le titre, les mots-clés, et davantage pour ce " "document" #: ../src/PdfMod/Gui/Actions.cs:113 msgid "Toolbar" msgstr "Barre d'outils" #: ../src/PdfMod/Gui/Actions.cs:114 msgid "Bookmarks" msgstr "Signets" #: ../src/PdfMod/Gui/Actions.cs:115 msgid "Fullscreen" msgstr "Plein écran" #: ../src/PdfMod/Gui/Actions.cs:186 #, csharp-format msgid "Export Image" msgid_plural "Export {0} Images" msgstr[0] "Exporter l'image" msgstr[1] "Exporter les {0} images" #: ../src/PdfMod/Gui/Actions.cs:189 #, csharp-format msgid "Save image from the selected pages to a new folder" msgid_plural "Save {0} images from the selected pages to a new folder" msgstr[0] "Enregistre l'image des pages sélectionnées dans un nouveau dossier" msgstr[1] "" "Enregistre les {0} images des pages sélectionnées dans un nouveau dossier" #: ../src/PdfMod/Gui/Actions.cs:196 msgid "_Undo" msgstr "A_nnuler" #: ../src/PdfMod/Gui/Actions.cs:197 #, csharp-format msgid "Undo {0}" msgstr "Annuler {0}" #: ../src/PdfMod/Gui/Actions.cs:201 msgid "_Redo" msgstr "_Rétablir" #: ../src/PdfMod/Gui/Actions.cs:202 #, csharp-format msgid "Redo {0}" msgstr "Rétablir {0}" #: ../src/PdfMod/Gui/Actions.cs:210 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Supprimer la page" msgstr[1] "Supprimer les {0} pages" #: ../src/PdfMod/Gui/Actions.cs:213 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Supprime la page sélectionnée" msgstr[1] "Supprime les {0} pages sélectionnées" #: ../src/PdfMod/Gui/Actions.cs:216 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Extraire la page" msgstr[1] "Extraire les {0} pages" #: ../src/PdfMod/Gui/Actions.cs:219 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Extrait la page sélectionnée" msgstr[1] "Extrait les {0} pages sélectionnées" #: ../src/PdfMod/Gui/Actions.cs:229 ../src/PdfMod/Gui/Actions.cs:316 msgid "Select PDF" msgstr "Sélectionner le PDF" #: ../src/PdfMod/Gui/Actions.cs:258 msgid "Unable to Save Document" msgstr "Impossible d'enregistrer le document" #: ../src/PdfMod/Gui/Actions.cs:264 msgid "Save as..." msgstr "Enregistrer sous..." #: ../src/PdfMod/Gui/Actions.cs:333 ../src/PdfMod/Gui/Client.cs:308 msgid "Error Loading Document" msgstr "Erreur de chargement du document" #: ../src/PdfMod/Gui/Actions.cs:334 ../src/PdfMod/Gui/Client.cs:309 #, csharp-format msgid "There was an error loading {0}" msgstr "Une erreur est survenue lors de l'ouverture de {0}" #: ../src/PdfMod/Gui/Actions.cs:510 msgid "Error opening help" msgstr "Erreur lors de l'ouverture de l'aide" #: ../src/PdfMod/Gui/Actions.cs:511 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Voulez-vous ouvrir la documentation en ligne de PDF Mod ?" #: ../src/PdfMod/Gui/Actions.cs:532 msgid "Visit Website" msgstr "Visitez le site Web" #: ../src/PdfMod/Gui/Actions.cs:534 msgid "Primary Development:" msgstr "Développement initial :" #: ../src/PdfMod/Gui/Actions.cs:537 msgid "Contributors:" msgstr "Contributeurs :" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:555 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" "Copyright {0} Novell Inc.\n" "Copyright {1} Autres contributeurs de PDF Mod" #: ../src/PdfMod/Gui/Actions.cs:558 msgid "translator-credits" msgstr "" "Olivier Lê Thanh Duong \n" "Bruno Brouard \n" "Claude Paroz " #. Add it to the PDF document #: ../src/PdfMod/Gui/BookmarkView.cs:90 msgid "New bookmark" msgstr "Nouveau signet" #: ../src/PdfMod/Gui/BookmarkView.cs:113 msgid "Add Bookmark" msgstr "Ajouter un signet" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/BookmarkView.cs:137 #, csharp-format msgid "Remove Bookmark" msgid_plural "Remove Bookmarks" msgstr[0] "Supprimer le signet" msgstr[1] "Supprimer les signets" #: ../src/PdfMod/Gui/BookmarkView.cs:285 ../src/PdfMod/Gui/BookmarkView.cs:323 msgid "Rename Bookmark" msgstr "Renommer le signet" #: ../src/PdfMod/Gui/BookmarkView.cs:417 #, csharp-format msgid "Bookmark links to page {0}" msgstr "Signet en relation avec la page {0}" #: ../src/PdfMod/Gui/Client.cs:86 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:207 msgid "Save the changes made to this document?" msgstr "Enregistrer les modifications effectuées dans ce document ?" #: ../src/PdfMod/Gui/Client.cs:210 msgid "Close _Without Saving" msgstr "Fer_mer sans enregistrer" #: ../src/PdfMod/Gui/Client.cs:240 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Continuer en ouvrant le document dans une fenêtre séparée ?" msgstr[1] "" "Voulez-vous continuer en ouvrant les {0} documents dans des fenêtres " "séparées ?" #: ../src/PdfMod/Gui/Client.cs:244 msgid "Open _First" msgstr "Ou_vrir le premier" #: ../src/PdfMod/Gui/Client.cs:245 msgid "Open _All" msgstr "_Tout ouvrir" #: ../src/PdfMod/Gui/Client.cs:276 msgid "Loading document..." msgstr "Ouverture du document..." #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:338 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (initialement {1})" #: ../src/PdfMod/Gui/Client.cs:343 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} page" msgstr[1] "{0} pages" #: ../src/PdfMod/Gui/Client.cs:364 msgid "Document is Encrypted" msgstr "Le document est chiffré" #: ../src/PdfMod/Gui/Client.cs:365 msgid "Enter the document's password to open it:" msgstr "Saisissez le mot de passe du document pour l'ouvrir :" #: ../src/PdfMod/Gui/Client.cs:395 msgid "PDF Documents" msgstr "Documents PDF" #: ../src/PdfMod/Gui/Client.cs:396 msgid "All Files" msgstr "Tous les fichiers" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "Sélectionner les occurrences" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "T_itre :" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "Au_teur :" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "_Mots-clés :" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "S_ujet :" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "Réta_blir les propriétés" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "Rétablit les propriétés du document à leurs valeurs d'origine" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "Fe_rmer" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "Masquer les propriétés du document" pdfmod-0.9.1/po/nb.po0000644000175000001440000002416611533723307014501 0ustar00gabeusers00000000000000# Norwegian translation of pdfmod (bokmål dialect). # Copyright (C) 2000-2003, 2005 Free Software Foundation, Inc. # Kjartan Maraas , 2000-2011. # Terance Edward Sola , 2005. # # msgid "" msgstr "" "Project-Id-Version: pdfmod 0.x\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-02-23 22:57+0100\n" "PO-Revision-Date: 2011-02-23 23:02+0100\n" "Last-Translator: Kjartan Maraas \n" "Language-Team: Norwegian bokmal \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "PDF-redigering" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "" #: ../src/PdfMod/Pdf/Actions/ExportImagesAction.cs:136 #: ../src/PdfMod/Pdf/Page.cs:36 #, csharp-format msgid "Page {0}" msgstr "Side {0}" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Flytt {1}" msgstr[1] "Flytt {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "_File" msgstr "_Fil" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Open a document" msgstr "Åpne et dokument" #: ../src/PdfMod/Gui/Actions.cs:67 msgid "Save changes to this document, overwriting the existing file" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "Save this document to a new file" msgstr "Lagrer dette dokumentet til en ny fil" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "_Insert From..." msgstr "Sett _inn fra …" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "Insert pages from another document" msgstr "Sett inn sider fra et annet dokument" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Edit" msgstr "R_ediger" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate Left" msgstr "Roter til venstre" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate left" msgstr "Roter til venstre" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate Right" msgstr "Roter til høyre" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate right" msgstr "Roter til høyre" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "Select Odd Pages" msgstr "Velg ulike sider" #: ../src/PdfMod/Gui/Actions.cs:83 msgid "Select Even Pages" msgstr "Velg like sider" #: ../src/PdfMod/Gui/Actions.cs:84 #, fuzzy msgid "Select Matching..." msgstr "Velg side" #: ../src/PdfMod/Gui/Actions.cs:85 #, fuzzy msgid "_Invert Selection" msgstr "Ugyldig sideutvalg" #: ../src/PdfMod/Gui/Actions.cs:87 msgid "_View" msgstr "_Vis" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in Viewer" msgstr "Åpne for visning" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in viewer" msgstr "Åpne for visning" #: ../src/PdfMod/Gui/Actions.cs:92 ../src/PdfMod/Gui/BookmarkView.cs:346 msgid "_Bookmarks" msgstr "_Bokmerker" #: ../src/PdfMod/Gui/Actions.cs:93 msgid "_Add Bookmark" msgstr "_Legg til bokmerke" #: ../src/PdfMod/Gui/Actions.cs:94 msgid "Re_name Bookmark" msgstr "Endre _navn på bokmerke" #: ../src/PdfMod/Gui/Actions.cs:95 msgid "_Change Bookmark Destination" msgstr "" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/Actions.cs:96 ../src/PdfMod/Gui/BookmarkView.cs:383 #, csharp-format msgid "_Remove Bookmark" msgid_plural "_Remove Bookmarks" msgstr[0] "" msgstr[1] "" #: ../src/PdfMod/Gui/Actions.cs:97 msgid "_Edit Bookmarks" msgstr "R_ediger bokmerker" #: ../src/PdfMod/Gui/Actions.cs:99 msgid "_Help" msgstr "_Hjelp" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "_Contents" msgstr "_Innhold" #: ../src/PdfMod/Gui/Actions.cs:107 msgid "_Add" msgstr "_Legg til" #: ../src/PdfMod/Gui/Actions.cs:108 msgid "_Remove" msgstr "Fje_rn" #: ../src/PdfMod/Gui/Actions.cs:111 msgid "View and edit the title, keywords, and more for this document" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:113 msgid "Toolbar" msgstr "Verktøylinje" #: ../src/PdfMod/Gui/Actions.cs:114 msgid "Bookmarks" msgstr "Bokmerker" #: ../src/PdfMod/Gui/Actions.cs:115 msgid "Fullscreen" msgstr "Fullskjerm" #: ../src/PdfMod/Gui/Actions.cs:186 #, csharp-format msgid "Export Image" msgid_plural "Export {0} Images" msgstr[0] "Eksporter bilde" msgstr[1] "Eksporter {0} bilder" #: ../src/PdfMod/Gui/Actions.cs:189 #, csharp-format msgid "Save image from the selected pages to a new folder" msgid_plural "Save {0} images from the selected pages to a new folder" msgstr[0] "" msgstr[1] "" #: ../src/PdfMod/Gui/Actions.cs:196 msgid "_Undo" msgstr "_Angre" #: ../src/PdfMod/Gui/Actions.cs:197 #, csharp-format msgid "Undo {0}" msgstr "Angre {0}" #: ../src/PdfMod/Gui/Actions.cs:201 msgid "_Redo" msgstr "Gjenopp_rett" #: ../src/PdfMod/Gui/Actions.cs:202 #, csharp-format msgid "Redo {0}" msgstr "Gjenopprett {0}" #: ../src/PdfMod/Gui/Actions.cs:210 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Fjern side" msgstr[1] "Fjern {0} sider" #: ../src/PdfMod/Gui/Actions.cs:213 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Fjern valgt side" msgstr[1] "Fjern {0} valgte sider" #: ../src/PdfMod/Gui/Actions.cs:216 #, fuzzy, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "_Neste side" msgstr[1] "_Neste side" #: ../src/PdfMod/Gui/Actions.cs:219 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "" msgstr[1] "" #: ../src/PdfMod/Gui/Actions.cs:229 ../src/PdfMod/Gui/Actions.cs:316 msgid "Select PDF" msgstr "Velg PDF" #: ../src/PdfMod/Gui/Actions.cs:258 msgid "Unable to Save Document" msgstr "Kan ikke lagre dokument" #: ../src/PdfMod/Gui/Actions.cs:264 msgid "Save as..." msgstr "Lagre som …" #: ../src/PdfMod/Gui/Actions.cs:333 ../src/PdfMod/Gui/Client.cs:308 #, fuzzy msgid "Error Loading Document" msgstr "Laster ned dokument (%d%%)" #: ../src/PdfMod/Gui/Actions.cs:334 ../src/PdfMod/Gui/Client.cs:309 #, fuzzy, csharp-format msgid "There was an error loading {0}" msgstr "Det oppsto en feil ved visning av hjelp" #: ../src/PdfMod/Gui/Actions.cs:510 msgid "Error opening help" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:511 msgid "Would you like to open PDF Mod's online documentation?" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:532 msgid "Visit Website" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:534 msgid "Primary Development:" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:537 msgid "Contributors:" msgstr "Bidragsytere:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:555 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:558 msgid "translator-credits" msgstr "Kjartan Maraas " #. Add it to the PDF document #: ../src/PdfMod/Gui/BookmarkView.cs:90 msgid "New bookmark" msgstr "Nytt bokmerke" #: ../src/PdfMod/Gui/BookmarkView.cs:113 msgid "Add Bookmark" msgstr "Legg til bokmerke" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/BookmarkView.cs:137 #, csharp-format msgid "Remove Bookmark" msgid_plural "Remove Bookmarks" msgstr[0] "Fjern bokmerke" msgstr[1] "Fjern bokmerker" #: ../src/PdfMod/Gui/BookmarkView.cs:285 ../src/PdfMod/Gui/BookmarkView.cs:323 msgid "Rename Bookmark" msgstr "Endre navn på bokmerke" #: ../src/PdfMod/Gui/BookmarkView.cs:417 #, csharp-format msgid "Bookmark links to page {0}" msgstr "" #: ../src/PdfMod/Gui/Client.cs:86 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:207 msgid "Save the changes made to this document?" msgstr "Lagre endringene som er gjort i dokumentet?" #: ../src/PdfMod/Gui/Client.cs:210 msgid "Close _Without Saving" msgstr "Lukk _uten å lagre" #: ../src/PdfMod/Gui/Client.cs:240 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "" msgstr[1] "" #: ../src/PdfMod/Gui/Client.cs:244 msgid "Open _First" msgstr "Åpne _første" #: ../src/PdfMod/Gui/Client.cs:245 msgid "Open _All" msgstr "Åpne _alle" #: ../src/PdfMod/Gui/Client.cs:276 msgid "Loading document..." msgstr "Laster dokument …" #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:338 #, csharp-format msgid "{0} (originally {1})" msgstr "" #: ../src/PdfMod/Gui/Client.cs:343 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} side" msgstr[1] "{0} sider" #: ../src/PdfMod/Gui/Client.cs:364 msgid "Document is Encrypted" msgstr "Dokumentet er kryptert" #: ../src/PdfMod/Gui/Client.cs:365 msgid "Enter the document's password to open it:" msgstr "" #: ../src/PdfMod/Gui/Client.cs:395 msgid "PDF Documents" msgstr "PDF-dokumenter" #: ../src/PdfMod/Gui/Client.cs:396 msgid "All Files" msgstr "Alle filer" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 #, fuzzy msgid "Select Matching" msgstr "Velg side" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "_Tittel:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "Forf_atter:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "Nø_kkelord:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "_Emne:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "Fo_rkast egenskaper" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "_Lukk" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "Skjul egenskaper for dokumentet" pdfmod-0.9.1/po/sv.po0000644000175000001440000002715411511422704014523 0ustar00gabeusers00000000000000# Swedish translation for pdfmod. # Copyright (C) 2009, 2010 Free Software Foundation, Inc. # This file is distributed under the same license as the pdfmod package. # Daniel Nylander , 2009, 2010. # msgid "" msgstr "" "Project-Id-Version: pdfmod\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-12-29 15:05+0100\n" "PO-Revision-Date: 2010-12-29 18:34+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" "Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "PDF-ändrare" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Ta bort, extrahera och rotera sidor i PDF-dokument" #: ../src/PdfMod/Pdf/Actions/ExportImagesAction.cs:136 #: ../src/PdfMod/Pdf/Page.cs:36 #, csharp-format msgid "Page {0}" msgstr "Sida {0}" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Flytta {1}" msgstr[1] "Flytta {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "Fel vid försök att flytta tillbaka sidor" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "Fel vid försök att flytta sidor" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Fel vid försök att flytta sidor från dokumentet" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "_File" msgstr "_Arkiv" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Open a document" msgstr "Öppna ett dokument" #: ../src/PdfMod/Gui/Actions.cs:67 msgid "Save changes to this document, overwriting the existing file" msgstr "Spara ändringar i detta dokument och skriv över den befintliga filen" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "Save this document to a new file" msgstr "Spara detta dokument som en ny fil" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "Tidigare _filer" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "_Insert From..." msgstr "_Infoga från..." #: ../src/PdfMod/Gui/Actions.cs:70 msgid "Insert pages from another document" msgstr "Infoga sidor från annat dokument" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Edit" msgstr "R_edigera" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate Left" msgstr "Rotera åt vänster" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate left" msgstr "Rotera åt vänster" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate Right" msgstr "Rotera åt höger" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate right" msgstr "Rotera åt höger" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "Select Odd Pages" msgstr "Markera udda sidor" #: ../src/PdfMod/Gui/Actions.cs:83 msgid "Select Even Pages" msgstr "Markera jämna sidor" #: ../src/PdfMod/Gui/Actions.cs:84 msgid "Select Matching..." msgstr "Markera matchande..." #: ../src/PdfMod/Gui/Actions.cs:85 msgid "_Invert Selection" msgstr "_Invertera markering" #: ../src/PdfMod/Gui/Actions.cs:87 msgid "_View" msgstr "_Visa" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in Viewer" msgstr "Öppna i visare" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in viewer" msgstr "Öppna i visare" #: ../src/PdfMod/Gui/Actions.cs:92 #: ../src/PdfMod/Gui/BookmarkView.cs:346 msgid "_Bookmarks" msgstr "_Bokmärken" #: ../src/PdfMod/Gui/Actions.cs:93 msgid "_Add Bookmark" msgstr "_Lägg till bokmärke" #: ../src/PdfMod/Gui/Actions.cs:94 msgid "Re_name Bookmark" msgstr "B_yt namn på bokmärke" #: ../src/PdfMod/Gui/Actions.cs:95 msgid "_Change Bookmark Destination" msgstr "_Ändra bokmärkets mål" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/Actions.cs:96 #: ../src/PdfMod/Gui/BookmarkView.cs:383 #, csharp-format msgid "_Remove Bookmark" msgid_plural "_Remove Bookmarks" msgstr[0] "_Ta bort bokmärke" msgstr[1] "_Ta bort bokmärken" #: ../src/PdfMod/Gui/Actions.cs:97 msgid "_Edit Bookmarks" msgstr "R_edigera bokmärken" #: ../src/PdfMod/Gui/Actions.cs:99 msgid "_Help" msgstr "_Hjälp" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "_Contents" msgstr "_Innehåll" #: ../src/PdfMod/Gui/Actions.cs:107 msgid "_Add" msgstr "_Lägg till" #: ../src/PdfMod/Gui/Actions.cs:108 msgid "_Remove" msgstr "_Ta bort" #: ../src/PdfMod/Gui/Actions.cs:111 msgid "View and edit the title, keywords, and more for this document" msgstr "Visa och redigera titeln, nyckelord och annat i detta dokument" #: ../src/PdfMod/Gui/Actions.cs:113 msgid "Toolbar" msgstr "Verktygsrad" #: ../src/PdfMod/Gui/Actions.cs:114 msgid "Bookmarks" msgstr "Bokmärken" #: ../src/PdfMod/Gui/Actions.cs:115 msgid "Fullscreen" msgstr "Helskärm" #: ../src/PdfMod/Gui/Actions.cs:186 #, csharp-format msgid "Export Image" msgid_plural "Export {0} Images" msgstr[0] "Exportera bild" msgstr[1] "Exportera {0} bilder" #: ../src/PdfMod/Gui/Actions.cs:189 #, csharp-format msgid "Save image from the selected pages to a new folder" msgid_plural "Save {0} images from the selected pages to a new folder" msgstr[0] "Spara bild från markerade sidor till en ny mapp" msgstr[1] "Spara {0} bilder från markerade sidor till en ny mapp" #: ../src/PdfMod/Gui/Actions.cs:196 msgid "_Undo" msgstr "_Ångra" #: ../src/PdfMod/Gui/Actions.cs:197 #, csharp-format msgid "Undo {0}" msgstr "Ångra {0}" #: ../src/PdfMod/Gui/Actions.cs:201 msgid "_Redo" msgstr "_Gör om" #: ../src/PdfMod/Gui/Actions.cs:202 #, csharp-format msgid "Redo {0}" msgstr "Gör om {0}" #: ../src/PdfMod/Gui/Actions.cs:210 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Ta bort sida" msgstr[1] "Ta bort {0} sidor" #: ../src/PdfMod/Gui/Actions.cs:213 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Ta bort markerad sida" msgstr[1] "Ta bort {0} markerade sidor" #: ../src/PdfMod/Gui/Actions.cs:216 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Extrahera sida" msgstr[1] "Extrahera {0} sidor" #: ../src/PdfMod/Gui/Actions.cs:219 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Extrahera markerad sida" msgstr[1] "Extrahera {0} markerade sidor" #: ../src/PdfMod/Gui/Actions.cs:229 #: ../src/PdfMod/Gui/Actions.cs:316 msgid "Select PDF" msgstr "Välj PDF" #: ../src/PdfMod/Gui/Actions.cs:258 msgid "Unable to Save Document" msgstr "Kunde inte spara dokumentet" #: ../src/PdfMod/Gui/Actions.cs:264 msgid "Save as..." msgstr "Spara som..." #: ../src/PdfMod/Gui/Actions.cs:333 #: ../src/PdfMod/Gui/Client.cs:308 msgid "Error Loading Document" msgstr "Fel vid inläsning av dokumentet" #: ../src/PdfMod/Gui/Actions.cs:334 #: ../src/PdfMod/Gui/Client.cs:309 #, csharp-format msgid "There was an error loading {0}" msgstr "Det uppstod ett fel vid inläsning av {0}" #: ../src/PdfMod/Gui/Actions.cs:510 msgid "Error opening help" msgstr "Fel vid öppnandet av hjälp" #: ../src/PdfMod/Gui/Actions.cs:511 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Vill du öppna nätdokumentationen för PDF Mod?" #: ../src/PdfMod/Gui/Actions.cs:532 msgid "Visit Website" msgstr "Besök webbplatsen" #: ../src/PdfMod/Gui/Actions.cs:534 msgid "Primary Development:" msgstr "Primära utvecklare:" #: ../src/PdfMod/Gui/Actions.cs:537 msgid "Contributors:" msgstr "Bidragsgivare:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:555 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" "Copyright {0} Novell Inc.\n" "Copyright {1} Övriga bidragsgivare till PDF Mod" #: ../src/PdfMod/Gui/Actions.cs:558 msgid "translator-credits" msgstr "" "Daniel Nylander \n" "\n" "Skicka synpunkter på översättningen till\n" "." #. Add it to the PDF document #: ../src/PdfMod/Gui/BookmarkView.cs:90 msgid "New bookmark" msgstr "Nytt bokmärke" #: ../src/PdfMod/Gui/BookmarkView.cs:113 msgid "Add Bookmark" msgstr "Lägg till bokmärke" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/BookmarkView.cs:137 #, csharp-format msgid "Remove Bookmark" msgid_plural "Remove Bookmarks" msgstr[0] "Ta bort bokmärke" msgstr[1] "Ta bort bokmärken" #: ../src/PdfMod/Gui/BookmarkView.cs:285 #: ../src/PdfMod/Gui/BookmarkView.cs:323 msgid "Rename Bookmark" msgstr "Byt namn på bokmärke" #: ../src/PdfMod/Gui/BookmarkView.cs:417 #, csharp-format msgid "Bookmark links to page {0}" msgstr "Bokmärket länkar till sida {0}" #: ../src/PdfMod/Gui/Client.cs:86 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:207 msgid "Save the changes made to this document?" msgstr "Spara ändringarna gjorda i detta dokument?" #: ../src/PdfMod/Gui/Client.cs:210 msgid "Close _Without Saving" msgstr "Stäng _utan att spara" #: ../src/PdfMod/Gui/Client.cs:240 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Fortsätt och öppna {0} dokument i separat fönster?" msgstr[1] "Fortsätt och öppna alla {0} dokument i separata fönster?" #: ../src/PdfMod/Gui/Client.cs:244 msgid "Open _First" msgstr "Öppna _första" #: ../src/PdfMod/Gui/Client.cs:245 msgid "Open _All" msgstr "Öppna _alla" #: ../src/PdfMod/Gui/Client.cs:276 msgid "Loading document..." msgstr "Läser in dokument..." #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:338 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (ursprungligen {1})" #: ../src/PdfMod/Gui/Client.cs:343 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} sida" msgstr[1] "{0} sidor" #: ../src/PdfMod/Gui/Client.cs:364 msgid "Document is Encrypted" msgstr "Dokumentet är krypterat" #: ../src/PdfMod/Gui/Client.cs:365 msgid "Enter the document's password to open it:" msgstr "Ange dokumentets lösenord för att öppna det:" #: ../src/PdfMod/Gui/Client.cs:395 msgid "PDF Documents" msgstr "PDF-dokument" #: ../src/PdfMod/Gui/Client.cs:396 msgid "All Files" msgstr "Alla filer" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "Välj matchande" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "_Titel:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "_Författare:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "_Nyckelord:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "_Ämne:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "_Återställ egenskaper" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "Ändra tillbaka dokumentets egenskaper till dess ursprungsvärden" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "S_täng" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "Dölj dokumentets egenskaper" #~ msgid "Pages {1} - {2}" #~ msgid_plural "Pages {1} - {2}" #~ msgstr[0] "Sidor {1} - {2}" #~ msgstr[1] "Sidor {1} - {2}" #~ msgid "{0} Page" #~ msgid_plural "{0} Pages" #~ msgstr[0] "{0} sida" #~ msgstr[1] "{0} sidor" #~ msgid "{0} - Images for {1}" #~ msgstr "{0} - Bilder för {1}" #~ msgid "Loading {0}" #~ msgstr "Läser in {0}" #~ msgid "/Subtype" #~ msgstr "/Undertyp" pdfmod-0.9.1/po/de.po0000644000175000001440000002757311461355327014502 0ustar00gabeusers00000000000000# German translation for PDF Mod, a PDF modifier # Copyright (C) 2009 # This file is distributed under the same license as the PDF Mod package. # Benjamin Elbers , 2009. # Mario Blättermann , 2009, 2010. # msgid "" msgstr "" "Project-Id-Version: 0.8\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=pdfmod&component=general\n" "POT-Creation-Date: 2010-10-25 19:26+0000\n" "PO-Revision-Date: 2010-10-25 21:26+0100\n" "Last-Translator: Mario Blättermann \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "PDF-Bearbeitung" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Seiten in PDF-Dokumenten entfernen, herauslösen und drehen" #: ../src/PdfMod/Pdf/Actions/ExportImagesAction.cs:136 #: ../src/PdfMod/Pdf/Page.cs:36 #, csharp-format msgid "Page {0}" msgstr "Seite {0}" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "{1} verschieben" msgstr[1] "{1} verschieben" # not sure. what does it mean? #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "Fehler beim Versuch, Seiten zurück zu verschieben" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "Fehler beim Versuch, Seiten zu verschieben" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Fehler beim Löschen von Seiten aus dem Dokument" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "_File" msgstr "_Datei" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Open a document" msgstr "Ein Dokument öffnen" #: ../src/PdfMod/Gui/Actions.cs:67 msgid "Save changes to this document, overwriting the existing file" msgstr "Veränderungen speichern, bestehendes Dokument überschreiben" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "Save this document to a new file" msgstr "Dieses Dokument in eine neue Datei speichern" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "Zuletzt geöffnete _Dateien" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "_Insert From..." msgstr "_Einfügen aus …" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "Insert pages from another document" msgstr "Seiten aus einem anderen Dokument einfügen" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Edit" msgstr "_Bearbeiten" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate Left" msgstr "Nach links drehen" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate left" msgstr "Nach links drehen" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate Right" msgstr "Nach rechts drehen" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate right" msgstr "Nach rechts drehen" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "Select Odd Pages" msgstr "Seiten mit ungeraden Nummern auswählen" #: ../src/PdfMod/Gui/Actions.cs:83 msgid "Select Even Pages" msgstr "Seiten mit geraden Nummern auswählen" #: ../src/PdfMod/Gui/Actions.cs:84 msgid "Select Matching..." msgstr "Passende Seiten auswählen …" #: ../src/PdfMod/Gui/Actions.cs:85 msgid "_Invert Selection" msgstr "Auswahl _umkehren" #: ../src/PdfMod/Gui/Actions.cs:87 msgid "_View" msgstr "_Ansicht" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in Viewer" msgstr "Im Betrachter öffnen" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in viewer" msgstr "Im Betrachter öffnen" #: ../src/PdfMod/Gui/Actions.cs:92 ../src/PdfMod/Gui/BookmarkView.cs:346 msgid "_Bookmarks" msgstr "_Lesezeichen" #: ../src/PdfMod/Gui/Actions.cs:93 msgid "_Add Bookmark" msgstr "Lesezeichen _hinzufügen" #: ../src/PdfMod/Gui/Actions.cs:94 msgid "Re_name Bookmark" msgstr "Lesezeichen umbe_nennen" #: ../src/PdfMod/Gui/Actions.cs:95 msgid "_Change Bookmark Destination" msgstr "Ziel des Lesezeichens we_chseln" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/Actions.cs:96 ../src/PdfMod/Gui/BookmarkView.cs:383 #, csharp-format msgid "_Remove Bookmark" msgid_plural "_Remove Bookmarks" msgstr[0] "Lesezeichen entfe_rnen" msgstr[1] "Lesezeichen entfe_rnen" #: ../src/PdfMod/Gui/Actions.cs:97 msgid "_Edit Bookmarks" msgstr "Lesezeichen _bearbeiten" #: ../src/PdfMod/Gui/Actions.cs:99 msgid "_Help" msgstr "_Hilfe" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "_Contents" msgstr "_Inhalte" #: ../src/PdfMod/Gui/Actions.cs:107 msgid "_Add" msgstr "_Hinzufügen" #: ../src/PdfMod/Gui/Actions.cs:108 msgid "_Remove" msgstr "_Entfernen" #: ../src/PdfMod/Gui/Actions.cs:111 msgid "View and edit the title, keywords, and more for this document" msgstr "" "Titel, Schlüsselwörter usw. für dieses Dokument betrachten und bearbeiten" #: ../src/PdfMod/Gui/Actions.cs:113 msgid "Toolbar" msgstr "Werkzeugleiste" #: ../src/PdfMod/Gui/Actions.cs:114 msgid "Bookmarks" msgstr "Lesezeichen" #: ../src/PdfMod/Gui/Actions.cs:115 msgid "Fullscreen" msgstr "Vollbild" #: ../src/PdfMod/Gui/Actions.cs:186 #, csharp-format msgid "Export Image" msgid_plural "Export {0} Images" msgstr[0] "Bild exportieren" msgstr[1] "{0} Bilder exportieren" #: ../src/PdfMod/Gui/Actions.cs:189 #, csharp-format msgid "Save image from the selected pages to a new folder" msgid_plural "Save {0} images from the selected pages to a new folder" msgstr[0] "Bild in diesem Dokument in einem neuen Ordner speichern" msgstr[1] "{0} Bilder in diesem Dokument in einem neuen Ordner speichern" #: ../src/PdfMod/Gui/Actions.cs:196 msgid "_Undo" msgstr "_Rückgängig" #: ../src/PdfMod/Gui/Actions.cs:197 #, csharp-format msgid "Undo {0}" msgstr "Rückgängig {0}" #: ../src/PdfMod/Gui/Actions.cs:201 msgid "_Redo" msgstr "_Wiederholen" #: ../src/PdfMod/Gui/Actions.cs:202 #, csharp-format msgid "Redo {0}" msgstr "{0} wiederholen" #: ../src/PdfMod/Gui/Actions.cs:210 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Seite entfernen" msgstr[1] "{0} Seiten entfernen" #: ../src/PdfMod/Gui/Actions.cs:213 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Ausgewählte Seite entfernen" msgstr[1] "{0} ausgewählte Seiten entfernen" #: ../src/PdfMod/Gui/Actions.cs:216 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Seite herauslösen" msgstr[1] "{0} Seiten herauslösen" #: ../src/PdfMod/Gui/Actions.cs:219 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Ausgewählte Seite herauslösen" msgstr[1] "{0} ausgewählte Seiten herauslösen" #: ../src/PdfMod/Gui/Actions.cs:229 ../src/PdfMod/Gui/Actions.cs:316 msgid "Select PDF" msgstr "PDF auswählen" #: ../src/PdfMod/Gui/Actions.cs:258 msgid "Unable to Save Document" msgstr "Speichern des Dokuments nicht möglich" #: ../src/PdfMod/Gui/Actions.cs:264 msgid "Save as..." msgstr "Speichern unter …" #: ../src/PdfMod/Gui/Actions.cs:333 ../src/PdfMod/Gui/Client.cs:308 msgid "Error Loading Document" msgstr "Fehler beim Laden des Dokuments" #: ../src/PdfMod/Gui/Actions.cs:334 ../src/PdfMod/Gui/Client.cs:309 #, csharp-format msgid "There was an error loading {0}" msgstr "Fehler beim Laden von {0}" #: ../src/PdfMod/Gui/Actions.cs:510 msgid "Error opening help" msgstr "Fehler beim Öffnen der Hilfe" #: ../src/PdfMod/Gui/Actions.cs:511 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Möchten Sie die Online-Dokumentation von PDF Mod öffnen?" #: ../src/PdfMod/Gui/Actions.cs:532 msgid "Visit Website" msgstr "Website besuchen" #: ../src/PdfMod/Gui/Actions.cs:534 msgid "Primary Development:" msgstr "Hauptentwickler:" #: ../src/PdfMod/Gui/Actions.cs:537 msgid "Contributors:" msgstr "Mitwirkende:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:555 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" "Copyright {0} Novell Inc.\n" "Copyright {1} Weitere Mitwirkende an PDF Mod" #: ../src/PdfMod/Gui/Actions.cs:558 msgid "translator-credits" msgstr "" "Benjamin Elbers \n" "Mario Blättermann " #. Add it to the PDF document #: ../src/PdfMod/Gui/BookmarkView.cs:90 msgid "New bookmark" msgstr "Neues Lesezeichen" #: ../src/PdfMod/Gui/BookmarkView.cs:113 msgid "Add Bookmark" msgstr "Lesezeichen hinzufügen" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/BookmarkView.cs:137 #, csharp-format msgid "Remove Bookmark" msgid_plural "Remove Bookmarks" msgstr[0] "Lesezeichen entfernen" msgstr[1] "Lesezeichen entfernen" #: ../src/PdfMod/Gui/BookmarkView.cs:285 ../src/PdfMod/Gui/BookmarkView.cs:323 msgid "Rename Bookmark" msgstr "Lesezeichen umbenennen" #: ../src/PdfMod/Gui/BookmarkView.cs:417 #, csharp-format msgid "Bookmark links to page {0}" msgstr "Lesezeichen verweist auf Seite {0}" #: ../src/PdfMod/Gui/Client.cs:86 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:207 msgid "Save the changes made to this document?" msgstr "Veränderungen in diesem Dokument speichern?" #: ../src/PdfMod/Gui/Client.cs:210 msgid "Close _Without Saving" msgstr "S_chließen, ohne zu speichern" #: ../src/PdfMod/Gui/Client.cs:240 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Fortsetzen und {0} Dokument in einem getrennten Fenster öffnen?" msgstr[1] "Fortsetzen und alle {0} Dokumente in getrennten Fenstern öffnen?" #: ../src/PdfMod/Gui/Client.cs:244 msgid "Open _First" msgstr "Das _Erste öffnen" #: ../src/PdfMod/Gui/Client.cs:245 msgid "Open _All" msgstr "_Alle öffnen" #: ../src/PdfMod/Gui/Client.cs:276 msgid "Loading document..." msgstr "Dokument wird geladen …" #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:338 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (original {1})" #: ../src/PdfMod/Gui/Client.cs:343 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} Seite" msgstr[1] "{0} Seiten" #: ../src/PdfMod/Gui/Client.cs:364 msgid "Document is Encrypted" msgstr "Dokument ist verschlüsselt" #: ../src/PdfMod/Gui/Client.cs:365 msgid "Enter the document's password to open it:" msgstr "Geben Sie das Passwort des Dokuments ein, um es zu öffnen:" #: ../src/PdfMod/Gui/Client.cs:395 msgid "PDF Documents" msgstr "PDF-Dokumente" #: ../src/PdfMod/Gui/Client.cs:396 msgid "All Files" msgstr "Alle Dateien" # not sure. where is this string used? #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "Passende auswählen" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "_Titel:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "_Autor:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "_Schlüsselwörter:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "_Betreff:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "_Eigenschaften zurücksetzen" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "Eigenschaften des Dokumentes zu den vorherigen Werten ändern" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "S_chließen" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "Eigenschaften des Dokuments verbergen" #~ msgid "Pages {1} - {2}" #~ msgid_plural "Pages {1} - {2}" #~ msgstr[0] "Seiten {1} - {2}" #~ msgstr[1] "Seiten {1} - {2}" #~ msgid "Pages {1}" #~ msgid_plural "Pages {1}" #~ msgstr[0] "Seiten {1}" #~ msgstr[1] "Seiten {1}" pdfmod-0.9.1/po/sl.po0000644000175000001440000003035511511422704014506 0ustar00gabeusers00000000000000# Slovenian translations for pdfmod. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the pdfmod package. # # Andrej Žnidaršič , 2009 - 2010. # msgid "" msgstr "" "Project-Id-Version: Pdfmod\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=pdfmod&component=general\n" "POT-Creation-Date: 2010-10-29 13:17+0000\n" "PO-Revision-Date: 2010-10-30 08:15+0100\n" "Last-Translator: Andrej Žnidaršič \n" "Language-Team: Slovenian GNOME Translation Team \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);\n" "X-Poedit-Country: SLOVENIA\n" "X-Poedit-Language: Slovenian\n" "X-Poedit-SourceCharset: utf-8\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "Urejevalnik PDF" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Odstranjevanje, razširjanje in vrtenje strani v dokumentih PDF." #: ../src/PdfMod/Pdf/Actions/ExportImagesAction.cs:136 #: ../src/PdfMod/Pdf/Page.cs:36 #, csharp-format msgid "Page {0}" msgstr "Stran {0}" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Premik {1}" msgstr[1] "Premik {1}" msgstr[2] "Premik {1}" msgstr[3] "Premik {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "Napaka med razveljavitvijo premika strani" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "Napaka med premikanjem strani" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Napaka med poskusom odstranjevanja strani iz dokumenta" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "_File" msgstr "_Datoteka" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Open a document" msgstr "Odpri dokument" #: ../src/PdfMod/Gui/Actions.cs:67 msgid "Save changes to this document, overwriting the existing file" msgstr "Shranjevanje sprememb tega dokumenta, prepiše prejšnjo datoteko" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "Save this document to a new file" msgstr "Shrani dokument v novo datoteko" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "_Nedavne datoteke" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "_Insert From..." msgstr "_Vstavi iz ..." #: ../src/PdfMod/Gui/Actions.cs:70 msgid "Insert pages from another document" msgstr "Vstavljanje strani iz drugega dokumenta" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Edit" msgstr "_Uredi" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate Left" msgstr "Zavrti levo" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate left" msgstr "Vrtenje slike levo" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate Right" msgstr "Zavrti desno" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate right" msgstr "Vrtenje slike desno" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "Select Odd Pages" msgstr "Izberi lihe strani" #: ../src/PdfMod/Gui/Actions.cs:83 msgid "Select Even Pages" msgstr "Izberi sode strani" #: ../src/PdfMod/Gui/Actions.cs:84 msgid "Select Matching..." msgstr "Izberi skladne ..." #: ../src/PdfMod/Gui/Actions.cs:85 msgid "_Invert Selection" msgstr "Obrni _izbor" #: ../src/PdfMod/Gui/Actions.cs:87 msgid "_View" msgstr "_Pogled" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in Viewer" msgstr "Odpri v pregledovalniku" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in viewer" msgstr "Odpri v pregledovalniku" #: ../src/PdfMod/Gui/Actions.cs:92 #: ../src/PdfMod/Gui/BookmarkView.cs:346 msgid "_Bookmarks" msgstr "_Zaznamki" #: ../src/PdfMod/Gui/Actions.cs:93 msgid "_Add Bookmark" msgstr "_Dodaj zaznamek" #: ../src/PdfMod/Gui/Actions.cs:94 msgid "Re_name Bookmark" msgstr "Pr_eimenuj zaznamek" #: ../src/PdfMod/Gui/Actions.cs:95 msgid "_Change Bookmark Destination" msgstr "_Spremeni cilj zaznamka" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/Actions.cs:96 #: ../src/PdfMod/Gui/BookmarkView.cs:383 #, csharp-format msgid "_Remove Bookmark" msgid_plural "_Remove Bookmarks" msgstr[0] "_Odstrani zaznamke" msgstr[1] "_Odstrani zaznamek" msgstr[2] "_Odstrani zaznamka" msgstr[3] "_Odstrani zaznamke" #: ../src/PdfMod/Gui/Actions.cs:97 msgid "_Edit Bookmarks" msgstr "_Uredi zaznamke" #: ../src/PdfMod/Gui/Actions.cs:99 msgid "_Help" msgstr "Pomo_č" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "_Contents" msgstr "_Vsebina" #: ../src/PdfMod/Gui/Actions.cs:107 msgid "_Add" msgstr "_Dodaj" #: ../src/PdfMod/Gui/Actions.cs:108 msgid "_Remove" msgstr "_Odstrani" #: ../src/PdfMod/Gui/Actions.cs:111 msgid "View and edit the title, keywords, and more for this document" msgstr "Ogled in urejanje naslova, ključnih besed in več za ta dokument" #: ../src/PdfMod/Gui/Actions.cs:113 msgid "Toolbar" msgstr "Orodna vrstica" #: ../src/PdfMod/Gui/Actions.cs:114 msgid "Bookmarks" msgstr "Zaznamki" #: ../src/PdfMod/Gui/Actions.cs:115 msgid "Fullscreen" msgstr "Celozaslonski način" #: ../src/PdfMod/Gui/Actions.cs:186 #, csharp-format msgid "Export Image" msgid_plural "Export {0} Images" msgstr[0] "Izvozi {0} slik" msgstr[1] "Izvozi {0} sliko" msgstr[2] "Izvozi {0} sliki" msgstr[3] "Izvozi {0} slike" #: ../src/PdfMod/Gui/Actions.cs:189 #, csharp-format msgid "Save image from the selected pages to a new folder" msgid_plural "Save {0} images from the selected pages to a new folder" msgstr[0] "Shrani {0} slik iz izbranih strani v novo mapo" msgstr[1] "Shrani {0} sliko iz izbrane strani v novo mapo" msgstr[2] "Shrani {0} sliki iz izbranih strani v novo mapo" msgstr[3] "Shrani {0} slike iz izbranih strani v novo mapo" #: ../src/PdfMod/Gui/Actions.cs:196 msgid "_Undo" msgstr "_Razveljavi" #: ../src/PdfMod/Gui/Actions.cs:197 #, csharp-format msgid "Undo {0}" msgstr "Razveljavitev {0}" #: ../src/PdfMod/Gui/Actions.cs:201 msgid "_Redo" msgstr "_Uveljavi" #: ../src/PdfMod/Gui/Actions.cs:202 #, csharp-format msgid "Redo {0}" msgstr "Uveljavitev {0}" #: ../src/PdfMod/Gui/Actions.cs:210 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Odstrani {0} strani" msgstr[1] "Odstrani {0} stran" msgstr[2] "Odstrani {0} strani" msgstr[3] "Odstrani {0} strani" #: ../src/PdfMod/Gui/Actions.cs:213 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Odstrani {0} izbranih strani" msgstr[1] "Odstrani {0} izbrane strani" msgstr[2] "Odstrani {0} izbranih strani" msgstr[3] "Odstrani {0} izbranih strani" #: ../src/PdfMod/Gui/Actions.cs:216 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Razširi {0} strani" msgstr[1] "Razširi {0} stran" msgstr[2] "Razširi {0} strani" msgstr[3] "Razširi {0} strani" #: ../src/PdfMod/Gui/Actions.cs:219 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Razširi {0} izbranih strani" msgstr[1] "Razširi {0} izbrano stran" msgstr[2] "Razširi {0} izbrani strani" msgstr[3] "Razširi {0} izbrane strani" #: ../src/PdfMod/Gui/Actions.cs:229 #: ../src/PdfMod/Gui/Actions.cs:316 msgid "Select PDF" msgstr "Izbor PDF" #: ../src/PdfMod/Gui/Actions.cs:258 msgid "Unable to Save Document" msgstr "Dokumenta ni mogoče shraniti" #: ../src/PdfMod/Gui/Actions.cs:264 msgid "Save as..." msgstr "Shrani kot ..." #: ../src/PdfMod/Gui/Actions.cs:333 #: ../src/PdfMod/Gui/Client.cs:308 msgid "Error Loading Document" msgstr "Napaka nalaganja dokumenta" #: ../src/PdfMod/Gui/Actions.cs:334 #: ../src/PdfMod/Gui/Client.cs:309 #, csharp-format msgid "There was an error loading {0}" msgstr "Prišlo je do napake med nalaganjem {0}" #: ../src/PdfMod/Gui/Actions.cs:510 msgid "Error opening help" msgstr "Napaka med odpiranjem pomoči" #: ../src/PdfMod/Gui/Actions.cs:511 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Ali želite odpreti spletno dokumentacijo programa?" #: ../src/PdfMod/Gui/Actions.cs:532 msgid "Visit Website" msgstr "Obisk spletišča" #: ../src/PdfMod/Gui/Actions.cs:534 msgid "Primary Development:" msgstr "Osnovni razvoj:" #: ../src/PdfMod/Gui/Actions.cs:537 msgid "Contributors:" msgstr "Sodelujoči:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:555 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" "Avtorske pravice {0} Novell Inc.\n" "Avtorske pravice {1} Drugi sodelavci PDF Mod" #: ../src/PdfMod/Gui/Actions.cs:558 msgid "translator-credits" msgstr "Andrej Žnidaršič " #. Add it to the PDF document #: ../src/PdfMod/Gui/BookmarkView.cs:90 msgid "New bookmark" msgstr "Nov zaznamek" #: ../src/PdfMod/Gui/BookmarkView.cs:113 msgid "Add Bookmark" msgstr "Dodaj zaznamek" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/BookmarkView.cs:137 #, csharp-format msgid "Remove Bookmark" msgid_plural "Remove Bookmarks" msgstr[0] "Odstrani zaznamke" msgstr[1] "Odstrani zaznamek" msgstr[2] "Odstrani zaznamka" msgstr[3] "Odstrani zaznamke" #: ../src/PdfMod/Gui/BookmarkView.cs:285 #: ../src/PdfMod/Gui/BookmarkView.cs:323 msgid "Rename Bookmark" msgstr "Preimenuj zaznamek" #: ../src/PdfMod/Gui/BookmarkView.cs:417 #, csharp-format msgid "Bookmark links to page {0}" msgstr "Zaznamek se povezuje na stran {0}" #: ../src/PdfMod/Gui/Client.cs:86 msgid "PDF Mod" msgstr "PDF urejevalnik" #: ../src/PdfMod/Gui/Client.cs:207 msgid "Save the changes made to this document?" msgstr "Ali naj se shranijo spremembe dokumenta?" #: ../src/PdfMod/Gui/Client.cs:210 msgid "Close _Without Saving" msgstr "Zapri _brez shranjevanja" #: ../src/PdfMod/Gui/Client.cs:240 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Ali naj se nadaljuje odpiranje vseh {0} dokumentov v ločenih oknih?" msgstr[1] "Ali naj se nadaljuje odpiranje {0} dokumenta v ločenih oknih?" msgstr[2] "Ali naj se nadaljuje odpiranje {0} dokumentov v ločenih oknih?" msgstr[3] "Ali naj se nadaljuje odpiranje {0} dokumentov v ločenih oknih?" #: ../src/PdfMod/Gui/Client.cs:244 msgid "Open _First" msgstr "Odpri _prvo" #: ../src/PdfMod/Gui/Client.cs:245 msgid "Open _All" msgstr "Odpri _vse" #: ../src/PdfMod/Gui/Client.cs:276 msgid "Loading document..." msgstr "Nalaganje dokumenta ..." #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:338 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (izvorno {1})" #: ../src/PdfMod/Gui/Client.cs:343 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} strani" msgstr[1] "{0} stran" msgstr[2] "{0} strani" msgstr[3] "{0} strani" #: ../src/PdfMod/Gui/Client.cs:364 msgid "Document is Encrypted" msgstr "Dokument je šifriran" #: ../src/PdfMod/Gui/Client.cs:365 msgid "Enter the document's password to open it:" msgstr "Vnesite geslo za odpiranje dokumenta:" #: ../src/PdfMod/Gui/Client.cs:395 msgid "PDF Documents" msgstr "Dokumenti PDF" #: ../src/PdfMod/Gui/Client.cs:396 msgid "All Files" msgstr "Vse datoteke" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "Izbor skladnih" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "_Naslov:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "_Avtor:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "_Ključne besede:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "_Zadeva:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "_Povrni lastnosti" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "Sprememba lastnosti dokumenta nazaj na izvorne vrednosti" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "_Zapri" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "Skrij lastnosti dokumenta" pdfmod-0.9.1/po/lt.po0000644000175000001440000002001611234074541014504 0ustar00gabeusers00000000000000# Lithuanian translation for pdfmod. # Copyright (C) 2009 Free Software Foundation, Inc. # This file is distributed under the same license as the pdfmod package. # Žygimantas Beručka , 2009. # msgid "" msgstr "" "Project-Id-Version: pdfmod master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-07-29 10:46+0300\n" "PO-Revision-Date: 2009-07-29 11:15+0300\n" "Last-Translator: Žygimantas Beručka \n" "Language-Team: Lithuanian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: ../data/pdfmod.desktop.in.h:1 ../src/PdfMod/PdfMod/PdfMod.cs:63 msgid "PDF Mod" msgstr "PDF Mod" #: ../data/pdfmod.desktop.in.h:2 msgid "PDF Modifier" msgstr "PDF taisymo programa" #: ../data/pdfmod.desktop.in.h:3 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Galite šalinti, išgauti ir pasukti PDF dokumentų puslapius" #: ../src/PdfMod/PdfMod.Actions/ExportImagesAction.cs:85 msgid "/Subtype" msgstr "/Potipis" #: ../src/PdfMod/PdfMod.Actions/MoveAction.cs:28 msgid "Error trying to unmove pages" msgstr "Klaida bandant grąžinti puslapius" #: ../src/PdfMod/PdfMod.Actions/MoveAction.cs:38 msgid "Error trying to move pages" msgstr "Klaida bandant perkelti puslapius" #: ../src/PdfMod/PdfMod.Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Klaida bandant pašalinti puslapius iš dokumento" #: ../src/PdfMod/PdfMod/GlobalActions.cs:46 msgid "Open a document" msgstr "Atverti dokumentą" #: ../src/PdfMod/PdfMod/GlobalActions.cs:47 msgid "Save changes to this document, overwriting the existing file" msgstr "Įrašyti šio dokumento pakeitimus, perrašant jau esantį failą" #: ../src/PdfMod/PdfMod/GlobalActions.cs:48 msgid "Save this document to a new file" msgstr "Įrašyti šį dokumentą į naują failą" #: ../src/PdfMod/PdfMod/GlobalActions.cs:50 msgid "_File" msgstr "_Failas" #: ../src/PdfMod/PdfMod/GlobalActions.cs:51 msgid "Recent _Files" msgstr "Paskutinieji _failai" #: ../src/PdfMod/PdfMod/GlobalActions.cs:55 msgid "Rotate Right" msgstr "Pasukti dešinėn" #: ../src/PdfMod/PdfMod/GlobalActions.cs:55 msgid "Rotate right" msgstr "Pasukti dešinėn" #: ../src/PdfMod/PdfMod/GlobalActions.cs:56 msgid "Rotate Left" msgstr "Pasukti kairėn" #: ../src/PdfMod/PdfMod/GlobalActions.cs:56 msgid "Rotate left" msgstr "Pasukti kairėn" #: ../src/PdfMod/PdfMod/GlobalActions.cs:57 msgid "Export Images..." msgstr "Eksportuoti paveikslėlius..." #: ../src/PdfMod/PdfMod/GlobalActions.cs:59 msgid "_Edit" msgstr "_Keisti" #: ../src/PdfMod/PdfMod/GlobalActions.cs:61 msgid "Select Even Pages" msgstr "Pasirinkti lyginius puslapius" #: ../src/PdfMod/PdfMod/GlobalActions.cs:62 msgid "Select Odd Pages" msgstr "Pasirinkti nelyginius puslapius" #: ../src/PdfMod/PdfMod/GlobalActions.cs:63 msgid "Select Matching..." msgstr "Pasirinkti atitikimą..." #: ../src/PdfMod/PdfMod/GlobalActions.cs:67 msgid "_View" msgstr "_Rodymas" #: ../src/PdfMod/PdfMod/GlobalActions.cs:71 msgid "_Help" msgstr "_Žinynas" #: ../src/PdfMod/PdfMod/GlobalActions.cs:72 msgid "_Contents" msgstr "_Turinys" #: ../src/PdfMod/PdfMod/GlobalActions.cs:79 msgid "View and edit the title, keywords, and more for this document" msgstr "Rodyti ir taisyti šio dokumento pavadinimą, raktažodžius ir kt." #: ../src/PdfMod/PdfMod/GlobalActions.cs:81 msgid "Toolbar" msgstr "Įrankinė" #: ../src/PdfMod/PdfMod/GlobalActions.cs:157 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Pašalinti {0} puslapį" msgstr[1] "Pašalinti {0} puslapius" msgstr[2] "Pašalinti {0} puslapių" #: ../src/PdfMod/PdfMod/GlobalActions.cs:160 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Pašalinti {0} pasirinktą puslapį" msgstr[1] "Pašalinti {0} pasirinktus puslapius" msgstr[2] "Pašalinti {0} pasirinktų puslapių" #: ../src/PdfMod/PdfMod/GlobalActions.cs:163 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Išgauti {0} puslapį" msgstr[1] "Išgauti {0} puslapius" msgstr[2] "Išgauti {0} puslapių" #: ../src/PdfMod/PdfMod/GlobalActions.cs:166 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Išgauti {0} pasirinktą puslapį" msgstr[1] "Išgauti {0} pasirinktus puslapius" msgstr[2] "Išgauti {0} pasirinktų puslapių" #: ../src/PdfMod/PdfMod/GlobalActions.cs:174 msgid "Select PDF" msgstr "Pasirinkite PDF" #: ../src/PdfMod/PdfMod/GlobalActions.cs:176 #: ../src/PdfMod/PdfMod/GlobalActions.cs:205 msgid "All Files" msgstr "Visi failai" #: ../src/PdfMod/PdfMod/GlobalActions.cs:199 msgid "Save as..." msgstr "Įrašyti kaip..." #. Translators: {0} is the number of pages (always 1), and {1} is the page number, eg Page 1, or Page 5 #: ../src/PdfMod/PdfMod/GlobalActions.cs:264 #, csharp-format msgid "Page {1}" msgid_plural "Page {1}" msgstr[0] "{1} puslapis" msgstr[1] "{1} puslapis" msgstr[2] "{1} puslapis" #. Translators: {0} is the number of pages, and {1} is the first page, {2} is the last page, #. eg Pages 3 - 7 #: ../src/PdfMod/PdfMod/GlobalActions.cs:268 #, csharp-format msgid "Pages {1} - {2}" msgid_plural "Pages {1} - {2}" msgstr[0] "Puslapiai {1} – {2}" msgstr[1] "Puslapiai {1} – {2}" msgstr[2] "Puslapiai {1} – {2}" #. Translators: {0} is the number of pages, {1} is a comma separated list of page numbers, eg Pages 1, 4, 9 #: ../src/PdfMod/PdfMod/GlobalActions.cs:273 #, csharp-format msgid "Pages {1}" msgid_plural "Pages {1}" msgstr[0] "{1} puslapiai" msgstr[1] "{1} puslapiai" msgstr[2] "{1} puslapiai" #. Translators: {0} is the number of pages, eg 12 Pages #: ../src/PdfMod/PdfMod/GlobalActions.cs:276 #, csharp-format msgid "{0} Page" msgid_plural "{0} Pages" msgstr[0] "{0} puslapis" msgstr[1] "{0} puslapiai" msgstr[2] "{0} puslapių" #. Translators: This is used for creating a folder name, be careful! #: ../src/PdfMod/PdfMod/GlobalActions.cs:293 #, csharp-format msgid "{0} - Images for {1}" msgstr "{0} - {1} paveikslėliai" #: ../src/PdfMod/PdfMod/GlobalActions.cs:360 msgid "Error opening help" msgstr "Klaida atveriant žinyną" #: ../src/PdfMod/PdfMod/GlobalActions.cs:361 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Ar pageidaujate atverti PDF Mod programos dokumentaciją internete?" #: ../src/PdfMod/PdfMod/GlobalActions.cs:382 msgid "Visit Website" msgstr "Aplankyti tinklalapį" #: ../src/PdfMod/PdfMod/GlobalActions.cs:386 msgid "translator-credits" msgstr "Žygimantas Beručka " #: ../src/PdfMod/PdfMod/PdfListStore.cs:55 #: ../src/PdfMod/PdfMod/PdfListStore.cs:63 #, csharp-format msgid "Page {0}" msgstr "{0} puslapis" #: ../src/PdfMod/PdfMod/PdfMod.cs:156 msgid "Save the changes made to this document?" msgstr "Įrašyti šio dokumento pakeitimus?" #: ../src/PdfMod/PdfMod/PdfMod.cs:159 msgid "Close _Without Saving" msgstr "Užverti _neįrašant" #: ../src/PdfMod/PdfMod/PdfMod.cs:192 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Tęsti atveriant {0} dokumentą atskirame lange?" msgstr[1] "Tęsti atveriant {0} dokumentus atskiruose languose?" msgstr[2] "Tęsti atveriant {0} dokumentų atskiruose languose?" #: ../src/PdfMod/PdfMod/PdfMod.cs:196 msgid "Open _First" msgstr "Atverti _pirmą" #: ../src/PdfMod/PdfMod/PdfMod.cs:197 msgid "Open _All" msgstr "Atverti _visus" #: ../src/PdfMod/PdfMod/PdfMod.cs:226 #, csharp-format msgid "Loading {0}" msgstr "Įkeliama {0}" #: ../src/PdfMod/PdfMod/PdfMod.cs:246 msgid "Error Loading Document" msgstr "Klaida įkeliant dokumentą" #: ../src/PdfMod/PdfMod/PdfMod.cs:247 #, csharp-format msgid "There was an error loading {0}" msgstr "Klaida įkeliant {0}" #: ../src/PdfMod/PdfMod/PdfMod.cs:268 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (iš pradžių {1})" #: ../src/PdfMod/PdfMod/QueryBox.cs:26 msgid "Select Matching" msgstr "Pasirinkti atitikimą" pdfmod-0.9.1/po/et.po0000644000175000001440000001742411511422704014502 0ustar00gabeusers00000000000000# Estonian translation for pdfmod. # Pdfmod-i eesti keele tõlge. # # Copyright (C) 2010 The GNOME Translation Team. # This file is distributed under the same license as the pdfmod package. # # Mattias Põldaru , 2010. # msgid "" msgstr "" "Project-Id-Version: pdfmod master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=pdfmod&component=general\n" "POT-Creation-Date: 2010-11-24 21:50+0000\n" "PO-Revision-Date: 2010-12-19 02:00+0300\n" "Last-Translator: Mattias Põldaru \n" "Language-Team: Estonian \n" "Language: et\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "PDF Modifier" msgstr "PDF-i muundur" msgid "Remove, extract, and rotate pages in PDF documents" msgstr "PDF dokumendis lehekülgede eemaldamine, lahutamine ja pööramine" #, csharp-format msgid "Page {0}" msgstr "Lehekülg {0}" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Tõsta {1}" msgstr[1] "Tõsta {1}" msgid "Error trying to unmove pages" msgstr "Tõrge lehekülgede tagasitõstmisel" msgid "Error trying to move pages" msgstr "Tõrge lehekülgede liigutamisel" msgid "Error trying to remove pages from document" msgstr "Tõrge lehekülgede eemaldamisel dokumendist" msgid "_File" msgstr "_Fail" msgid "Open a document" msgstr "Dokumendi avamine" msgid "Save changes to this document, overwriting the existing file" msgstr "" "Muudatuste salvestamine sellesse dokumenti, olemasoleva faili ülekirjutamine" msgid "Save this document to a new file" msgstr "Selle dokumendi salvestamine uue nimega" msgid "Recent _Files" msgstr "Hiljutised _failid" msgid "_Insert From..." msgstr "_Lisa mujalt..." msgid "Insert pages from another document" msgstr "Lehekülgede lisamine teisest dokumendist" msgid "_Edit" msgstr "_Redaktor" msgid "Rotate Left" msgstr "Pööra vasakule" msgid "Rotate left" msgstr "Vasakule pööramine" msgid "Rotate Right" msgstr "Pööra paremale" msgid "Rotate right" msgstr "Paremale pööramine" msgid "Select Odd Pages" msgstr "Vali paaritud leheküljed" msgid "Select Even Pages" msgstr "Vali paarisleheküljed" msgid "Select Matching..." msgstr "Kattuvate valimine..." msgid "_Invert Selection" msgstr "_Pööra valik" msgid "_View" msgstr "_Vaade" msgid "Open in Viewer" msgstr "Ava vaaturis" msgid "Open in viewer" msgstr "Vaaturis avamine" msgid "_Bookmarks" msgstr "_Järjehoidjad" msgid "_Add Bookmark" msgstr "_Lisa järjehoidja" msgid "Re_name Bookmark" msgstr "_Nimeta järjehoidja ümber" msgid "_Change Bookmark Destination" msgstr "_Tõsta järjehoidja ümber" #. Translators: {0} is available for you to use; contains the number of bookmarks #, csharp-format msgid "_Remove Bookmark" msgid_plural "_Remove Bookmarks" msgstr[0] "_Eemalda järjehoidja" msgstr[1] "_Eemalda järjehoidjad" msgid "_Edit Bookmarks" msgstr "_Muuda järjehoidjaid" msgid "_Help" msgstr "A_bi" msgid "_Contents" msgstr "_Sisukord" msgid "_Add" msgstr "_Lisa" msgid "_Remove" msgstr "_Eemalda" msgid "View and edit the title, keywords, and more for this document" msgstr "Kuva ja muuda pealkirja, võtmesõnu ja selle dokumendi teisi omadusi" msgid "Toolbar" msgstr "Tööriistariba" msgid "Bookmarks" msgstr "Järjehoidjad" msgid "Fullscreen" msgstr "Täisekraan" #, csharp-format msgid "Export Image" msgid_plural "Export {0} Images" msgstr[0] "Pildi eksportimine" msgstr[1] "{0} pildi eksportimine" #, csharp-format msgid "Save image from the selected pages to a new folder" msgid_plural "Save {0} images from the selected pages to a new folder" msgstr[0] "Valitud lehel oleva pildi salvestamine uude kausta" msgstr[1] "Valitud lehel oleva {0} pildi salvestamine uude kausta" msgid "_Undo" msgstr "_Võta tagasi" #, csharp-format msgid "Undo {0}" msgstr "Võta {0} tagasi" msgid "_Redo" msgstr "_Tee uuesti" #, csharp-format msgid "Redo {0}" msgstr "Tee {0} uuesti" #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Eemalda lehekülg" msgstr[1] "Eemalda {0} lehekülge" #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Eemalda valitud lehekülg" msgstr[1] "Eemalda valitud {0} lehekülge" #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Lehekülje eraldamine" msgstr[1] "{0} lehekülje eraldamine" #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Valitud lehe eraldamine" msgstr[1] "Valitud {0} lehe eraldamine" msgid "Select PDF" msgstr "PDF-i valimine" msgid "Unable to Save Document" msgstr "Dokumendi salvestamine pole võimalik" msgid "Save as..." msgstr "Salvesta kui..." msgid "Error Loading Document" msgstr "Tõrge dokumendi laadimisel" #, csharp-format msgid "There was an error loading {0}" msgstr "{0} laadimisel esines viga" msgid "Error opening help" msgstr "Tõrge abi avamisel" msgid "Would you like to open PDF Mod's online documentation?" msgstr "Kas tahad avada PDF Mod-i veebidokumentatsiooni?" msgid "Visit Website" msgstr "Külasta veebilehte" msgid "Primary Development:" msgstr "Peamine arendus:" msgid "Contributors:" msgstr "Kaasautorid:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" "Copyright {0} Novell Inc.\n" "Copyright {1} teised PDF Mod autorid" msgid "translator-credits" msgstr "Mattias Põldaru 2010." #. Add it to the PDF document msgid "New bookmark" msgstr "Uus järjehoidja" msgid "Add Bookmark" msgstr "Järjehoidja lisamine" #. Translators: {0} is available for you to use; contains the number of bookmarks #, csharp-format msgid "Remove Bookmark" msgid_plural "Remove Bookmarks" msgstr[0] "Järjehoidja eemaldamine" msgstr[1] "Järjehoidjate eemaldamine" msgid "Rename Bookmark" msgstr "Järjehoidja nime muutmine" #, csharp-format msgid "Bookmark links to page {0}" msgstr "Järjehoidja viitab lehele {0}" msgid "PDF Mod" msgstr "PDF Mod" msgid "Save the changes made to this document?" msgstr "Kas salvestada sellesse dokumenti tehtud muudatused?" msgid "Close _Without Saving" msgstr "Sulge _ilma salvestamata" #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Kas jätkata {0} dokumendi avamist eraldi akendes?" msgstr[1] "Kas jätkata {0} dokumendi avamist eraldi akendes?" msgid "Open _First" msgstr "Ava _esimene" msgid "Open _All" msgstr "Ava _kõik" msgid "Loading document..." msgstr "Dokumendi laadimine..." #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (alguses {1})" #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} leht" msgstr[1] "{0} lehte" msgid "Document is Encrypted" msgstr "Dokument on krüpteeritud" msgid "Enter the document's password to open it:" msgstr "Dokumendi avamiseks sisesta selle parool:" msgid "PDF Documents" msgstr "PDF-dokumendid" msgid "All Files" msgstr "Kõik failid" msgid "Select Matching" msgstr "Vali kattuvad" msgid "_Title:" msgstr "_Pealkiri:" msgid "_Author:" msgstr "_Autor:" msgid "_Keywords:" msgstr "_Võtmesõnad:" msgid "_Subject:" msgstr "_Teema:" msgid "_Revert Properties" msgstr "_Taasta omadused" msgid "Change the document's properties back to the original values" msgstr "Dokumendi esialgsete omaduste taastamine" msgid "_Close" msgstr "_Sulge" msgid "Hide the document's properties" msgstr "Dokumendi omaduste varjamine" pdfmod-0.9.1/po/POTFILES.in0000644000175000001440000000065711442002546015310 0ustar00gabeusers00000000000000# List of source files containing translatable strings. [encoding: UTF-8] data/pdfmod.desktop.in.in src/PdfMod/Pdf/Actions/ExportImagesAction.cs src/PdfMod/Pdf/Actions/MoveAction.cs src/PdfMod/Pdf/Actions/RemoveAction.cs src/PdfMod/Pdf/Page.cs src/PdfMod/Gui/Actions.cs src/PdfMod/Gui/BookmarkView.cs src/PdfMod/Gui/PageListStore.cs src/PdfMod/Gui/Client.cs src/PdfMod/Gui/SelectMatchingBox.cs src/PdfMod/Gui/MetadataEditorBox.cs pdfmod-0.9.1/po/ca@valencia.po0000644000175000001440000002663311511422704016262 0ustar00gabeusers00000000000000# Pdf Mod UI Catalan Translation. # Copyright (C) 2009 Free Software Foundation, Inc. # This file is distributed under the same license as the PDF Mod package. # Andreu Correa Casablanca , 2009. # msgid "" msgstr "" "Project-Id-Version: Pdf Mod 0.5\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=pdfmod&component=general\n" "POT-Creation-Date: 2010-09-14 21:06+0000\n" "PO-Revision-Date: 2009-08-17 13:50+0200\n" "Last-Translator: Andreu Correa Casablanca \n" "Language-Team: Català \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "Modificador de fitxers PDF" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Podeu suprimir, extreure i capgirar pàgines en documents PDF" #: ../src/PdfMod/Pdf/Actions/ExportImagesAction.cs:136 #: ../src/PdfMod/Pdf/Page.cs:36 #, fuzzy, csharp-format #| msgid "Redo {0}" msgid "Page {0}" msgstr "Torna a fer {0}" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Es mou {1}" msgstr[1] "Es mouen {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "S'ha produït un error en provar de desfer un moviment de pàgines" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "S'ha produït un error en provar de moure pàgines" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "S'ha produït un error en provar de suprimir pàgines del document" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "_File" msgstr "_Fitxer" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Open a document" msgstr "Obri un document" #: ../src/PdfMod/Gui/Actions.cs:67 msgid "Save changes to this document, overwriting the existing file" msgstr "" "Alça els canvis realitzats al document, se sobreescriurà el fitxer existent" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "Save this document to a new file" msgstr "Alça este document en un fitxer nou" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "_Fitxers Recents" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "_Insert From..." msgstr "_Insereix des de..." #: ../src/PdfMod/Gui/Actions.cs:70 msgid "Insert pages from another document" msgstr "Insereix pàgines d'un altre document" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Edit" msgstr "_Edita" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate Left" msgstr "Gira a l'esquerra" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate left" msgstr "Gira a l'esquerra" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate Right" msgstr "Gira a la dreta" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate right" msgstr "Gira a la dreta" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "Select Odd Pages" msgstr "Sel·lecciona les pàgines senars" #: ../src/PdfMod/Gui/Actions.cs:83 msgid "Select Even Pages" msgstr "Sel·lecciona les pàgines parelles" #: ../src/PdfMod/Gui/Actions.cs:84 msgid "Select Matching..." msgstr "Sel·lecciona per coincidència..." #: ../src/PdfMod/Gui/Actions.cs:85 msgid "_Invert Selection" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:87 msgid "_View" msgstr "_Visualitza" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in Viewer" msgstr "Obri en el visualitzador" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in viewer" msgstr "Obri en el visualitzador" #: ../src/PdfMod/Gui/Actions.cs:92 ../src/PdfMod/Gui/BookmarkView.cs:346 msgid "_Bookmarks" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:93 msgid "_Add Bookmark" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:94 msgid "Re_name Bookmark" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:95 msgid "_Change Bookmark Destination" msgstr "" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/Actions.cs:96 ../src/PdfMod/Gui/BookmarkView.cs:383 #, csharp-format msgid "_Remove Bookmark" msgid_plural "_Remove Bookmarks" msgstr[0] "" msgstr[1] "" #: ../src/PdfMod/Gui/Actions.cs:97 msgid "_Edit Bookmarks" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:99 msgid "_Help" msgstr "A_juda" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "_Contents" msgstr "_Continguts" #: ../src/PdfMod/Gui/Actions.cs:107 msgid "_Add" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:108 #, fuzzy #| msgid "_Redo" msgid "_Remove" msgstr "_Torna a fer" #: ../src/PdfMod/Gui/Actions.cs:111 msgid "View and edit the title, keywords, and more for this document" msgstr "" "Visualitza el document i edita'n el títol, les paraules clau i d'altres dades" #: ../src/PdfMod/Gui/Actions.cs:113 msgid "Toolbar" msgstr "Barra d'eines" #: ../src/PdfMod/Gui/Actions.cs:114 msgid "Bookmarks" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:115 msgid "Fullscreen" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:186 #, fuzzy, csharp-format #| msgid "Export Images" msgid "Export Image" msgid_plural "Export {0} Images" msgstr[0] "Exporta imatges" msgstr[1] "Exporta imatges" #: ../src/PdfMod/Gui/Actions.cs:189 #, fuzzy, csharp-format #| msgid "Save all images in this document to a new folder" msgid "Save image from the selected pages to a new folder" msgid_plural "Save {0} images from the selected pages to a new folder" msgstr[0] "" "Alça totes les imatges que hi ha en este document en una carpeta nova" msgstr[1] "" "Alça totes les imatges que hi ha en este document en una carpeta nova" #: ../src/PdfMod/Gui/Actions.cs:196 msgid "_Undo" msgstr "_Desfer" #: ../src/PdfMod/Gui/Actions.cs:197 #, csharp-format msgid "Undo {0}" msgstr "Desfer {0}" #: ../src/PdfMod/Gui/Actions.cs:201 msgid "_Redo" msgstr "_Torna a fer" #: ../src/PdfMod/Gui/Actions.cs:202 #, csharp-format msgid "Redo {0}" msgstr "Torna a fer {0}" #: ../src/PdfMod/Gui/Actions.cs:210 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Suprimeix la pàgina" msgstr[1] "Suprimeix les {0} pàgines" #: ../src/PdfMod/Gui/Actions.cs:213 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Suprimeix la pàgina sel·leccionada" msgstr[1] "Suprimeix les pàgines {0} sel·leccionades" #: ../src/PdfMod/Gui/Actions.cs:216 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Extreu la pàgina" msgstr[1] "Extreu les {0} pàgines" #: ../src/PdfMod/Gui/Actions.cs:219 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Extreu la pàgina sel·leccionada" msgstr[1] "Extreu les {0} pàgines sel·leccionades" #: ../src/PdfMod/Gui/Actions.cs:229 ../src/PdfMod/Gui/Actions.cs:312 msgid "Select PDF" msgstr "Sel·lecciona el PDF" #: ../src/PdfMod/Gui/Actions.cs:260 msgid "Save as..." msgstr "Anomena i alça..." #: ../src/PdfMod/Gui/Actions.cs:329 ../src/PdfMod/Gui/Client.cs:303 msgid "Error Loading Document" msgstr "S'ha produït un error en carregar el document" #: ../src/PdfMod/Gui/Actions.cs:330 ../src/PdfMod/Gui/Client.cs:304 #, csharp-format msgid "There was an error loading {0}" msgstr "S'ha produit un error en carregar {0}" #: ../src/PdfMod/Gui/Actions.cs:506 msgid "Error opening help" msgstr "S'ha produït un error en obrir l'ajuda" #: ../src/PdfMod/Gui/Actions.cs:507 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Voleu obrir l'ajuda en línia del PDF Mod?" #: ../src/PdfMod/Gui/Actions.cs:528 msgid "Visit Website" msgstr "Visita el lloc web" #: ../src/PdfMod/Gui/Actions.cs:530 msgid "Primary Development:" msgstr "Desenvolupament inicial:" #: ../src/PdfMod/Gui/Actions.cs:533 msgid "Contributors:" msgstr "Contribuïdors:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:551 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" #: ../src/PdfMod/Gui/Actions.cs:554 msgid "translator-credits" msgstr "Andreu Correa Casablanca " #. Add it to the PDF document #: ../src/PdfMod/Gui/BookmarkView.cs:90 msgid "New bookmark" msgstr "" #: ../src/PdfMod/Gui/BookmarkView.cs:113 msgid "Add Bookmark" msgstr "" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/BookmarkView.cs:137 #, fuzzy, csharp-format #| msgid "Remove Page" #| msgid_plural "Remove {0} Pages" msgid "Remove Bookmark" msgid_plural "Remove Bookmarks" msgstr[0] "Suprimeix la pàgina" msgstr[1] "Suprimeix les {0} pàgines" #: ../src/PdfMod/Gui/BookmarkView.cs:285 ../src/PdfMod/Gui/BookmarkView.cs:323 msgid "Rename Bookmark" msgstr "" #: ../src/PdfMod/Gui/BookmarkView.cs:417 #, csharp-format msgid "Bookmark links to page {0}" msgstr "" #: ../src/PdfMod/Gui/Client.cs:86 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:202 msgid "Save the changes made to this document?" msgstr "Voleu alçar els canvis realitzats en este document?" #: ../src/PdfMod/Gui/Client.cs:205 msgid "Close _Without Saving" msgstr "Tancar _sense alçar" #: ../src/PdfMod/Gui/Client.cs:235 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Continua i obri el document {0} en una finestra separada?" msgstr[1] "Continua i obri els documents {0} en finestres separades?" #: ../src/PdfMod/Gui/Client.cs:239 msgid "Open _First" msgstr "Obri _primer" #: ../src/PdfMod/Gui/Client.cs:240 msgid "Open _All" msgstr "Obri'ls _tots" #: ../src/PdfMod/Gui/Client.cs:271 msgid "Loading document..." msgstr "S'està carregant el document..." #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:333 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (originalment {1})" #: ../src/PdfMod/Gui/Client.cs:338 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} pàgina" msgstr[1] "{0} pàgines" #: ../src/PdfMod/Gui/Client.cs:359 msgid "Document is Encrypted" msgstr "El document és encriptat" #: ../src/PdfMod/Gui/Client.cs:360 msgid "Enter the document's password to open it:" msgstr "Introdueix la contrasenya del document per obrir-lo:" #: ../src/PdfMod/Gui/Client.cs:390 msgid "PDF Documents" msgstr "Documents PDF" #: ../src/PdfMod/Gui/Client.cs:391 msgid "All Files" msgstr "Tots els fitxers" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "Sel·lecciona per coincidència" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "_Títol" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "_Autor:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "Paraules _clau:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "_Assumpte:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "_Reverteix les propietats" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "" "Canvia les propietats del document per tornar-les als seus valors originals" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "_Tanca" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "Oculta les propietats del document" pdfmod-0.9.1/po/gl.po0000644000175000001440000002324311406252320014466 0ustar00gabeusers00000000000000# Galician translation of pdfmod. # Copyright (C) 2010 Leandro Regueiro # This file is distributed under the same license as the pdfmod package. # Leandro Regueiro , 2010. # # Proxecto Trasno - Adaptación do software libre á lingua galega: Se desexas # colaborar connosco, podes atopar máis información en http://trasno.net # Fran Diéguez , 2010. # msgid "" msgstr "" "Project-Id-Version: pdfmod\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-05-24 12:27+0200\n" "PO-Revision-Date: 2010-05-24 12:27+0200\n" "Last-Translator: Fran Diéguez \n" "Language-Team: Galician \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n!=1);\\\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "Modificador de PDF" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Eliminar, extraer, e rotar páxinas de documentos PDF" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Mover {1}" msgstr[1] "Mover {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "Produciuse un erro ao intentar anular o movemento de páxinas" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "Produciuse un erro ao intentar mover as páxinas" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Produciuse un erro ao intentar eliminar páxinas do documento" #: ../src/PdfMod/Pdf/Page.cs:36 #, csharp-format msgid "Page {0}" msgstr "Páxina {0}" #: ../src/PdfMod/Gui/Actions.cs:63 msgid "Open a document" msgstr "Abrir un documento" #: ../src/PdfMod/Gui/Actions.cs:64 msgid "_Insert From..." msgstr "_Inserir desde..." #: ../src/PdfMod/Gui/Actions.cs:64 msgid "Insert pages from another document" msgstr "Inserir páxinas de outro documento" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "Save changes to this document, overwriting the existing file" msgstr "Gardar os cambios deste documento, sobrescribindo o ficheiro existente" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Save this document to a new file" msgstr "Gardar este documento nun novo ficheiro" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "_File" msgstr "_Ficheiro" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "_Ficheiros recentes" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "Rotate Right" msgstr "Rotar á dereita" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "Rotate right" msgstr "Rotar á dereita" #: ../src/PdfMod/Gui/Actions.cs:74 msgid "Rotate Left" msgstr "Rotar á esquerda" #: ../src/PdfMod/Gui/Actions.cs:74 msgid "Rotate left" msgstr "Rotar á esquerda" #: ../src/PdfMod/Gui/Actions.cs:75 msgid "Export Images" msgstr "Exportar as imaxes" #: ../src/PdfMod/Gui/Actions.cs:75 msgid "Save all images in this document to a new folder" msgstr "Gardar todas as imaxes deste documento nun novo cartafol" #: ../src/PdfMod/Gui/Actions.cs:77 msgid "_Edit" msgstr "_Editar" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Select Even Pages" msgstr "Seleccionar as páxinas pares" #: ../src/PdfMod/Gui/Actions.cs:80 msgid "Select Odd Pages" msgstr "Seleccionar as páxinas impares" #: ../src/PdfMod/Gui/Actions.cs:81 msgid "Select Matching..." msgstr "Seleccionar as coincidencias" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "_Invert Selection" msgstr "_Inverter a selección" #: ../src/PdfMod/Gui/Actions.cs:86 msgid "_View" msgstr "_Ver" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "_Help" msgstr "A_xuda" #: ../src/PdfMod/Gui/Actions.cs:91 msgid "_Contents" msgstr "_Contido" #: ../src/PdfMod/Gui/Actions.cs:96 msgid "Open in Viewer" msgstr "Abrir no visor" #: ../src/PdfMod/Gui/Actions.cs:96 msgid "Open in viewer" msgstr "Abrir no visor" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "View and edit the title, keywords, and more for this document" msgstr "Ver e editar o título, palabras chave, e outras cousas deste documento" #: ../src/PdfMod/Gui/Actions.cs:102 msgid "Toolbar" msgstr "Barra de ferramentas" #: ../src/PdfMod/Gui/Actions.cs:103 msgid "Fullscreen" msgstr "Pantalla completa" #: ../src/PdfMod/Gui/Actions.cs:172 msgid "_Undo" msgstr "_Desfacer" #: ../src/PdfMod/Gui/Actions.cs:173 #, csharp-format msgid "Undo {0}" msgstr "Desfacer {0}" #: ../src/PdfMod/Gui/Actions.cs:177 msgid "_Redo" msgstr "_Refacer" #: ../src/PdfMod/Gui/Actions.cs:178 #, csharp-format msgid "Redo {0}" msgstr "Refacer {0}" #: ../src/PdfMod/Gui/Actions.cs:186 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Eliminar a páxina" msgstr[1] "Eliminar {0} páxinas" #: ../src/PdfMod/Gui/Actions.cs:189 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Eliminar a páxina seleccionada" msgstr[1] "Eliminar as {0} páxinas seleccionadas" #: ../src/PdfMod/Gui/Actions.cs:192 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Extraer a páxina" msgstr[1] "Extraer {0} páxinas" #: ../src/PdfMod/Gui/Actions.cs:195 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Extraer a páxina seleccionada" msgstr[1] "Extraer as {0} páxinas seleccionadas" #: ../src/PdfMod/Gui/Actions.cs:203 ../src/PdfMod/Gui/Actions.cs:244 msgid "Select PDF" msgstr "Seleccionar PDF" #: ../src/PdfMod/Gui/Actions.cs:261 ../src/PdfMod/Gui/Client.cs:289 msgid "Error Loading Document" msgstr "Produciuse un erro ao cargar o documento" #: ../src/PdfMod/Gui/Actions.cs:262 ../src/PdfMod/Gui/Client.cs:290 #, csharp-format msgid "There was an error loading {0}" msgstr "Produciuse un erro ao cargar {0}" #: ../src/PdfMod/Gui/Actions.cs:276 msgid "Save as..." msgstr "Gardar como..." #: ../src/PdfMod/Gui/Actions.cs:413 msgid "Error opening help" msgstr "Produciuse un erro ao abrir a axuda" #: ../src/PdfMod/Gui/Actions.cs:414 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Desexa abrir a documentación en liña de PDF Mod?" #: ../src/PdfMod/Gui/Actions.cs:435 msgid "Visit Website" msgstr "Visitar sitio web" #: ../src/PdfMod/Gui/Actions.cs:437 msgid "Primary Development:" msgstr "Desenvolvemento primario:" #: ../src/PdfMod/Gui/Actions.cs:440 msgid "Contributors:" msgstr "Colaboradores:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:458 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" "Copyright {0} Novell Inc.\n" "Copyright {1} Outros contribuidores de PDF Mod" #: ../src/PdfMod/Gui/Actions.cs:461 msgid "translator-credits" msgstr "" "Leandro Regueiro , 2010\n" "Fran Diéguez , 2010\n" "\n" "Proxecto Trasno - Adaptación do software libre á lingua galega: Se\n" "desexas colaborar connosco, podes atopar máis información\n" "en http://trasno.net" #: ../src/PdfMod/Gui/Client.cs:85 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:190 msgid "Save the changes made to this document?" msgstr "Desexa gardar os cambios realizados ao documento?" #: ../src/PdfMod/Gui/Client.cs:193 msgid "Close _Without Saving" msgstr "Pechar _sen gardar" #: ../src/PdfMod/Gui/Client.cs:223 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Continuar ca apertura de {0} documento en xanelas separadas?" msgstr[1] "Continuar ca apertura de {0} documentos en xanelas separadas?" #: ../src/PdfMod/Gui/Client.cs:227 msgid "Open _First" msgstr "Abrir _primeiro" #: ../src/PdfMod/Gui/Client.cs:228 msgid "Open _All" msgstr "_Abrir todo" #: ../src/PdfMod/Gui/Client.cs:259 msgid "Loading document..." msgstr "Cargando o documento..." #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:315 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (antes ocupaba {1})" #: ../src/PdfMod/Gui/Client.cs:320 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} páxina" msgstr[1] "{0} páxinas" #: ../src/PdfMod/Gui/Client.cs:343 msgid "Document is Encrypted" msgstr "O documento está cifrado" #: ../src/PdfMod/Gui/Client.cs:344 msgid "Enter the document's password to open it:" msgstr "Introduza o contrasinal do documento para abrilo:" #: ../src/PdfMod/Gui/Client.cs:377 msgid "PDF Documents" msgstr "Documentos PDF" #: ../src/PdfMod/Gui/Client.cs:378 msgid "All Files" msgstr "Todos os ficheiros" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "Seleccionar as coincidencias" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "_Título:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "_Autor:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "Palabras _chave:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "A_sunto:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "_Reverter as propiedades" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "Restaurar os valores orixinais das propiedades do documento" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "_Pechar" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "Ocultar as propiedades do documento" pdfmod-0.9.1/po/LINGUAS0000644000175000001440000000024111511422704014544 0ustar00gabeusers00000000000000# Translators: don't forget to translate the user-guide in docs/ bn_IN ca ca@valencia cs da de es et fr gl hr hu it ja lt nb nl pl pt pt_BR ro ru sl sv ta zh_CN pdfmod-0.9.1/po/ja.po0000644000175000001440000003037211511422704014461 0ustar00gabeusers00000000000000# pdfmod ja.po. # Copyright (C) 2009,2010 Free Software Foundation, Inc. # This file is distributed under the same license as the pdfmod package. # Takeshi AIHANA , 2009,2010. # msgid "" msgstr "" "Project-Id-Version: pdfmod master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-11-07 11:11+0900\n" "PO-Revision-Date: 2010-11-07 11:06+0900\n" "Last-Translator: Takeshi AIHANA \n" "Language-Team: Japanese \n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "PDF の変更" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "PDF ドキュメントのページの削除や展開や回転を行います" #: ../src/PdfMod/Pdf/Actions/ExportImagesAction.cs:136 #: ../src/PdfMod/Pdf/Page.cs:36 #, csharp-format msgid "Page {0}" msgstr "{0}ページ" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "{1}の移動" msgstr[1] "{1}の移動" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "ページ移動のアンドゥ・エラー" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "ページの移動エラー" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "ドキュメントからページの削除エラー" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "_File" msgstr "ファイル(_F)" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Open a document" msgstr "ドキュメントを開きます" #: ../src/PdfMod/Gui/Actions.cs:67 msgid "Save changes to this document, overwriting the existing file" msgstr "このドキュメントの変更点を保存します (既存のファイルを上書きします)" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "Save this document to a new file" msgstr "このドキュメントを新しいファイルとして保存します" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "最近開いたファイル(_F)" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "_Insert From..." msgstr "別の PDF を挿入する(_I)..." #: ../src/PdfMod/Gui/Actions.cs:70 msgid "Insert pages from another document" msgstr "別のドキュメントのページを挿入します" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Edit" msgstr "編集(_E)" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate Left" msgstr "反時計回りに回転する" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate left" msgstr "反時計回りに回転させます" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate Right" msgstr "時計回りに回転する" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate right" msgstr "時計回りに回転させます" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "Select Odd Pages" msgstr "奇数ページの選択" #: ../src/PdfMod/Gui/Actions.cs:83 msgid "Select Even Pages" msgstr "偶数ページの選択" #: ../src/PdfMod/Gui/Actions.cs:84 msgid "Select Matching..." msgstr "検索して選択..." #: ../src/PdfMod/Gui/Actions.cs:85 msgid "_Invert Selection" msgstr "検索の反転(_I)" #: ../src/PdfMod/Gui/Actions.cs:87 msgid "_View" msgstr "表示(_V)" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in Viewer" msgstr "ビューアで開く" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in viewer" msgstr "選択したページをビューアの中に開きます" #: ../src/PdfMod/Gui/Actions.cs:92 ../src/PdfMod/Gui/BookmarkView.cs:346 msgid "_Bookmarks" msgstr "ブックマーク(_B)" #: ../src/PdfMod/Gui/Actions.cs:93 msgid "_Add Bookmark" msgstr "ブックマークの追加(_A)" #: ../src/PdfMod/Gui/Actions.cs:94 msgid "Re_name Bookmark" msgstr "ブックマーク名の変更(_N)" #: ../src/PdfMod/Gui/Actions.cs:95 msgid "_Change Bookmark Destination" msgstr "ブックマーク先の変更(_C)" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/Actions.cs:96 ../src/PdfMod/Gui/BookmarkView.cs:383 #, csharp-format msgid "_Remove Bookmark" msgid_plural "_Remove Bookmarks" msgstr[0] "ブックマークの削除(_R)" msgstr[1] "複数のブックマークの削除(_R)" #: ../src/PdfMod/Gui/Actions.cs:97 msgid "_Edit Bookmarks" msgstr "ブックマークの編集(_E)" #: ../src/PdfMod/Gui/Actions.cs:99 msgid "_Help" msgstr "ヘルプ(_H)" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "_Contents" msgstr "目次(_C)" #: ../src/PdfMod/Gui/Actions.cs:107 msgid "_Add" msgstr "追加(_A)" #: ../src/PdfMod/Gui/Actions.cs:108 msgid "_Remove" msgstr "削除(_R)" #: ../src/PdfMod/Gui/Actions.cs:111 msgid "View and edit the title, keywords, and more for this document" msgstr "このドキュメントのタイトルやキーワード等の情報を表示したり編集します" #: ../src/PdfMod/Gui/Actions.cs:113 msgid "Toolbar" msgstr "ツールバー" #: ../src/PdfMod/Gui/Actions.cs:114 msgid "Bookmarks" msgstr "ブックマーク" #: ../src/PdfMod/Gui/Actions.cs:115 msgid "Fullscreen" msgstr "フルスクリーン表示" #: ../src/PdfMod/Gui/Actions.cs:186 #, csharp-format msgid "Export Image" msgid_plural "Export {0} Images" msgstr[0] "画像のエキスポート" msgstr[1] "{0}個の画像のエキスポート" #: ../src/PdfMod/Gui/Actions.cs:189 #, csharp-format msgid "Save image from the selected pages to a new folder" msgid_plural "Save {0} images from the selected pages to a new folder" msgstr[0] "選択したページに含まれている画像を新しいフォルダに保存します" msgstr[1] "選択したページに含まれている{0}個の画像を新しいフォルダに保存します" #: ../src/PdfMod/Gui/Actions.cs:196 msgid "_Undo" msgstr "元に戻す(_U)" #: ../src/PdfMod/Gui/Actions.cs:197 #, csharp-format msgid "Undo {0}" msgstr "\"{0}\" を元に戻す" #: ../src/PdfMod/Gui/Actions.cs:201 msgid "_Redo" msgstr "やり直す(_R)" #: ../src/PdfMod/Gui/Actions.cs:202 #, csharp-format msgid "Redo {0}" msgstr "\"{0}\" をやり直す" #: ../src/PdfMod/Gui/Actions.cs:210 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "ページの削除" msgstr[1] "{0}ページの削除" #: ../src/PdfMod/Gui/Actions.cs:213 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "選択したページを削除します" msgstr[1] "選択した{0}ページを削除します" #: ../src/PdfMod/Gui/Actions.cs:216 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "ページを抜き出す" msgstr[1] "{0}ページ抜き出す" #: ../src/PdfMod/Gui/Actions.cs:219 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "選択したページを抜き出します" msgstr[1] "選択した{0}ページを抜き出します" #: ../src/PdfMod/Gui/Actions.cs:229 ../src/PdfMod/Gui/Actions.cs:316 msgid "Select PDF" msgstr "PDF の選択" #: ../src/PdfMod/Gui/Actions.cs:258 msgid "Unable to Save Document" msgstr "ドキュメントを保存できません" #: ../src/PdfMod/Gui/Actions.cs:264 msgid "Save as..." msgstr "別名で保存..." #: ../src/PdfMod/Gui/Actions.cs:333 ../src/PdfMod/Gui/Client.cs:308 msgid "Error Loading Document" msgstr "ドキュメントの読み込みエラー" #: ../src/PdfMod/Gui/Actions.cs:334 ../src/PdfMod/Gui/Client.cs:309 #, csharp-format msgid "There was an error loading {0}" msgstr "{0} を読み込んでいる最中にエラーが発生しました。" #: ../src/PdfMod/Gui/Actions.cs:510 msgid "Error opening help" msgstr "ヘルプの表示エラー" #: ../src/PdfMod/Gui/Actions.cs:511 msgid "Would you like to open PDF Mod's online documentation?" msgstr "PDF Mod のオンライン・ドキュメントを開きますか?" #: ../src/PdfMod/Gui/Actions.cs:532 msgid "Visit Website" msgstr "ホームページを開く" #: ../src/PdfMod/Gui/Actions.cs:534 msgid "Primary Development:" msgstr "メインの開発者:" #: ../src/PdfMod/Gui/Actions.cs:537 msgid "Contributors:" msgstr "その他の貢献者:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:555 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" "Copyright {0} Novell Inc.\n" "Copyright {1} その他の貢献者" #: ../src/PdfMod/Gui/Actions.cs:558 msgid "translator-credits" msgstr "相花 毅 " #. Add it to the PDF document #: ../src/PdfMod/Gui/BookmarkView.cs:90 msgid "New bookmark" msgstr "新しいブックマーク" #: ../src/PdfMod/Gui/BookmarkView.cs:113 msgid "Add Bookmark" msgstr "ブックマークの追加" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/BookmarkView.cs:137 #, csharp-format msgid "Remove Bookmark" msgid_plural "Remove Bookmarks" msgstr[0] "ブックマークの削除" msgstr[1] "複数のブックマークの削除" #: ../src/PdfMod/Gui/BookmarkView.cs:285 ../src/PdfMod/Gui/BookmarkView.cs:323 msgid "Rename Bookmark" msgstr "ブックマーク名の変更" #: ../src/PdfMod/Gui/BookmarkView.cs:417 #, csharp-format msgid "Bookmark links to page {0}" msgstr "{0}ページ目を指しているブックマークです" #: ../src/PdfMod/Gui/Client.cs:86 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:207 msgid "Save the changes made to this document?" msgstr "このドキュメントの変更点を保存しますか?" #: ../src/PdfMod/Gui/Client.cs:210 msgid "Close _Without Saving" msgstr "保存せずに閉じる(_W)" #: ../src/PdfMod/Gui/Client.cs:240 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "{0} のドキュメントを別々のウィンドウで開きますか?" msgstr[1] "{0} の全てのドキュメントを別々のウィンドウで開きますか?" #: ../src/PdfMod/Gui/Client.cs:244 msgid "Open _First" msgstr "先頭を開く(_F)" #: ../src/PdfMod/Gui/Client.cs:245 msgid "Open _All" msgstr "全て開く(_A)" #: ../src/PdfMod/Gui/Client.cs:276 msgid "Loading document..." msgstr "ドキュメントの読み込み中..." #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:338 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (もともとは {1})" #: ../src/PdfMod/Gui/Client.cs:343 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0}ページ" msgstr[1] "{0}ページ" #: ../src/PdfMod/Gui/Client.cs:364 msgid "Document is Encrypted" msgstr "ドキュメントは暗号化されています" #: ../src/PdfMod/Gui/Client.cs:365 msgid "Enter the document's password to open it:" msgstr "ドキュメントを開く際のパスワードを入力して下さい:" #: ../src/PdfMod/Gui/Client.cs:395 msgid "PDF Documents" msgstr "PDF ドキュメント" #: ../src/PdfMod/Gui/Client.cs:396 msgid "All Files" msgstr "全てのファイル" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "検索して選択する" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "タイトル(_T):" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "作者(_A):" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "キーワード(_K):" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "サブタイトル(_S):" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "元に戻す(_R)" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "ドキュメントのプロパティに対する変更点を元に戻します" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "閉じる(_C)" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "ドキュメントのプロパティ表示を OFF にします" pdfmod-0.9.1/po/da.po0000644000175000001440000002156011274372763014471 0ustar00gabeusers00000000000000# Danish translation of pdfmod # Copyright (C) 2009 pdfmod # This file is distributed under the same license as the pdfmod package. # Kris Thomsen , 2009. # msgid "" msgstr "" "Project-Id-Version: pdfmod\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-10-21 22:53+0200\n" "PO-Revision-Date: 2009-10-21 01:58+0200\n" "Last-Translator: Kris Thomsen \n" "Language-Team: Danish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "PDF Moderator" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Fjern, udtræk og rotér sider i PDF-dokumenter" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Flyt {1}" msgstr[1] "Flyt {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "Kunne ikke omgøre flytning af sider" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "Kunne ikke flytte sider" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Kunne ikke fjerne sider fra dokument" #: ../src/PdfMod/Gui/Actions.cs:63 msgid "Open a document" msgstr "Åbn et dokument" #: ../src/PdfMod/Gui/Actions.cs:64 msgid "_Insert From..." msgstr "_Indsæt fra..." #: ../src/PdfMod/Gui/Actions.cs:64 msgid "Insert pages from another document" msgstr "Indsæt sider fra et andet dokument" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "Save changes to this document, overwriting the existing file" msgstr "Gem ændringer til dette dokument og overskriv den eksisterende fil" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Save this document to a new file" msgstr "Gem dette dokument til en ny fil" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "_File" msgstr "_Fil" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "Seneste _filer" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "Rotate Right" msgstr "Rotér til højre" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "Rotate right" msgstr "Rotér til højre" #: ../src/PdfMod/Gui/Actions.cs:74 msgid "Rotate Left" msgstr "Rotér til venstre" #: ../src/PdfMod/Gui/Actions.cs:74 msgid "Rotate left" msgstr "Rotér til venstre" #: ../src/PdfMod/Gui/Actions.cs:75 msgid "Export Images" msgstr "Eksportér billeder" #: ../src/PdfMod/Gui/Actions.cs:75 msgid "Save all images in this document to a new folder" msgstr "Gem alle billeder i dette dokument i en ny mappe" #: ../src/PdfMod/Gui/Actions.cs:77 msgid "_Edit" msgstr "_Redigér" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Select Even Pages" msgstr "Vælg lige sider" #: ../src/PdfMod/Gui/Actions.cs:80 msgid "Select Odd Pages" msgstr "Vælg ulige sider" #: ../src/PdfMod/Gui/Actions.cs:81 msgid "Select Matching..." msgstr "Vælg tilsvarende..." #: ../src/PdfMod/Gui/Actions.cs:82 msgid "_Invert Selection" msgstr "_Invertér markering" #: ../src/PdfMod/Gui/Actions.cs:86 msgid "_View" msgstr "_Vis" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "_Help" msgstr "_Hjælp" #: ../src/PdfMod/Gui/Actions.cs:91 msgid "_Contents" msgstr "_Indhold" #: ../src/PdfMod/Gui/Actions.cs:96 msgid "Open in Viewer" msgstr "Åbn i fremviser" #: ../src/PdfMod/Gui/Actions.cs:96 msgid "Open in viewer" msgstr "Åbn i fremviser" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "View and edit the title, keywords, and more for this document" msgstr "Vis og redigér titlen, stikordene og andet for dette dokument" #: ../src/PdfMod/Gui/Actions.cs:102 msgid "Toolbar" msgstr "Værktøjslinje" #: ../src/PdfMod/Gui/Actions.cs:103 msgid "Fullscreen" msgstr "Fuldskærm" #: ../src/PdfMod/Gui/Actions.cs:177 msgid "_Undo" msgstr "_Fortryd" #: ../src/PdfMod/Gui/Actions.cs:178 #, csharp-format msgid "Undo {0}" msgstr "Fortryd {0}" #: ../src/PdfMod/Gui/Actions.cs:182 msgid "_Redo" msgstr "_Omgør" #: ../src/PdfMod/Gui/Actions.cs:183 #, csharp-format msgid "Redo {0}" msgstr "Omgør {0}" #: ../src/PdfMod/Gui/Actions.cs:191 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Fjern side" msgstr[1] "Fjern {0} sider" #: ../src/PdfMod/Gui/Actions.cs:194 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Fjern markeret side" msgstr[1] "Fjern de {0} markerede sider" #: ../src/PdfMod/Gui/Actions.cs:197 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Udtræk side" msgstr[1] "Udtræk {0} sider" #: ../src/PdfMod/Gui/Actions.cs:200 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Udtræk den valgte side" msgstr[1] "Udtræk de {0} valgte sider" #: ../src/PdfMod/Gui/Actions.cs:208 ../src/PdfMod/Gui/Actions.cs:254 msgid "Select PDF" msgstr "Vælg PDF" #: ../src/PdfMod/Gui/Actions.cs:212 msgid "PDF Documents" msgstr "PDF-dokumenter" #: ../src/PdfMod/Gui/Actions.cs:213 ../src/PdfMod/Gui/Actions.cs:259 #: ../src/PdfMod/Gui/Actions.cs:290 msgid "All Files" msgstr "Alle filer" #: ../src/PdfMod/Gui/Actions.cs:281 msgid "Save as..." msgstr "Gem som..." #: ../src/PdfMod/Gui/Actions.cs:423 msgid "Error opening help" msgstr "Fejl ved åbning af hjælp" #: ../src/PdfMod/Gui/Actions.cs:424 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Vil du åbne PDF Mods online-dokumentation?" #: ../src/PdfMod/Gui/Actions.cs:445 msgid "Visit Website" msgstr "Besøg netsted" #: ../src/PdfMod/Gui/Actions.cs:447 msgid "Primary Development:" msgstr "Primær udvikling:" #: ../src/PdfMod/Gui/Actions.cs:450 msgid "Contributors:" msgstr "Bidragydere:" #: ../src/PdfMod/Gui/Actions.cs:466 msgid "translator-credits" msgstr "" "Kris Thomsen\n" "\n" "Dansk-gruppen \n" "Mere info: http://www.dansk-gruppen.dk" #: ../src/PdfMod/Gui/Client.cs:84 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:189 msgid "Save the changes made to this document?" msgstr "Gem ændringerne i dette dokument?" #: ../src/PdfMod/Gui/Client.cs:192 msgid "Close _Without Saving" msgstr "Luk _uden at gemme" #: ../src/PdfMod/Gui/Client.cs:221 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Fortsæt, åbn {0} dokument i et separat vindue?" msgstr[1] "Fortsæt, åbn alle {0} dokumenter i separate vinduer?" #: ../src/PdfMod/Gui/Client.cs:225 msgid "Open _First" msgstr "Åbn _første" #: ../src/PdfMod/Gui/Client.cs:226 msgid "Open _All" msgstr "Åbn _alle" #: ../src/PdfMod/Gui/Client.cs:257 msgid "Loading document..." msgstr "Indlæser dokument..." #: ../src/PdfMod/Gui/Client.cs:287 msgid "Error Loading Document" msgstr "Fejl ved indlæsning af dokument" #: ../src/PdfMod/Gui/Client.cs:288 #, csharp-format msgid "There was an error loading {0}" msgstr "Der opstod en fejl ved indlæsning {0}" #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:313 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (oprindeligt {1})" #: ../src/PdfMod/Gui/Client.cs:318 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} side" msgstr[1] "{0} sider" #: ../src/PdfMod/Gui/Client.cs:341 msgid "Document is Encrypted" msgstr "Dokument er krypteret" #: ../src/PdfMod/Gui/Client.cs:342 msgid "Enter the document's password to open it:" msgstr "Indtast dokumentets adgangskode for at åbne det:" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "Vælg passende" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "_Titel:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "_Forfatter:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "_Nøgleord:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "_Emne:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "_Skift egenskaber tilbage" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "Skift dokumentets egenskaber tilbage til de originale værdier" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "_Luk" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "Skjul dokumentets egenskaber" #~ msgid "/Subtype" #~ msgstr "/Undertype" #~ msgid "Pages {1} - {2}" #~ msgid_plural "Pages {1} - {2}" #~ msgstr[0] "Side {1} - {2}" #~ msgstr[1] "Side {1} - {2}" #~ msgid "Pages {1}" #~ msgid_plural "Pages {1}" #~ msgstr[0] "Side {1}" #~ msgstr[1] "Side {1}" #~ msgid "{0} - Images for {1}" #~ msgstr "{0} - Billeder for {1}" #~ msgid "Loading {0}" #~ msgstr "Indlæser {0}" pdfmod-0.9.1/po/cs.po0000644000175000001440000002772111511422704014500 0ustar00gabeusers00000000000000# Czech translation for pdfmod. # Copyright (C) 2009, 2010 the author(s) of pdfmod. # This file is distributed under the same license as the pdfmod package. # Marek Černocký , 2009, 2010. # msgid "" msgstr "" "Project-Id-Version: pdfmod\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=pdfmod&component=general\n" "POT-Creation-Date: 2010-10-28 19:45+0000\n" "PO-Revision-Date: 2010-10-29 12:02+0200\n" "Last-Translator: Marek Černocký \n" "Language-Team: Czech \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cs\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" "X-Poedit-Language: Czech\n" "X-Poedit-SourceCharset: utf-8\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "Aplikace na úpravy PDF" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Odstraňování, přidávání, extrakce a otáčení stránek v dokumentech PDF" #: ../src/PdfMod/Pdf/Actions/ExportImagesAction.cs:136 #: ../src/PdfMod/Pdf/Page.cs:36 #, csharp-format msgid "Page {0}" msgstr "Stránka {0}" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Přesunout {1}" msgstr[1] "Přesunout {1}" msgstr[2] "Přesunout {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "Chyba při pokusu o vrácení stránek na původní místo" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "Chyba při pokusu o přesun stránek" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Chyba při pokusu o odstranění stránek z dokumentu" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "_File" msgstr "_Soubor" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Open a document" msgstr "Otevřít dokument" #: ../src/PdfMod/Gui/Actions.cs:67 msgid "Save changes to this document, overwriting the existing file" msgstr "Uložit změny do tohoto dokumentu, přepsat existující soubor" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "Save this document to a new file" msgstr "Uložit tento dokument do nového souboru" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "Nedávné _soubory" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "_Insert From..." msgstr "_Vložit z…" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "Insert pages from another document" msgstr "Vložit stránky z jiného dokumentu" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Edit" msgstr "_Upravit" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate Left" msgstr "Otočit vlevo" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate left" msgstr "Otočit vlevo" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate Right" msgstr "Otočit vpravo" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate right" msgstr "Otočit vpravo" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "Select Odd Pages" msgstr "Vybrat liché stránky" #: ../src/PdfMod/Gui/Actions.cs:83 msgid "Select Even Pages" msgstr "Vybrat sudé stránky" #: ../src/PdfMod/Gui/Actions.cs:84 msgid "Select Matching..." msgstr "Vybrat odpovídající…" #: ../src/PdfMod/Gui/Actions.cs:85 msgid "_Invert Selection" msgstr "_Invertovat výběr" #: ../src/PdfMod/Gui/Actions.cs:87 msgid "_View" msgstr "_Zobrazit" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in Viewer" msgstr "Zobrazit v prohlížeči" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in viewer" msgstr "Zobrazit v prohlížeči" #: ../src/PdfMod/Gui/Actions.cs:92 ../src/PdfMod/Gui/BookmarkView.cs:346 msgid "_Bookmarks" msgstr "_Záložky" #: ../src/PdfMod/Gui/Actions.cs:93 msgid "_Add Bookmark" msgstr "Přid_at záložku" #: ../src/PdfMod/Gui/Actions.cs:94 msgid "Re_name Bookmark" msgstr "Přejme_novat záložku" #: ../src/PdfMod/Gui/Actions.cs:95 msgid "_Change Bookmark Destination" msgstr "Z_měnit cíl záložky" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/Actions.cs:96 ../src/PdfMod/Gui/BookmarkView.cs:383 #, csharp-format msgid "_Remove Bookmark" msgid_plural "_Remove Bookmarks" msgstr[0] "Odst_ranit záložku" msgstr[1] "Odst_ranit záložky" msgstr[2] "Odst_ranit záložky" #: ../src/PdfMod/Gui/Actions.cs:97 msgid "_Edit Bookmarks" msgstr "_Upravit záložky" #: ../src/PdfMod/Gui/Actions.cs:99 msgid "_Help" msgstr "_Nápověda" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "_Contents" msgstr "_Obsah" #: ../src/PdfMod/Gui/Actions.cs:107 msgid "_Add" msgstr "Přid_at" #: ../src/PdfMod/Gui/Actions.cs:108 msgid "_Remove" msgstr "Odst_ranit" #: ../src/PdfMod/Gui/Actions.cs:111 msgid "View and edit the title, keywords, and more for this document" msgstr "Zobrazit a upravit název, klíčová slova a další údaje tohoto dokumentu" #: ../src/PdfMod/Gui/Actions.cs:113 msgid "Toolbar" msgstr "Panel nástrojů" #: ../src/PdfMod/Gui/Actions.cs:114 msgid "Bookmarks" msgstr "Záložky" #: ../src/PdfMod/Gui/Actions.cs:115 msgid "Fullscreen" msgstr "Přes celou obrazovku" #: ../src/PdfMod/Gui/Actions.cs:186 #, csharp-format msgid "Export Image" msgid_plural "Export {0} Images" msgstr[0] "Exportovat obrázek" msgstr[1] "Exportovat {0} obrázky" msgstr[2] "Exportovat {0} obrázků" #: ../src/PdfMod/Gui/Actions.cs:189 #, csharp-format msgid "Save image from the selected pages to a new folder" msgid_plural "Save {0} images from the selected pages to a new folder" msgstr[0] "Uložit obrázek z vybraných stránek do nové složky" msgstr[1] "Uložit {0} obrázky z vybraných stránek do nové složky" msgstr[2] "Uložit {0} obrázků z vybraných stránek do nové složky" #: ../src/PdfMod/Gui/Actions.cs:196 msgid "_Undo" msgstr "_Zpět" #: ../src/PdfMod/Gui/Actions.cs:197 #, csharp-format msgid "Undo {0}" msgstr "Zpět {0}" #: ../src/PdfMod/Gui/Actions.cs:201 msgid "_Redo" msgstr "Zn_ovu" #: ../src/PdfMod/Gui/Actions.cs:202 #, csharp-format msgid "Redo {0}" msgstr "Znovu {0}" #: ../src/PdfMod/Gui/Actions.cs:210 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Odstranit stránku" msgstr[1] "Odstranit {0} stránky" msgstr[2] "Odstranit {0} stránek" #: ../src/PdfMod/Gui/Actions.cs:213 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Odstranit vybranou stránku" msgstr[1] "Odstranit {0}vybrané stránky" msgstr[2] "Odstranit {0} vybraných stránek" #: ../src/PdfMod/Gui/Actions.cs:216 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Extrahovat stránku" msgstr[1] "Extrahovat {0} stránky" msgstr[2] "Extrahovat {0} stránek" #: ../src/PdfMod/Gui/Actions.cs:219 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Extrahovat vybranou stránku" msgstr[1] "Extrahovat {0} vybrané stránky" msgstr[2] "Extrahovat {0} vybraných stránek" #: ../src/PdfMod/Gui/Actions.cs:229 ../src/PdfMod/Gui/Actions.cs:316 msgid "Select PDF" msgstr "Výběr PDF" #: ../src/PdfMod/Gui/Actions.cs:258 msgid "Unable to Save Document" msgstr "Nelze uložit dokument" #: ../src/PdfMod/Gui/Actions.cs:264 msgid "Save as..." msgstr "Uložení jako…" #: ../src/PdfMod/Gui/Actions.cs:333 ../src/PdfMod/Gui/Client.cs:308 msgid "Error Loading Document" msgstr "Chyba při načítání dokumentu" #: ../src/PdfMod/Gui/Actions.cs:334 ../src/PdfMod/Gui/Client.cs:309 #, csharp-format msgid "There was an error loading {0}" msgstr "Vyskytla se chyba během načítání {0}" #: ../src/PdfMod/Gui/Actions.cs:510 msgid "Error opening help" msgstr "Chyba při otevírání nápovědy" #: ../src/PdfMod/Gui/Actions.cs:511 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Chtěli byste otevřít on-line dokumentaci k PDF Mod?" #: ../src/PdfMod/Gui/Actions.cs:532 msgid "Visit Website" msgstr "Navštívit webové stránky" #: ../src/PdfMod/Gui/Actions.cs:534 msgid "Primary Development:" msgstr "Hlavní vývoj:" #: ../src/PdfMod/Gui/Actions.cs:537 msgid "Contributors:" msgstr "Přispěvatelé:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:555 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" "Copyright {0} Novell Inc.\n" "Copyright {1} ostatní přispěvatelé PDF Mod" #: ../src/PdfMod/Gui/Actions.cs:558 msgid "translator-credits" msgstr "Marek Černocký " #. Add it to the PDF document #: ../src/PdfMod/Gui/BookmarkView.cs:90 msgid "New bookmark" msgstr "Nová záložka" #: ../src/PdfMod/Gui/BookmarkView.cs:113 msgid "Add Bookmark" msgstr "Přidat záložku" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/BookmarkView.cs:137 #, csharp-format msgid "Remove Bookmark" msgid_plural "Remove Bookmarks" msgstr[0] "Odst_ranit záložku" msgstr[1] "Odst_ranit záložky" msgstr[2] "Odst_ranit záložky" #: ../src/PdfMod/Gui/BookmarkView.cs:285 ../src/PdfMod/Gui/BookmarkView.cs:323 msgid "Rename Bookmark" msgstr "Přejmenovat založku" #: ../src/PdfMod/Gui/BookmarkView.cs:417 #, csharp-format msgid "Bookmark links to page {0}" msgstr "Záložka odkazuje na stránku {0}" #: ../src/PdfMod/Gui/Client.cs:86 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:207 msgid "Save the changes made to this document?" msgstr "Uložit změny provedené v tomto dokumentu?" #: ../src/PdfMod/Gui/Client.cs:210 msgid "Close _Without Saving" msgstr "Zavřít _bez uložení" #: ../src/PdfMod/Gui/Client.cs:240 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Pokračovat, otevírání {0} dokumentu ve zvláštním okně?" msgstr[1] "Pokračovat, otevírání {0} dokumentů ve zvláštních oknech?" msgstr[2] "Pokračovat, otevírání všech {0} dokumentů ve zvláštních oknech?" #: ../src/PdfMod/Gui/Client.cs:244 msgid "Open _First" msgstr "Otevřít _první" #: ../src/PdfMod/Gui/Client.cs:245 msgid "Open _All" msgstr "Otevřít _vše" #: ../src/PdfMod/Gui/Client.cs:276 msgid "Loading document..." msgstr "Načítá se dokument…" #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:338 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (původně {1})" #: ../src/PdfMod/Gui/Client.cs:343 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} stránka" msgstr[1] "{0} stránky" msgstr[2] "{0} stránek" #: ../src/PdfMod/Gui/Client.cs:364 msgid "Document is Encrypted" msgstr "Dokument je šifrovaný" #: ../src/PdfMod/Gui/Client.cs:365 msgid "Enter the document's password to open it:" msgstr "Pro otevření zadejte heslo k dokumentu:" #: ../src/PdfMod/Gui/Client.cs:395 msgid "PDF Documents" msgstr "Dokumenty PDF" #: ../src/PdfMod/Gui/Client.cs:396 msgid "All Files" msgstr "Všechny soubory" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "Vybrat odpovídající" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "_Název:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "_Autor:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "_Klíčová slova:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "_Subjekt:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "_Původní vlastnosti" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "Vráti zpět původní hodnoty vlastností dokumentu" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "_Zavřít" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "Skrýt vlastnosti dokumentu" pdfmod-0.9.1/po/pl.po0000644000175000001440000002413611406252320014501 0ustar00gabeusers00000000000000# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # Aviary.pl # Jeśli masz jakiekolwiek uwagi odnoszące się do tłumaczenia lub chcesz # pomóc w jego rozwijaniu i pielęgnowaniu, napisz do nas: # gnomepl@aviary.pl # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # Polish translations for pdfmod package # Polskie tłumaczenia dla pakietu pdfmod. # Copyright (C) 2009 THE pdfmod'S COPYRIGHT HOLDER # This file is distributed under the same license as the pdfmod package. # Michał Sawicz , 2009. # Aviary.pl , 2009. # Łukasz Jernaś , 2009, 2010. msgid "" msgstr "" "Project-Id-Version: pdfmod 0.6\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-05-25 23:15+0200\n" "PO-Revision-Date: 2010-05-12 22:51+0100\n" "Last-Translator: Wadim Dziedzic \n" "Language-Team: Polish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pl\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2);\n" "X-Generator: Virtaal 0.5.2\n" "X-Poedit-Language: Polish\n" "X-Poedit-Country: Poland\n" "X-Poedit-Basepath: .\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "Edytor plików PDF" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Usuwa, wyodrębnia i obraca strony w dokumentach PDF" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Przenosi {0} stronę: {1}" msgstr[1] "Przenosi {0} strony: {1}" msgstr[2] "Przenosi {0} stron: {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "Błąd podczas cofania przenoszenia stron" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "Błąd podczas przenoszenia stron" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Błąd podczas usuwania stron z dokumentu" #: ../src/PdfMod/Pdf/Page.cs:36 #, csharp-format msgid "Page {0}" msgstr "Strona {0}" #: ../src/PdfMod/Gui/Actions.cs:63 msgid "Open a document" msgstr "Otwiera dokument" #: ../src/PdfMod/Gui/Actions.cs:64 msgid "_Insert From..." msgstr "W_staw z..." #: ../src/PdfMod/Gui/Actions.cs:64 msgid "Insert pages from another document" msgstr "Wstawia strony z innego dokumentu" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "Save changes to this document, overwriting the existing file" msgstr "Zapisuje zmiany w tym dokumencie, nadpisując istniejący plik" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Save this document to a new file" msgstr "Zapisuje ten dokument jako nowy plik" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "_File" msgstr "_Plik" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "Ost_atnio otwarte pliki" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "Rotate Right" msgstr "Obróć w prawo" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "Rotate right" msgstr "Obraca w prawo" #: ../src/PdfMod/Gui/Actions.cs:74 msgid "Rotate Left" msgstr "Obróć w lewo" #: ../src/PdfMod/Gui/Actions.cs:74 msgid "Rotate left" msgstr "Obraca w lewo" #: ../src/PdfMod/Gui/Actions.cs:75 msgid "Export Images" msgstr "Eksportuj obrazy" #: ../src/PdfMod/Gui/Actions.cs:75 msgid "Save all images in this document to a new folder" msgstr "Zapisuje wszystkie obrazy z tego dokumentu w nowym katalogu" #: ../src/PdfMod/Gui/Actions.cs:77 msgid "_Edit" msgstr "_Edycja" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Select Even Pages" msgstr "Zaznacz strony parzyste" #: ../src/PdfMod/Gui/Actions.cs:80 msgid "Select Odd Pages" msgstr "Zaznacz strony nieparzyste" #: ../src/PdfMod/Gui/Actions.cs:81 msgid "Select Matching..." msgstr "Zaznacz pasujące..." #: ../src/PdfMod/Gui/Actions.cs:82 msgid "_Invert Selection" msgstr "_Odwróć zaznaczenie" #: ../src/PdfMod/Gui/Actions.cs:86 msgid "_View" msgstr "_Widok" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "_Help" msgstr "Pomo_c" #: ../src/PdfMod/Gui/Actions.cs:91 msgid "_Contents" msgstr "_Spis treści" #: ../src/PdfMod/Gui/Actions.cs:96 msgid "Open in Viewer" msgstr "Otwórz w przeglądarce" #: ../src/PdfMod/Gui/Actions.cs:96 msgid "Open in viewer" msgstr "Otwiera w przeglądarce" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "View and edit the title, keywords, and more for this document" msgstr "" "Wyświetla i modyfikuje tytuł, słowa kluczowe i inne właściwości tego " "dokumentu" #: ../src/PdfMod/Gui/Actions.cs:102 msgid "Toolbar" msgstr "Pasek narzędziowy" #: ../src/PdfMod/Gui/Actions.cs:103 msgid "Fullscreen" msgstr "Tryb pełnoekranowy" #: ../src/PdfMod/Gui/Actions.cs:172 msgid "_Undo" msgstr "C_ofnij" #: ../src/PdfMod/Gui/Actions.cs:173 #, csharp-format msgid "Undo {0}" msgstr "Cofa {0}" #: ../src/PdfMod/Gui/Actions.cs:177 msgid "_Redo" msgstr "Po_nów" #: ../src/PdfMod/Gui/Actions.cs:178 #, csharp-format msgid "Redo {0}" msgstr "Ponawia {0}" #: ../src/PdfMod/Gui/Actions.cs:186 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Usuń stronę" msgstr[1] "Usuń {0} strony" msgstr[2] "Usuń {0} stron" #: ../src/PdfMod/Gui/Actions.cs:189 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Usuwa zaznaczoną stronę" msgstr[1] "Usuwa {0} zaznaczone strony" msgstr[2] "Usuwa {0} zaznaczonych stron" #: ../src/PdfMod/Gui/Actions.cs:192 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Wyodrębnij stronę" msgstr[1] "Wyodrębnij {0} strony" msgstr[2] "Wyodrębnij {0} stron" #: ../src/PdfMod/Gui/Actions.cs:195 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Wyodrębnia zaznaczoną stronę" msgstr[1] "Wyodrębnia {0} zaznaczone strony" msgstr[2] "Wyodrębnia {0} zaznaczonych stron" #: ../src/PdfMod/Gui/Actions.cs:203 ../src/PdfMod/Gui/Actions.cs:244 msgid "Select PDF" msgstr "Wybierz dokument PDF" #: ../src/PdfMod/Gui/Actions.cs:261 ../src/PdfMod/Gui/Client.cs:289 msgid "Error Loading Document" msgstr "Błąd podczas wczytywania dokumentu" #: ../src/PdfMod/Gui/Actions.cs:262 ../src/PdfMod/Gui/Client.cs:290 #, csharp-format msgid "There was an error loading {0}" msgstr "Wystąpił błąd podczas wczytywania {0}" #: ../src/PdfMod/Gui/Actions.cs:276 msgid "Save as..." msgstr "Zapisz jako..." #: ../src/PdfMod/Gui/Actions.cs:413 msgid "Error opening help" msgstr "Błąd podczas otwierania pliku pomocy" #: ../src/PdfMod/Gui/Actions.cs:414 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Otworzyć dokumentację online programu PDF Mod?" #: ../src/PdfMod/Gui/Actions.cs:435 msgid "Visit Website" msgstr "Odwiedź witrynę programu" #: ../src/PdfMod/Gui/Actions.cs:437 msgid "Primary Development:" msgstr "Główni twórcy:" #: ../src/PdfMod/Gui/Actions.cs:440 msgid "Contributors:" msgstr "Współtwórcy:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:458 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" "Copyright {0} Novell Inc.\n" "Copyright {1} Współtwórcy programu PDF Mod" #: ../src/PdfMod/Gui/Actions.cs:461 msgid "translator-credits" msgstr "" "Aviary.pl , 2009, 2010\n" "Łukasz Jernaś , 2009, 2010\n" "Michał Sawicz , 2009" #: ../src/PdfMod/Gui/Client.cs:85 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:190 msgid "Save the changes made to this document?" msgstr "Zapisać zmiany dokonane w tym dokumencie?" #: ../src/PdfMod/Gui/Client.cs:193 msgid "Close _Without Saving" msgstr "Zamknij _bez zapisywania" #: ../src/PdfMod/Gui/Client.cs:223 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Otworzyć {0} dokument w osobnym oknie?" msgstr[1] "Otworzyć {0} dokumenty w osobnych oknach?" msgstr[2] "Otworzyć {0} dokumentów w osobnych oknach?" #: ../src/PdfMod/Gui/Client.cs:227 msgid "Open _First" msgstr "_Otwórz pierwszy" #: ../src/PdfMod/Gui/Client.cs:228 msgid "Open _All" msgstr "Otwórz w_szystkie" #: ../src/PdfMod/Gui/Client.cs:259 msgid "Loading document..." msgstr "Wczytywanie dokumentu..." #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:315 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (początkowo {1})" #: ../src/PdfMod/Gui/Client.cs:320 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} strona" msgstr[1] "{0} strony" msgstr[2] "{0} stron" #: ../src/PdfMod/Gui/Client.cs:343 msgid "Document is Encrypted" msgstr "Dokument jest zaszyfrowany" #: ../src/PdfMod/Gui/Client.cs:344 msgid "Enter the document's password to open it:" msgstr "Należy wprowadzić hasło do dokumentu, aby go otworzyć:" #: ../src/PdfMod/Gui/Client.cs:377 msgid "PDF Documents" msgstr "Dokumenty PDF" #: ../src/PdfMod/Gui/Client.cs:378 msgid "All Files" msgstr "Wszystkie pliki" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "Zaznacz pasujące" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "_Tytuł:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "_Autor:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "_Słowa kluczowe" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "T_emat:" # LJ #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "_Przywróć właściwości" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "Przywraca początkowe wartości właściwości dokumentu" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "_Zamknij" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "Ukrywa właściwości dokumentu" pdfmod-0.9.1/po/ca.po0000644000175000001440000002151111242311625014445 0ustar00gabeusers00000000000000# Pdf Mod UI Catalan Translation. # Copyright (C) 2009 Free Software Foundation, Inc. # This file is distributed under the same license as the PDF Mod package. # Andreu Correa Casablanca , 2009. # msgid "" msgstr "" "Project-Id-Version: Pdf Mod 0.5\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-08-17 13:49+0200\n" "PO-Revision-Date: 2009-08-17 13:50+0200\n" "Last-Translator: Andreu Correa Casablanca \n" "Language-Team: Català \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "Modificador de fitxers PDF" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Podeu suprimir, extreure i capgirar pàgines en documents PDF" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Es mou {1}" msgstr[1] "Es mouen {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "S'ha produït un error en provar de desfer un moviment de pàgines" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "S'ha produït un error en provar de moure pàgines" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "S'ha produït un error en provar de suprimir pàgines del document" #: ../src/PdfMod/Gui/Actions.cs:46 msgid "Open a document" msgstr "Obre un document" #: ../src/PdfMod/Gui/Actions.cs:47 msgid "_Insert From..." msgstr "_Insereix des de..." #: ../src/PdfMod/Gui/Actions.cs:47 msgid "Insert pages from another document" msgstr "Insereix pàgines d'un altre document" #: ../src/PdfMod/Gui/Actions.cs:48 msgid "Save changes to this document, overwriting the existing file" msgstr "" "Desa els canvis realitzats al document, se sobreescriurà el fitxer existent" #: ../src/PdfMod/Gui/Actions.cs:49 msgid "Save this document to a new file" msgstr "Desa aquest document en un fitxer nou" #: ../src/PdfMod/Gui/Actions.cs:51 msgid "_File" msgstr "_Fitxer" #: ../src/PdfMod/Gui/Actions.cs:52 msgid "Recent _Files" msgstr "_Fitxers Recents" #: ../src/PdfMod/Gui/Actions.cs:56 msgid "Rotate Right" msgstr "Gira a la dreta" #: ../src/PdfMod/Gui/Actions.cs:56 msgid "Rotate right" msgstr "Gira a la dreta" #: ../src/PdfMod/Gui/Actions.cs:57 msgid "Rotate Left" msgstr "Gira a l'esquerra" #: ../src/PdfMod/Gui/Actions.cs:57 msgid "Rotate left" msgstr "Gira a l'esquerra" #: ../src/PdfMod/Gui/Actions.cs:58 msgid "Export Images" msgstr "Exporta imatges" #: ../src/PdfMod/Gui/Actions.cs:58 msgid "Save all images in this document to a new folder" msgstr "" "Desa totes les imatges que hi ha en aquest document en una carpeta nova" #: ../src/PdfMod/Gui/Actions.cs:60 msgid "_Edit" msgstr "_Edita" #: ../src/PdfMod/Gui/Actions.cs:62 msgid "Select Even Pages" msgstr "Sel·lecciona les pàgines parelles" #: ../src/PdfMod/Gui/Actions.cs:63 msgid "Select Odd Pages" msgstr "Sel·lecciona les pàgines senars" #: ../src/PdfMod/Gui/Actions.cs:64 msgid "Select Matching..." msgstr "Sel·lecciona per coincidència..." #: ../src/PdfMod/Gui/Actions.cs:68 msgid "_View" msgstr "_Visualitza" #: ../src/PdfMod/Gui/Actions.cs:72 msgid "_Help" msgstr "A_juda" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Contents" msgstr "_Continguts" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Open in Viewer" msgstr "Obre en el visualitzador" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Open in viewer" msgstr "Obre en el visualitzador" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "View and edit the title, keywords, and more for this document" msgstr "" "Visualitza el document i edita'n el títol, les paraules clau i d'altres dades" #: ../src/PdfMod/Gui/Actions.cs:84 msgid "Toolbar" msgstr "Barra d'eines" #: ../src/PdfMod/Gui/Actions.cs:155 msgid "_Undo" msgstr "_Desfer" #: ../src/PdfMod/Gui/Actions.cs:156 #, csharp-format msgid "Undo {0}" msgstr "Desfer {0}" #: ../src/PdfMod/Gui/Actions.cs:160 msgid "_Redo" msgstr "_Torna a fer" #: ../src/PdfMod/Gui/Actions.cs:161 #, csharp-format msgid "Redo {0}" msgstr "Torna a fer {0}" #: ../src/PdfMod/Gui/Actions.cs:169 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Suprimeix la pàgina" msgstr[1] "Suprimeix les {0} pàgines" #: ../src/PdfMod/Gui/Actions.cs:172 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Suprimeix la pàgina sel·leccionada" msgstr[1] "Suprimeix les pàgines {0} sel·leccionades" #: ../src/PdfMod/Gui/Actions.cs:175 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Extreu la pàgina" msgstr[1] "Extreu les {0} pàgines" #: ../src/PdfMod/Gui/Actions.cs:178 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Extreu la pàgina sel·leccionada" msgstr[1] "Extreu les {0} pàgines sel·leccionades" #: ../src/PdfMod/Gui/Actions.cs:186 ../src/PdfMod/Gui/Actions.cs:215 msgid "Select PDF" msgstr "Sel·lecciona el PDF" #: ../src/PdfMod/Gui/Actions.cs:187 msgid "PDF Documents" msgstr "Documents PDF" #: ../src/PdfMod/Gui/Actions.cs:188 ../src/PdfMod/Gui/Actions.cs:217 #: ../src/PdfMod/Gui/Actions.cs:247 msgid "All Files" msgstr "Tots els fitxers" #: ../src/PdfMod/Gui/Actions.cs:241 msgid "Save as..." msgstr "Anomena i desa..." #: ../src/PdfMod/Gui/Actions.cs:382 msgid "Error opening help" msgstr "S'ha produït un error en obrir l'ajuda" #: ../src/PdfMod/Gui/Actions.cs:383 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Voleu obrir l'ajuda en línia del PDF Mod?" #: ../src/PdfMod/Gui/Actions.cs:404 msgid "Visit Website" msgstr "Visita el lloc web" #: ../src/PdfMod/Gui/Actions.cs:406 msgid "Primary Development:" msgstr "Desenvolupament inicial:" #: ../src/PdfMod/Gui/Actions.cs:409 msgid "Contributors:" msgstr "Contribuïdors:" #: ../src/PdfMod/Gui/Actions.cs:422 msgid "translator-credits" msgstr "Andreu Correa Casablanca " #: ../src/PdfMod/Gui/Client.cs:64 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:171 msgid "Save the changes made to this document?" msgstr "Voleu desar els canvis realitzats en aquest document?" #: ../src/PdfMod/Gui/Client.cs:174 msgid "Close _Without Saving" msgstr "Tancar _sense desar" #: ../src/PdfMod/Gui/Client.cs:203 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Continua i obre el document {0} en una finestra separada?" msgstr[1] "Continua i obre els documents {0} en finestres separades?" #: ../src/PdfMod/Gui/Client.cs:207 msgid "Open _First" msgstr "Obre _primer" #: ../src/PdfMod/Gui/Client.cs:208 msgid "Open _All" msgstr "Obre'ls _tots" #: ../src/PdfMod/Gui/Client.cs:236 msgid "Loading document..." msgstr "S'està carregant el document..." #: ../src/PdfMod/Gui/Client.cs:259 msgid "Error Loading Document" msgstr "S'ha produït un error en carregar el document" #: ../src/PdfMod/Gui/Client.cs:260 #, csharp-format msgid "There was an error loading {0}" msgstr "S'ha produit un error en carregar {0}" #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:287 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (originalment {1})" #: ../src/PdfMod/Gui/Client.cs:292 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} pàgina" msgstr[1] "{0} pàgines" #: ../src/PdfMod/Gui/Client.cs:308 msgid "Document is Encrypted" msgstr "El document és encriptat" #: ../src/PdfMod/Gui/Client.cs:309 msgid "Enter the document's password to open it:" msgstr "Introdueix la contrasenya del document per obrir-lo:" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:26 msgid "Select Matching" msgstr "Sel·lecciona per coincidència" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:48 msgid "_Title:" msgstr "_Títol" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:49 msgid "_Author:" msgstr "_Autor:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:50 msgid "_Keywords:" msgstr "Paraules _clau:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:51 msgid "_Subject:" msgstr "_Assumpte:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:71 msgid "_Revert Properties" msgstr "_Reverteix les propietats" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:72 msgid "Change the document's properties back to the original values" msgstr "" "Canvia les propietats del document per tornar-les als seus valors originals" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:77 msgid "_Close" msgstr "_Tanca" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:78 msgid "Hide the document's properties" msgstr "Oculta les propietats del document" pdfmod-0.9.1/po/hr.po0000644000175000001440000002205511236141231014474 0ustar00gabeusers00000000000000msgid "" msgstr "" "Project-Id-Version: PDF Mod\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=pdfmod&component=general\n" "POT-Creation-Date: 2009-08-02 21:56+0000\n" "PO-Revision-Date: \n" "Last-Translator: Igor Vatavuk \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "X-Poedit-Language: Croatian\n" #: ../data/pdfmod.desktop.in.h:1 msgid "PDF Modifier" msgstr "Uređivač PDF datoteka" #: ../data/pdfmod.desktop.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Izbrišite, izdvojite, i rotirajte stranice u PDF dokumentima" #: ../src/PdfMod/PdfMod.Actions/MoveAction.cs:28 msgid "Error trying to unmove pages" msgstr "Greška prilikom vraćanja stranica" #: ../src/PdfMod/PdfMod.Actions/MoveAction.cs:38 msgid "Error trying to move pages" msgstr "Greška prilikom premještanja stranica" #: ../src/PdfMod/PdfMod.Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Greška prilikom brisanja stranica iz dokumenta" #: ../src/PdfMod/PdfMod/GlobalActions.cs:46 msgid "Open a document" msgstr "Otvori dokument" #: ../src/PdfMod/PdfMod/GlobalActions.cs:47 msgid "_Insert From..." msgstr "_Ubaci iz..." #: ../src/PdfMod/PdfMod/GlobalActions.cs:47 msgid "Insert pages from another document" msgstr "Ubaci stranice iz drugog dokumenta" #: ../src/PdfMod/PdfMod/GlobalActions.cs:48 msgid "Save changes to this document, overwriting the existing file" msgstr "Spremi promjene na dokumentu, prepisujući postojeću datoteku." #: ../src/PdfMod/PdfMod/GlobalActions.cs:49 msgid "Save this document to a new file" msgstr "Spremi dokument u novu datoteku." #: ../src/PdfMod/PdfMod/GlobalActions.cs:51 msgid "_File" msgstr "_Datoteka" #: ../src/PdfMod/PdfMod/GlobalActions.cs:52 msgid "Recent _Files" msgstr "Skorašnji dokumenti" #: ../src/PdfMod/PdfMod/GlobalActions.cs:56 msgid "Rotate Right" msgstr "Zakreni udesno" #: ../src/PdfMod/PdfMod/GlobalActions.cs:56 msgid "Rotate right" msgstr "Zakreni udesno" #: ../src/PdfMod/PdfMod/GlobalActions.cs:57 msgid "Rotate Left" msgstr "Zakreni ulijevo" #: ../src/PdfMod/PdfMod/GlobalActions.cs:57 msgid "Rotate left" msgstr "Zakreni ulijevo" #: ../src/PdfMod/PdfMod/GlobalActions.cs:58 msgid "Export Images..." msgstr "Izvezi slike..." #: ../src/PdfMod/PdfMod/GlobalActions.cs:60 msgid "_Edit" msgstr "_Uredi" #: ../src/PdfMod/PdfMod/GlobalActions.cs:62 msgid "Select Even Pages" msgstr "Odaberi parne stranice" #: ../src/PdfMod/PdfMod/GlobalActions.cs:63 msgid "Select Odd Pages" msgstr "Odaberi neparne stranice" #: ../src/PdfMod/PdfMod/GlobalActions.cs:64 msgid "Select Matching..." msgstr "Odaberi sve što sadrži..." #: ../src/PdfMod/PdfMod/GlobalActions.cs:68 msgid "_View" msgstr "P_ogled" #: ../src/PdfMod/PdfMod/GlobalActions.cs:72 msgid "_Help" msgstr "_Pomoć" #: ../src/PdfMod/PdfMod/GlobalActions.cs:73 msgid "_Contents" msgstr "_Sadržaj" #: ../src/PdfMod/PdfMod/GlobalActions.cs:80 msgid "View and edit the title, keywords, and more for this document" msgstr "Pregledajte i uredite naslov, ključne riječi i druga svojstva dokumenta" #: ../src/PdfMod/PdfMod/GlobalActions.cs:82 msgid "Toolbar" msgstr "Alatna traka" #: ../src/PdfMod/PdfMod/GlobalActions.cs:158 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Izbriši {0} stranicu" msgstr[1] "Izbriši {0} stranice" msgstr[2] "Izbriši {0} stranica" #: ../src/PdfMod/PdfMod/GlobalActions.cs:161 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Izbriši {0} odabranu stranicu" msgstr[1] "Izbriši {0} odabrane stranice" msgstr[2] "Izbriši {0} odabranih stranica" #: ../src/PdfMod/PdfMod/GlobalActions.cs:164 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Izdvoji {0} stranicu" msgstr[1] "Izdvoji {0} stranice" msgstr[2] "Izdvoji {0} stranica" #: ../src/PdfMod/PdfMod/GlobalActions.cs:167 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Izdvoji {0} odabranu stranicu" msgstr[1] "Izdvoji {0} odabrane stranice" msgstr[2] "Izdvoji {0} odabranih stranica" #: ../src/PdfMod/PdfMod/GlobalActions.cs:175 #: ../src/PdfMod/PdfMod/GlobalActions.cs:194 msgid "Select PDF" msgstr "Odaberi PDF" #: ../src/PdfMod/PdfMod/GlobalActions.cs:177 #: ../src/PdfMod/PdfMod/GlobalActions.cs:196 #: ../src/PdfMod/PdfMod/GlobalActions.cs:225 msgid "All Files" msgstr "Sve datoteke" #: ../src/PdfMod/PdfMod/GlobalActions.cs:219 msgid "Save as..." msgstr "Spremi kao..." #. Translators: {0} is the number of pages (always 1), and {1} is the page number, eg Page 1, or Page 5 #: ../src/PdfMod/PdfMod/GlobalActions.cs:284 #, csharp-format msgid "Page {1}" msgid_plural "Page {1}" msgstr[0] "Stranica {1}" msgstr[1] "Stranica {1}" msgstr[2] "Stranica {1}" #. Translators: {0} is the number of pages, and {1} is the first page, {2} is the last page, #. eg Pages 3 - 7 #: ../src/PdfMod/PdfMod/GlobalActions.cs:288 #, csharp-format msgid "Pages {1} - {2}" msgid_plural "Pages {1} - {2}" msgstr[0] "Stranice {1} - {2}" msgstr[1] "Stranice {1} - {2}" msgstr[2] "Stranice {1} - {2}" #. Translators: {0} is the number of pages, {1} is a comma separated list of page numbers, eg Pages 1, 4, 9 #: ../src/PdfMod/PdfMod/GlobalActions.cs:293 #, csharp-format msgid "Pages {1}" msgid_plural "Pages {1}" msgstr[0] "Stranice {1}" msgstr[1] "Stranice {1}" msgstr[2] "Stranice {1}" #. Translators: {0} is the number of pages, eg 12 Pages #: ../src/PdfMod/PdfMod/GlobalActions.cs:296 #, csharp-format msgid "{0} Page" msgid_plural "{0} Pages" msgstr[0] "{0} stranicu" msgstr[1] "{0} stranice" msgstr[2] "{0} stranica" #. Translators: This is used for creating a folder name, be careful! #: ../src/PdfMod/PdfMod/GlobalActions.cs:313 #, csharp-format msgid "{0} - Images for {1}" msgstr "{0} - Slike za {1}" #: ../src/PdfMod/PdfMod/GlobalActions.cs:380 msgid "Error opening help" msgstr "Greška prilikom pristupanja pomoći" #: ../src/PdfMod/PdfMod/GlobalActions.cs:381 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Želite li pristupiti dokumentaciji na Internetu?" #: ../src/PdfMod/PdfMod/GlobalActions.cs:402 msgid "Visit Website" msgstr "Posjetite web stranicu" #: ../src/PdfMod/PdfMod/GlobalActions.cs:414 msgid "translator-credits" msgstr "Igor Vatavuk , 2009" #: ../src/PdfMod/PdfMod/PdfListStore.cs:55 #: ../src/PdfMod/PdfMod/PdfListStore.cs:63 #, csharp-format msgid "Page {0}" msgstr "Stranica {0}" #: ../src/PdfMod/PdfMod/PdfMod.cs:64 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/PdfMod/PdfMod.cs:158 msgid "Save the changes made to this document?" msgstr "Spremanje promjena na dokumentu?" #: ../src/PdfMod/PdfMod/PdfMod.cs:161 msgid "Close _Without Saving" msgstr "Zatvori _bez spremanja" #: ../src/PdfMod/PdfMod/PdfMod.cs:194 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Nastavi otvarajući {0} dokument u zasebnom prozoru?" msgstr[1] "Nastavi otvarajući {0} dokumenta u zasebnim prozorima?" msgstr[2] "Nastavi otvarajući {0} dokumenata u zasebnim prozorima?" #: ../src/PdfMod/PdfMod/PdfMod.cs:198 msgid "Open _First" msgstr "Otvori _prvo" #: ../src/PdfMod/PdfMod/PdfMod.cs:199 msgid "Open _All" msgstr "Otvori _sve" #: ../src/PdfMod/PdfMod/PdfMod.cs:228 #, csharp-format msgid "Loading {0}" msgstr "Učitavanje {0}" #: ../src/PdfMod/PdfMod/PdfMod.cs:248 msgid "Error Loading Document" msgstr "Greška prilikom učitavanja dokumenta" #: ../src/PdfMod/PdfMod/PdfMod.cs:249 #, csharp-format msgid "There was an error loading {0}" msgstr "Greška prilikom učitavanja {0}" #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/PdfMod/PdfMod.cs:272 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (originalno {1})" #: ../src/PdfMod/PdfMod/PdfMod.cs:277 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} stranica" msgstr[1] "{0} stranice" msgstr[2] "{0} stranica" #: ../src/PdfMod/PdfMod/QueryBox.cs:26 msgid "Select Matching" msgstr "Odaberi odgovarajuće" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:46 msgid "_Title:" msgstr "_Naslov:" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:47 msgid "_Author:" msgstr "_Autor:" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:48 msgid "_Keywords:" msgstr "_Ključne riječi:" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:49 msgid "_Subject:" msgstr "_Tema:" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:69 msgid "_Revert Properties" msgstr "_Vrati svojstva" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:70 msgid "Change the document's properties back to the original values" msgstr "Vratite svojstva dokumenta na originalne vrijednosti" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:75 msgid "_Close" msgstr "_Zatvori" #: ../src/PdfMod/PdfMod/MetadataEditorBox.cs:76 msgid "Hide the document's properties" msgstr "Sakrij svojstva dokumenta" pdfmod-0.9.1/po/ro.po0000644000175000001440000003022211511422704014501 0ustar00gabeusers00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # Daniel Butum , 2010. msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=pdfmod&component=general\n" "POT-Creation-Date: 2010-11-14 14:35+0000\n" "PO-Revision-Date: 2010-11-24 23:17+0300\n" "Last-Translator: Daniel Butum \n" "Language-Team: Romania\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ro\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " "20)) ? 1 : 2);;\n" "X-Generator: Virtaal 0.6.1\n" #: ../data/pdfmod.desktop.in.in.h:1 msgid "PDF Modifier" msgstr "Modificator PDF" #: ../data/pdfmod.desktop.in.in.h:2 msgid "Remove, extract, and rotate pages in PDF documents" msgstr "Elimină, extrage, și rotește paginile PDF din document" #: ../src/PdfMod/Pdf/Actions/ExportImagesAction.cs:136 #: ../src/PdfMod/Pdf/Page.cs:36 #, csharp-format msgid "Page {0}" msgstr "Pagina {0}" #. Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:24 #, csharp-format msgid "Move {1}" msgid_plural "Move {1}" msgstr[0] "Mută {1}" msgstr[1] "Mută {1}" msgstr[2] "Mută {1}" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:31 msgid "Error trying to unmove pages" msgstr "Eroare la încercarea de anulare a mutării paginilor" #: ../src/PdfMod/Pdf/Actions/MoveAction.cs:41 msgid "Error trying to move pages" msgstr "Eroare la încercarea mutării paginilor" #: ../src/PdfMod/Pdf/Actions/RemoveAction.cs:41 msgid "Error trying to remove pages from document" msgstr "Eroare la încercarea eliminării paginilor din document" #: ../src/PdfMod/Gui/Actions.cs:65 msgid "_File" msgstr "_Fișier" #: ../src/PdfMod/Gui/Actions.cs:66 msgid "Open a document" msgstr "Deschide un document" #: ../src/PdfMod/Gui/Actions.cs:67 msgid "Save changes to this document, overwriting the existing file" msgstr "" "Salvează modificările aplicate documentului, înlocuind fișierul existent" #: ../src/PdfMod/Gui/Actions.cs:68 msgid "Save this document to a new file" msgstr "Salvează documentul într-un fișier nou" #: ../src/PdfMod/Gui/Actions.cs:69 msgid "Recent _Files" msgstr "_Fișiere recente" #: ../src/PdfMod/Gui/Actions.cs:70 msgid "_Insert From..." msgstr "_Inserează din..." #: ../src/PdfMod/Gui/Actions.cs:70 msgid "Insert pages from another document" msgstr "Inserează pagini din alt document" #: ../src/PdfMod/Gui/Actions.cs:73 msgid "_Edit" msgstr "_Editare" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate Left" msgstr "Rotește la stânga" #: ../src/PdfMod/Gui/Actions.cs:78 msgid "Rotate left" msgstr "Rotește la stânga" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate Right" msgstr "Rotește la dreapta" #: ../src/PdfMod/Gui/Actions.cs:79 msgid "Rotate right" msgstr "Rotește la dreapta" #: ../src/PdfMod/Gui/Actions.cs:82 msgid "Select Odd Pages" msgstr "Selectează paginile impare" #: ../src/PdfMod/Gui/Actions.cs:83 msgid "Select Even Pages" msgstr "Selectează paginile pare" #: ../src/PdfMod/Gui/Actions.cs:84 msgid "Select Matching..." msgstr "Selectează după un criteriu..." #: ../src/PdfMod/Gui/Actions.cs:85 msgid "_Invert Selection" msgstr "_Inversează selecția" #: ../src/PdfMod/Gui/Actions.cs:87 msgid "_View" msgstr "_Vizualizare" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in Viewer" msgstr "Deschide în vizualizator" #: ../src/PdfMod/Gui/Actions.cs:90 msgid "Open in viewer" msgstr "Deschide în vizualizator" #: ../src/PdfMod/Gui/Actions.cs:92 ../src/PdfMod/Gui/BookmarkView.cs:346 msgid "_Bookmarks" msgstr "_Semne de carte" #: ../src/PdfMod/Gui/Actions.cs:93 msgid "_Add Bookmark" msgstr "_Adaugă un semn de carte" #: ../src/PdfMod/Gui/Actions.cs:94 msgid "Re_name Bookmark" msgstr "Rede_numește semnul de carte" #: ../src/PdfMod/Gui/Actions.cs:95 msgid "_Change Bookmark Destination" msgstr "Modifi_că destinația semnului de carte" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/Actions.cs:96 ../src/PdfMod/Gui/BookmarkView.cs:383 #, csharp-format msgid "_Remove Bookmark" msgid_plural "_Remove Bookmarks" msgstr[0] "_Elimină semnul de carte" msgstr[1] "_Elimină semnele de carte" msgstr[2] "_Elimină semnele de carte" #: ../src/PdfMod/Gui/Actions.cs:97 msgid "_Edit Bookmarks" msgstr "_Editează semnele de carte" #: ../src/PdfMod/Gui/Actions.cs:99 msgid "_Help" msgstr "_Ajutor" #: ../src/PdfMod/Gui/Actions.cs:100 msgid "_Contents" msgstr "_Conținut" #: ../src/PdfMod/Gui/Actions.cs:107 msgid "_Add" msgstr "_Adaugă" #: ../src/PdfMod/Gui/Actions.cs:108 msgid "_Remove" msgstr "_Elimină" #: ../src/PdfMod/Gui/Actions.cs:111 msgid "View and edit the title, keywords, and more for this document" msgstr "" "Vizualizează și editează titlul, cunvintele cheie, și mai altele pentru " "acest document" #: ../src/PdfMod/Gui/Actions.cs:113 msgid "Toolbar" msgstr "Bară de unelte" #: ../src/PdfMod/Gui/Actions.cs:114 msgid "Bookmarks" msgstr "Semne de carte" #: ../src/PdfMod/Gui/Actions.cs:115 msgid "Fullscreen" msgstr "Pe tot ecranul" #: ../src/PdfMod/Gui/Actions.cs:186 #, csharp-format msgid "Export Image" msgid_plural "Export {0} Images" msgstr[0] "Exportă imaginea" msgstr[1] "Exportă {0} imagini" msgstr[2] "Exportă {0} de imagini" #: ../src/PdfMod/Gui/Actions.cs:189 #, csharp-format msgid "Save image from the selected pages to a new folder" msgid_plural "Save {0} images from the selected pages to a new folder" msgstr[0] "Salvează imaginea din paginile selectate într-un dosar nou" msgstr[1] "Salvează {0} imagini din paginile selectate într-un dosar nou" msgstr[2] "Salvează {0} de imagini din paginile selectate într-un dosar nou" #: ../src/PdfMod/Gui/Actions.cs:196 msgid "_Undo" msgstr "An_ulează" #: ../src/PdfMod/Gui/Actions.cs:197 #, csharp-format msgid "Undo {0}" msgstr "Anulează {0}" #: ../src/PdfMod/Gui/Actions.cs:201 msgid "_Redo" msgstr "_Refă" #: ../src/PdfMod/Gui/Actions.cs:202 #, csharp-format msgid "Redo {0}" msgstr "Refă {0}" #: ../src/PdfMod/Gui/Actions.cs:210 #, csharp-format msgid "Remove Page" msgid_plural "Remove {0} Pages" msgstr[0] "Elimină pagina" msgstr[1] "Elimină {0} pagini" msgstr[2] "Elimină {0} de pagini" #: ../src/PdfMod/Gui/Actions.cs:213 #, csharp-format msgid "Remove the selected page" msgid_plural "Remove the {0} selected pages" msgstr[0] "Elimină pagina selectată" msgstr[1] "Elimină {0} pagini selectate" msgstr[2] "Elimină {0} de pagini selectate" #: ../src/PdfMod/Gui/Actions.cs:216 #, csharp-format msgid "Extract Page" msgid_plural "Extract {0} Pages" msgstr[0] "Extrage pagina" msgstr[1] "Extrage {0} pagini" msgstr[2] "Extrage {0} de pagini" #: ../src/PdfMod/Gui/Actions.cs:219 #, csharp-format msgid "Extract the selected page" msgid_plural "Extract the {0} selected pages" msgstr[0] "Extrage pagina selectată" msgstr[1] "Extrage {0} pagini selectate" msgstr[2] "Extrage {0} de pagini selectate" #: ../src/PdfMod/Gui/Actions.cs:229 ../src/PdfMod/Gui/Actions.cs:316 msgid "Select PDF" msgstr "Selectare PDF" #: ../src/PdfMod/Gui/Actions.cs:258 msgid "Unable to Save Document" msgstr "Documentul nu a putut fi salvat" #: ../src/PdfMod/Gui/Actions.cs:264 msgid "Save as..." msgstr "Salvează ca..." #: ../src/PdfMod/Gui/Actions.cs:333 ../src/PdfMod/Gui/Client.cs:308 msgid "Error Loading Document" msgstr "Eroare la încărcarea documentului" #: ../src/PdfMod/Gui/Actions.cs:334 ../src/PdfMod/Gui/Client.cs:309 #, csharp-format msgid "There was an error loading {0}" msgstr "S-a produs o eroare la încărcarea {0}" #: ../src/PdfMod/Gui/Actions.cs:510 msgid "Error opening help" msgstr "Eroare la deschiderea ajutorului" #: ../src/PdfMod/Gui/Actions.cs:511 msgid "Would you like to open PDF Mod's online documentation?" msgstr "Doriți să deschideți documentația online a programului PDF Mod?" #: ../src/PdfMod/Gui/Actions.cs:532 msgid "Visit Website" msgstr "Vizitați siteul" #: ../src/PdfMod/Gui/Actions.cs:534 msgid "Primary Development:" msgstr "Dezvoltare principală:" #: ../src/PdfMod/Gui/Actions.cs:537 msgid "Contributors:" msgstr "Contribuitori:" #. Translators: {0} and {1} are the years the copyright assertion covers; put into #. variables so you don't have to re-translate this every year #: ../src/PdfMod/Gui/Actions.cs:555 #, csharp-format msgid "" "Copyright {0} Novell Inc.\n" "Copyright {1} Other PDF Mod Contributors" msgstr "" "Drepturi de autor {0} Novell Inc.\n" "Drepturi de autor {1} Alți contribuitori la PDF Mod" #: ../src/PdfMod/Gui/Actions.cs:558 msgid "translator-credits" msgstr "Butum Daniel " #. Add it to the PDF document #: ../src/PdfMod/Gui/BookmarkView.cs:90 msgid "New bookmark" msgstr "Semn de carte nou" #: ../src/PdfMod/Gui/BookmarkView.cs:113 msgid "Add Bookmark" msgstr "Adaugă un semn de carte" #. Translators: {0} is available for you to use; contains the number of bookmarks #: ../src/PdfMod/Gui/BookmarkView.cs:137 #, csharp-format msgid "Remove Bookmark" msgid_plural "Remove Bookmarks" msgstr[0] "Elimină semnul de carte" msgstr[1] "Elimină semnele de carte" msgstr[2] "Elimină semnele de carte" #: ../src/PdfMod/Gui/BookmarkView.cs:285 ../src/PdfMod/Gui/BookmarkView.cs:323 msgid "Rename Bookmark" msgstr "Redenumește semnul de carte" #: ../src/PdfMod/Gui/BookmarkView.cs:417 #, csharp-format msgid "Bookmark links to page {0}" msgstr "Semnul de carte trimite către pagina {0}" #: ../src/PdfMod/Gui/Client.cs:86 msgid "PDF Mod" msgstr "PDF Mod" #: ../src/PdfMod/Gui/Client.cs:207 msgid "Save the changes made to this document?" msgstr "Doriți să salvați modificările aplicate documentului?" #: ../src/PdfMod/Gui/Client.cs:210 msgid "Close _Without Saving" msgstr "Închide _fără a salva" #: ../src/PdfMod/Gui/Client.cs:240 #, csharp-format msgid "Continue, opening {0} document in separate windows?" msgid_plural "Continue, opening all {0} documents in separate windows?" msgstr[0] "Continuați, deschizând {0} document într-o fereastră separată?" msgstr[1] "" "Continuați, deschizând toate cele {0} documente în ferestre separate?" msgstr[2] "" "Continuați, deschizând toate cele {0} de documente în ferestre separate?" #: ../src/PdfMod/Gui/Client.cs:244 msgid "Open _First" msgstr "Deschide _primul" #: ../src/PdfMod/Gui/Client.cs:245 msgid "Open _All" msgstr "Deschide _toate" #: ../src/PdfMod/Gui/Client.cs:276 msgid "Loading document..." msgstr "Se încarcă documentul..." #. Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" #: ../src/PdfMod/Gui/Client.cs:338 #, csharp-format msgid "{0} (originally {1})" msgstr "{0} (inițial {1})" #: ../src/PdfMod/Gui/Client.cs:343 #, csharp-format msgid "{0} page" msgid_plural "{0} pages" msgstr[0] "{0} pagină" msgstr[1] "{0} pagini" msgstr[2] "{0} de pagini" #: ../src/PdfMod/Gui/Client.cs:364 msgid "Document is Encrypted" msgstr "Documentul este criptat" #: ../src/PdfMod/Gui/Client.cs:365 msgid "Enter the document's password to open it:" msgstr "Introduceți parola documentului pentru a-l deschide:" #: ../src/PdfMod/Gui/Client.cs:395 msgid "PDF Documents" msgstr "Documente PDF" #: ../src/PdfMod/Gui/Client.cs:396 msgid "All Files" msgstr "Toate fișierele" #: ../src/PdfMod/Gui/SelectMatchingBox.cs:41 msgid "Select Matching" msgstr "Selectează cele care se potrivesc" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:62 msgid "_Title:" msgstr "_Titlu:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:63 msgid "_Author:" msgstr "_Autor:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:64 msgid "_Keywords:" msgstr "_Cuvinte cheie:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:65 msgid "_Subject:" msgstr "_Subiect:" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:85 msgid "_Revert Properties" msgstr "_Refă proprietățile" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:86 msgid "Change the document's properties back to the original values" msgstr "Schimbă proprietățile documentului înapoi la valorile originale" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:89 msgid "_Close" msgstr "_Închide" #: ../src/PdfMod/Gui/MetadataEditorBox.cs:90 msgid "Hide the document's properties" msgstr "Ascunde proprietățile documentului" pdfmod-0.9.1/icon-theme-installer0000755000175000001440000001216511261513367017072 0ustar00gabeusers00000000000000#!/bin/bash # icon-theme-installer # Copyright (C) 2006 Novell, Inc. # Written by Aaron Bockover # Licensed under the MIT/X11 license # # This script is meant to be invoked from within a Makefile/Makefile.am # in the install-data-local and uninstall-data sections. It handles the # task of properly installing icons into the icon theme. It requires a # few arguments to set up its environment, and a list of files to be # installed. The format of the file list is critical: # # , # # apps,music-player-banshee.svg # apps,music-player-banshee-16.png # apps,music-player-banshee-22.png # # is the icon theme category, for instance, apps, devices, # actions, emblems... # # must have a basename in the form of: # # proper-theme-name[-]. # # Where should be either nothing, which will default to scalable # or \-[0-9]{2}, which will expand to x. For example: # # music-player-banshee-16.png # # The here is -16 and will expand to 16x16 per the icon theme spec # # What follows is an example Makefile.am for icon theme installation: # # --------------- # theme=hicolor # themedir=$(datadir)/icons/$(theme) # theme_icons = \ # apps,music-player-banshee.svg \ # apps,music-player-banshee-16.png \ # apps,music-player-banshee-22.png \ # apps,music-player-banshee-24.png \ # apps,music-player-banshee-32.png # # install_icon_exec = $(top_srcdir)/build/icon-theme-installer -t $(theme) -s $(srcdir) -d "x$(DESTDIR)" -b $(themedir) -m "$(mkinstalldirs)" -x "$(INSTALL_DATA)" # install-data-local: # $(install_icon_exec) -i $(theme_icons) # # uninstall-hook: # $(install_icon_exec) -u $(theme_icons) # # MAINTAINERCLEANFILES = Makefile.in # EXTRA_DIST = $(wildcard *.svg *.png) # --------------- # # Arguments to this program: # # -i : Install # -u : Uninstall # -t : Theme name (hicolor) # -b : Theme installation dest directory [x$(DESTDIR)] - Always prefix # this argument with x; it will be stripped but will act as a # placeholder for zero $DESTDIRs (only set by packagers) # -d : Theme installation directory [$(hicolordir)] # -s : Source directory [$(srcdir)] # -m : Command to exec for directory creation [$(mkinstalldirs)] # -x : Command to exec for single file installation [$(INSTALL_DATA)] # : All remainging should be category,filename pairs while getopts "iut:b:d:s:m:x:" flag; do case "$flag" in i) INSTALL=yes ;; u) UNINSTALL=yes ;; t) THEME_NAME=$OPTARG ;; d) INSTALL_DEST_DIR=${OPTARG##x} ;; b) INSTALL_BASE_DIR=$OPTARG ;; s) SRC_DIR=$OPTARG ;; m) MKINSTALLDIRS_EXEC=$OPTARG ;; x) INSTALL_DATA_EXEC=$OPTARG ;; esac done shift $(($OPTIND - 1)) if test "x$INSTALL" = "xyes" -a "x$UNINSTALL" = "xyes"; then echo "Cannot pass both -i and -u" exit 1 elif test "x$INSTALL" = "x" -a "x$UNINSTALL" = "x"; then echo "Must path either -i or -u" exit 1 fi if test -z "$THEME_NAME"; then echo "Theme name required (-t hicolor)" exit 1 fi if test -z "$INSTALL_BASE_DIR"; then echo "Base theme directory required [-d \$(hicolordir)]" exit 1 fi if test ! -x $(echo "$MKINSTALLDIRS_EXEC" | cut -f1 -d' '); then echo "Cannot find '$MKINSTALLDIRS_EXEC'; You probably want to pass -m \$(mkinstalldirs)" exit 1 fi if test ! -x $(echo "$INSTALL_DATA_EXEC" | cut -f1 -d' '); then echo "Cannot find '$INSTALL_DATA_EXEC'; You probably want to pass -x \$(INSTALL_DATA)" exit 1 fi if test -z "$SRC_DIR"; then SRC_DIR=. fi for icon in $@; do size=$(echo $icon | sed s/[^0-9]*//g) category=$(echo $icon | cut -d, -f1) build_name=$(echo $icon | cut -d, -f2) install_name=$(echo $build_name | sed "s/[0-9]//g; s/-\././") install_name=$(basename $install_name) if test -z $size; then size=scalable; else size=${size}x${size}; fi install_dir=${INSTALL_DEST_DIR}${INSTALL_BASE_DIR}/$size/$category install_path=$install_dir/$install_name if test "x$INSTALL" = "xyes"; then echo "Installing $size $install_name into $THEME_NAME icon theme" $($MKINSTALLDIRS_EXEC $install_dir) || { echo "Failed to create directory $install_dir" exit 1 } $($INSTALL_DATA_EXEC $SRC_DIR/$build_name $install_path) || { echo "Failed to install $SRC_DIR/$build_name into $install_path" exit 1 } if test ! -e $install_path; then echo "Failed to install $SRC_DIR/$build_name into $install_path" exit 1 fi else if test -e $install_path; then echo "Removing $size $install_name from $THEME_NAME icon theme" rm $install_path || { echo "Failed to remove $install_path" exit 1 } fi fi done gtk_update_icon_cache_bin="$((which gtk-update-icon-cache || echo /opt/gnome/bin/gtk-update-icon-cache)2>/dev/null)" gtk_update_icon_cache="$gtk_update_icon_cache_bin -f -t $INSTALL_BASE_DIR" if test -z "$INSTALL_DEST_DIR"; then if test -x $gtk_update_icon_cache_bin; then echo "Updating GTK icon cache" $gtk_update_icon_cache else echo "*** Icon cache not updated. Could not execute $gtk_update_icon_cache_bin" fi else echo "*** Icon cache not updated. After (un)install, run this:" echo "*** $gtk_update_icon_cache" fi pdfmod-0.9.1/AUTHORS0000644000175000001440000000056711533735262014176 0ustar00gabeusers00000000000000Gabriel Burt Contributions from: • Sandy Armstrong • Aaron Bockover • Olivier Le Thanh Duong • Julien Rebetez • Igor Vatavuk • Bertrand Lorentz • Michael McKinley • Łukasz Jernaś • Romain Tartière • Robert Dyer • Andreu Correa Casablanca • Chow Loong Jin • Robson Roberto Souza Peixoto • Thomas Klausner pdfmod-0.9.1/gnome-doc-utils.make0000644000175000001440000005410611371521336016764 0ustar00gabeusers00000000000000# gnome-doc-utils.make - make magic for building documentation # Copyright (C) 2004-2005 Shaun McCance # # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. ################################################################################ ## @@ Generating Header Files ## @ DOC_H_FILE ## The name of the header file to generate DOC_H_FILE ?= ## @ DOC_H_DOCS ## The input DocBook files for generating the header file DOC_H_DOCS ?= $(DOC_H_FILE): $(DOC_H_DOCS); @rm -f $@.tmp; touch $@.tmp; echo 'const gchar* documentation_credits[] = {' >> $@.tmp list='$(DOC_H_DOCS)'; for doc in $$list; do \ xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \ if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \ xsltproc --path "$$xmlpath" $(_credits) $$doc; \ done | sort | uniq \ | awk 'BEGIN{s=""}{n=split($$0,w,"<");if(s!=""&&s!=substr(w[1],1,length(w[1])-1)){print s};if(n>1){print $$0;s=""}else{s=$$0}};END{if(s!=""){print s}}' \ | sed -e 's/\\/\\\\/' -e 's/"/\\"/' -e 's/\(.*\)/\t"\1",/' >> $@.tmp echo ' NULL' >> $@.tmp echo '};' >> $@.tmp echo >> $@.tmp list='$(DOC_H_DOCS)'; for doc in $$list; do \ xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \ if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \ docid=`echo "$$doc" | sed -e 's/.*\/\([^/]*\)\.xml/\1/' \ | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`; \ echo $$xmlpath; \ ids=`xsltproc --xinclude --path "$$xmlpath" $(_ids) $$doc`; \ for id in $$ids; do \ echo '#define HELP_'`echo $$docid`'_'`echo $$id \ | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`' "'$$id'"' >> $@.tmp; \ done; \ echo >> $@.tmp; \ done; cp $@.tmp $@ && rm -f $@.tmp dist-check-gdu: if !HAVE_GNOME_DOC_UTILS @echo "*** GNOME Doc Utils must be installed in order to make dist" @false endif .PHONY: dist-doc-header dist-doc-header: $(DOC_H_FILE) @if test -f "$(DOC_H_FILE)"; then d=; else d="$(srcdir)/"; fi; \ echo "$(INSTALL_DATA) $${d}$(DOC_H_FILE) $(distdir)/$(DOC_H_FILE)"; \ $(INSTALL_DATA) "$${d}$(DOC_H_FILE)" "$(distdir)/$(DOC_H_FILE)"; doc-dist-hook: dist-check-gdu $(if $(DOC_H_FILE),dist-doc-header) .PHONY: clean-doc-header _clean_doc_header = $(if $(DOC_H_FILE),clean-doc-header) clean-local: $(_clean_doc_header) distclean-local: $(_clean_doc_header) mostlyclean-local: $(_clean_doc_header) maintainer-clean-local: $(_clean_doc_header) clean-doc-header: rm -f $(DOC_H_FILE) all: $(DOC_H_FILE) ################################################################################ ## @@ Generating Documentation Files ## @ DOC_MODULE ## The name of the document being built DOC_MODULE ?= ## @ DOC_ID ## The unique identifier for a Mallard document DOC_ID ?= ## @ DOC_PAGES ## Page files in a Mallard document DOC_PAGES ?= ## @ DOC_ENTITIES ## Files included with a SYSTEM entity DOC_ENTITIES ?= ## @ DOC_INCLUDES ## Files included with XInclude DOC_INCLUDES ?= ## @ DOC_FIGURES ## Figures and other external data DOC_FIGURES ?= ## @ DOC_FORMATS ## The default formats to be built and installed DOC_FORMATS ?= docbook _DOC_REAL_FORMATS = $(if $(DOC_USER_FORMATS),$(DOC_USER_FORMATS),$(DOC_FORMATS)) ## @ DOC_LINGUAS ## The languages this document is translated into DOC_LINGUAS ?= _DOC_REAL_LINGUAS = $(if $(filter environment,$(origin LINGUAS)), \ $(filter $(LINGUAS),$(DOC_LINGUAS)), \ $(DOC_LINGUAS)) _DOC_ABS_SRCDIR = @abs_srcdir@ ################################################################################ ## Variables for Bootstrapping _xml2po ?= `which xml2po` _xml2po_mode = $(if $(DOC_ID),mallard,docbook) _db2html ?= `$(PKG_CONFIG) --variable db2html gnome-doc-utils` _db2omf ?= `$(PKG_CONFIG) --variable db2omf gnome-doc-utils` _malrng ?= `$(PKG_CONFIG) --variable malrng gnome-doc-utils` _chunks ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl _credits ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl _ids ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/ids.xsl if ENABLE_SK _ENABLE_SK = true _skpkgdatadir ?= `scrollkeeper-config --pkgdatadir` _sklocalstatedir ?= `scrollkeeper-config --pkglocalstatedir` _skcontentslist ?= $(_skpkgdatadir)/Templates/C/scrollkeeper_cl.xml endif ################################################################################ ## @@ Rules for OMF Files db2omf_args = \ --stringparam db2omf.basename $(DOC_MODULE) \ --stringparam db2omf.format $(3) \ --stringparam db2omf.dtd \ $(shell xmllint --format $(2) | grep -h PUBLIC | head -n 1 \ | sed -e 's/.*PUBLIC \(\"[^\"]*\"\).*/\1/') \ --stringparam db2omf.lang $(notdir $(patsubst %/$(notdir $(2)),%,$(2))) \ --stringparam db2omf.omf_dir "$(OMF_DIR)" \ --stringparam db2omf.help_dir "$(HELP_DIR)" \ --stringparam db2omf.omf_in "$(_DOC_OMF_IN)" \ $(if $(_ENABLE_SK), \ --stringparam db2omf.scrollkeeper_cl "$(_skcontentslist)") \ $(_db2omf) $(2) ## @ _DOC_OMF_IN ## The OMF input file _DOC_OMF_IN = $(if $(DOC_MODULE),$(wildcard $(_DOC_ABS_SRCDIR)/$(DOC_MODULE).omf.in)) ## @ _DOC_OMF_DB ## The OMF files for DocBook output _DOC_OMF_DB = $(if $(_DOC_OMF_IN), \ $(foreach lc,C $(_DOC_REAL_LINGUAS),$(DOC_MODULE)-$(lc).omf)) $(_DOC_OMF_DB) : $(_DOC_OMF_IN) $(_DOC_OMF_DB) : $(DOC_MODULE)-%.omf : %/$(DOC_MODULE).xml @test "x$(_ENABLE_SK)" != "xtrue" -o -f "$(_skcontentslist)" || { \ echo "The file '$(_skcontentslist)' does not exist." >&2; \ echo "Please check your ScrollKeeper installation." >&2; \ exit 1; } xsltproc -o $@ $(call db2omf_args,$@,$<,'docbook') || { rm -f "$@"; exit 1; } ## @ _DOC_OMF_HTML ## The OMF files for HTML output _DOC_OMF_HTML = $(if $(_DOC_OMF_IN), \ $(foreach lc,C $(_DOC_REAL_LINGUAS),$(DOC_MODULE)-html-$(lc).omf)) $(_DOC_OMF_HTML) : $(_DOC_OMF_IN) $(_DOC_OMF_HTML) : $(DOC_MODULE)-html-%.omf : %/$(DOC_MODULE).xml if ENABLE_SK @test "x$(_ENABLE_SK)" != "xtrue" -o -f "$(_skcontentslist)" || { \ echo "The file '$(_skcontentslist)' does not exist" >&2; \ echo "Please check your ScrollKeeper installation." >&2; \ exit 1; } endif xsltproc -o $@ $(call db2omf_args,$@,$<,'xhtml') || { rm -f "$@"; exit 1; } ## @ _DOC_OMF_ALL ## All OMF output files to be built # FIXME _DOC_OMF_ALL = \ $(if $(filter docbook,$(_DOC_REAL_FORMATS)),$(_DOC_OMF_DB)) \ $(if $(filter html HTML,$(_DOC_REAL_FORMATS)),$(_DOC_OMF_HTML)) .PHONY: omf omf: $(_DOC_OMF_ALL) ################################################################################ ## @@ C Locale Documents ## @ _DOC_C_MODULE ## The top-level documentation file in the C locale _DOC_C_MODULE = $(if $(DOC_MODULE),C/$(DOC_MODULE).xml) ## @ _DOC_C_PAGES ## Page files in a Mallard document in the C locale _DOC_C_PAGES = $(foreach page,$(DOC_PAGES),C/$(page)) ## @ _DOC_C_ENTITIES ## Files included with a SYSTEM entity in the C locale _DOC_C_ENTITIES = $(foreach ent,$(DOC_ENTITIES),C/$(ent)) ## @ _DOC_C_XINCLUDES ## Files included with XInclude in the C locale _DOC_C_INCLUDES = $(foreach inc,$(DOC_INCLUDES),C/$(inc)) ## @ _DOC_C_DOCS ## All documentation files in the C locale _DOC_C_DOCS = \ $(_DOC_C_ENTITIES) $(_DOC_C_INCLUDES) \ $(_DOC_C_PAGES) $(_DOC_C_MODULE) ## @ _DOC_C_DOCS_NOENT ## All documentation files in the C locale, ## except files included with a SYSTEM entity _DOC_C_DOCS_NOENT = \ $(_DOC_C_MODULE) $(_DOC_C_INCLUDES) \ $(_DOC_C_PAGES) ## @ _DOC_C_FIGURES ## All figures and other external data in the C locale _DOC_C_FIGURES = $(if $(DOC_FIGURES), \ $(foreach fig,$(DOC_FIGURES),C/$(fig)), \ $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/C/figures/*.png))) ## @ _DOC_C_HTML ## All HTML documentation in the C locale # FIXME: probably have to shell escape to determine the file names _DOC_C_HTML = $(foreach f, \ $(shell xsltproc --xinclude \ --stringparam db.chunk.basename "$(DOC_MODULE)" \ $(_chunks) "C/$(DOC_MODULE).xml"), \ C/$(f).xhtml) ############################################################################### ## @@ Other Locale Documentation ## @ _DOC_POFILES ## The .po files used for translating the document _DOC_POFILES = $(if $(DOC_MODULE)$(DOC_ID), \ $(foreach lc,$(_DOC_REAL_LINGUAS),$(lc)/$(lc).po)) .PHONY: po po: $(_DOC_POFILES) ## @ _DOC_LC_MODULES ## The top-level documentation files in all other locales _DOC_LC_MODULES = $(if $(DOC_MODULE), \ $(foreach lc,$(_DOC_REAL_LINGUAS),$(lc)/$(DOC_MODULE).xml)) ## @ _DOC_LC_PAGES ## Page files in a Mallard document in all other locales _DOC_LC_PAGES = \ $(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach page,$(_DOC_C_PAGES), \ $(lc)/$(notdir $(page)) )) ## @ _DOC_LC_XINCLUDES ## Files included with XInclude in all other locales _DOC_LC_INCLUDES = \ $(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach inc,$(_DOC_C_INCLUDES), \ $(lc)/$(notdir $(inc)) )) ## @ _DOC_LC_HTML ## All HTML documentation in all other locales # FIXME: probably have to shell escape to determine the file names _DOC_LC_HTML = \ $(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach doc,$(_DOC_C_HTML), \ $(lc)/$(notdir $(doc)) )) ## @ _DOC_LC_DOCS ## All documentation files in all other locales _DOC_LC_DOCS = \ $(_DOC_LC_MODULES) $(_DOC_LC_INCLUDES) $(_DOC_LC_PAGES) \ $(if $(filter html HTML,$(_DOC_REAL_FORMATS)),$(_DOC_LC_HTML)) ## @ _DOC_LC_FIGURES ## All figures and other external data in all other locales _DOC_LC_FIGURES = $(foreach lc,$(_DOC_REAL_LINGUAS), \ $(patsubst C/%,$(lc)/%,$(_DOC_C_FIGURES)) ) _DOC_SRC_FIGURES = \ $(foreach fig,$(_DOC_C_FIGURES), $(foreach lc,C $(_DOC_REAL_LINGUAS), \ $(wildcard $(srcdir)/$(lc)/$(patsubst C/%,%,$(fig))) )) $(_DOC_POFILES): @if ! test -d $(dir $@); then \ echo "mkdir $(dir $@)"; \ mkdir "$(dir $@)"; \ fi @if test ! -f $@ -a -f $(srcdir)/$@; then \ echo "cp $(srcdir)/$@ $@"; \ cp "$(srcdir)/$@" "$@"; \ fi; @docs=; \ list='$(_DOC_C_DOCS_NOENT)'; for doc in $$list; do \ docs="$$docs $(_DOC_ABS_SRCDIR)/$$doc"; \ done; \ if ! test -f $@; then \ echo "(cd $(dir $@) && \ $(_xml2po) -m $(_xml2po_mode) -e $$docs > $(notdir $@).tmp && \ cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp)"; \ (cd $(dir $@) && \ $(_xml2po) -m $(_xml2po_mode) -e $$docs > $(notdir $@).tmp && \ cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp); \ else \ echo "(cd $(dir $@) && \ $(_xml2po) -m $(_xml2po_mode) -e -u $(notdir $@) $$docs)"; \ (cd $(dir $@) && \ $(_xml2po) -m $(_xml2po_mode) -e -u $(notdir $@) $$docs); \ fi # FIXME: fix the dependancy # FIXME: hook xml2po up $(_DOC_LC_DOCS) : $(_DOC_POFILES) $(_DOC_LC_DOCS) : $(_DOC_C_DOCS) if ! test -d $(dir $@); then mkdir $(dir $@); fi if [ -f "C/$(notdir $@)" ]; then d="../"; else d="$(_DOC_ABS_SRCDIR)/"; fi; \ po="$(dir $@)$(patsubst %/$(notdir $@),%,$@).po"; \ if [ -f "$${po}" ]; then po="../$${po}"; else po="$(_DOC_ABS_SRCDIR)/$${po}"; fi; \ (cd $(dir $@) && \ $(_xml2po) -m $(_xml2po_mode) -e -p "$${po}" \ "$${d}C/$(notdir $@)" > $(notdir $@).tmp && \ cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp) ## @ _DOC_POT ## A pot file _DOC_POT = $(if $(DOC_MODULE),$(DOC_MODULE).pot) .PHONY: pot pot: $(_DOC_POT) $(_DOC_POT): $(_DOC_C_DOCS_NOENT) $(_xml2po) -m $(_xml2po_mode) -e -o $@ $^ ################################################################################ ## @@ All Documentation ## @ _DOC_HTML_ALL ## All HTML documentation, only if it's built _DOC_HTML_ALL = $(if $(filter html HTML,$(_DOC_REAL_FORMATS)), \ $(_DOC_C_HTML) $(_DOC_LC_HTML)) _DOC_HTML_TOPS = $(foreach lc,C $(_DOC_REAL_LINGUAS),$(lc)/$(DOC_MODULE).xhtml) $(_DOC_HTML_TOPS): $(_DOC_C_DOCS) $(_DOC_LC_DOCS) xsltproc -o $@ --xinclude --param db.chunk.chunk_top "false()" --stringparam db.chunk.basename "$(DOC_MODULE)" --stringparam db.chunk.extension ".xhtml" $(_db2html) $(patsubst %.xhtml,%.xml,$@) ################################################################################ ## All all: \ $(_DOC_C_DOCS) $(_DOC_LC_DOCS) \ $(_DOC_OMF_ALL) $(_DOC_DSK_ALL) \ $(_DOC_HTML_ALL) $(_DOC_POFILES) ################################################################################ ## Clean .PHONY: clean-doc-omf clean-doc-dsk clean-doc-lc clean-doc-dir clean-doc-omf: ; rm -f $(_DOC_OMF_DB) $(_DOC_OMF_HTML) clean-doc-dsk: ; rm -f $(_DOC_DSK_DB) $(_DOC_DSK_HTML) clean-doc-lc: rm -f $(_DOC_LC_DOCS) @list='$(_DOC_POFILES)'; for po in $$list; do \ if ! test "$$po" -ef "$(srcdir)/$$po"; then \ echo "rm -f $$po"; \ rm -f "$$po"; \ fi; \ done @for lc in C $(_DOC_REAL_LINGUAS); do \ if test -f "$$lc/.xml2po.mo"; then \ echo "rm -f $$lc/.xml2po.mo"; \ rm -f "$$lc/.xml2po.mo"; \ fi; \ done clean-doc-dir: clean-doc-lc @for lc in C $(_DOC_REAL_LINGUAS); do \ for dir in `find $$lc -depth -type d`; do \ if ! test $$dir -ef $(srcdir)/$$dir; then \ echo "rmdir $$dir"; \ rmdir "$$dir"; \ fi; \ done; \ done _clean_omf = $(if $(_DOC_OMF_IN),clean-doc-omf) _clean_dsk = $(if $(_DOC_DSK_IN),clean-doc-dsk) _clean_lc = $(if $(_DOC_REAL_LINGUAS),clean-doc-lc) _clean_dir = $(if $(DOC_MODULE)$(DOC_ID),clean-doc-dir) clean-local: \ $(_clean_omf) $(_clean_dsk) \ $(_clean_lc) $(_clean_dir) distclean-local: \ $(_clean_omf) $(_clean_dsk) \ $(_clean_lc) $(_clean_dir) mostlyclean-local: \ $(_clean_omf) $(_clean_dsk) \ $(_clean_lc) $(_clean_dir) maintainer-clean-local: \ $(_clean_omf) $(_clean_dsk) \ $(_clean_lc) $(_clean_dir) ################################################################################ ## Dist .PHONY: dist-doc-docs dist-doc-pages dist-doc-figs dist-doc-omf dist-doc-dsk doc-dist-hook: \ $(if $(DOC_MODULE)$(DOC_ID),dist-doc-docs) \ $(if $(_DOC_C_FIGURES),dist-doc-figs) \ $(if $(_DOC_OMF_IN),dist-doc-omf) # $(if $(_DOC_DSK_IN),dist-doc-dsk) dist-doc-docs: $(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES) @for lc in C $(_DOC_REAL_LINGUAS); do \ echo " $(mkinstalldirs) $(distdir)/$$lc"; \ $(mkinstalldirs) "$(distdir)/$$lc"; \ done @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES)'; \ for doc in $$list; do \ if test -f "$$doc"; then d=; else d="$(srcdir)/"; fi; \ docdir=`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \ if ! test -d "$(distdir)/$$docdir"; then \ echo "$(mkinstalldirs) $(distdir)/$$docdir"; \ $(mkinstalldirs) "$(distdir)/$$docdir"; \ fi; \ echo "$(INSTALL_DATA) $$d$$doc $(distdir)/$$doc"; \ $(INSTALL_DATA) "$$d$$doc" "$(distdir)/$$doc"; \ done dist-doc-figs: $(_DOC_SRC_FIGURES) @list='$(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)'; \ for fig in $$list; do \ if test -f "$$fig"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$fig"; then \ figdir=`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \ if ! test -d "$(distdir)/$$figdir"; then \ echo "$(mkinstalldirs) $(distdir)/$$figdir"; \ $(mkinstalldirs) "$(distdir)/$$figdir"; \ fi; \ echo "$(INSTALL_DATA) $$d$$fig $(distdir)/$$fig"; \ $(INSTALL_DATA) "$$d$$fig" "$(distdir)/$$fig"; \ fi; \ done; dist-doc-omf: @if test -f "$(_DOC_OMF_IN)"; then d=; else d="$(srcdir)/"; fi; \ echo "$(INSTALL_DATA) $$d$(_DOC_OMF_IN) $(distdir)/$(notdir $(_DOC_OMF_IN))"; \ $(INSTALL_DATA) "$$d$(_DOC_OMF_IN)" "$(distdir)/$(notdir $(_DOC_OMF_IN))" dist-doc-dsk: @if test -f "$(_DOC_DSK_IN)"; then d=; else d="$(srcdir)/"; fi; \ echo "$(INSTALL_DATA) $$d$(_DOC_DSK_IN) $(distdir)/$(notdir $(_DOC_DSK_IN))"; \ $(INSTALL_DATA) "$$d$(_DOC_DSK_IN)" "$(distdir)/$(notdir $(_DOC_DSK_IN))" ################################################################################ ## Check .PHONY: check-doc-docs check-doc-omf check: \ $(if $(DOC_MODULE),check-doc-docs) \ $(if $(DOC_ID),check-doc-pages) \ $(if $(_DOC_OMF_IN),check-doc-omf) check-doc-docs: $(_DOC_C_DOCS) $(_DOC_LC_DOCS) @for lc in C $(_DOC_REAL_LINGUAS); do \ if test -f "$$lc"; \ then d=; \ xmlpath="$$lc"; \ else \ d="$(srcdir)/"; \ xmlpath="$$lc:$(srcdir)/$$lc"; \ fi; \ echo "xmllint --noout --noent --path $$xmlpath --xinclude --postvalid $$d$$lc/$(DOC_MODULE).xml"; \ xmllint --noout --noent --path "$$xmlpath" --xinclude --postvalid "$$d$$lc/$(DOC_MODULE).xml"; \ done check-doc-pages: $(_DOC_C_PAGES) $(_DOC_LC_PAGES) for lc in C $(_DOC_REAL_LINGUAS); do \ if test -f "$$lc"; \ then d=; \ xmlpath="$$lc"; \ else \ d="$(srcdir)/"; \ xmlpath="$$lc:$(srcdir)/$$lc"; \ fi; \ for page in $(DOC_PAGES); do \ echo "xmllint --noout --noent --path $$xmlpath --xinclude --relaxng $(_malrng) $$d$$lc/$$page"; \ xmllint --noout --noent --path "$$xmlpath" --xinclude --relaxng "$(_malrng)" "$$d$$lc/$$page"; \ done; \ done check-doc-omf: $(_DOC_OMF_ALL) @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \ echo "xmllint --noout --xinclude --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' $$omf"; \ xmllint --noout --xinclude --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' $$omf; \ done ################################################################################ ## Install .PHONY: install-doc-docs install-doc-html install-doc-figs install-doc-omf install-doc-dsk _doc_install_dir = $(if $(DOC_ID),$(DOC_ID),$(DOC_MODULE)) install-data-local: \ $(if $(DOC_MODULE)$(DOC_ID),install-doc-docs) \ $(if $(_DOC_HTML_ALL),install-doc-html) \ $(if $(_DOC_C_FIGURES),install-doc-figs) \ $(if $(_DOC_OMF_IN),install-doc-omf) # $(if $(_DOC_DSK_IN),install-doc-dsk) install-doc-docs: @for lc in C $(_DOC_REAL_LINGUAS); do \ echo "$(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$lc"; \ $(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$lc; \ done @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \ if test -f "$$doc"; then d=; else d="$(srcdir)/"; fi; \ docdir="$$lc/"`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \ docdir="$(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$docdir"; \ if ! test -d "$$docdir"; then \ echo "$(mkinstalldirs) $$docdir"; \ $(mkinstalldirs) "$$docdir"; \ fi; \ echo "$(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$doc"; \ $(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$doc; \ done install-doc-figs: @list='$(patsubst C/%,%,$(_DOC_C_FIGURES))'; for fig in $$list; do \ for lc in C $(_DOC_REAL_LINGUAS); do \ figsymlink=false; \ if test -f "$$lc/$$fig"; then \ figfile="$$lc/$$fig"; \ elif test -f "$(srcdir)/$$lc/$$fig"; then \ figfile="$(srcdir)/$$lc/$$fig"; \ else \ figsymlink=true; \ fi; \ figdir="$$lc/"`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \ figdir="$(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$figdir"; \ if ! test -d "$$figdir"; then \ echo "$(mkinstalldirs) $$figdir"; \ $(mkinstalldirs) "$$figdir"; \ fi; \ figbase=`echo $$fig | sed -e 's/^.*\///'`; \ if $$figsymlink; then \ echo "cd $$figdir && $(LN_S) -f ../../C/$$fig $$figbase"; \ ( cd "$$figdir" && $(LN_S) -f "../../C/$$fig" "$$figbase" ); \ else \ echo "$(INSTALL_DATA) $$figfile $$figdir$$figbase"; \ $(INSTALL_DATA) "$$figfile" "$$figdir$$figbase"; \ fi; \ done; \ done install-doc-html: echo install-html install-doc-omf: $(mkinstalldirs) $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir) @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \ echo "$(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf"; \ $(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf; \ done @if test "x$(_ENABLE_SK)" = "xtrue"; then \ echo "scrollkeeper-update -p $(DESTDIR)$(_sklocalstatedir) -o $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)"; \ scrollkeeper-update -p "$(DESTDIR)$(_sklocalstatedir)" -o "$(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)"; \ fi; install-doc-dsk: echo install-dsk ################################################################################ ## Uninstall .PHONY: uninstall-doc-docs uninstall-doc-html uninstall-doc-figs uninstall-doc-omf uninstall-doc-dsk uninstall-local: \ $(if $(DOC_MODULE)$(DOC_ID),uninstall-doc-docs) \ $(if $(_DOC_HTML_ALL),uninstall-doc-html) \ $(if $(_DOC_C_FIGURES),uninstall-doc-figs) \ $(if $(_DOC_OMF_IN),uninstall-doc-omf) # $(if $(_DOC_DSK_IN),uninstall-doc-dsk) uninstall-doc-docs: @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \ echo " rm -f $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$doc"; \ rm -f "$(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$doc"; \ done uninstall-doc-figs: @list='$(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)'; for fig in $$list; do \ echo "rm -f $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$fig"; \ rm -f "$(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$fig"; \ done; uninstall-doc-omf: @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \ if test "x$(_ENABLE_SK)" = "xtrue"; then \ echo "scrollkeeper-uninstall -p $(_sklocalstatedir) $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf"; \ scrollkeeper-uninstall -p "$(_sklocalstatedir)" "$(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf"; \ fi; \ echo "rm -f $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf"; \ rm -f "$(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf"; \ done pdfmod-0.9.1/README0000644000175000001440000000076011406252544013775 0ustar00gabeusers00000000000000Website: http://live.gnome.org/PdfMod Bugs: http://bugzilla.gnome.org/browse.cgi?product=pdfmod Dependencies: * Mono * Gtk# * poppler * poppler-sharp - http://github.com/jacintos/poppler-sharp - optional: if not installed, will use bundled version * gnome-doc-utils-devel * gnome-common (if building from git) * Hyena (http://git.gnome.org/cgit/hyena) To build from git: $ ./autogen.sh && make To build from tarball: $ ./configure && make To run uninstalled: $ make run pdfmod-0.9.1/lib/0000777000175000001440000000000011533760017013664 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/poppler-sharp/0000777000175000001440000000000011533760020016452 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/poppler-sharp/Makefile.in0000644000175000001440000006157611533760015020536 0ustar00gabeusers00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.include COPYING subdir = lib/poppler-sharp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibdir)" \ "$(DESTDIR)$(programfilesdir)" binSCRIPT_INSTALL = $(INSTALL_SCRIPT) pkglibSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) $(pkglib_SCRIPTS) SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; programfilesDATA_INSTALL = $(INSTALL_DATA) DATA = $(programfiles_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUNDLE_ASSEMBLIES = @BUNDLE_ASSEMBLIES@ BUNDLE_FILES = @BUNDLE_FILES@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GCONF_SHARP_20_CFLAGS = @GCONF_SHARP_20_CFLAGS@ GCONF_SHARP_20_LIBS = @GCONF_SHARP_20_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ HELP_DIR = @HELP_DIR@ HYENA_ASSEMBLIES = @HYENA_ASSEMBLIES@ HYENA_CFLAGS = @HYENA_CFLAGS@ HYENA_FILES = @HYENA_FILES@ HYENA_GUI_ASSEMBLIES = @HYENA_GUI_ASSEMBLIES@ HYENA_GUI_CFLAGS = @HYENA_GUI_CFLAGS@ HYENA_GUI_FILES = @HYENA_GUI_FILES@ HYENA_GUI_LIBS = @HYENA_GUI_LIBS@ HYENA_LIBS = @HYENA_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@ INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@ INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@ INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@ INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@ INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@ INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@ INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@ INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@ INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@ INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@ INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@ INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@ INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POPPLER_ASSEMBLIES = @POPPLER_ASSEMBLIES@ POPPLER_CFLAGS = @POPPLER_CFLAGS@ POPPLER_LIBS = @POPPLER_LIBS@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) @ENABLE_DEBUG_TRUE@@USE_BUNDLED_POPPLER_TRUE@ASSEMBLY_COMPILER_COMMAND = $(MCS) @ENABLE_RELEASE_TRUE@@USE_BUNDLED_POPPLER_TRUE@ASSEMBLY_COMPILER_COMMAND = $(MCS) @ENABLE_DEBUG_TRUE@@USE_BUNDLED_POPPLER_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -unsafe -debug "-define:DEBUG" @ENABLE_RELEASE_TRUE@@USE_BUNDLED_POPPLER_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -unsafe -debug -define:DEBUG @ENABLE_DEBUG_TRUE@@USE_BUNDLED_POPPLER_TRUE@ASSEMBLY = ../../bin/poppler-sharp.dll @ENABLE_RELEASE_TRUE@@USE_BUNDLED_POPPLER_TRUE@ASSEMBLY = ../../bin/poppler-sharp.dll @ENABLE_DEBUG_TRUE@@USE_BUNDLED_POPPLER_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@@USE_BUNDLED_POPPLER_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_DEBUG_TRUE@@USE_BUNDLED_POPPLER_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@@USE_BUNDLED_POPPLER_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@@USE_BUNDLED_POPPLER_TRUE@PROJECT_REFERENCES = @ENABLE_RELEASE_TRUE@@USE_BUNDLED_POPPLER_TRUE@PROJECT_REFERENCES = @ENABLE_DEBUG_TRUE@@USE_BUNDLED_POPPLER_TRUE@BUILD_DIR = ../../bin @ENABLE_RELEASE_TRUE@@USE_BUNDLED_POPPLER_TRUE@BUILD_DIR = ../../bin @USE_BUNDLED_POPPLER_TRUE@PROGRAMFILES = \ @USE_BUNDLED_POPPLER_TRUE@ $(POPPLER_SHARP_DLL_MDB) @USE_BUNDLED_POPPLER_TRUE@BINARIES = @USE_BUNDLED_POPPLER_TRUE@RESGEN = resgen2 FILES = \ poppler-sharp/Document.cs \ poppler-sharp/generated/Action.cs \ poppler-sharp/generated/ActionAny.cs \ poppler-sharp/generated/ActionGotoDest.cs \ poppler-sharp/generated/ActionGotoRemote.cs \ poppler-sharp/generated/ActionLaunch.cs \ poppler-sharp/generated/ActionMovie.cs \ poppler-sharp/generated/ActionNamed.cs \ poppler-sharp/generated/ActionType.cs \ poppler-sharp/generated/ActionUri.cs \ poppler-sharp/generated/Annot.cs \ poppler-sharp/generated/AnnotCalloutLine.cs \ poppler-sharp/generated/AnnotExternalDataType.cs \ poppler-sharp/generated/AnnotFlag.cs \ poppler-sharp/generated/AnnotFreeText.cs \ poppler-sharp/generated/AnnotFreeTextQuadding.cs \ poppler-sharp/generated/AnnotMapping.cs \ poppler-sharp/generated/AnnotMarkup.cs \ poppler-sharp/generated/AnnotMarkupReplyType.cs \ poppler-sharp/generated/AnnotText.cs \ poppler-sharp/generated/AnnotTextState.cs \ poppler-sharp/generated/AnnotType.cs \ poppler-sharp/generated/Attachment.cs \ poppler-sharp/generated/AttachmentSaveFunc.cs \ poppler-sharp/generated/Backend.cs \ poppler-sharp/generated/Color.cs \ poppler-sharp/generated/Dest.cs \ poppler-sharp/generated/DestType.cs \ poppler-sharp/generated/Document.cs \ poppler-sharp/generated/Error.cs \ poppler-sharp/generated/FontInfo.cs \ poppler-sharp/generated/FontType.cs \ poppler-sharp/generated/FontsIter.cs \ poppler-sharp/generated/FormButtonType.cs \ poppler-sharp/generated/FormChoiceType.cs \ poppler-sharp/generated/FormField.cs \ poppler-sharp/generated/FormFieldMapping.cs \ poppler-sharp/generated/FormFieldType.cs \ poppler-sharp/generated/FormTextType.cs \ poppler-sharp/generated/Global.cs \ poppler-sharp/generated/ImageMapping.cs \ poppler-sharp/generated/IndexIter.cs \ poppler-sharp/generated/Layer.cs \ poppler-sharp/generated/LayersIter.cs \ poppler-sharp/generated/LinkMapping.cs \ poppler-sharp/generated/Orientation.cs \ poppler-sharp/generated/PSFile.cs \ poppler-sharp/generated/Page.cs \ poppler-sharp/generated/PageLayout.cs \ poppler-sharp/generated/PageMode.cs \ poppler-sharp/generated/PageTransition.cs \ poppler-sharp/generated/PageTransitionAlignment.cs \ poppler-sharp/generated/PageTransitionDirection.cs \ poppler-sharp/generated/PageTransitionType.cs \ poppler-sharp/generated/PopplerSharp.AttachmentSaveFuncNative.cs \ poppler-sharp/generated/Rectangle.cs \ poppler-sharp/generated/SelectionStyle.cs \ poppler-sharp/generated/ViewerPreferences.cs DATA_FILES = RESOURCES = EXTRAS = REFERENCES = \ Mono.Cairo \ -pkg:gtk-sharp-2.0 \ System DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) $(ASSEMBLY) $(ASSEMBLY).mdb \ $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q = $(subst \ ,?,$1) q2s = $(subst ?,\ ,$1) # use this when result will be quoted unesc2 = $(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc = $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed = $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC = $(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target = $(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets = $(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) DLL_REFERENCES_EXPANDED = $(foreach reference, $(DLL_REFERENCES), $(addprefix $(srcdir)/, $(reference))) build_references_ref = $(call q2s,$(foreach ref, $(call \ s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), \ $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) $(call \ q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES_EXPANDED)), \ -r:$(ref))) $(call q2s,$(foreach ref, $(call \ s2q,$(PROJECT_REFERENCES)), -r:$(ref))) s2q2s = $(call unesc2,$(call s2q,$1)) cp_actual = test -z $1 || cp $1 $2 cp = $(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual = test -z '$1' || rm -f '$2' rm = $(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* pkglib_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) POPPLER_SHARP_DLL = $(BUILD_DIR)/poppler-sharp.dll POPPLER_SHARP_DLL_CONFIG = $(BUILD_DIR)/poppler-sharp.dll.config POPPLER_SHARP_DLL_MDB = $(BUILD_DIR)/poppler-sharp.dll.mdb all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/poppler-sharp/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/poppler-sharp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done install-pkglibSCRIPTS: $(pkglib_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(pkglibSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(pkglibSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ else :; fi; \ done uninstall-pkglibSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkglib_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) test -z "$(programfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" @list='$(programfiles_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(programfilesDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(programfilesdir)/$$f'"; \ $(programfilesDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(programfilesdir)/$$f"; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(programfilesdir)/$$f'"; \ rm -f "$(DESTDIR)$(programfilesdir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(programfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-programfilesDATA install-dvi: install-dvi-am install-exec-am: install-binSCRIPTS install-pkglibSCRIPTS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-pkglibSCRIPTS \ uninstall-programfilesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibSCRIPTS install-programfilesDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-binSCRIPTS uninstall-pkglibSCRIPTS \ uninstall-programfilesDATA @USE_BUNDLED_POPPLER_TRUE@all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) $(eval $(call emit-deploy-target,POPPLER_SHARP_DLL_CONFIG)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) cp $(srcdir)/poppler-sharp/poppler-sharp.dll.config $(BUILD_DIR) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/0000777000175000001440000000000011533760020021246 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/Document.cs0000644000175000001440000000305411240370571023354 0ustar00gabeusers00000000000000/* Bit of a hack because GAPI doesn't detect the GObject properties in * poppler-document.cc and I don't know how to add them using the GAPI * fixup tool. *sigh* */ namespace Poppler { public partial class Document : GLib.Object { public string Title { get { return (string)this.GetProperty("title"); } } public string Format { get { return (string)this.GetProperty("format"); } } public string Author { get { return (string)this.GetProperty("author"); } } public string Subject { get { return (string)this.GetProperty("subject"); } } public string Keywords { get { return (string)this.GetProperty("keywords"); } } public string Creator { get { return (string)this.GetProperty("creator"); } } public string Producer { get { return (string)this.GetProperty("producer"); } } public int CreationDate { get { return (int)this.GetProperty("creation-date"); } } public int ModificationDate { get { return (int)this.GetProperty("mod-date"); } } public string Linearized { get { return (string)this.GetProperty("linearized"); } } // TODO: modification-date // TODO: page-layout, page-mode, viewer-preferences, permissions public string Metadata { get { return (string)this.GetProperty("metadata"); } } } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/poppler-sharp.dll.config0000644000175000001440000000024511511430546026003 0ustar00gabeusers00000000000000 pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/0000777000175000001440000000000011533760020023204 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/ActionType.cs0000644000175000001440000000115411242311651025606 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.ActionTypeGType))] public enum ActionType { Unknown, None, GotoDest, GotoRemote, Launch, Uri, Named, Movie, } internal class ActionTypeGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_action_type_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_action_type_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/Dest.cs0000644000175000001440000000421311242311651024425 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code [StructLayout(LayoutKind.Sequential)] public struct Dest { public Poppler.DestType Type; public int PageNum; public double Left; public double Bottom; public double Right; public double Top; public double Zoom; public string NamedDest; private uint _bitfield0; public static Poppler.Dest Zero = new Poppler.Dest (); public static Poppler.Dest New(IntPtr raw) { if (raw == IntPtr.Zero) return Poppler.Dest.Zero; return (Poppler.Dest) Marshal.PtrToStructure (raw, typeof (Poppler.Dest)); } [DllImport("poppler-glib")] static extern IntPtr poppler_dest_copy(IntPtr raw); public Poppler.Dest Copy() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); IntPtr raw_ret = poppler_dest_copy(this_as_native); Poppler.Dest ret = Poppler.Dest.New (raw_ret); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); return ret; } [DllImport("poppler-glib")] static extern void poppler_dest_free(IntPtr raw); public void Free() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); poppler_dest_free(this_as_native); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); } [DllImport("poppler-glib")] static extern IntPtr poppler_dest_get_type(); public static GLib.GType GType { get { IntPtr raw_ret = poppler_dest_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } static void ReadNative (IntPtr native, ref Poppler.Dest target) { target = New (native); } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/AnnotCalloutLine.cs0000644000175000001440000000500711242311651026743 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code [StructLayout(LayoutKind.Sequential)] public struct AnnotCalloutLine { public bool Multiline; public double X1; public double Y1; public double X2; public double Y2; public double X3; public double Y3; public static Poppler.AnnotCalloutLine Zero = new Poppler.AnnotCalloutLine (); public static Poppler.AnnotCalloutLine New(IntPtr raw) { if (raw == IntPtr.Zero) return Poppler.AnnotCalloutLine.Zero; return (Poppler.AnnotCalloutLine) Marshal.PtrToStructure (raw, typeof (Poppler.AnnotCalloutLine)); } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_callout_line_new(); public static AnnotCalloutLine New() { AnnotCalloutLine result = AnnotCalloutLine.New (poppler_annot_callout_line_new()); return result; } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_callout_line_copy(IntPtr raw); public Poppler.AnnotCalloutLine Copy() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); IntPtr raw_ret = poppler_annot_callout_line_copy(this_as_native); Poppler.AnnotCalloutLine ret = Poppler.AnnotCalloutLine.New (raw_ret); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); return ret; } [DllImport("poppler-glib")] static extern void poppler_annot_callout_line_free(IntPtr raw); public void Free() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); poppler_annot_callout_line_free(this_as_native); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_callout_line_get_type(); public static GLib.GType GType { get { IntPtr raw_ret = poppler_annot_callout_line_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } static void ReadNative (IntPtr native, ref Poppler.AnnotCalloutLine target) { target = New (native); } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/AnnotMarkup.cs0000644000175000001440000000474011242311651025772 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class AnnotMarkup : GLib.Object { [Obsolete] protected AnnotMarkup(GLib.GType gtype) : base(gtype) {} public AnnotMarkup(IntPtr raw) : base(raw) {} protected AnnotMarkup() : base(IntPtr.Zero) { CreateNativeObject (new string [0], new GLib.Value [0]); } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_markup_get_label(IntPtr raw); public string Label { get { IntPtr raw_ret = poppler_annot_markup_get_label(Handle); string ret = GLib.Marshaller.PtrToStringGFree(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern int poppler_annot_markup_get_external_data(IntPtr raw); public Poppler.AnnotExternalDataType ExternalData { get { int raw_ret = poppler_annot_markup_get_external_data(Handle); Poppler.AnnotExternalDataType ret = (Poppler.AnnotExternalDataType) raw_ret; return ret; } } [DllImport("poppler-glib")] static extern int poppler_annot_markup_get_reply_to(IntPtr raw); public Poppler.AnnotMarkupReplyType ReplyTo { get { int raw_ret = poppler_annot_markup_get_reply_to(Handle); Poppler.AnnotMarkupReplyType ret = (Poppler.AnnotMarkupReplyType) raw_ret; return ret; } } [DllImport("poppler-glib")] static extern bool poppler_annot_markup_get_popup_is_open(IntPtr raw); public bool PopupIsOpen { get { bool raw_ret = poppler_annot_markup_get_popup_is_open(Handle); bool ret = raw_ret; return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_markup_get_type(); public static new GLib.GType GType { get { IntPtr raw_ret = poppler_annot_markup_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_markup_get_subject(IntPtr raw); public string Subject { get { IntPtr raw_ret = poppler_annot_markup_get_subject(Handle); string ret = GLib.Marshaller.PtrToStringGFree(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern double poppler_annot_markup_get_opacity(IntPtr raw); public double Opacity { get { double raw_ret = poppler_annot_markup_get_opacity(Handle); double ret = raw_ret; return ret; } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/Document.cs0000644000175000001440000001225311242311651025307 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public partial class Document : GLib.Object { [Obsolete] protected Document(GLib.GType gtype) : base(gtype) {} public Document(IntPtr raw) : base(raw) {} [DllImport("poppler-glib")] static extern unsafe IntPtr poppler_document_new_from_data(IntPtr data, int length, IntPtr password, out IntPtr error); public unsafe Document (string data, string password) : base (IntPtr.Zero) { if (GetType () != typeof (Document)) { throw new InvalidOperationException ("Can't override this constructor."); } IntPtr native_password = GLib.Marshaller.StringToPtrGStrdup (password); IntPtr error = IntPtr.Zero; Raw = poppler_document_new_from_data(GLib.Marshaller.StringToPtrGStrdup(data), System.Text.Encoding.UTF8.GetByteCount (data), native_password, out error); GLib.Marshaller.Free (native_password); if (error != IntPtr.Zero) throw new GLib.GException (error); } [DllImport("poppler-glib")] static extern unsafe IntPtr poppler_document_new_from_file(IntPtr uri, IntPtr password, out IntPtr error); public static unsafe Document NewFromFile(string uri, string password) { IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri); IntPtr native_password = GLib.Marshaller.StringToPtrGStrdup (password); IntPtr error = IntPtr.Zero; Document result = new Document (poppler_document_new_from_file(native_uri, native_password, out error)); GLib.Marshaller.Free (native_uri); GLib.Marshaller.Free (native_password); if (error != IntPtr.Zero) throw new GLib.GException (error); return result; } [DllImport("poppler-glib")] static extern unsafe bool poppler_document_save(IntPtr raw, IntPtr uri, out IntPtr error); public unsafe bool Save(string uri) { IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri); IntPtr error = IntPtr.Zero; bool raw_ret = poppler_document_save(Handle, native_uri, out error); bool ret = raw_ret; GLib.Marshaller.Free (native_uri); if (error != IntPtr.Zero) throw new GLib.GException (error); return ret; } [DllImport("poppler-glib")] static extern unsafe bool poppler_document_save_a_copy(IntPtr raw, IntPtr uri, out IntPtr error); public unsafe bool SaveACopy(string uri) { IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri); IntPtr error = IntPtr.Zero; bool raw_ret = poppler_document_save_a_copy(Handle, native_uri, out error); bool ret = raw_ret; GLib.Marshaller.Free (native_uri); if (error != IntPtr.Zero) throw new GLib.GException (error); return ret; } [DllImport("poppler-glib")] static extern IntPtr poppler_document_get_page_by_label(IntPtr raw, IntPtr label); public Poppler.Page GetPageByLabel(string label) { IntPtr native_label = GLib.Marshaller.StringToPtrGStrdup (label); IntPtr raw_ret = poppler_document_get_page_by_label(Handle, native_label); Poppler.Page ret = GLib.Object.GetObject(raw_ret) as Poppler.Page; GLib.Marshaller.Free (native_label); return ret; } [DllImport("poppler-glib")] static extern IntPtr poppler_document_get_form_field(IntPtr raw, int id); public Poppler.FormField GetFormField(int id) { IntPtr raw_ret = poppler_document_get_form_field(Handle, id); Poppler.FormField ret = GLib.Object.GetObject(raw_ret) as Poppler.FormField; return ret; } [DllImport("poppler-glib")] static extern IntPtr poppler_document_get_page(IntPtr raw, int index); public Poppler.Page GetPage(int index) { IntPtr raw_ret = poppler_document_get_page(Handle, index); Poppler.Page ret = GLib.Object.GetObject(raw_ret) as Poppler.Page; return ret; } [DllImport("poppler-glib")] static extern int poppler_document_get_n_pages(IntPtr raw); public int NPages { get { int raw_ret = poppler_document_get_n_pages(Handle); int ret = raw_ret; return ret; } } [DllImport("poppler-glib")] static extern bool poppler_document_has_attachments(IntPtr raw); public bool HasAttachments { get { bool raw_ret = poppler_document_has_attachments(Handle); bool ret = raw_ret; return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_document_find_dest(IntPtr raw, IntPtr link_name); public Poppler.Dest FindDest(string link_name) { IntPtr native_link_name = GLib.Marshaller.StringToPtrGStrdup (link_name); IntPtr raw_ret = poppler_document_find_dest(Handle, native_link_name); Poppler.Dest ret = Poppler.Dest.New (raw_ret); GLib.Marshaller.Free (native_link_name); return ret; } [DllImport("poppler-glib")] static extern IntPtr poppler_document_get_attachments(IntPtr raw); public GLib.List Attachments { get { IntPtr raw_ret = poppler_document_get_attachments(Handle); GLib.List ret = new GLib.List(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_document_get_type(); public static new GLib.GType GType { get { IntPtr raw_ret = poppler_document_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/ActionNamed.cs0000644000175000001440000000140211242311651025705 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code [StructLayout(LayoutKind.Sequential)] public struct ActionNamed { public Poppler.ActionType Type; public string Title; public string NamedDest; public static Poppler.ActionNamed Zero = new Poppler.ActionNamed (); public static Poppler.ActionNamed New(IntPtr raw) { if (raw == IntPtr.Zero) return Poppler.ActionNamed.Zero; return (Poppler.ActionNamed) Marshal.PtrToStructure (raw, typeof (Poppler.ActionNamed)); } private static GLib.GType GType { get { return GLib.GType.Pointer; } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/PopplerSharp.AttachmentSaveFuncNative.cs0000644000175000001440000000505711242311651033045 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace PopplerSharp { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.CDeclCallback] internal delegate bool AttachmentSaveFuncNative(IntPtr buf, UIntPtr count, IntPtr data, out IntPtr error); internal class AttachmentSaveFuncInvoker { AttachmentSaveFuncNative native_cb; IntPtr __data; GLib.DestroyNotify __notify; ~AttachmentSaveFuncInvoker () { if (__notify == null) return; __notify (__data); } internal AttachmentSaveFuncInvoker (AttachmentSaveFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {} internal AttachmentSaveFuncInvoker (AttachmentSaveFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {} internal AttachmentSaveFuncInvoker (AttachmentSaveFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify) { this.native_cb = native_cb; __data = data; __notify = notify; } internal Poppler.AttachmentSaveFunc Handler { get { return new Poppler.AttachmentSaveFunc(InvokeNative); } } bool InvokeNative (string buf, ulong count) { IntPtr native_buf = GLib.Marshaller.StringToPtrGStrdup (buf); IntPtr error = IntPtr.Zero; bool result = native_cb (native_buf, new UIntPtr (count), __data, out error); GLib.Marshaller.Free (native_buf); return result; } } internal class AttachmentSaveFuncWrapper { public bool NativeCallback (IntPtr buf, UIntPtr count, IntPtr data, out IntPtr error) { error = IntPtr.Zero; try { bool __ret = managed (GLib.Marshaller.Utf8PtrToString (buf), (ulong) count); if (release_on_call) gch.Free (); return __ret; } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, false); return false; } } bool release_on_call = false; GCHandle gch; public void PersistUntilCalled () { release_on_call = true; gch = GCHandle.Alloc (this); } internal AttachmentSaveFuncNative NativeDelegate; Poppler.AttachmentSaveFunc managed; public AttachmentSaveFuncWrapper (Poppler.AttachmentSaveFunc managed) { this.managed = managed; if (managed != null) NativeDelegate = new AttachmentSaveFuncNative (NativeCallback); } public static Poppler.AttachmentSaveFunc GetManagedDelegate (AttachmentSaveFuncNative native) { if (native == null) return null; AttachmentSaveFuncWrapper wrapper = (AttachmentSaveFuncWrapper) native.Target; if (wrapper == null) return null; return wrapper.managed; } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/PageTransitionAlignment.cs0000644000175000001440000000117111242311651030314 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.PageTransitionAlignmentGType))] public enum PageTransitionAlignment { Horizontal, Vertical, } internal class PageTransitionAlignmentGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_page_transition_alignment_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_page_transition_alignment_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/PageTransition.cs0000644000175000001440000000506111242311651026457 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code [StructLayout(LayoutKind.Sequential)] public struct PageTransition { public Poppler.PageTransitionType Type; public Poppler.PageTransitionAlignment Alignment; public Poppler.PageTransitionDirection Direction; public int Duration; public int Angle; public double Scale; public bool Rectangular; public static Poppler.PageTransition Zero = new Poppler.PageTransition (); public static Poppler.PageTransition New(IntPtr raw) { if (raw == IntPtr.Zero) return Poppler.PageTransition.Zero; return (Poppler.PageTransition) Marshal.PtrToStructure (raw, typeof (Poppler.PageTransition)); } [DllImport("poppler-glib")] static extern IntPtr poppler_page_transition_new(); public static PageTransition New() { PageTransition result = PageTransition.New (poppler_page_transition_new()); return result; } [DllImport("poppler-glib")] static extern IntPtr poppler_page_transition_copy(IntPtr raw); public Poppler.PageTransition Copy() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); IntPtr raw_ret = poppler_page_transition_copy(this_as_native); Poppler.PageTransition ret = Poppler.PageTransition.New (raw_ret); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); return ret; } [DllImport("poppler-glib")] static extern void poppler_page_transition_free(IntPtr raw); public void Free() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); poppler_page_transition_free(this_as_native); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); } [DllImport("poppler-glib")] static extern IntPtr poppler_page_transition_get_type(); public static GLib.GType GType { get { IntPtr raw_ret = poppler_page_transition_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } static void ReadNative (IntPtr native, ref Poppler.PageTransition target) { target = New (native); } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/ActionLaunch.cs0000644000175000001440000000144011242311651026075 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code [StructLayout(LayoutKind.Sequential)] public struct ActionLaunch { public Poppler.ActionType Type; public string Title; public string FileName; public string Params; public static Poppler.ActionLaunch Zero = new Poppler.ActionLaunch (); public static Poppler.ActionLaunch New(IntPtr raw) { if (raw == IntPtr.Zero) return Poppler.ActionLaunch.Zero; return (Poppler.ActionLaunch) Marshal.PtrToStructure (raw, typeof (Poppler.ActionLaunch)); } private static GLib.GType GType { get { return GLib.GType.Pointer; } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/ActionMovie.cs0000644000175000001440000000134711242311651025750 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code [StructLayout(LayoutKind.Sequential)] public struct ActionMovie { public Poppler.ActionType Type; public string Title; public static Poppler.ActionMovie Zero = new Poppler.ActionMovie (); public static Poppler.ActionMovie New(IntPtr raw) { if (raw == IntPtr.Zero) return Poppler.ActionMovie.Zero; return (Poppler.ActionMovie) Marshal.PtrToStructure (raw, typeof (Poppler.ActionMovie)); } private static GLib.GType GType { get { return GLib.GType.Pointer; } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/Annot.cs0000644000175000001440000000451111242311651024606 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class Annot : GLib.Object { [Obsolete] protected Annot(GLib.GType gtype) : base(gtype) {} public Annot(IntPtr raw) : base(raw) {} protected Annot() : base(IntPtr.Zero) { CreateNativeObject (new string [0], new GLib.Value [0]); } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_get_name(IntPtr raw); public string Name { get { IntPtr raw_ret = poppler_annot_get_name(Handle); string ret = GLib.Marshaller.PtrToStringGFree(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_get_color(IntPtr raw); public Poppler.Color Color { get { IntPtr raw_ret = poppler_annot_get_color(Handle); Poppler.Color ret = Poppler.Color.New (raw_ret); return ret; } } [DllImport("poppler-glib")] static extern int poppler_annot_get_annot_type(IntPtr raw); public Poppler.AnnotType AnnotType { get { int raw_ret = poppler_annot_get_annot_type(Handle); Poppler.AnnotType ret = (Poppler.AnnotType) raw_ret; return ret; } } [DllImport("poppler-glib")] static extern int poppler_annot_get_flags(IntPtr raw); public Poppler.AnnotFlag Flags { get { int raw_ret = poppler_annot_get_flags(Handle); Poppler.AnnotFlag ret = (Poppler.AnnotFlag) raw_ret; return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_get_contents(IntPtr raw); public string Contents { get { IntPtr raw_ret = poppler_annot_get_contents(Handle); string ret = GLib.Marshaller.PtrToStringGFree(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_get_type(); public static new GLib.GType GType { get { IntPtr raw_ret = poppler_annot_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_get_modified(IntPtr raw); public string Modified { get { IntPtr raw_ret = poppler_annot_get_modified(Handle); string ret = GLib.Marshaller.PtrToStringGFree(raw_ret); return ret; } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/FormChoiceType.cs0000644000175000001440000000110311242311651026401 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.FormChoiceTypeGType))] public enum FormChoiceType { Combo, List, } internal class FormChoiceTypeGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_form_choice_type_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_form_choice_type_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/Color.cs0000644000175000001440000000426611242311651024614 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code [StructLayout(LayoutKind.Sequential)] public struct Color { public ushort Red; public ushort Green; public ushort Blue; public static Poppler.Color Zero = new Poppler.Color (); public static Poppler.Color New(IntPtr raw) { if (raw == IntPtr.Zero) return Poppler.Color.Zero; return (Poppler.Color) Marshal.PtrToStructure (raw, typeof (Poppler.Color)); } [DllImport("poppler-glib")] static extern IntPtr poppler_color_new(); public static Color New() { Color result = Color.New (poppler_color_new()); return result; } [DllImport("poppler-glib")] static extern IntPtr poppler_color_copy(IntPtr raw); public Poppler.Color Copy() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); IntPtr raw_ret = poppler_color_copy(this_as_native); Poppler.Color ret = Poppler.Color.New (raw_ret); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); return ret; } [DllImport("poppler-glib")] static extern void poppler_color_free(IntPtr raw); public void Free() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); poppler_color_free(this_as_native); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); } [DllImport("poppler-glib")] static extern IntPtr poppler_color_get_type(); public static GLib.GType GType { get { IntPtr raw_ret = poppler_color_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } static void ReadNative (IntPtr native, ref Poppler.Color target) { target = New (native); } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/Rectangle.cs0000644000175000001440000000443411242311651025437 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code [StructLayout(LayoutKind.Sequential)] public struct Rectangle { public double X1; public double Y1; public double X2; public double Y2; public static Poppler.Rectangle Zero = new Poppler.Rectangle (); public static Poppler.Rectangle New(IntPtr raw) { if (raw == IntPtr.Zero) return Poppler.Rectangle.Zero; return (Poppler.Rectangle) Marshal.PtrToStructure (raw, typeof (Poppler.Rectangle)); } [DllImport("poppler-glib")] static extern IntPtr poppler_rectangle_new(); public static Rectangle New() { Rectangle result = Rectangle.New (poppler_rectangle_new()); return result; } [DllImport("poppler-glib")] static extern IntPtr poppler_rectangle_copy(IntPtr raw); public Poppler.Rectangle Copy() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); IntPtr raw_ret = poppler_rectangle_copy(this_as_native); Poppler.Rectangle ret = Poppler.Rectangle.New (raw_ret); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); return ret; } [DllImport("poppler-glib")] static extern void poppler_rectangle_free(IntPtr raw); public void Free() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); poppler_rectangle_free(this_as_native); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); } [DllImport("poppler-glib")] static extern IntPtr poppler_rectangle_get_type(); public static GLib.GType GType { get { IntPtr raw_ret = poppler_rectangle_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } static void ReadNative (IntPtr native, ref Poppler.Rectangle target) { target = New (native); } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/AnnotFlag.cs0000644000175000001440000000137511242311651025405 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [Flags] [GLib.GType (typeof (Poppler.AnnotFlagGType))] public enum AnnotFlag { Unknown, Invisible = 1 << 0, Hidden = 1 << 1, Print = 1 << 2, NoZoom = 1 << 3, NoRotate = 1 << 4, NoView = 1 << 5, ReadOnly = 1 << 6, Locked = 1 << 7, ToggleNoView = 1 << 8, LockedContents = 1 << 9, } internal class AnnotFlagGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_annot_flag_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_annot_flag_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/AnnotMapping.cs0000644000175000001440000000324411242311651026124 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class AnnotMapping : GLib.Opaque { [DllImport("poppler-glib")] static extern IntPtr poppler_annot_mapping_copy(IntPtr raw); public Poppler.AnnotMapping Copy() { IntPtr raw_ret = poppler_annot_mapping_copy(Handle); Poppler.AnnotMapping ret = raw_ret == IntPtr.Zero ? null : (Poppler.AnnotMapping) GLib.Opaque.GetOpaque (raw_ret, typeof (Poppler.AnnotMapping), true); return ret; } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_mapping_get_type(); public static GLib.GType GType { get { IntPtr raw_ret = poppler_annot_mapping_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } public AnnotMapping(IntPtr raw) : base(raw) {} [DllImport("poppler-glib")] static extern IntPtr poppler_annot_mapping_new(); public AnnotMapping () { Raw = poppler_annot_mapping_new(); } [DllImport("poppler-glib")] static extern void poppler_annot_mapping_free(IntPtr raw); protected override void Free (IntPtr raw) { poppler_annot_mapping_free (raw); } class FinalizerInfo { IntPtr handle; public FinalizerInfo (IntPtr handle) { this.handle = handle; } public bool Handler () { poppler_annot_mapping_free (handle); return false; } } ~AnnotMapping () { if (!Owned) return; FinalizerInfo info = new FinalizerInfo (Handle); GLib.Timeout.Add (50, new GLib.TimeoutHandler (info.Handler)); } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/IndexIter.cs0000644000175000001440000000544011242311651025424 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class IndexIter : GLib.Opaque { [DllImport("poppler-glib")] static extern IntPtr poppler_index_iter_copy(IntPtr raw); public Poppler.IndexIter Copy() { IntPtr raw_ret = poppler_index_iter_copy(Handle); Poppler.IndexIter ret = raw_ret == IntPtr.Zero ? null : (Poppler.IndexIter) GLib.Opaque.GetOpaque (raw_ret, typeof (Poppler.IndexIter), true); return ret; } [DllImport("poppler-glib")] static extern IntPtr poppler_index_iter_get_action(IntPtr raw); public Poppler.Action Action { get { IntPtr raw_ret = poppler_index_iter_get_action(Handle); Poppler.Action ret = GLib.Object.GetObject(raw_ret) as Poppler.Action; return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_index_iter_get_child(IntPtr raw); public Poppler.IndexIter Child { get { IntPtr raw_ret = poppler_index_iter_get_child(Handle); Poppler.IndexIter ret = raw_ret == IntPtr.Zero ? null : (Poppler.IndexIter) GLib.Opaque.GetOpaque (raw_ret, typeof (Poppler.IndexIter), false); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_index_iter_get_type(); public static GLib.GType GType { get { IntPtr raw_ret = poppler_index_iter_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern bool poppler_index_iter_next(IntPtr raw); public bool Next() { bool raw_ret = poppler_index_iter_next(Handle); bool ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern bool poppler_index_iter_is_open(IntPtr raw); public bool IsOpen { get { bool raw_ret = poppler_index_iter_is_open(Handle); bool ret = raw_ret; return ret; } } public IndexIter(IntPtr raw) : base(raw) {} [DllImport("poppler-glib")] static extern IntPtr poppler_index_iter_new(IntPtr document); public IndexIter (Poppler.Document document) { Raw = poppler_index_iter_new(document == null ? IntPtr.Zero : document.Handle); } [DllImport("poppler-glib")] static extern void poppler_index_iter_free(IntPtr raw); protected override void Free (IntPtr raw) { poppler_index_iter_free (raw); } class FinalizerInfo { IntPtr handle; public FinalizerInfo (IntPtr handle) { this.handle = handle; } public bool Handler () { poppler_index_iter_free (handle); return false; } } ~IndexIter () { if (!Owned) return; FinalizerInfo info = new FinalizerInfo (Handle); GLib.Timeout.Add (50, new GLib.TimeoutHandler (info.Handler)); } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/PageLayout.cs0000644000175000001440000000120211242311651025573 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.PageLayoutGType))] public enum PageLayout { Unset, SinglePage, OneColumn, TwoColumnLeft, TwoColumnRight, TwoPageLeft, TwoPageRight, } internal class PageLayoutGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_page_layout_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_page_layout_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/FormButtonType.cs0000644000175000001440000000111411242311651026464 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.FormButtonTypeGType))] public enum FormButtonType { Push, Check, Radio, } internal class FormButtonTypeGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_form_button_type_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_form_button_type_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/FontType.cs0000644000175000001440000000124111242311651025274 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.FontTypeGType))] public enum FontType { Unknown, Type1, Type1c, Type1cot, Type3, Truetype, Truetypeot, CidType0, CidType0c, CidType0cot, CidType2, CidType2ot, } internal class FontTypeGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_font_type_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_font_type_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/Page.cs0000644000175000001440000002544711242311651024416 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class Page : GLib.Object { [Obsolete] protected Page(GLib.GType gtype) : base(gtype) {} public Page(IntPtr raw) : base(raw) {} protected Page() : base(IntPtr.Zero) { CreateNativeObject (new string [0], new GLib.Value [0]); } [DllImport("poppler-glib")] static extern IntPtr poppler_page_get_type(); public static new GLib.GType GType { get { IntPtr raw_ret = poppler_page_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern void poppler_page_render_to_pixbuf(IntPtr raw, int src_x, int src_y, int src_width, int src_height, double scale, int rotation, IntPtr pixbuf); public void RenderToPixbuf(int src_x, int src_y, int src_width, int src_height, double scale, int rotation, Gdk.Pixbuf pixbuf) { poppler_page_render_to_pixbuf(Handle, src_x, src_y, src_width, src_height, scale, rotation, pixbuf == null ? IntPtr.Zero : pixbuf.Handle); } [DllImport("poppler-glib")] static extern IntPtr poppler_page_get_text(IntPtr raw, int style, IntPtr rect); public string GetText(Poppler.SelectionStyle style, Poppler.Rectangle rect) { IntPtr native_rect = GLib.Marshaller.StructureToPtrAlloc (rect); IntPtr raw_ret = poppler_page_get_text(Handle, (int) style, native_rect); string ret = GLib.Marshaller.PtrToStringGFree(raw_ret); rect = Poppler.Rectangle.New (native_rect); Marshal.FreeHGlobal (native_rect); return ret; } [DllImport("poppler-glib")] static extern void poppler_page_free_link_mapping(IntPtr list); public static void FreeLinkMapping(GLib.List list) { poppler_page_free_link_mapping(list == null ? IntPtr.Zero : list.Handle); } [DllImport("poppler-glib")] static extern void poppler_page_get_crop_box(IntPtr raw, IntPtr rect); public void GetCropBox(Poppler.Rectangle rect) { IntPtr native_rect = GLib.Marshaller.StructureToPtrAlloc (rect); poppler_page_get_crop_box(Handle, native_rect); rect = Poppler.Rectangle.New (native_rect); Marshal.FreeHGlobal (native_rect); } [DllImport("poppler-glib")] static extern IntPtr poppler_page_find_text(IntPtr raw, IntPtr text); public GLib.List FindText(string text) { IntPtr native_text = GLib.Marshaller.StringToPtrGStrdup (text); IntPtr raw_ret = poppler_page_find_text(Handle, native_text); GLib.List ret = new GLib.List(raw_ret); GLib.Marshaller.Free (native_text); return ret; } [DllImport("poppler-glib")] static extern double poppler_page_get_duration(IntPtr raw); public double Duration { get { double raw_ret = poppler_page_get_duration(Handle); double ret = raw_ret; return ret; } } [DllImport("poppler-glib")] static extern void poppler_page_render_for_printing(IntPtr raw, IntPtr cairo); public void RenderForPrinting(Cairo.Context cairo) { poppler_page_render_for_printing(Handle, cairo == null ? IntPtr.Zero : cairo.Handle); } [DllImport("poppler-glib")] static extern void poppler_page_selection_region_free(IntPtr region); public static void SelectionRegionFree(GLib.List region) { poppler_page_selection_region_free(region == null ? IntPtr.Zero : region.Handle); } [DllImport("poppler-glib")] static extern void poppler_page_render_to_pixbuf_for_printing(IntPtr raw, int src_x, int src_y, int src_width, int src_height, double scale, int rotation, IntPtr pixbuf); public void RenderToPixbufForPrinting(int src_x, int src_y, int src_width, int src_height, double scale, int rotation, Gdk.Pixbuf pixbuf) { poppler_page_render_to_pixbuf_for_printing(Handle, src_x, src_y, src_width, src_height, scale, rotation, pixbuf == null ? IntPtr.Zero : pixbuf.Handle); } [DllImport("poppler-glib")] static extern IntPtr poppler_page_get_thumbnail_pixbuf(IntPtr raw); public Gdk.Pixbuf ThumbnailPixbuf { get { IntPtr raw_ret = poppler_page_get_thumbnail_pixbuf(Handle); Gdk.Pixbuf ret = new Gdk.Pixbuf(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_page_get_form_field_mapping(IntPtr raw); public GLib.List FormFieldMapping { get { IntPtr raw_ret = poppler_page_get_form_field_mapping(Handle); GLib.List ret = new GLib.List(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern int poppler_page_get_index(IntPtr raw); public int Index { get { int raw_ret = poppler_page_get_index(Handle); int ret = raw_ret; return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_page_get_transition(IntPtr raw); public Poppler.PageTransition Transition { get { IntPtr raw_ret = poppler_page_get_transition(Handle); Poppler.PageTransition ret = Poppler.PageTransition.New (raw_ret); return ret; } } [DllImport("poppler-glib")] static extern void poppler_page_render_selection_to_pixbuf(IntPtr raw, double scale, int rotation, IntPtr pixbuf, IntPtr selection, IntPtr old_selection, int style, IntPtr glyph_color, IntPtr background_color); public void RenderSelectionToPixbuf(double scale, int rotation, Gdk.Pixbuf pixbuf, Poppler.Rectangle selection, Poppler.Rectangle old_selection, Poppler.SelectionStyle style, Gdk.Color glyph_color, Gdk.Color background_color) { IntPtr native_selection = GLib.Marshaller.StructureToPtrAlloc (selection); IntPtr native_old_selection = GLib.Marshaller.StructureToPtrAlloc (old_selection); IntPtr native_glyph_color = GLib.Marshaller.StructureToPtrAlloc (glyph_color); IntPtr native_background_color = GLib.Marshaller.StructureToPtrAlloc (background_color); poppler_page_render_selection_to_pixbuf(Handle, scale, rotation, pixbuf == null ? IntPtr.Zero : pixbuf.Handle, native_selection, native_old_selection, (int) style, native_glyph_color, native_background_color); selection = Poppler.Rectangle.New (native_selection); Marshal.FreeHGlobal (native_selection); old_selection = Poppler.Rectangle.New (native_old_selection); Marshal.FreeHGlobal (native_old_selection); glyph_color = Gdk.Color.New (native_glyph_color); Marshal.FreeHGlobal (native_glyph_color); background_color = Gdk.Color.New (native_background_color); Marshal.FreeHGlobal (native_background_color); } [DllImport("poppler-glib")] static extern void poppler_page_get_size(IntPtr raw, out double width, out double height); public void GetSize(out double width, out double height) { poppler_page_get_size(Handle, out width, out height); } [DllImport("poppler-glib")] static extern void poppler_page_render_to_ps(IntPtr raw, IntPtr ps_file); public void RenderToPs(Poppler.PSFile ps_file) { poppler_page_render_to_ps(Handle, ps_file == null ? IntPtr.Zero : ps_file.Handle); } [DllImport("poppler-glib")] static extern IntPtr poppler_page_get_link_mapping(IntPtr raw); public GLib.List LinkMapping { get { IntPtr raw_ret = poppler_page_get_link_mapping(Handle); GLib.List ret = new GLib.List(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_page_get_annot_mapping(IntPtr raw); public GLib.List AnnotMapping { get { IntPtr raw_ret = poppler_page_get_annot_mapping(Handle); GLib.List ret = new GLib.List(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_page_get_image_mapping(IntPtr raw); public GLib.List ImageMapping { get { IntPtr raw_ret = poppler_page_get_image_mapping(Handle); GLib.List ret = new GLib.List(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern void poppler_page_free_form_field_mapping(IntPtr list); public static void FreeFormFieldMapping(GLib.List list) { poppler_page_free_form_field_mapping(list == null ? IntPtr.Zero : list.Handle); } [DllImport("poppler-glib")] static extern void poppler_page_render_selection(IntPtr raw, IntPtr cairo, IntPtr selection, IntPtr old_selection, int style, IntPtr glyph_color, IntPtr background_color); public void RenderSelection(Cairo.Context cairo, Poppler.Rectangle selection, Poppler.Rectangle old_selection, Poppler.SelectionStyle style, Poppler.Color glyph_color, Poppler.Color background_color) { IntPtr native_selection = GLib.Marshaller.StructureToPtrAlloc (selection); IntPtr native_old_selection = GLib.Marshaller.StructureToPtrAlloc (old_selection); IntPtr native_glyph_color = GLib.Marshaller.StructureToPtrAlloc (glyph_color); IntPtr native_background_color = GLib.Marshaller.StructureToPtrAlloc (background_color); poppler_page_render_selection(Handle, cairo == null ? IntPtr.Zero : cairo.Handle, native_selection, native_old_selection, (int) style, native_glyph_color, native_background_color); selection = Poppler.Rectangle.New (native_selection); Marshal.FreeHGlobal (native_selection); old_selection = Poppler.Rectangle.New (native_old_selection); Marshal.FreeHGlobal (native_old_selection); glyph_color = Poppler.Color.New (native_glyph_color); Marshal.FreeHGlobal (native_glyph_color); background_color = Poppler.Color.New (native_background_color); Marshal.FreeHGlobal (native_background_color); } [DllImport("poppler-glib")] static extern void poppler_page_free_annot_mapping(IntPtr list); public static void FreeAnnotMapping(GLib.List list) { poppler_page_free_annot_mapping(list == null ? IntPtr.Zero : list.Handle); } [DllImport("poppler-glib")] static extern void poppler_page_free_image_mapping(IntPtr list); public static void FreeImageMapping(GLib.List list) { poppler_page_free_image_mapping(list == null ? IntPtr.Zero : list.Handle); } [DllImport("poppler-glib")] static extern IntPtr poppler_page_get_selection_region(IntPtr raw, double scale, int style, IntPtr selection); public GLib.List GetSelectionRegion(double scale, Poppler.SelectionStyle style, Poppler.Rectangle selection) { IntPtr native_selection = GLib.Marshaller.StructureToPtrAlloc (selection); IntPtr raw_ret = poppler_page_get_selection_region(Handle, scale, (int) style, native_selection); GLib.List ret = new GLib.List(raw_ret); selection = Poppler.Rectangle.New (native_selection); Marshal.FreeHGlobal (native_selection); return ret; } [DllImport("poppler-glib")] static extern bool poppler_page_get_thumbnail_size(IntPtr raw, out int width, out int height); public bool GetThumbnailSize(out int width, out int height) { bool raw_ret = poppler_page_get_thumbnail_size(Handle, out width, out height); bool ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern void poppler_page_render(IntPtr raw, IntPtr cairo); public void Render(Cairo.Context cairo) { poppler_page_render(Handle, cairo == null ? IntPtr.Zero : cairo.Handle); } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/PageTransitionDirection.cs0000644000175000001440000000116411242311651030320 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.PageTransitionDirectionGType))] public enum PageTransitionDirection { Inward, Outward, } internal class PageTransitionDirectionGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_page_transition_direction_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_page_transition_direction_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/AnnotMarkupReplyType.cs0000644000175000001440000000114011242311651027637 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.AnnotMarkupReplyTypeGType))] public enum AnnotMarkupReplyType { R, Group, } internal class AnnotMarkupReplyTypeGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_annot_markup_reply_type_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_annot_markup_reply_type_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/PSFile.cs0000644000175000001440000000350111242311651024647 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class PSFile : GLib.Object { [Obsolete] protected PSFile(GLib.GType gtype) : base(gtype) {} public PSFile(IntPtr raw) : base(raw) {} [DllImport("poppler-glib")] static extern IntPtr poppler_ps_file_new(IntPtr document, IntPtr filename, int first_page, int n_pages); public PSFile (Poppler.Document document, string filename, int first_page, int n_pages) : base (IntPtr.Zero) { if (GetType () != typeof (PSFile)) { throw new InvalidOperationException ("Can't override this constructor."); } IntPtr native_filename = GLib.Marshaller.StringToPtrGStrdup (filename); Raw = poppler_ps_file_new(document == null ? IntPtr.Zero : document.Handle, native_filename, first_page, n_pages); GLib.Marshaller.Free (native_filename); } [DllImport("poppler-glib")] static extern void poppler_ps_file_set_paper_size(IntPtr raw, double width, double height); public void SetPaperSize(double width, double height) { poppler_ps_file_set_paper_size(Handle, width, height); } [DllImport("poppler-glib")] static extern IntPtr poppler_ps_file_get_type(); public static new GLib.GType GType { get { IntPtr raw_ret = poppler_ps_file_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern void poppler_ps_file_free(IntPtr raw); public void Free() { poppler_ps_file_free(Handle); } [DllImport("poppler-glib")] static extern void poppler_ps_file_set_duplex(IntPtr raw, bool duplex); public bool Duplex { set { poppler_ps_file_set_duplex(Handle, value); } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/AnnotTextState.cs0000644000175000001440000000121511242311651026452 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.AnnotTextStateGType))] public enum AnnotTextState { Marked, Unmarked, Accepted, Rejected, Cancelled, Completed, None, Unknown, } internal class AnnotTextStateGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_annot_text_state_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_annot_text_state_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/AnnotText.cs0000644000175000001440000000305611242311651025456 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class AnnotText : GLib.Object { [Obsolete] protected AnnotText(GLib.GType gtype) : base(gtype) {} public AnnotText(IntPtr raw) : base(raw) {} protected AnnotText() : base(IntPtr.Zero) { CreateNativeObject (new string [0], new GLib.Value [0]); } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_text_get_icon(IntPtr raw); public string Icon { get { IntPtr raw_ret = poppler_annot_text_get_icon(Handle); string ret = GLib.Marshaller.PtrToStringGFree(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_text_get_type(); public static new GLib.GType GType { get { IntPtr raw_ret = poppler_annot_text_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern int poppler_annot_text_get_state(IntPtr raw); public Poppler.AnnotTextState State { get { int raw_ret = poppler_annot_text_get_state(Handle); Poppler.AnnotTextState ret = (Poppler.AnnotTextState) raw_ret; return ret; } } [DllImport("poppler-glib")] static extern bool poppler_annot_text_get_is_open(IntPtr raw); public bool IsOpen { get { bool raw_ret = poppler_annot_text_get_is_open(Handle); bool ret = raw_ret; return ret; } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/PageMode.cs0000644000175000001440000000115011242311651025204 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.PageModeGType))] public enum PageMode { Unset, None, UseOutlines, UseThumbs, FullScreen, UseOc, UseAttachments, } internal class PageModeGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_page_mode_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_page_mode_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/AttachmentSaveFunc.cs0000644000175000001440000000032411242311651027250 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; public delegate bool AttachmentSaveFunc(string buf, ulong count); } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/ActionGotoDest.cs0000644000175000001440000000154211242311651026416 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code [StructLayout(LayoutKind.Sequential)] public struct ActionGotoDest { public Poppler.ActionType Type; public string Title; private IntPtr _dest; public Poppler.Dest dest { get { return Poppler.Dest.New (_dest); } } public static Poppler.ActionGotoDest Zero = new Poppler.ActionGotoDest (); public static Poppler.ActionGotoDest New(IntPtr raw) { if (raw == IntPtr.Zero) return Poppler.ActionGotoDest.Zero; return (Poppler.ActionGotoDest) Marshal.PtrToStructure (raw, typeof (Poppler.ActionGotoDest)); } private static GLib.GType GType { get { return GLib.GType.Pointer; } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/Layer.cs0000644000175000001440000000375011242311651024607 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class Layer : GLib.Object { [Obsolete] protected Layer(GLib.GType gtype) : base(gtype) {} public Layer(IntPtr raw) : base(raw) {} protected Layer() : base(IntPtr.Zero) { CreateNativeObject (new string [0], new GLib.Value [0]); } [DllImport("poppler-glib")] static extern void poppler_layer_show(IntPtr raw); public void Show() { poppler_layer_show(Handle); } [DllImport("poppler-glib")] static extern IntPtr poppler_layer_get_type(); public static new GLib.GType GType { get { IntPtr raw_ret = poppler_layer_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern bool poppler_layer_is_visible(IntPtr raw); public bool IsVisible { get { bool raw_ret = poppler_layer_is_visible(Handle); bool ret = raw_ret; return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_layer_get_title(IntPtr raw); public string Title { get { IntPtr raw_ret = poppler_layer_get_title(Handle); string ret = GLib.Marshaller.Utf8PtrToString (raw_ret); return ret; } } [DllImport("poppler-glib")] static extern bool poppler_layer_is_parent(IntPtr raw); public bool IsParent { get { bool raw_ret = poppler_layer_is_parent(Handle); bool ret = raw_ret; return ret; } } [DllImport("poppler-glib")] static extern void poppler_layer_hide(IntPtr raw); public void Hide() { poppler_layer_hide(Handle); } [DllImport("poppler-glib")] static extern int poppler_layer_get_radio_button_group_id(IntPtr raw); public int RadioButtonGroupId { get { int raw_ret = poppler_layer_get_radio_button_group_id(Handle); int ret = raw_ret; return ret; } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/LayersIter.cs0000644000175000001440000000554411242311651025621 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class LayersIter : GLib.Opaque { [DllImport("poppler-glib")] static extern IntPtr poppler_layers_iter_copy(IntPtr raw); public Poppler.LayersIter Copy() { IntPtr raw_ret = poppler_layers_iter_copy(Handle); Poppler.LayersIter ret = raw_ret == IntPtr.Zero ? null : (Poppler.LayersIter) GLib.Opaque.GetOpaque (raw_ret, typeof (Poppler.LayersIter), true); return ret; } [DllImport("poppler-glib")] static extern IntPtr poppler_layers_iter_get_title(IntPtr raw); public string Title { get { IntPtr raw_ret = poppler_layers_iter_get_title(Handle); string ret = GLib.Marshaller.PtrToStringGFree(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_layers_iter_get_child(IntPtr raw); public Poppler.LayersIter Child { get { IntPtr raw_ret = poppler_layers_iter_get_child(Handle); Poppler.LayersIter ret = raw_ret == IntPtr.Zero ? null : (Poppler.LayersIter) GLib.Opaque.GetOpaque (raw_ret, typeof (Poppler.LayersIter), false); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_layers_iter_get_type(); public static GLib.GType GType { get { IntPtr raw_ret = poppler_layers_iter_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern bool poppler_layers_iter_next(IntPtr raw); public bool Next() { bool raw_ret = poppler_layers_iter_next(Handle); bool ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern IntPtr poppler_layers_iter_get_layer(IntPtr raw); public Poppler.Layer Layer { get { IntPtr raw_ret = poppler_layers_iter_get_layer(Handle); Poppler.Layer ret = GLib.Object.GetObject(raw_ret) as Poppler.Layer; return ret; } } public LayersIter(IntPtr raw) : base(raw) {} [DllImport("poppler-glib")] static extern IntPtr poppler_layers_iter_new(IntPtr document); public LayersIter (Poppler.Document document) { Raw = poppler_layers_iter_new(document == null ? IntPtr.Zero : document.Handle); } [DllImport("poppler-glib")] static extern void poppler_layers_iter_free(IntPtr raw); protected override void Free (IntPtr raw) { poppler_layers_iter_free (raw); } class FinalizerInfo { IntPtr handle; public FinalizerInfo (IntPtr handle) { this.handle = handle; } public bool Handler () { poppler_layers_iter_free (handle); return false; } } ~LayersIter () { if (!Owned) return; FinalizerInfo info = new FinalizerInfo (Handle); GLib.Timeout.Add (50, new GLib.TimeoutHandler (info.Handler)); } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/ActionGotoRemote.cs0000644000175000001440000000161211242311651026750 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code [StructLayout(LayoutKind.Sequential)] public struct ActionGotoRemote { public Poppler.ActionType Type; public string Title; public string FileName; private IntPtr _dest; public Poppler.Dest dest { get { return Poppler.Dest.New (_dest); } } public static Poppler.ActionGotoRemote Zero = new Poppler.ActionGotoRemote (); public static Poppler.ActionGotoRemote New(IntPtr raw) { if (raw == IntPtr.Zero) return Poppler.ActionGotoRemote.Zero; return (Poppler.ActionGotoRemote) Marshal.PtrToStructure (raw, typeof (Poppler.ActionGotoRemote)); } private static GLib.GType GType { get { return GLib.GType.Pointer; } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/DestType.cs0000644000175000001440000000114611242311651025271 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.DestTypeGType))] public enum DestType { Unknown, Xyz, Fit, Fith, Fitv, Fitr, Fitb, Fitbh, Fitbv, Named, } internal class DestTypeGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_dest_type_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_dest_type_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/LinkMapping.cs0000644000175000001440000000476311242311651025751 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code [StructLayout(LayoutKind.Sequential)] public struct LinkMapping { public Poppler.Rectangle Area; private IntPtr _action; public Poppler.Action Action { get { return GLib.Object.GetObject(_action) as Poppler.Action; } set { _action = value == null ? IntPtr.Zero : value.Handle; } } public static Poppler.LinkMapping Zero = new Poppler.LinkMapping (); public static Poppler.LinkMapping New(IntPtr raw) { if (raw == IntPtr.Zero) return Poppler.LinkMapping.Zero; return (Poppler.LinkMapping) Marshal.PtrToStructure (raw, typeof (Poppler.LinkMapping)); } [DllImport("poppler-glib")] static extern IntPtr poppler_link_mapping_new(); public static LinkMapping New() { LinkMapping result = LinkMapping.New (poppler_link_mapping_new()); return result; } [DllImport("poppler-glib")] static extern IntPtr poppler_link_mapping_copy(IntPtr raw); public Poppler.LinkMapping Copy() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); IntPtr raw_ret = poppler_link_mapping_copy(this_as_native); Poppler.LinkMapping ret = Poppler.LinkMapping.New (raw_ret); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); return ret; } [DllImport("poppler-glib")] static extern void poppler_link_mapping_free(IntPtr raw); public void Free() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); poppler_link_mapping_free(this_as_native); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); } [DllImport("poppler-glib")] static extern IntPtr poppler_link_mapping_get_type(); public static GLib.GType GType { get { IntPtr raw_ret = poppler_link_mapping_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } static void ReadNative (IntPtr native, ref Poppler.LinkMapping target) { target = New (native); } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/Orientation.cs0000644000175000001440000000112211242311651026015 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.OrientationGType))] public enum Orientation { Portrait, Landscape, Upsidedown, Seascape, } internal class OrientationGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_orientation_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_orientation_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/FormFieldMapping.cs0000644000175000001440000000515311242311651026715 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code [StructLayout(LayoutKind.Sequential)] public struct FormFieldMapping { public Poppler.Rectangle Area; private IntPtr _field; public Poppler.FormField Field { get { return GLib.Object.GetObject(_field) as Poppler.FormField; } set { _field = value == null ? IntPtr.Zero : value.Handle; } } public static Poppler.FormFieldMapping Zero = new Poppler.FormFieldMapping (); public static Poppler.FormFieldMapping New(IntPtr raw) { if (raw == IntPtr.Zero) return Poppler.FormFieldMapping.Zero; return (Poppler.FormFieldMapping) Marshal.PtrToStructure (raw, typeof (Poppler.FormFieldMapping)); } [DllImport("poppler-glib")] static extern IntPtr poppler_form_field_mapping_new(); public static FormFieldMapping New() { FormFieldMapping result = FormFieldMapping.New (poppler_form_field_mapping_new()); return result; } [DllImport("poppler-glib")] static extern IntPtr poppler_form_field_mapping_copy(IntPtr raw); public Poppler.FormFieldMapping Copy() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); IntPtr raw_ret = poppler_form_field_mapping_copy(this_as_native); Poppler.FormFieldMapping ret = Poppler.FormFieldMapping.New (raw_ret); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); return ret; } [DllImport("poppler-glib")] static extern void poppler_form_field_mapping_free(IntPtr raw); public void Free() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); poppler_form_field_mapping_free(this_as_native); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); } [DllImport("poppler-glib")] static extern IntPtr poppler_form_field_mapping_get_type(); public static GLib.GType GType { get { IntPtr raw_ret = poppler_form_field_mapping_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } static void ReadNative (IntPtr native, ref Poppler.FormFieldMapping target) { target = New (native); } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/Error.cs0000644000175000001440000000107611242311651024623 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.ErrorGType))] public enum Error { Invalid, Encrypted, OpenFile, BadCatalog, Damaged, } internal class ErrorGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_error_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_error_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/Global.cs0000644000175000001440000000164711242311651024736 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code public class Global { [DllImport("poppler-glib")] static extern IntPtr poppler_get_version(); public static string Version { get { IntPtr raw_ret = poppler_get_version(); string ret = GLib.Marshaller.Utf8PtrToString (raw_ret); return ret; } } [DllImport("poppler-glib")] static extern int poppler_error_quark(); public static int ErrorQuark() { int raw_ret = poppler_error_quark(); int ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern int poppler_get_backend(); public static Poppler.Backend Backend { get { int raw_ret = poppler_get_backend(); Poppler.Backend ret = (Poppler.Backend) raw_ret; return ret; } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/Backend.cs0000644000175000001440000000105111242311651025052 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.BackendGType))] public enum Backend { Unknown, Splash, Cairo, } internal class BackendGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_backend_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_backend_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/PageTransitionType.cs0000644000175000001440000000126511242311651027323 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.PageTransitionTypeGType))] public enum PageTransitionType { Replace, Split, Blinds, Box, Wipe, Dissolve, Glitter, Fly, Push, Cover, Uncover, Fade, } internal class PageTransitionTypeGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_page_transition_type_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_page_transition_type_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/Action.cs0000644000175000001440000000222611242311651024745 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class Action : GLib.Object { [Obsolete] protected Action(GLib.GType gtype) : base(gtype) {} public Action(IntPtr raw) : base(raw) {} protected Action() : base(IntPtr.Zero) { CreateNativeObject (new string [0], new GLib.Value [0]); } [DllImport("poppler-glib")] static extern IntPtr poppler_action_copy(IntPtr raw); public Poppler.Action Copy() { IntPtr raw_ret = poppler_action_copy(Handle); Poppler.Action ret = GLib.Object.GetObject(raw_ret, true) as Poppler.Action; return ret; } [DllImport("poppler-glib")] static extern void poppler_action_free(IntPtr raw); public void Free() { poppler_action_free(Handle); } [DllImport("poppler-glib")] static extern IntPtr poppler_action_get_type(); public static new GLib.GType GType { get { IntPtr raw_ret = poppler_action_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/AnnotFreeTextQuadding.cs0000644000175000001440000000120611242311651027730 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.AnnotFreeTextQuaddingGType))] public enum AnnotFreeTextQuadding { LeftJustified, Centered, RightJustified, } internal class AnnotFreeTextQuaddingGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_annot_free_text_quadding_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_annot_free_text_quadding_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/ActionUri.cs0000644000175000001440000000135611242311651025430 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code [StructLayout(LayoutKind.Sequential)] public struct ActionUri { public Poppler.ActionType Type; public string Title; public string Uri; public static Poppler.ActionUri Zero = new Poppler.ActionUri (); public static Poppler.ActionUri New(IntPtr raw) { if (raw == IntPtr.Zero) return Poppler.ActionUri.Zero; return (Poppler.ActionUri) Marshal.PtrToStructure (raw, typeof (Poppler.ActionUri)); } private static GLib.GType GType { get { return GLib.GType.Pointer; } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/AnnotType.cs0000644000175000001440000000145711242311651025456 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.AnnotTypeGType))] public enum AnnotType { Unknown, Text, Link, FreeText, Line, Square, Circle, Polygon, PolyLine, Highlight, Underline, Squiggly, StrikeOut, Stamp, Caret, Ink, Popup, FileAttachment, Sound, Movie, Widget, Screen, PrinterMark, TrapNet, Watermark, ThreeD, } internal class AnnotTypeGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_annot_type_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_annot_type_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/FontsIter.cs0000644000175000001440000000636311242311651025453 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class FontsIter : GLib.Opaque { [DllImport("poppler-glib")] static extern IntPtr poppler_fonts_iter_get_name(IntPtr raw); public string Name { get { IntPtr raw_ret = poppler_fonts_iter_get_name(Handle); string ret = GLib.Marshaller.Utf8PtrToString (raw_ret); return ret; } } [DllImport("poppler-glib")] static extern bool poppler_fonts_iter_is_embedded(IntPtr raw); public bool IsEmbedded { get { bool raw_ret = poppler_fonts_iter_is_embedded(Handle); bool ret = raw_ret; return ret; } } [DllImport("poppler-glib")] static extern int poppler_fonts_iter_get_font_type(IntPtr raw); public Poppler.FontType FontType { get { int raw_ret = poppler_fonts_iter_get_font_type(Handle); Poppler.FontType ret = (Poppler.FontType) raw_ret; return ret; } } [DllImport("poppler-glib")] static extern bool poppler_fonts_iter_is_subset(IntPtr raw); public bool IsSubset { get { bool raw_ret = poppler_fonts_iter_is_subset(Handle); bool ret = raw_ret; return ret; } } [DllImport("poppler-glib")] static extern bool poppler_fonts_iter_next(IntPtr raw); public bool Next() { bool raw_ret = poppler_fonts_iter_next(Handle); bool ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern IntPtr poppler_fonts_iter_get_full_name(IntPtr raw); public string FullName { get { IntPtr raw_ret = poppler_fonts_iter_get_full_name(Handle); string ret = GLib.Marshaller.Utf8PtrToString (raw_ret); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_fonts_iter_get_file_name(IntPtr raw); public string FileName { get { IntPtr raw_ret = poppler_fonts_iter_get_file_name(Handle); string ret = GLib.Marshaller.Utf8PtrToString (raw_ret); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_fonts_iter_get_type(); public static GLib.GType GType { get { IntPtr raw_ret = poppler_fonts_iter_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_fonts_iter_copy(IntPtr raw); public Poppler.FontsIter Copy() { IntPtr raw_ret = poppler_fonts_iter_copy(Handle); Poppler.FontsIter ret = raw_ret == IntPtr.Zero ? null : (Poppler.FontsIter) GLib.Opaque.GetOpaque (raw_ret, typeof (Poppler.FontsIter), true); return ret; } public FontsIter(IntPtr raw) : base(raw) {} [DllImport("poppler-glib")] static extern void poppler_fonts_iter_free(IntPtr raw); protected override void Free (IntPtr raw) { poppler_fonts_iter_free (raw); } class FinalizerInfo { IntPtr handle; public FinalizerInfo (IntPtr handle) { this.handle = handle; } public bool Handler () { poppler_fonts_iter_free (handle); return false; } } ~FontsIter () { if (!Owned) return; FinalizerInfo info = new FinalizerInfo (Handle); GLib.Timeout.Add (50, new GLib.TimeoutHandler (info.Handler)); } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/FormFieldType.cs0000644000175000001440000000114111242311651026234 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.FormFieldTypeGType))] public enum FormFieldType { Unknown, Button, Text, Choice, Signature, } internal class FormFieldTypeGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_form_field_type_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_form_field_type_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/ImageMapping.cs0000644000175000001440000000451511242311651026071 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code [StructLayout(LayoutKind.Sequential)] public struct ImageMapping { public Poppler.Rectangle Area; public int ImageId; public static Poppler.ImageMapping Zero = new Poppler.ImageMapping (); public static Poppler.ImageMapping New(IntPtr raw) { if (raw == IntPtr.Zero) return Poppler.ImageMapping.Zero; return (Poppler.ImageMapping) Marshal.PtrToStructure (raw, typeof (Poppler.ImageMapping)); } [DllImport("poppler-glib")] static extern IntPtr poppler_image_mapping_new(); public static ImageMapping New() { ImageMapping result = ImageMapping.New (poppler_image_mapping_new()); return result; } [DllImport("poppler-glib")] static extern IntPtr poppler_image_mapping_copy(IntPtr raw); public Poppler.ImageMapping Copy() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); IntPtr raw_ret = poppler_image_mapping_copy(this_as_native); Poppler.ImageMapping ret = Poppler.ImageMapping.New (raw_ret); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); return ret; } [DllImport("poppler-glib")] static extern void poppler_image_mapping_free(IntPtr raw); public void Free() { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this)); System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false); poppler_image_mapping_free(this_as_native); ReadNative (this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native); } [DllImport("poppler-glib")] static extern IntPtr poppler_image_mapping_get_type(); public static GLib.GType GType { get { IntPtr raw_ret = poppler_image_mapping_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } static void ReadNative (IntPtr native, ref Poppler.ImageMapping target) { target = New (native); } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/Attachment.cs0000644000175000001440000000362511242311651025624 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class Attachment : GLib.Object { [Obsolete] protected Attachment(GLib.GType gtype) : base(gtype) {} public Attachment(IntPtr raw) : base(raw) {} protected Attachment() : base(IntPtr.Zero) { CreateNativeObject (new string [0], new GLib.Value [0]); } [DllImport("poppler-glib")] static extern unsafe bool poppler_attachment_save_to_callback(IntPtr raw, PopplerSharp.AttachmentSaveFuncNative save_func, IntPtr user_data, out IntPtr error); public unsafe bool SaveToCallback(Poppler.AttachmentSaveFunc save_func) { PopplerSharp.AttachmentSaveFuncWrapper save_func_wrapper = new PopplerSharp.AttachmentSaveFuncWrapper (save_func); IntPtr error = IntPtr.Zero; bool raw_ret = poppler_attachment_save_to_callback(Handle, save_func_wrapper.NativeDelegate, IntPtr.Zero, out error); bool ret = raw_ret; if (error != IntPtr.Zero) throw new GLib.GException (error); return ret; } [DllImport("poppler-glib")] static extern IntPtr poppler_attachment_get_type(); public static new GLib.GType GType { get { IntPtr raw_ret = poppler_attachment_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern unsafe bool poppler_attachment_save(IntPtr raw, IntPtr filename, out IntPtr error); public unsafe bool Save(string filename) { IntPtr native_filename = GLib.Marshaller.StringToPtrGStrdup (filename); IntPtr error = IntPtr.Zero; bool raw_ret = poppler_attachment_save(Handle, native_filename, out error); bool ret = raw_ret; GLib.Marshaller.Free (native_filename); if (error != IntPtr.Zero) throw new GLib.GException (error); return ret; } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/FormField.cs0000644000175000001440000001762311242311651025406 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class FormField : GLib.Object { [Obsolete] protected FormField(GLib.GType gtype) : base(gtype) {} public FormField(IntPtr raw) : base(raw) {} protected FormField() : base(IntPtr.Zero) { CreateNativeObject (new string [0], new GLib.Value [0]); } [DllImport("poppler-glib")] static extern IntPtr poppler_form_field_get_type(); public static new GLib.GType GType { get { IntPtr raw_ret = poppler_form_field_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern bool poppler_form_field_choice_do_spell_check(IntPtr raw); public bool ChoiceDoSpellCheck() { bool raw_ret = poppler_form_field_choice_do_spell_check(Handle); bool ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern double poppler_form_field_get_font_size(IntPtr raw); public double FontSize { get { double raw_ret = poppler_form_field_get_font_size(Handle); double ret = raw_ret; return ret; } } [DllImport("poppler-glib")] static extern int poppler_form_field_text_get_max_len(IntPtr raw); public int TextGetMaxLen() { int raw_ret = poppler_form_field_text_get_max_len(Handle); int ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern bool poppler_form_field_choice_commit_on_change(IntPtr raw); public bool ChoiceCommitOnChange() { bool raw_ret = poppler_form_field_choice_commit_on_change(Handle); bool ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern IntPtr poppler_form_field_choice_get_item(IntPtr raw, int index); public string ChoiceGetItem(int index) { IntPtr raw_ret = poppler_form_field_choice_get_item(Handle, index); string ret = GLib.Marshaller.PtrToStringGFree(raw_ret); return ret; } [DllImport("poppler-glib")] static extern int poppler_form_field_text_get_text_type(IntPtr raw); public Poppler.FormTextType TextGetTextType() { int raw_ret = poppler_form_field_text_get_text_type(Handle); Poppler.FormTextType ret = (Poppler.FormTextType) raw_ret; return ret; } [DllImport("poppler-glib")] static extern bool poppler_form_field_choice_is_item_selected(IntPtr raw, int index); public bool ChoiceIsItemSelected(int index) { bool raw_ret = poppler_form_field_choice_is_item_selected(Handle, index); bool ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern int poppler_form_field_choice_get_choice_type(IntPtr raw); public Poppler.FormChoiceType ChoiceGetChoiceType() { int raw_ret = poppler_form_field_choice_get_choice_type(Handle); Poppler.FormChoiceType ret = (Poppler.FormChoiceType) raw_ret; return ret; } [DllImport("poppler-glib")] static extern void poppler_form_field_button_set_state(IntPtr raw, bool state); public void ButtonSetState(bool state) { poppler_form_field_button_set_state(Handle, state); } [DllImport("poppler-glib")] static extern bool poppler_form_field_text_do_spell_check(IntPtr raw); public bool TextDoSpellCheck() { bool raw_ret = poppler_form_field_text_do_spell_check(Handle); bool ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern int poppler_form_field_get_id(IntPtr raw); public int Id { get { int raw_ret = poppler_form_field_get_id(Handle); int ret = raw_ret; return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_form_field_text_get_text(IntPtr raw); public string TextGetText() { IntPtr raw_ret = poppler_form_field_text_get_text(Handle); string ret = GLib.Marshaller.PtrToStringGFree(raw_ret); return ret; } [DllImport("poppler-glib")] static extern void poppler_form_field_text_set_text(IntPtr raw, IntPtr text); public void TextSetText(string text) { IntPtr native_text = GLib.Marshaller.StringToPtrGStrdup (text); poppler_form_field_text_set_text(Handle, native_text); GLib.Marshaller.Free (native_text); } [DllImport("poppler-glib")] static extern bool poppler_form_field_choice_can_select_multiple(IntPtr raw); public bool ChoiceCanSelectMultiple() { bool raw_ret = poppler_form_field_choice_can_select_multiple(Handle); bool ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern void poppler_form_field_choice_select_item(IntPtr raw, int index); public void ChoiceSelectItem(int index) { poppler_form_field_choice_select_item(Handle, index); } [DllImport("poppler-glib")] static extern int poppler_form_field_choice_get_n_items(IntPtr raw); public int ChoiceGetNItems() { int raw_ret = poppler_form_field_choice_get_n_items(Handle); int ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern bool poppler_form_field_is_read_only(IntPtr raw); public bool IsReadOnly { get { bool raw_ret = poppler_form_field_is_read_only(Handle); bool ret = raw_ret; return ret; } } [DllImport("poppler-glib")] static extern int poppler_form_field_get_field_type(IntPtr raw); public Poppler.FormFieldType FieldType { get { int raw_ret = poppler_form_field_get_field_type(Handle); Poppler.FormFieldType ret = (Poppler.FormFieldType) raw_ret; return ret; } } [DllImport("poppler-glib")] static extern void poppler_form_field_choice_unselect_all(IntPtr raw); public void ChoiceUnselectAll() { poppler_form_field_choice_unselect_all(Handle); } [DllImport("poppler-glib")] static extern int poppler_form_field_button_get_button_type(IntPtr raw); public Poppler.FormButtonType ButtonGetButtonType() { int raw_ret = poppler_form_field_button_get_button_type(Handle); Poppler.FormButtonType ret = (Poppler.FormButtonType) raw_ret; return ret; } [DllImport("poppler-glib")] static extern bool poppler_form_field_text_is_password(IntPtr raw); public bool TextIsPassword() { bool raw_ret = poppler_form_field_text_is_password(Handle); bool ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern bool poppler_form_field_text_do_scroll(IntPtr raw); public bool TextDoScroll() { bool raw_ret = poppler_form_field_text_do_scroll(Handle); bool ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern bool poppler_form_field_choice_is_editable(IntPtr raw); public bool ChoiceIsEditable() { bool raw_ret = poppler_form_field_choice_is_editable(Handle); bool ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern IntPtr poppler_form_field_choice_get_text(IntPtr raw); public string ChoiceGetText() { IntPtr raw_ret = poppler_form_field_choice_get_text(Handle); string ret = GLib.Marshaller.PtrToStringGFree(raw_ret); return ret; } [DllImport("poppler-glib")] static extern bool poppler_form_field_text_is_rich_text(IntPtr raw); public bool TextIsRichText() { bool raw_ret = poppler_form_field_text_is_rich_text(Handle); bool ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern void poppler_form_field_choice_toggle_item(IntPtr raw, int index); public void ChoiceToggleItem(int index) { poppler_form_field_choice_toggle_item(Handle, index); } [DllImport("poppler-glib")] static extern void poppler_form_field_choice_set_text(IntPtr raw, IntPtr text); public void ChoiceSetText(string text) { IntPtr native_text = GLib.Marshaller.StringToPtrGStrdup (text); poppler_form_field_choice_set_text(Handle, native_text); GLib.Marshaller.Free (native_text); } [DllImport("poppler-glib")] static extern bool poppler_form_field_button_get_state(IntPtr raw); public bool ButtonGetState() { bool raw_ret = poppler_form_field_button_get_state(Handle); bool ret = raw_ret; return ret; } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/FontInfo.cs0000644000175000001440000000274211242311651025255 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class FontInfo : GLib.Object { [Obsolete] protected FontInfo(GLib.GType gtype) : base(gtype) {} public FontInfo(IntPtr raw) : base(raw) {} [DllImport("poppler-glib")] static extern IntPtr poppler_font_info_new(IntPtr document); public FontInfo (Poppler.Document document) : base (IntPtr.Zero) { if (GetType () != typeof (FontInfo)) { throw new InvalidOperationException ("Can't override this constructor."); } Raw = poppler_font_info_new(document == null ? IntPtr.Zero : document.Handle); } [DllImport("poppler-glib")] static extern bool poppler_font_info_scan(IntPtr raw, int n_pages, IntPtr iter); public bool Scan(int n_pages, Poppler.FontsIter iter) { bool raw_ret = poppler_font_info_scan(Handle, n_pages, iter == null ? IntPtr.Zero : iter.Handle); bool ret = raw_ret; return ret; } [DllImport("poppler-glib")] static extern IntPtr poppler_font_info_get_type(); public static new GLib.GType GType { get { IntPtr raw_ret = poppler_font_info_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern void poppler_font_info_free(IntPtr raw); public void Free() { poppler_font_info_free(Handle); } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/ActionAny.cs0000644000175000001440000000133111242311651025411 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code [StructLayout(LayoutKind.Sequential)] public struct ActionAny { public Poppler.ActionType Type; public string Title; public static Poppler.ActionAny Zero = new Poppler.ActionAny (); public static Poppler.ActionAny New(IntPtr raw) { if (raw == IntPtr.Zero) return Poppler.ActionAny.Zero; return (Poppler.ActionAny) Marshal.PtrToStructure (raw, typeof (Poppler.ActionAny)); } private static GLib.GType GType { get { return GLib.GType.Pointer; } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/FormTextType.cs0000644000175000001440000000111511242311651026136 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.FormTextTypeGType))] public enum FormTextType { Normal, Multiline, FileSelect, } internal class FormTextTypeGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_form_text_type_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_form_text_type_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/ViewerPreferences.cs0000644000175000001440000000137611242311651027160 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [Flags] [GLib.GType (typeof (Poppler.ViewerPreferencesGType))] public enum ViewerPreferences { Unset, HideToolbar = 1 << 0, HideMenubar = 1 << 1, HideWindowui = 1 << 2, FitWindow = 1 << 3, CenterWindow = 1 << 4, DisplayDocTitle = 1 << 5, DirectionRtl = 1 << 6, } internal class ViewerPreferencesGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_viewer_preferences_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_viewer_preferences_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/SelectionStyle.cs0000644000175000001440000000111111242311651026466 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.SelectionStyleGType))] public enum SelectionStyle { Glyph, Word, Line, } internal class SelectionStyleGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_selection_style_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_selection_style_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/AnnotFreeText.cs0000644000175000001440000000270411242311651026257 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class AnnotFreeText : GLib.Object { [Obsolete] protected AnnotFreeText(GLib.GType gtype) : base(gtype) {} public AnnotFreeText(IntPtr raw) : base(raw) {} protected AnnotFreeText() : base(IntPtr.Zero) { CreateNativeObject (new string [0], new GLib.Value [0]); } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_free_text_get_type(); public static new GLib.GType GType { get { IntPtr raw_ret = poppler_annot_free_text_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("poppler-glib")] static extern IntPtr poppler_annot_free_text_get_callout_line(IntPtr raw); public Poppler.AnnotCalloutLine CalloutLine { get { IntPtr raw_ret = poppler_annot_free_text_get_callout_line(Handle); Poppler.AnnotCalloutLine ret = Poppler.AnnotCalloutLine.New (raw_ret); return ret; } } [DllImport("poppler-glib")] static extern int poppler_annot_free_text_get_quadding(IntPtr raw); public Poppler.AnnotFreeTextQuadding Quadding { get { int raw_ret = poppler_annot_free_text_get_quadding(Handle); Poppler.AnnotFreeTextQuadding ret = (Poppler.AnnotFreeTextQuadding) raw_ret; return ret; } } #endregion } } pdfmod-0.9.1/lib/poppler-sharp/poppler-sharp/generated/AnnotExternalDataType.cs0000644000175000001440000000115411242311651027745 0ustar00gabeusers00000000000000// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Poppler { using System; using System.Runtime.InteropServices; #region Autogenerated code [GLib.GType (typeof (Poppler.AnnotExternalDataTypeGType))] public enum AnnotExternalDataType { ThreeD, Unknown, } internal class AnnotExternalDataTypeGType { [DllImport ("poppler-glib")] static extern IntPtr poppler_annot_external_data_type_get_type (); public static GLib.GType GType { get { return new GLib.GType (poppler_annot_external_data_type_get_type ()); } } } #endregion } pdfmod-0.9.1/lib/poppler-sharp/Makefile.am0000644000175000001440000001023011406252324020500 0ustar00gabeusers00000000000000 EXTRA_DIST = if USE_BUNDLED_POPPLER if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = $(MCS) ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -unsafe -debug "-define:DEBUG" ASSEMBLY = ../../bin/poppler-sharp.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = BUILD_DIR = ../../bin endif if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = $(MCS) ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -unsafe -debug -define:DEBUG ASSEMBLY = ../../bin/poppler-sharp.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = BUILD_DIR = ../../bin endif PROGRAMFILES = \ $(POPPLER_SHARP_DLL_MDB) BINARIES = RESGEN=resgen2 all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) endif FILES = \ poppler-sharp/Document.cs \ poppler-sharp/generated/Action.cs \ poppler-sharp/generated/ActionAny.cs \ poppler-sharp/generated/ActionGotoDest.cs \ poppler-sharp/generated/ActionGotoRemote.cs \ poppler-sharp/generated/ActionLaunch.cs \ poppler-sharp/generated/ActionMovie.cs \ poppler-sharp/generated/ActionNamed.cs \ poppler-sharp/generated/ActionType.cs \ poppler-sharp/generated/ActionUri.cs \ poppler-sharp/generated/Annot.cs \ poppler-sharp/generated/AnnotCalloutLine.cs \ poppler-sharp/generated/AnnotExternalDataType.cs \ poppler-sharp/generated/AnnotFlag.cs \ poppler-sharp/generated/AnnotFreeText.cs \ poppler-sharp/generated/AnnotFreeTextQuadding.cs \ poppler-sharp/generated/AnnotMapping.cs \ poppler-sharp/generated/AnnotMarkup.cs \ poppler-sharp/generated/AnnotMarkupReplyType.cs \ poppler-sharp/generated/AnnotText.cs \ poppler-sharp/generated/AnnotTextState.cs \ poppler-sharp/generated/AnnotType.cs \ poppler-sharp/generated/Attachment.cs \ poppler-sharp/generated/AttachmentSaveFunc.cs \ poppler-sharp/generated/Backend.cs \ poppler-sharp/generated/Color.cs \ poppler-sharp/generated/Dest.cs \ poppler-sharp/generated/DestType.cs \ poppler-sharp/generated/Document.cs \ poppler-sharp/generated/Error.cs \ poppler-sharp/generated/FontInfo.cs \ poppler-sharp/generated/FontType.cs \ poppler-sharp/generated/FontsIter.cs \ poppler-sharp/generated/FormButtonType.cs \ poppler-sharp/generated/FormChoiceType.cs \ poppler-sharp/generated/FormField.cs \ poppler-sharp/generated/FormFieldMapping.cs \ poppler-sharp/generated/FormFieldType.cs \ poppler-sharp/generated/FormTextType.cs \ poppler-sharp/generated/Global.cs \ poppler-sharp/generated/ImageMapping.cs \ poppler-sharp/generated/IndexIter.cs \ poppler-sharp/generated/Layer.cs \ poppler-sharp/generated/LayersIter.cs \ poppler-sharp/generated/LinkMapping.cs \ poppler-sharp/generated/Orientation.cs \ poppler-sharp/generated/PSFile.cs \ poppler-sharp/generated/Page.cs \ poppler-sharp/generated/PageLayout.cs \ poppler-sharp/generated/PageMode.cs \ poppler-sharp/generated/PageTransition.cs \ poppler-sharp/generated/PageTransitionAlignment.cs \ poppler-sharp/generated/PageTransitionDirection.cs \ poppler-sharp/generated/PageTransitionType.cs \ poppler-sharp/generated/PopplerSharp.AttachmentSaveFuncNative.cs \ poppler-sharp/generated/Rectangle.cs \ poppler-sharp/generated/SelectionStyle.cs \ poppler-sharp/generated/ViewerPreferences.cs DATA_FILES = RESOURCES = EXTRAS = REFERENCES = \ Mono.Cairo \ -pkg:gtk-sharp-2.0 \ System DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(BINARIES) include $(top_srcdir)/Makefile.include POPPLER_SHARP_DLL = $(BUILD_DIR)/poppler-sharp.dll POPPLER_SHARP_DLL_CONFIG = $(BUILD_DIR)/poppler-sharp.dll.config POPPLER_SHARP_DLL_MDB = $(BUILD_DIR)/poppler-sharp.dll.mdb $(eval $(call emit-deploy-target,POPPLER_SHARP_DLL_CONFIG)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) cp $(srcdir)/poppler-sharp/poppler-sharp.dll.config $(BUILD_DIR) pdfmod-0.9.1/lib/poppler-sharp/COPYING0000644000175000001440000004310311240370571017505 0ustar00gabeusers00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. pdfmod-0.9.1/lib/PdfSharp/0000777000175000001440000000000011533760020015365 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.Layout/0000777000175000001440000000000011533760020021742 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.Layout/XTextFormatter.cs0000644000175000001440000003062611435766646025261 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using System.Text; using PdfSharp.Drawing; using PdfSharp.Pdf.IO; namespace PdfSharp.Drawing.Layout { /// /// Represents a very simple text formatter. /// If this class does not satisfy your needs on formatting paragraphs I recommend to take a look /// at MigraDoc Foundation. Alternatively you should copy this class in your own source code and modify it. /// public class XTextFormatter { /// /// Initializes a new instance of the class. /// public XTextFormatter(XGraphics gfx) { if (gfx == null) throw new ArgumentNullException("gfx"); this.gfx = gfx; } XGraphics gfx; /// /// Gets or sets the text. /// /// The text. public string Text { get { return this.text; } set { this.text = value; } } string text; /// /// Gets or sets the font. /// public XFont Font { get { return this.font; } set { if (value == null) throw new ArgumentNullException("font"); this.font = value; this.lineSpace = font.GetHeight(this.gfx); this.cyAscent = lineSpace * font.cellAscent / font.cellSpace; this.cyDescent = lineSpace * font.cellDescent / font.cellSpace; // HACK in XTextFormatter this.spaceWidth = gfx.MeasureString("xx", value).width; this.spaceWidth -= gfx.MeasureString("xx", value).width; } } XFont font; double lineSpace; double cyAscent; double cyDescent; double spaceWidth; /// /// Gets or sets the bounding box of the layout. /// public XRect LayoutRectangle { get { return this.layoutRectangle; } set { this.layoutRectangle = value; } } XRect layoutRectangle; /// /// Gets or sets the alignment of the text. /// public XParagraphAlignment Alignment { get { return this.alignment; } set { this.alignment = value; } } XParagraphAlignment alignment = XParagraphAlignment.Left; /// /// Draws the text. /// /// The text to be drawn. /// The font. /// The text brush. /// The layout rectangle. public void DrawString(string text, XFont font, XBrush brush, XRect layoutRectangle) { DrawString(text, font, brush, layoutRectangle, XStringFormats.TopLeft); } /// /// Draws the text. /// /// The text to be drawn. /// The font. /// The text brush. /// The layout rectangle. /// The format. Must be XStringFormat.TopLeft public void DrawString(string text, XFont font, XBrush brush, XRect layoutRectangle, XStringFormat format) { if (text == null) throw new ArgumentNullException("text"); if (font == null) throw new ArgumentNullException("font"); if (brush == null) throw new ArgumentNullException("brush"); if (format.Alignment != XStringAlignment.Near || format.LineAlignment!= XLineAlignment.Near) throw new ArgumentException("Only TopLeft alignment is currently implemented."); Text = text; Font = font; LayoutRectangle = layoutRectangle; if (text.Length == 0) return; CreateBlocks(); CreateLayout(); double dx = layoutRectangle.Location.x; double dy = layoutRectangle.Location.y + cyAscent; int count = this.blocks.Count; for (int idx = 0; idx < count; idx++) { Block block = (Block)this.blocks[idx]; if (block.Stop) break; if (block.Type == BlockType.LineBreak) continue; gfx.DrawString(block.Text, font, brush, dx + block.Location.x, dy + block.Location.y); } } void CreateBlocks() { this.blocks.Clear(); int length = this.text.Length; bool inNonWhiteSpace = false; int startIndex = 0, blockLength = 0; for (int idx = 0; idx < length; idx++) { char ch = text[idx]; // Treat CR and CRLF as LF if (ch == Chars.CR) { if (idx < length - 1 && text[idx + 1] == Chars.LF) idx++; ch = Chars.LF; } if (ch == Chars.LF) { if (blockLength != 0) { string token = text.Substring(startIndex, blockLength); this.blocks.Add(new Block(token, BlockType.Text, this.gfx.MeasureString(token, this.font).Width)); } startIndex = idx + 1; blockLength = 0; this.blocks.Add(new Block(BlockType.LineBreak)); } else if (Char.IsWhiteSpace(ch)) { if (inNonWhiteSpace) { string token = text.Substring(startIndex, blockLength); this.blocks.Add(new Block(token, BlockType.Text, this.gfx.MeasureString(token, this.font).Width)); startIndex = idx + 1; blockLength = 0; } else { blockLength++; } } else { inNonWhiteSpace = true; blockLength++; } } if (blockLength != 0) { string token = text.Substring(startIndex, blockLength); this.blocks.Add(new Block(token, BlockType.Text, this.gfx.MeasureString(token, this.font).Width)); } } void CreateLayout() { double rectWidth = this.layoutRectangle.width; double rectHeight = this.layoutRectangle.height - this.cyAscent - this.cyDescent; int firstIndex = 0; double x = 0, y = 0; int count = this.blocks.Count; for (int idx = 0; idx < count; idx++) { Block block = (Block)this.blocks[idx]; if (block.Type == BlockType.LineBreak) { if (Alignment == XParagraphAlignment.Justify) ((Block)this.blocks[firstIndex]).Alignment = XParagraphAlignment.Left; AlignLine(firstIndex, idx - 1, rectWidth); firstIndex = idx + 1; x = 0; y += this.lineSpace; } else { double width = block.Width; //!!!modTHHO 19.11.09 don't add this.spaceWidth here if ((x + width <= rectWidth || x == 0) && block.Type != BlockType.LineBreak) { block.Location = new XPoint(x, y); x += width + spaceWidth; //!!!modTHHO 19.11.09 add this.spaceWidth here } else { AlignLine(firstIndex, idx - 1, rectWidth); firstIndex = idx; y += lineSpace; if (y > rectHeight) { block.Stop = true; break; } block.Location = new XPoint(0, y); x = width + spaceWidth; //!!!modTHHO 19.11.09 add this.spaceWidth here } } } if (firstIndex < count && Alignment != XParagraphAlignment.Justify) AlignLine(firstIndex, count - 1, rectWidth); } /// /// Align center, right or justify. /// void AlignLine(int firstIndex, int lastIndex, double layoutWidth) { XParagraphAlignment blockAlignment = ((Block)(this.blocks[firstIndex])).Alignment; if (this.alignment == XParagraphAlignment.Left || blockAlignment == XParagraphAlignment.Left) return; int count = lastIndex - firstIndex + 1; if (count == 0) return; double totalWidth = -this.spaceWidth; for (int idx = firstIndex; idx <= lastIndex; idx++) totalWidth += ((Block)(this.blocks[idx])).Width + this.spaceWidth; double dx = Math.Max(layoutWidth - totalWidth, 0); //Debug.Assert(dx >= 0); if (this.alignment != XParagraphAlignment.Justify) { if (this.alignment == XParagraphAlignment.Center) dx /= 2; for (int idx = firstIndex; idx <= lastIndex; idx++) { Block block = (Block)this.blocks[idx]; block.Location += new XSize(dx, 0); } } else if (count > 1) // case: justify { dx /= count - 1; for (int idx = firstIndex + 1, i = 1; idx <= lastIndex; idx++, i++) { Block block = (Block)this.blocks[idx]; block.Location += new XSize(dx * i, 0); } } } readonly List blocks = new List(); enum BlockType { Text, Space, Hyphen, LineBreak, } /// /// Represents a single word. /// class Block { /// /// Initializes a new instance of the class. /// /// The text of the block. /// The type of the block. /// The width of the text. public Block(string text, BlockType type, double width) { Text = text; Type = type; Width = width; } /// /// Initializes a new instance of the class. /// /// The type. public Block(BlockType type) { Type = type; } /// /// The text represented by this block. /// public string Text; /// /// The type of the block. /// public BlockType Type; /// /// The width of the text. /// public double Width; /// /// The location relative to the upper left corner of the layout rectangle. /// public XPoint Location; /// /// The alignment of this line. /// public XParagraphAlignment Alignment; /// /// A flag indicating that this is the last bock that fits in the layout rectangle. /// public bool Stop; } // TODO: // - more XStringFormat variations // - calculate bounding box // - left and right indent // - first line indent // - margins and paddings // - background color // - text background color // - border style // - hyphens, soft hyphens, hyphenation // - kerning // - change font, size, text color etc. // - line spacing // - underine and strike-out variation // - super- and sub-script // - ... } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.Layout/enums/0000777000175000001440000000000011533760020023071 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.Layout/enums/XParagraphAlignment.cs0000644000175000001440000000401511435766646027335 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing.Layout { /// /// Specifies the alignment of a paragraph. /// public enum XParagraphAlignment { /// /// Default alignment, typically left alignment. /// Default, /// /// The paragraph is rendered left aligned. /// Left, /// /// The paragraph is rendered centered. /// Center, /// /// The paragraph is rendered right aligned. /// Right, /// /// The paragraph is rendered justified. /// Justify, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.Shapes/0000777000175000001440000000000011533760020021710 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.Shapes/Shape.cs0000644000175000001440000003701411435766646023325 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; #if under_constructioin namespace PdfSharp.Drawing.Shapes { public sealed class Ellipse : Shape { // // Methods // static Ellipse(); // public Ellipse(); // protected override Size ArrangeOverride(Size finalSize); // protected override Size MeasureOverride(Size constraint); // protected override void OnRender(DrawingContext dc); // // // Properties // public double CenterX { get; set; } // public double CenterY { get; set; } // public double RadiusX { get; set; } // public double RadiusY { get; set; } // // // Fields // private Rect _shapeBounds; // [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")] // public static readonly DependencyProperty CenterXProperty; // [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")] // public static readonly DependencyProperty CenterYProperty; // [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")] // public static readonly DependencyProperty RadiusXProperty; // [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")] // public static readonly DependencyProperty RadiusYProperty; } public sealed class Glyphs : Shape { // // Methods // static Glyphs(); // public Glyphs(); // protected override Size ArrangeOverride(Size finalSize); // public GlyphRun ComputeGlyphRun(); // private void ComputeMeasurementGlyphRunAndOrigin(); // private static double GetAdvanceWidth(GlyphTypeface glyphTypeface, ushort glyphIndex, bool sideways); // private static bool IsEmpty(string s); // protected override Size MeasureOverride(Size constraint); // protected override void OnRender(DrawingContext ctx); // private IList ParseCaretStops(); // [SecurityCritical, SecurityTreatAsSafe] // private void ParseGlyphRunProperties(); // private int ParseGlyphsProperty(GlyphTypeface fontFace, string unicodeString, bool sideways, out List parsedGlyphs, out ushort[] clusterMap); // private bool ReadGlyphIndex(string valueSpec, ref bool inCluster, ref int glyphClusterSize, ref int characterClusterSize, ref ushort glyphIndex); // // // Properties // public int BidiLevel { get; set; } // public string CaretStops { get; set; } // [Obsolete("This property is obsolete and will be removed in a future version. Use the fragment portion of FontUri property to specify TTC index instead.")] // public int FontFaceIndex { get; set; } // public double FontRenderingEmSize { get; set; } // public Uri FontUri { get; set; } // public string Indices { get; set; } // public bool IsSideways { get; set; } // public double OriginX { get; set; } // public double OriginY { get; set; } // public StyleSimulations StyleSimulations { get; set; } // Uri IUriContext.BaseUri { get; set; } // public string UnicodeString { get; set; } // // // Fields // private Point _glyphRunOrigin; // private LayoutDependentGlyphRunProperties _glyphRunProperties; // private GlyphRun _measurementGlyphRun; // public static readonly DependencyProperty BidiLevelProperty; // public static readonly DependencyProperty CaretStopsProperty; // private const double EmMultiplier = 100; // [Obsolete("This property is obsolete and will be removed in a future version. Use the fragment portion of FontUri property to specify TTC index instead.")] // public static readonly DependencyProperty FontFaceIndexProperty; // [TypeConverter("System.Windows.FontSizeConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")] // public static readonly DependencyProperty FontRenderingEmSizeProperty; // public static readonly DependencyProperty FontUriProperty; // public static readonly DependencyProperty IndicesProperty; // public static readonly DependencyProperty IsSidewaysProperty; // [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")] // public static readonly DependencyProperty OriginXProperty; // [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")] // public static readonly DependencyProperty OriginYProperty; // public static readonly DependencyProperty StyleSimulationsProperty; // public static readonly DependencyProperty UnicodeStringProperty; // // // Nested Types // private class LayoutDependentGlyphRunProperties // { // // Methods // public LayoutDependentGlyphRunProperties(); // public GlyphRun CreateGlyphRun(Point origin, CultureInfo culture); // // // Fields // public double[] advanceWidths; // public int bidiLevel; // public IList caretStops; // public ushort[] clusterMap; // public double fontRenderingSize; // public ushort[] glyphIndices; // public Point[] glyphOffsets; // public GlyphTypeface glyphTypeface; // public bool sideways; // public string unicodeString; // } // // private class ParsedGlyphData // { // // Methods // public ParsedGlyphData(); // // // Fields // public double advanceWidth; // public ushort glyphIndex; // public double offsetX; // public double offsetY; // } } public sealed class Line : StretchableShape { // // Methods // static Line(); // public Line(); // internal override void CacheDefiningGeometry(); // // // Properties // protected override Geometry DefiningGeometry { get; } // public double X1 { get; set; } // public double X2 { get; set; } // public double Y1 { get; set; } // public double Y2 { get; set; } // // // Fields // private LineGeometry _lineGeometry; // [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")] // public static readonly DependencyProperty X1Property; // [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")] // public static readonly DependencyProperty X2Property; // [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")] // public static readonly DependencyProperty Y1Property; // [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")] // public static readonly DependencyProperty Y2Property; } public sealed class Path : StretchableShape { // // Methods // static Path(); // public Path(); // internal override void CacheDefiningGeometry(); // private static void PathDataInvalidator(DependencyObject d); // // // Properties // public Geometry Data { get; set; } // protected override Geometry DefiningGeometry { get; } // public FillRule FillRule { get; set; } // // // Fields // private Geometry _cachedGeometry; // public static readonly DependencyProperty DataProperty; // public static readonly DependencyProperty FillRuleProperty; } public sealed class Polygon : StretchableShape { // // Methods // static Polygon(); // public Polygon(); // internal override void CacheDefiningGeometry(); // // // Properties // protected override Geometry DefiningGeometry { get; } // public FillRule FillRule { get; set; } // public PointCollection Points { get; set; } // // // Fields // private PathGeometry _polygonGeometry; // public static readonly DependencyProperty FillRuleProperty; // public static readonly DependencyProperty PointsProperty; } public sealed class Polyline : StretchableShape { // // Methods // static Polyline(); // public Polyline(); // internal override void CacheDefiningGeometry(); // protected override void OnRender(DrawingContext dc); // // // Properties // protected override Geometry DefiningGeometry { get; } // public FillRule FillRule { get; set; } // public PointCollection Points { get; set; } // // // Fields // private PathGeometry _polylineGeometry; // public static readonly DependencyProperty FillRuleProperty; // public static readonly DependencyProperty PointsProperty; } public sealed class Rectangle : StretchableShape { // // Methods // static Rectangle(); // public Rectangle(); // protected override Size ArrangeOverride(Size finalSize); // internal override void CacheDefiningGeometry(); // internal override Rect GetDefiningGeometryBounds(); // internal override Size GetNaturalSize(); // protected override Size MeasureOverride(Size constraint); // protected override void OnRender(DrawingContext dc); // // // Properties // protected override Geometry DefiningGeometry { get; } // public override Transform GeometryTransform { get; } // public double RadiusX { get; set; } // public double RadiusY { get; set; } // public override Geometry RenderedGeometry { get; } // // // Fields // private Rect _rect; // [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")] // public static readonly DependencyProperty RadiusXProperty; // [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")] // public static readonly DependencyProperty RadiusYProperty; } public abstract class Shape { // // Methods // static Shape(); // protected Shape(); // internal Pen GetPen(Size sizeReference); // internal double GetStrokeThickness(); // internal static bool IsDoubleFinite(object o); // internal static bool IsDoubleFiniteNonNegative(object o); // private static void PenInvalidated(DependencyObject d); // // // Properties // public Brush Fill { get; set; } // internal bool IsPenNoOp { get; } // public Brush Stroke { get; set; } // public DoubleCollection StrokeDashArray { get; set; } // public PenLineCap StrokeDashCap { get; set; } // public double StrokeDashOffset { get; set; } // public PenLineCap StrokeEndLineCap { get; set; } // public PenLineJoin StrokeLineJoin { get; set; } // public double StrokeMiterLimit { get; set; } // public PenLineCap StrokeStartLineCap { get; set; } // public double StrokeThickness { get; set; } // // // Fields // private Pen _pen; // public static readonly DependencyProperty FillProperty; // public static readonly DependencyProperty StrokeDashArrayProperty; // public static readonly DependencyProperty StrokeDashCapProperty; // public static readonly DependencyProperty StrokeDashOffsetProperty; // public static readonly DependencyProperty StrokeEndLineCapProperty; // public static readonly DependencyProperty StrokeLineJoinProperty; // public static readonly DependencyProperty StrokeMiterLimitProperty; // public static readonly DependencyProperty StrokeProperty; // public static readonly DependencyProperty StrokeStartLineCapProperty; // [TypeConverter("System.Windows.LengthConverter, PresentationFramework, Version=6.0.4030.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")] // public static readonly DependencyProperty StrokeThicknessProperty; } public abstract class StretchableShape : Shape { // // Methods // static StretchableShape(); // internal StretchableShape(); // protected override Size ArrangeOverride(Size finalSize); // internal abstract void CacheDefiningGeometry(); // internal Stretch GetAdjustedStretch(Size size); // internal virtual Rect GetDefiningGeometryBounds(); // internal virtual Size GetNaturalSize(); // protected override Size MeasureOverride(Size constraint); // protected override void OnRender(DrawingContext dc); // internal void Render(DrawingContext dc, Brush brush); // internal void ResetStretchMatrix(); // internal void SetStretchedGeometry(Size finalSize); // internal void SetStretchMatrix(Size size, Stretch mode, double penThickness); // // // Properties // protected abstract Geometry DefiningGeometry { get; } // public virtual Transform GeometryTransform { get; } // public virtual Geometry RenderedGeometry { get; } // public Stretch Stretch { get; set; } // // // Fields // private Geometry _renderedGeometry; // private Matrix _stretchMatrix; // public static readonly DependencyProperty StretchProperty; } } #endifpdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/0000777000175000001440000000000011533760020021476 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/PdfChoiseField.cs0000644000175000001440000001360411240370570024637 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2008 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.AcroForms { /// /// Represents the base class for all choise field dictionaries. /// public abstract class PdfChoiseField : PdfAcroField { /// /// Initializes a new instance of the class. /// protected PdfChoiseField(PdfDocument document) : base(document) { } /// /// Initializes a new instance of the class. /// protected PdfChoiseField(PdfDictionary dict) : base(dict) { } /// /// Gets the index of the specified string in the /Opt array or -1, if no such string exists. /// protected int IndexInOptArray(string value) { PdfArray opt = Elements[Keys.Opt] as PdfArray; if (opt != null) { int count = opt.Elements.Count; for (int idx = 0; idx < count; idx++) { PdfItem item = opt.Elements[idx]; if (item is PdfString) { if (item.ToString() == value) return idx; } else if (item is PdfArray) { PdfArray array = (PdfArray)item; if (array.Elements.Count != 0) { if (array.Elements[idx].ToString() == value) return idx; } } } } return -1; } /// /// Gets the value from the index in the /Opt array. /// protected string ValueInOptArray(int index) { PdfArray opt = Elements[Keys.Opt] as PdfArray; if (opt != null) { int count = opt.Elements.Count; if (index < 0 || index >= count) throw new ArgumentOutOfRangeException("index"); PdfItem item = opt.Elements[index]; if (item is PdfString) return item.ToString(); else if (item is PdfArray) { PdfArray array = (PdfArray)item; return array.Elements[0].ToString(); } } return ""; } /// /// Predefined keys of this dictionary. /// The description comes from PDF 1.4 Reference. /// public new class Keys : PdfAcroField.Keys { /// /// (Required; inheritable) An array of options to be presented to the user. Each element of /// the array is either a text string representing one of the available options or a two-element /// array consisting of a text string together with a default appearance string for constructing /// the items appearance dynamically at viewing time. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string Opt = "/Opt"; /// /// (Optional; inheritable) For scrollable list boxes, the top index (the index in the Opt array /// of the first option visible in the list). /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string TI = "/TI"; /// /// (Sometimes required, otherwise optional; inheritable; PDF 1.4) For choice fields that allow /// multiple selection (MultiSelect flag set), an array of integers, sorted in ascending order, /// representing the zero-based indices in the Opt array of the currently selected option /// items. This entry is required when two or more elements in the Opt array have different /// names but the same export value, or when the value of the choice field is an array; in /// other cases, it is permitted but not required. If the items identified by this entry differ /// from those in the V entry of the field dictionary (see below), the V entry takes precedence. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string I = "/I"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/PdfButtonField.cs0000644000175000001440000000676211435766646024732 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf.Annotations; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.AcroForms { /// /// Represents the base class for all button fields. /// public abstract class PdfButtonField : PdfAcroField { /// /// Initializes a new instance of the class. /// protected PdfButtonField(PdfDocument document) : base(document) { } /// /// Initializes a new instance of the class. /// protected PdfButtonField(PdfDictionary dict) : base(dict) { } /// /// Gets the name which represents the opposite of /Off. /// protected string GetNonOffValue() { // Try to get the information from the appearance dictionaray. // Just return the first key that is not /Off. // I'm not sure what is the right solution to get this value. PdfDictionary ap = Elements[PdfAnnotation.Keys.AP] as PdfDictionary; if (ap != null) { PdfDictionary n = ap.Elements["/N"] as PdfDictionary; if (n != null) { foreach (string name in n.Elements.Keys) if (name != "/Off") return name; } } return null; } internal override void GetDescendantNames(ref List names, string partialName) { string t = Elements.GetString(PdfAcroField.Keys.T); // HACK: ??? if (t == "") t = "???"; Debug.Assert(t != ""); if (t.Length > 0) { if (!String.IsNullOrEmpty(partialName)) names.Add(new PdfName(partialName + "." + t)); else names.Add(new PdfName(t)); } } /// /// Predefined keys of this dictionary. /// The description comes from PDF 1.4 Reference. /// public new class Keys : PdfAcroField.Keys { // Pushbuttons have no additional entries. } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/PdfComboBoxField.cs0000644000175000001440000000566611435766646025171 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.AcroForms { /// /// Represents the combo box field. /// public sealed class PdfComboBoxField : PdfChoiceField { /// /// Initializes a new instance of PdfComboBoxField. /// internal PdfComboBoxField(PdfDocument document) : base(document) { } internal PdfComboBoxField(PdfDictionary dict) : base(dict) { } /// /// Gets or sets the index of the selected item. /// public int SelectedIndex { get { string value = Elements.GetString(Keys.V); return IndexInOptArray(value); } set { string key = ValueInOptArray(value); Elements.SetString(Keys.V, key); } } /// /// Predefined keys of this dictionary. /// The description comes from PDF 1.4 Reference. /// public new class Keys : PdfAcroField.Keys { // Combo boxes have no additional entries. internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/PdfAcroField.cs0000644000175000001440000003771011435766646024340 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.AcroForms { /// /// Represents the base class for all interactive field dictionaries. /// public abstract class PdfAcroField : PdfDictionary { /// /// Initializes a new instance of PdfAcroField. /// internal PdfAcroField(PdfDocument document) : base(document) { } /// /// Initializes a new instance of the class. Used for type transformation. /// protected PdfAcroField(PdfDictionary dict) : base(dict) { } /// /// Gets the name of this field. /// public string Name { get { string name = Elements.GetString(Keys.T); return name; } } /// /// Gets the field flags of this instance. /// public PdfAcroFieldFlags Flags { // TODO: This entry is inheritable, thus the implementation is incorrect... get { return (PdfAcroFieldFlags)Elements.GetInteger(Keys.Ff); } } internal PdfAcroFieldFlags SetFlags { get { return (PdfAcroFieldFlags)Elements.GetInteger(Keys.Ff); } set { Elements.SetInteger(Keys.Ff, (int)value); } } /// /// Gets or sets the value of the field. /// public PdfItem Value { get { return Elements[Keys.V]; } set { if (ReadOnly) throw new InvalidOperationException("The field is read only."); if (value is PdfString || value is PdfName) Elements[Keys.V] = value; else throw new NotImplementedException("Values other than string cannot be set."); } } /// /// Gets or sets a value indicating whether the field is read only. /// public bool ReadOnly { get { return (Flags & PdfAcroFieldFlags.ReadOnly) != 0; } set { if (value) SetFlags |= PdfAcroFieldFlags.ReadOnly; else SetFlags &= ~PdfAcroFieldFlags.ReadOnly; } } /// /// Gets the field with the specified name. /// public PdfAcroField this[string name] { get { return GetValue(name); } } /// /// Gets a child field by name. /// protected virtual PdfAcroField GetValue(string name) { if (name == null || name.Length == 0) return this; if (HasKids) return Fields.GetValue(name); return null; } /// /// Indicates whether the field has child fields. /// public bool HasKids { get { PdfItem item = Elements[Keys.Kids]; if (item == null) return false; if (item is PdfArray) return ((PdfArray)item).Elements.Count > 0; return false; } } /// /// Gets the names of all descendants of this field. /// public string[] DescendantNames { get { List names = new List(); if (HasKids) { PdfAcroFieldCollection fields = Fields; fields.GetDescendantNames(ref names, null); } List temp = new List(); foreach (PdfName name in names) temp.Add(name.ToString()); return temp.ToArray(); } } internal virtual void GetDescendantNames(ref List names, string partialName) { if (HasKids) { PdfAcroFieldCollection fields = Fields; string t = Elements.GetString(Keys.T); Debug.Assert(t != ""); if (t.Length > 0) { if (partialName != null && partialName.Length > 0) partialName += "." + t; else partialName = t; fields.GetDescendantNames(ref names, partialName); } } else { string t = Elements.GetString(Keys.T); Debug.Assert(t != ""); if (t.Length > 0) { if (!String.IsNullOrEmpty(partialName)) names.Add(new PdfName(partialName + "." + t)); else names.Add(new PdfName(t)); } } } /// /// Gets the collection of fields within this field. /// public PdfAcroField.PdfAcroFieldCollection Fields { get { if (this.fields == null) { object o = Elements.GetValue(Keys.Kids, VCF.CreateIndirect); this.fields = (PdfAcroField.PdfAcroFieldCollection)o; } return this.fields; } } PdfAcroField.PdfAcroFieldCollection fields; /// /// Holds a collection of interactive fields. /// public sealed class PdfAcroFieldCollection : PdfArray { PdfAcroFieldCollection(PdfArray array) : base(array) { } /// /// Gets the names of all fields in the collection. /// public string[] Names { get { int count = Elements.Count; string[] names = new string[count]; for (int idx = 0; idx < count; idx++) names[idx] = ((PdfDictionary)((PdfReference)Elements[idx]).Value).Elements.GetString(Keys.T); return names; } } /// /// Gets an array of all descendant names. /// public string[] DescendantNames { get { List names = new List(); GetDescendantNames(ref names, null); List temp = new List(); foreach (PdfName name in names) temp.Add(name.ToString()); return temp.ToArray(); } } internal void GetDescendantNames(ref List names, string partialName) { int count = Elements.Count; for (int idx = 0; idx < count; idx++) { PdfAcroField field = this[idx]; Debug.Assert(field != null); if (field != null) field.GetDescendantNames(ref names, partialName); } } /// /// Gets a field from the collection. For your convenience an instance of a derived class like /// PdfTextField or PdfCheckBox is returned if PDFsharp can guess the actual type of the dictionary. /// If the actual type cannot be guessed by PDFsharp the function returns an instance /// of PdfGenericField. /// public PdfAcroField this[int index] { get { PdfItem item = Elements[index]; Debug.Assert(item is PdfReference); PdfDictionary dict = ((PdfReference)item).Value as PdfDictionary; Debug.Assert(dict != null); PdfAcroField field = dict as PdfAcroField; if (field == null && dict != null) { // Do type transformation field = CreateAcroField(dict); //Elements[index] = field.XRef; } return field; } } /// /// Gets the field with the specified name. /// public PdfAcroField this[string name] { get { return GetValue(name); } } internal PdfAcroField GetValue(string name) { if (name == null || name.Length == 0) return null; int dot = name.IndexOf('.'); string prefix = dot == -1 ? name : name.Substring(0, dot); string suffix = dot == -1 ? "" : name.Substring(dot + 1); int count = Elements.Count; for (int idx = 0; idx < count; idx++) { PdfAcroField field = this[idx]; if (field.Name == prefix) return field.GetValue(suffix); } return null; } /// /// Create a derived type like PdfTextField or PdfCheckBox if possible. /// If the actual cannot be guessed by PDFsharp the function returns an instance /// of PdfGenericField. /// PdfAcroField CreateAcroField(PdfDictionary dict) { string ft = dict.Elements.GetName(Keys.FT); PdfAcroFieldFlags flags = (PdfAcroFieldFlags)dict.Elements.GetInteger(Keys.Ff); switch (ft) { case "/Btn": if ((flags & PdfAcroFieldFlags.Pushbutton) != 0) return new PdfPushButtonField(dict); else if ((flags & PdfAcroFieldFlags.Radio) != 0) return new PdfRadioButtonField(dict); else return new PdfCheckBoxField(dict); case "/Tx": return new PdfTextField(dict); case "/Ch": if ((flags & PdfAcroFieldFlags.Combo) != 0) return new PdfComboBoxField(dict); else return new PdfListBoxField(dict); case "/Sig": return new PdfSignatureField(dict); default: return new PdfGenericField(dict); } } } /// /// Predefined keys of this dictionary. /// The description comes from PDF 1.4 Reference. /// public class Keys : KeysBase { /// /// (Required for terminal fields; inheritable) The type of field that this dictionary /// describes: /// Btn Button /// Tx Text /// Ch Choice /// Sig (PDF 1.3) Signature /// Note: This entry may be present in a nonterminal field (one whose descendants /// are themselves fields) in order to provide an inheritable FT value. However, a /// nonterminal field does not logically have a type of its own; it is merely a container /// for inheritable attributes that are intended for descendant terminal fields of /// any type. /// [KeyInfo(KeyType.Name | KeyType.Required)] public const string FT = "/FT"; /// /// (Required if this field is the child of another in the field hierarchy; absent otherwise) /// The field that is the immediate parent of this one (the field, if any, whose Kids array /// includes this field). A field can have at most one parent; that is, it can be included /// in the Kids array of at most one other field. /// [KeyInfo(KeyType.Dictionary)] public const string Parent = "/Parent"; /// /// (Optional) An array of indirect references to the immediate children of this field. /// [KeyInfo(KeyType.Array | KeyType.Optional, typeof(PdfAcroField.PdfAcroFieldCollection))] public const string Kids = "/Kids"; /// /// (Optional) The partial field name. /// [KeyInfo(KeyType.TextString | KeyType.Optional)] public const string T = "/T"; /// /// (Optional; PDF 1.3) An alternate field name, to be used in place of the actual /// field name wherever the field must be identified in the user interface (such as /// in error or status messages referring to the field). This text is also useful /// when extracting the documents contents in support of accessibility to disabled /// users or for other purposes. /// [KeyInfo(KeyType.TextString | KeyType.Optional)] public const string TU = "/TU"; /// /// (Optional; PDF 1.3) The mapping name to be used when exporting interactive form field /// data from the document. /// [KeyInfo(KeyType.TextString | KeyType.Optional)] public const string TM = "/TM"; /// /// (Optional; inheritable) A set of flags specifying various characteristics of the field. /// Default value: 0. /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string Ff = "/Ff"; /// /// (Optional; inheritable) The fields value, whose format varies depending on /// the field type; see the descriptions of individual field types for further information. /// [KeyInfo(KeyType.Various | KeyType.Optional)] public const string V = "/V"; /// /// (Optional; inheritable) The default value to which the field reverts when a /// reset-form action is executed. The format of this value is the same as that of V. /// [KeyInfo(KeyType.Various | KeyType.Optional)] public const string DV = "/DV"; /// /// (Optional; PDF 1.2) An additional-actions dictionary defining the fields behavior /// in response to various trigger events. This entry has exactly the same meaning as /// the AA entry in an annotation dictionary. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional)] public const string AA = "/AA"; // ----- Additional entries to all fields containing variable text -------------------------- /// /// (Required; inheritable) A resource dictionary containing default resources /// (such as fonts, patterns, or color spaces) to be used by the appearance stream. /// At a minimum, this dictionary must contain a Font entry specifying the resource /// name and font dictionary of the default font for displaying the fields text. /// [KeyInfo(KeyType.Dictionary | KeyType.Required)] public const string DR = "/DR"; /// /// (Required; inheritable) The default appearance string, containing a sequence of /// valid page-content graphics or text state operators defining such properties as /// the fields text size and color. /// [KeyInfo(KeyType.String | KeyType.Required)] public const string DA = "/DA"; /// /// (Optional; inheritable) A code specifying the form of quadding (justification) /// to be used in displaying the text: /// 0 Left-justified /// 1 Centered /// 2 Right-justified /// Default value: 0 (left-justified). /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string Q = "/Q"; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/PdfRadioButtonField.cs0000644000175000001440000001031611435766646025677 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.AcroForms { /// /// Represents the radio button field. /// public sealed class PdfRadioButtonField : PdfButtonField { /// /// Initializes a new instance of PdfRadioButtonField. /// internal PdfRadioButtonField(PdfDocument document) : base(document) { this.document = document; } internal PdfRadioButtonField(PdfDictionary dict) : base(dict) { } /// /// Gets or sets the index of the selected radio button in a radio button group. /// public int SelectedIndex { get { string value = Elements.GetString(Keys.V); return IndexInOptStrings(value); } set { PdfArray opt = Elements[Keys.Opt] as PdfArray; if (opt != null) { int count = opt.Elements.Count; if (value < 0 || value >= count) throw new ArgumentOutOfRangeException("value"); Elements.SetName(Keys.V, opt.Elements[value].ToString()); } } } int IndexInOptStrings(string value) { PdfArray opt = Elements[Keys.Opt] as PdfArray; if (opt != null) { int count = opt.Elements.Count; for (int idx = 0; idx < count; idx++) { PdfItem item = opt.Elements[idx]; if (item is PdfString) { if (item.ToString() == value) return idx; } } } return -1; } /// /// Predefined keys of this dictionary. /// The description comes from PDF 1.4 Reference. /// public new class Keys : PdfButtonField.Keys { /// /// (Optional; inheritable; PDF 1.4) An array of text strings to be used in /// place of the V entries for the values of the widget annotations representing /// the individual radio buttons. Each element in the array represents /// the export value of the corresponding widget annotation in the /// Kids array of the radio button field. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string Opt = "/Opt"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get {return Keys.Meta;} } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/PdfGenericField.cs0000644000175000001440000000504311435766646025022 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.AcroForms { /// /// Represents a generic field. Used for AcroForm dictionaries unknown to PDFsharp. /// public sealed class PdfGenericField : PdfAcroField { /// /// Initializes a new instance of PdfGenericField. /// internal PdfGenericField(PdfDocument document) : base(document) { } internal PdfGenericField(PdfDictionary dict) : base(dict) { } /// /// Predefined keys of this dictionary. /// The description comes from PDF 1.4 Reference. /// public new class Keys : PdfAcroField.Keys { internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get {return Keys.Meta;} } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/PdfPushButtonField.cs0000644000175000001440000000504411435766646025562 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.AcroForms { /// /// Represents the push button field. /// public sealed class PdfPushButtonField : PdfButtonField { /// /// Initializes a new instance of PdfPushButtonField. /// internal PdfPushButtonField(PdfDocument document) : base(document) { this.document = document; } internal PdfPushButtonField(PdfDictionary dict) : base(dict) { } /// /// Predefined keys of this dictionary. /// The description comes from PDF 1.4 Reference. /// public new class Keys : PdfAcroField.Keys { internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get {return Keys.Meta;} } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/enums/0000777000175000001440000000000011533760020022625 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/enums/PdfAcroFieldFlags.cs0000644000175000001440000001377011435766646026444 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Pdf.AcroForms { /// /// Specifies the flags of AcroForm fields. /// public enum PdfAcroFieldFlags { // ----- Common to all fields ----------------------------------------------------------------- /// /// If set, the user may not change the value of the field. Any associated widget /// annotations will not interact with the user; that is, they will not respond to /// mouse clicks or change their appearance in response to mouse motions. This /// flag is useful for fields whose values are computed or imported from a database. /// ReadOnly = 1 << (1 - 1), /// /// If set, the field must have a value at the time it is exported by a submit-form action. /// Required = 1 << (2 - 1), /// /// If set, the field must not be exported by a submit-form action. /// NoExport = 1 << (3 - 1), // ----- Specific to button fields ------------------------------------------------------------ /// /// If set, the field is a pushbutton that does not retain a permanent value. /// Pushbutton = 1 << (17 - 1), /// /// If set, the field is a set of radio buttons; if clear, the field is a checkbox. /// This flag is meaningful only if the Pushbutton flag is clear. /// Radio = 1 << (16 - 1), /// /// (Radio buttons only) If set, exactly one radio button must be selected at all times; /// clicking the currently selected button has no effect. If clear, clicking /// the selected button deselects it, leaving no button selected. /// NoToggleToOff = 1 << (15 - 1), // ----- Specific to text fields -------------------------------------------------------------- /// /// If set, the field may contain multiple lines of text; if clear, the fields text /// is restricted to a single line. /// Multiline = 1 << (13 - 1), /// /// If set, the field is intended for entering a secure password that should /// not be echoed visibly to the screen. Characters typed from the keyboard /// should instead be echoed in some unreadable form, such as /// asterisks or bullet characters. /// To protect password confidentiality, viewer applications should never /// store the value of the text field in the PDF file if this flag is set. /// Password = 1 << (14 - 1), /// /// (PDF 1.4) If set, the text entered in the field represents the pathname of /// a file whose contents are to be submitted as the value of the field. /// FileSelect = 1 << (21 - 1), /// /// (PDF 1.4) If set, the text entered in the field will not be spell-checked. /// DoNotSpellCheckTextField = 1 << (23 - 1), /// /// (PDF 1.4) If set, the field will not scroll (horizontally for single-line /// fields, vertically for multiple-line fields) to accommodate more text /// than will fit within its annotation rectangle. Once the field is full, no /// further text will be accepted. /// DoNotScroll = 1 << (24 - 1), // ----- Specific to choice fields ------------------------------------------------------------ /// /// If set, the field is a combo box; if clear, the field is a list box. /// Combo = 1 << (18 - 1), /// /// If set, the combo box includes an editable text box as well as a drop list; /// if clear, it includes only a drop list. This flag is meaningful only if the /// Combo flag is set. /// Edit = 1 << (19 - 1), /// /// If set, the fields option items should be sorted alphabetically. This flag is /// intended for use by form authoring tools, not by PDF viewer applications; /// viewers should simply display the options in the order in which they occur /// in the Opt array. /// Sort = 1 << (20 - 1), /// /// (PDF 1.4) If set, more than one of the fields option items may be selected /// simultaneously; if clear, no more than one item at a time may be selected. /// MultiSelect = 1 << (22 - 1), /// /// (PDF 1.4) If set, the text entered in the field will not be spell-checked. /// This flag is meaningful only if the Combo and Edit flags are both set. /// DoNotSpellCheckChoiseField = 1 << (23 - 1), } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/PdfSignatureField.cs0000644000175000001440000001206411435766646025410 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.AcroForms { /// /// Represents the signature field. /// public sealed class PdfSignatureField : PdfAcroField { /// /// Initializes a new instance of PdfSignatureField. /// internal PdfSignatureField(PdfDocument document) : base(document) { } internal PdfSignatureField(PdfDictionary dict) : base(dict) { } /// /// Predefined keys of this dictionary. /// The description comes from PDF 1.4 Reference. /// public new class Keys : PdfAcroField.Keys { /// /// (Optional) The type of PDF object that this dictionary describes; if present, /// must be Sig for a signature dictionary. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string Type = "/Type"; /// /// (Required; inheritable) The name of the signature handler to be used for /// authenticating the fields contents, such as Adobe.PPKLite, Entrust.PPKEF, /// CICI.SignIt, or VeriSign.PPKVS. /// [KeyInfo(KeyType.Name | KeyType.Required)] public const string Filter = "/Filter"; /// /// (Optional) The name of a specific submethod of the specified handler. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string SubFilter = "/SubFilter"; /// /// (Required) An array of pairs of integers (starting byte offset, length in bytes) /// describing the exact byte range for the digest calculation. Multiple discontinuous /// byte ranges may be used to describe a digest that does not include the /// signature token itself. /// [KeyInfo(KeyType.Array | KeyType.Required)] public const string ByteRange = "/ByteRange"; /// /// (Required) The encrypted signature token. /// [KeyInfo(KeyType.String | KeyType.Required)] public const string Contents = "/Contents"; /// /// (Optional) The name of the person or authority signing the document. /// [KeyInfo(KeyType.TextString | KeyType.Optional)] public const string Name = "/Name"; /// /// (Optional) The time of signing. Depending on the signature handler, this /// may be a normal unverified computer time or a time generated in a verifiable /// way from a secure time server. /// [KeyInfo(KeyType.Date | KeyType.Optional)] public const string M = "/M"; /// /// (Optional) The CPU host name or physical location of the signing. /// [KeyInfo(KeyType.TextString| KeyType.Optional)] public const string Location = "/Location"; /// /// (Optional) The reason for the signing, such as (I agree). /// [KeyInfo(KeyType.TextString| KeyType.Optional)] public const string Reason = "/Reason"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get {return Keys.Meta;} } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/PdfTextField.cs0000644000175000001440000001427211435766646024376 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Drawing; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Annotations; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.AcroForms { /// /// Represents the text field. /// public sealed class PdfTextField : PdfAcroField { /// /// Initializes a new instance of PdfTextField. /// internal PdfTextField(PdfDocument document) : base(document) { } internal PdfTextField(PdfDictionary dict) : base(dict) { } /// /// Gets or sets the text value of the text field. /// public string Text { get { return Elements.GetString(Keys.V); } set { Elements.SetString(Keys.V, value); RenderAppearance(); } //HACK in PdfTextField } /// /// Gets or sets the font used to draw the text of the field. /// public XFont Font { get { return this.font; } set { this.font = value; } } XFont font = new XFont("Courier New", 10); /// /// Gets or sets the foreground color of the field. /// public XColor ForeColor { get { return this.foreColor; } set { this.foreColor = value; } } XColor foreColor = XColors.Black; /// /// Gets or sets the background color of the field. /// public XColor BackColor { get { return this.backColor; } set { this.backColor = value; } } XColor backColor = XColor.Empty; /// /// Gets or sets the maximum length of the field. /// /// The length of the max. public int MaxLength { get { return Elements.GetInteger(Keys.MaxLen); } set { Elements.SetInteger(Keys.MaxLen, value); } } /// /// Gets or sets a value indicating whether the field has multiple lines. /// public bool MultiLine { get { return (Flags & PdfAcroFieldFlags.Multiline) != 0; } set { if (value) SetFlags |= PdfAcroFieldFlags.Multiline; else SetFlags &= ~PdfAcroFieldFlags.Multiline; } } /// /// Gets or sets a value indicating whether this field is used for passwords. /// public bool Password { get { return (Flags & PdfAcroFieldFlags.Password) != 0; } set { if (value) SetFlags |= PdfAcroFieldFlags.Password; else SetFlags &= ~PdfAcroFieldFlags.Password; } } /// /// Creates the normal appearance form X object for the annotation that represents /// this acro form text field. /// void RenderAppearance() { PdfRectangle rect = Elements.GetRectangle(PdfAnnotation.Keys.Rect); XForm form = new XForm(this.document, rect.Size); XGraphics gfx = XGraphics.FromForm(form); if (backColor != XColor.Empty) gfx.DrawRectangle(new XSolidBrush(BackColor), rect.ToXRect() - rect.Location); string text = Text; if (text.Length > 0) gfx.DrawString(Text, Font, new XSolidBrush(ForeColor), rect.ToXRect() - rect.Location + new XPoint(2, 0), XStringFormats.TopLeft); form.DrawingFinished(); // Get existing or create new appearance dictionary PdfDictionary ap = Elements[PdfAnnotation.Keys.AP] as PdfDictionary; if (ap == null) { ap = new PdfDictionary(this.document); Elements[PdfAnnotation.Keys.AP] = ap; } // Set XRef to normal state ap.Elements["/N"] = form.PdfForm.Reference; } internal override void PrepareForSave() { base.PrepareForSave(); RenderAppearance(); } /// /// Predefined keys of this dictionary. /// The description comes from PDF 1.4 Reference. /// public new class Keys : PdfAcroField.Keys { /// /// (Optional; inheritable) The maximum length of the fields text, in characters. /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string MaxLen = "/MaxLen"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/PdfChoiceField.cs0000644000175000001440000001360411435766646024642 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.AcroForms { /// /// Represents the base class for all choice field dictionaries. /// public abstract class PdfChoiceField : PdfAcroField { /// /// Initializes a new instance of the class. /// protected PdfChoiceField(PdfDocument document) : base(document) { } /// /// Initializes a new instance of the class. /// protected PdfChoiceField(PdfDictionary dict) : base(dict) { } /// /// Gets the index of the specified string in the /Opt array or -1, if no such string exists. /// protected int IndexInOptArray(string value) { PdfArray opt = Elements[Keys.Opt] as PdfArray; if (opt != null) { int count = opt.Elements.Count; for (int idx = 0; idx < count; idx++) { PdfItem item = opt.Elements[idx]; if (item is PdfString) { if (item.ToString() == value) return idx; } else if (item is PdfArray) { PdfArray array = (PdfArray)item; if (array.Elements.Count != 0) { if (array.Elements[idx].ToString() == value) return idx; } } } } return -1; } /// /// Gets the value from the index in the /Opt array. /// protected string ValueInOptArray(int index) { PdfArray opt = Elements[Keys.Opt] as PdfArray; if (opt != null) { int count = opt.Elements.Count; if (index < 0 || index >= count) throw new ArgumentOutOfRangeException("index"); PdfItem item = opt.Elements[index]; if (item is PdfString) return item.ToString(); else if (item is PdfArray) { PdfArray array = (PdfArray)item; return array.Elements[0].ToString(); } } return ""; } /// /// Predefined keys of this dictionary. /// The description comes from PDF 1.4 Reference. /// public new class Keys : PdfAcroField.Keys { /// /// (Required; inheritable) An array of options to be presented to the user. Each element of /// the array is either a text string representing one of the available options or a two-element /// array consisting of a text string together with a default appearance string for constructing /// the items appearance dynamically at viewing time. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string Opt = "/Opt"; /// /// (Optional; inheritable) For scrollable list boxes, the top index (the index in the Opt array /// of the first option visible in the list). /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string TI = "/TI"; /// /// (Sometimes required, otherwise optional; inheritable; PDF 1.4) For choice fields that allow /// multiple selection (MultiSelect flag set), an array of integers, sorted in ascending order, /// representing the zero-based indices in the Opt array of the currently selected option /// items. This entry is required when two or more elements in the Opt array have different /// names but the same export value, or when the value of the choice field is an array; in /// other cases, it is permitted but not required. If the items identified by this entry differ /// from those in the V entry of the field dictionary (see below), the V entry takes precedence. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string I = "/I"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/PdfListBoxField.cs0000644000175000001440000000563711435766646025043 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.AcroForms { /// /// Represents the list box field. /// public sealed class PdfListBoxField : PdfChoiceField { /// /// Initializes a new instance of PdfListBoxField. /// internal PdfListBoxField(PdfDocument document) : base(document) { } internal PdfListBoxField(PdfDictionary dict) : base(dict) { } /// /// Gets or sets the index of the selected item /// public int SelectedIndex { get { string value = Elements.GetString(Keys.V); return IndexInOptArray(value); } set { string key = ValueInOptArray(value); Elements.SetString(Keys.V, key); } } /// /// Predefined keys of this dictionary. /// The description comes from PDF 1.4 Reference. /// public new class Keys : PdfAcroField.Keys { // List boxes have no additional entries. internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get {return Keys.Meta;} } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/PdfAcroForm.cs0000644000175000001440000001241111435766646024207 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.AcroForms { /// /// Represents a interactive form (or AcroForm), a collection of fields for /// gathering information interactively from the user. /// public sealed class PdfAcroForm : PdfDictionary { /// /// Initializes a new instance of AcroForm. /// internal PdfAcroForm(PdfDocument document) : base(document) { this.document = document; } internal PdfAcroForm(PdfDictionary dictionary) : base(dictionary) { } /// /// Gets the fields collection of this form. /// public PdfAcroField.PdfAcroFieldCollection Fields { get { if (this.fields == null) { object o = Elements.GetValue(Keys.Fields, VCF.CreateIndirect); this.fields = (PdfAcroField.PdfAcroFieldCollection)o; } return this.fields; } } PdfAcroField.PdfAcroFieldCollection fields; /// /// Predefined keys of this dictionary. /// The description comes from PDF 1.4 Reference. /// public sealed class Keys : KeysBase { /// /// (Required) An array of references to the documents root fields (those with /// no ancestors in the field hierarchy). /// [KeyInfo(KeyType.Array | KeyType.Required, typeof(PdfAcroField.PdfAcroFieldCollection))] public const string Fields = "/Fields"; /// /// (Optional) A flag specifying whether to construct appearance streams and /// appearance dictionaries for all widget annotations in the document. /// Default value: false. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string NeedAppearances = "/NeedAppearances"; /// /// (Optional; PDF 1.3) A set of flags specifying various document-level characteristics /// related to signature fields. /// Default value: 0. /// [KeyInfo("1.3", KeyType.Integer | KeyType.Optional)] public const string SigFlags = "/SigFlags"; /// /// (Required if any fields in the document have additional-actions dictionaries /// containing a C entry; PDF 1.3) An array of indirect references to field dictionaries /// with calculation actions, defining the calculation order in which their values will /// be recalculated when the value of any field changes. /// [KeyInfo(KeyType.Array)] public const string CO = "/CO"; /// /// (Optional) A document-wide default value for the DR attribute of variable text fields. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional)] public const string DR = "/DR"; /// /// (Optional) A document-wide default value for the DA attribute of variable text fields. /// [KeyInfo(KeyType.String | KeyType.Optional)] public const string DA = "/DA"; /// /// (Optional) A document-wide default value for the Q attribute of variable text fields. /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string Q = "/Q"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get {return Keys.Meta;} } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.AcroForms/PdfCheckBoxField.cs0000644000175000001440000000655311435766646025143 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf.Annotations; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.AcroForms { /// /// Represents the check box field. /// public sealed class PdfCheckBoxField : PdfButtonField { /// /// Initializes a new instance of PdfCheckBoxField. /// internal PdfCheckBoxField(PdfDocument document) : base(document) { this.document = document; } internal PdfCheckBoxField(PdfDictionary dict) : base(dict) { } /// /// Indicates whether the field is checked. /// public bool Checked { get { string value = Elements.GetString(Keys.V); return value.Length != 0 && value != "/Off"; } set { string name = value ? GetNonOffValue() : "/Off"; Elements.SetName(Keys.V, name); Elements.SetName(PdfAnnotation.Keys.AS, name); } } /// /// Predefined keys of this dictionary. /// The description comes from PDF 1.4 Reference. /// public new class Keys : PdfButtonField.Keys { /// /// (Optional; inheritable; PDF 1.4) A text string to be used in place of the V entry for the /// value of the field. /// [KeyInfo(KeyType.TextString | KeyType.Optional)] public const string Opt = "/Opt"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get {return Keys.Meta;} } } } pdfmod-0.9.1/lib/PdfSharp/Makefile.in0000644000175000001440000010415211533760015017435 0ustar00gabeusers00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.include subdir = lib/PdfSharp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibdir)" \ "$(DESTDIR)$(programfilesdir)" binSCRIPT_INSTALL = $(INSTALL_SCRIPT) pkglibSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) $(pkglib_SCRIPTS) SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; programfilesDATA_INSTALL = $(INSTALL_DATA) DATA = $(programfiles_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUNDLE_ASSEMBLIES = @BUNDLE_ASSEMBLIES@ BUNDLE_FILES = @BUNDLE_FILES@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GCONF_SHARP_20_CFLAGS = @GCONF_SHARP_20_CFLAGS@ GCONF_SHARP_20_LIBS = @GCONF_SHARP_20_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ HELP_DIR = @HELP_DIR@ HYENA_ASSEMBLIES = @HYENA_ASSEMBLIES@ HYENA_CFLAGS = @HYENA_CFLAGS@ HYENA_FILES = @HYENA_FILES@ HYENA_GUI_ASSEMBLIES = @HYENA_GUI_ASSEMBLIES@ HYENA_GUI_CFLAGS = @HYENA_GUI_CFLAGS@ HYENA_GUI_FILES = @HYENA_GUI_FILES@ HYENA_GUI_LIBS = @HYENA_GUI_LIBS@ HYENA_LIBS = @HYENA_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@ INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@ INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@ INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@ INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@ INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@ INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@ INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@ INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@ INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@ INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@ INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@ INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@ INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POPPLER_ASSEMBLIES = @POPPLER_ASSEMBLIES@ POPPLER_CFLAGS = @POPPLER_CFLAGS@ POPPLER_LIBS = @POPPLER_LIBS@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) # Warning: This is an automatically generated file, do not edit! @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_COMMAND = $(MCS) @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_COMMAND = $(MCS) @ENABLE_DEBUG_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug "-define:TRACE;GDI;UseGdiObjects" @ENABLE_RELEASE_TRUE@ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug "-define:TRACE;GDI;UseGdiObjects" @ENABLE_DEBUG_TRUE@ASSEMBLY = ../../bin/PdfSharp.dll @ENABLE_RELEASE_TRUE@ASSEMBLY = ../../bin/PdfSharp.dll @ENABLE_DEBUG_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_RELEASE_TRUE@ASSEMBLY_MDB = $(ASSEMBLY).mdb @ENABLE_DEBUG_TRUE@COMPILE_TARGET = library @ENABLE_RELEASE_TRUE@COMPILE_TARGET = library @ENABLE_DEBUG_TRUE@PROJECT_REFERENCES = @ENABLE_RELEASE_TRUE@PROJECT_REFERENCES = @ENABLE_DEBUG_TRUE@BUILD_DIR = ../../bin @ENABLE_RELEASE_TRUE@BUILD_DIR = ../../bin @ENABLE_DEBUG_TRUE@PDFSHARP_DLL_MDB_SOURCE = ../../bin/PdfSharp.dll.mdb @ENABLE_RELEASE_TRUE@PDFSHARP_DLL_MDB_SOURCE = ../../bin/PdfSharp.dll.mdb AL = al2 PROGRAMFILES = \ $(PDFSHARP_DLL_MDB) RESGEN = resgen2 FILES = \ !internal/Directives.cs \ !internal/TargetContext.cs \ PdfSharp.Drawing.BarCodes/BarCode.cs \ PdfSharp.Drawing.BarCodes/BarCodeRenderInfo.cs \ PdfSharp.Drawing.BarCodes/BcgSR.cs \ PdfSharp.Drawing.BarCodes/Code2of5Interleaved.cs \ PdfSharp.Drawing.BarCodes/Code3of9Standard.cs \ PdfSharp.Drawing.BarCodes/CodeBase.cs \ PdfSharp.Drawing.BarCodes/CodeDataMatrix.cs \ PdfSharp.Drawing.BarCodes/CodeOmr.cs \ PdfSharp.Drawing.BarCodes/DataMatrixImage.cs \ PdfSharp.Drawing.BarCodes/enums/AnchorType.cs \ PdfSharp.Drawing.BarCodes/enums/CodeDirection.cs \ PdfSharp.Drawing.BarCodes/enums/CodeType.cs \ PdfSharp.Drawing.BarCodes/enums/DataMatrixEncoding.cs \ PdfSharp.Drawing.BarCodes/enums/MarkDistance.cs \ PdfSharp.Drawing.BarCodes/enums/TextLocation.cs \ PdfSharp.Drawing.BarCodes/MatrixCode.cs \ PdfSharp.Drawing.BarCodes/OmrData.cs \ PdfSharp.Drawing.BarCodes/ThickThinBarcodeRenderer.cs \ PdfSharp.Drawing/enums/PathStart.cs \ PdfSharp.Drawing/enums/XColorSpace.cs \ PdfSharp.Drawing/enums/XCombineMode.cs \ PdfSharp.Drawing/enums/XDashStyle.cs \ PdfSharp.Drawing/enums/XFillMode.cs \ PdfSharp.Drawing/enums/XFontStyle.cs \ PdfSharp.Drawing/enums/XGraphicRenderTarget.cs \ PdfSharp.Drawing/enums/XGraphicsPathItemType.cs \ PdfSharp.Drawing/enums/XGraphicsPdfPageOptions.cs \ PdfSharp.Drawing/enums/XGraphicsUnit.cs \ PdfSharp.Drawing/enums/XKnownColor.cs \ PdfSharp.Drawing/enums/XLineAlignment.cs \ PdfSharp.Drawing/enums/XLinearGradientMode.cs \ PdfSharp.Drawing/enums/XLineCap.cs \ PdfSharp.Drawing/enums/XLineJoin.cs \ PdfSharp.Drawing/enums/XMatrixOrder.cs \ PdfSharp.Drawing/enums/XPageDirection.cs \ PdfSharp.Drawing/enums/XSmoothingMode.cs \ PdfSharp.Drawing/enums/XStringAlignment.cs \ PdfSharp.Drawing/FontHelper.cs \ PdfSharp.Drawing/GeometryHelper.cs \ PdfSharp.Drawing/GraphicsStateStack.cs \ PdfSharp.Drawing/ImageHelper.cs \ PdfSharp.Drawing/InternalGraphicsState.cs \ PdfSharp.Drawing/IXGraphicsRenderer.cs \ PdfSharp.Drawing.Layout/enums/XParagraphAlignment.cs \ PdfSharp.Drawing.Layout/XTextFormatter.cs \ PdfSharp.Drawing.Pdf/enums/DirtyFlags.cs \ PdfSharp.Drawing.Pdf/enums/StreamMode.cs \ PdfSharp.Drawing/PdfFontOptions.cs \ PdfSharp.Drawing.Pdf/PdfGraphicsState.cs \ PdfSharp.Drawing.Pdf/XGraphicsPdfRenderer.cs \ PdfSharp.Drawing.Rtf/XGraphicsRtfRenderer.cs \ PdfSharp.Drawing.Shapes/Shape.cs \ PdfSharp.Drawing/XBrush.cs \ PdfSharp.Drawing/XBrushes.cs \ PdfSharp.Drawing/XColor.cs \ PdfSharp.Drawing/XColorResourceManager.cs \ PdfSharp.Drawing/XColors.cs \ PdfSharp.Drawing/XConvert.cs \ PdfSharp.Drawing/XFont.cs \ PdfSharp.Drawing/XFontFamily.cs \ PdfSharp.Drawing/XFontMetrics.cs \ PdfSharp.Drawing/XFontStretch.cs \ PdfSharp.Drawing/XFontWeight.cs \ PdfSharp.Drawing/XFontWeights.cs \ PdfSharp.Drawing/XForm.cs \ PdfSharp.Drawing/XGlyphTypeface.cs \ PdfSharp.Drawing/XGraphicsContainer.cs \ PdfSharp.Drawing/XGraphics.cs \ PdfSharp.Drawing/XGraphicsPath.cs \ PdfSharp.Drawing/XGraphicsPathInternals.cs \ PdfSharp.Drawing/XGraphicsPathItem.cs \ PdfSharp.Drawing/XGraphicsState.cs \ PdfSharp.Drawing/XImage.cs \ PdfSharp.Drawing/XImageFormat.cs \ PdfSharp.Drawing/XKnownColorTable.cs \ PdfSharp.Drawing/XLinearGradientBrush.cs \ PdfSharp.Drawing/XMatrix.cs \ PdfSharp.Drawing/XPdfForm.cs \ PdfSharp.Drawing/XPen.cs \ PdfSharp.Drawing/XPens.cs \ PdfSharp.Drawing/XPoint.cs \ PdfSharp.Drawing/XPrivateFontCollection.cs \ PdfSharp.Drawing/XRect.cs \ PdfSharp.Drawing/XSize.cs \ PdfSharp.Drawing/XSolidBrush.cs \ PdfSharp.Drawing/XStringFormat.cs \ PdfSharp.Drawing/XStringFormats.cs \ PdfSharp.Drawing/XTypeFace.cs \ PdfSharp.Drawing/XUnit.cs \ PdfSharp.Drawing/XVector.cs \ PdfSharp/enums/PageOrientation.cs \ PdfSharp/enums/PageSize.cs \ PdfSharp/enums/PSMsgID.cs \ PdfSharp.Fonts/AdobeGlyphList20.cs \ PdfSharp.Fonts/AdobeGlyphListForNewFonts.cs \ PdfSharp.Fonts/CMapInfo.cs \ PdfSharp.Fonts/FontDescriptor.cs \ PdfSharp.Fonts/FontDescriptorStock.cs \ PdfSharp.Fonts/FontWriter.cs \ PdfSharp.Fonts.OpenType/enums/FontTechnology.cs \ PdfSharp.Fonts.OpenType/enums/TableTag.cs \ PdfSharp.Fonts.OpenType/enums/TableTagNames.cs \ PdfSharp.Fonts.OpenType/ExternalHelper.cs \ PdfSharp.Fonts.OpenType/FontData.cs \ PdfSharp.Fonts.OpenType/FontDataStock.cs \ PdfSharp.Fonts.OpenType/GenericFontTable.cs \ PdfSharp.Fonts.OpenType/GlyphDataTable.cs \ PdfSharp.Fonts.OpenType/IndexToLocationTable.cs \ PdfSharp.Fonts.OpenType/IRefFontTable.cs \ PdfSharp.Fonts.OpenType/OpenTypeDescriptor.cs \ PdfSharp.Fonts.OpenType/OpenTypeFontTable.cs \ PdfSharp.Fonts.OpenType/OpenTypeFontWriter.cs \ PdfSharp.Fonts.OpenType/OpenTypeStructures.cs \ PdfSharp.Fonts.OpenType/TableDirectoryEntry.cs \ PdfSharp.Internal/Calc.cs \ PdfSharp.Internal/ColorHelper.cs \ PdfSharp.Internal/DoubleUtil.cs \ PdfSharp.Internal/NativeMethods.cs \ PdfSharp.Internal/TokenizerHelper.cs \ PdfSharp/PageSizeConverter.cs \ PdfSharp.Pdf.AcroForms/enums/PdfAcroFieldFlags.cs \ PdfSharp.Pdf.AcroForms/PdfAcroField.cs \ PdfSharp.Pdf.AcroForms/PdfAcroForm.cs \ PdfSharp.Pdf.AcroForms/PdfButtonField.cs \ PdfSharp.Pdf.AcroForms/PdfCheckBoxField.cs \ PdfSharp.Pdf.AcroForms/PdfChoiceField.cs \ PdfSharp.Pdf.AcroForms/PdfChoiseField.cs \ PdfSharp.Pdf.AcroForms/PdfComboBoxField.cs \ PdfSharp.Pdf.AcroForms/PdfGenericField.cs \ PdfSharp.Pdf.AcroForms/PdfListBoxField.cs \ PdfSharp.Pdf.AcroForms/PdfPushButtonField.cs \ PdfSharp.Pdf.AcroForms/PdfRadioButtonField.cs \ PdfSharp.Pdf.AcroForms/PdfSignatureField.cs \ PdfSharp.Pdf.AcroForms/PdfTextField.cs \ PdfSharp.Pdf.Actions/enums/PdfNamedActionNames.cs \ PdfSharp.Pdf.Actions/PdfAction.cs \ PdfSharp.Pdf.Advanced/IContentStream.cs \ PdfSharp.Pdf.Advanced/PdfCatalog.cs \ PdfSharp.Pdf.Advanced/PdfCIDFont.cs \ PdfSharp.Pdf.Advanced/PdfContent.cs \ PdfSharp.Pdf.Advanced/PdfContents.cs \ PdfSharp.Pdf.Advanced/PdfDictionaryWithContentStream.cs \ PdfSharp.Pdf.Advanced/PdfExtGState.cs \ PdfSharp.Pdf.Advanced/PdfExtGStateTable.cs \ PdfSharp.Pdf.Advanced/PdfFont.cs \ PdfSharp.Pdf.Advanced/PdfFontDescriptor.cs \ PdfSharp.Pdf.Advanced/PdfFontTable.cs \ PdfSharp.Pdf.Advanced/PdfFormXObject.cs \ PdfSharp.Pdf.Advanced/PdfFormXObjectTable.cs \ PdfSharp.Pdf.Advanced/PdfGroupAttributes.cs \ PdfSharp.Pdf.Advanced/PdfImage.cs \ PdfSharp.Pdf.Advanced/PdfImage.FaxEncode.cs \ PdfSharp.Pdf.Advanced/PdfImageTable.cs \ PdfSharp.Pdf.Advanced/PdfImportedObjectTable.cs \ PdfSharp.Pdf.Advanced/PdfInternals.cs \ PdfSharp.Pdf.Advanced/PdfObjectInternals.cs \ PdfSharp.Pdf.Advanced/PdfPageInheritableObjects.cs \ PdfSharp.Pdf.Advanced/PdfReference.cs \ PdfSharp.Pdf.Advanced/PdfResourceMap.cs \ PdfSharp.Pdf.Advanced/PdfResources.cs \ PdfSharp.Pdf.Advanced/PdfResourceTable.cs \ PdfSharp.Pdf.Advanced/PdfShading.cs \ PdfSharp.Pdf.Advanced/PdfShadingPattern.cs \ PdfSharp.Pdf.Advanced/PdfShadingTable.cs \ PdfSharp.Pdf.Advanced/PdfSoftMask.cs \ PdfSharp.Pdf.Advanced/PdfTilingPattern.cs \ PdfSharp.Pdf.Advanced/PdfToUnicodeMap.cs \ PdfSharp.Pdf.Advanced/PdfTrailer.cs \ PdfSharp.Pdf.Advanced/PdfTransparencyGroupAttributes.cs \ PdfSharp.Pdf.Advanced/PdfTrueTypeFont.cs \ PdfSharp.Pdf.Advanced/PdfType0Font.cs \ PdfSharp.Pdf.Advanced/PdfType1Font.cs \ PdfSharp.Pdf.Advanced/PdfXObject.cs \ PdfSharp.Pdf.Annotations/enums/PdfAnnotationFlags.cs \ PdfSharp.Pdf.Annotations/enums/PdfRubberStampAnnotationIcon.cs \ PdfSharp.Pdf.Annotations/enums/PdfTextAnnotationIcon.cs \ PdfSharp.Pdf.Annotations/PdfAnnotation.cs \ PdfSharp.Pdf.Annotations/PdfAnnotations.cs \ PdfSharp.Pdf.Annotations/PdfGenericAnnotation.cs \ PdfSharp.Pdf.Annotations/PdfLinkAnnotation.cs \ PdfSharp.Pdf.Annotations/PdfRubberStampAnnotation.cs \ PdfSharp.Pdf.Annotations/PdfTextAnnotation.cs \ PdfSharp.Pdf.Annotations/PdfWidgetAnnotation.cs \ PdfSharp.Pdf.Content/Chars.cs \ PdfSharp.Pdf.Content/CLexer.cs \ PdfSharp.Pdf.Content/ContentReader.cs \ PdfSharp.Pdf.Content/ContentReaderException.cs \ PdfSharp.Pdf.Content/ContentWriter.cs \ PdfSharp.Pdf.Content/CParser.cs \ PdfSharp.Pdf.Content/enums/Symbol.cs \ PdfSharp.Pdf.Content.Objects/CObjects.cs \ PdfSharp.Pdf.Content.Objects/enum/OpCodeFlags.cs \ PdfSharp.Pdf.Content.Objects/enum/OpCodeName.cs \ PdfSharp.Pdf.Content.Objects/Operators.cs \ PdfSharp.Pdf/EntryInfoAttribute.cs \ PdfSharp.Pdf/enums/DocumentState.cs \ PdfSharp.Pdf/enums/PdfColorMode.cs \ PdfSharp.Pdf/enums/PdfCustomValueCompression.cs \ PdfSharp.Pdf/enums/PdfFontEmbedding.cs \ PdfSharp.Pdf/enums/PdfFontEncoding.cs \ PdfSharp.Pdf/enums/PdfOutlineStyle.cs \ PdfSharp.Pdf/enums/PdfPageLayout.cs \ PdfSharp.Pdf/enums/PdfPageMode.cs \ PdfSharp.Pdf/enums/PdfReadingDirection.cs \ PdfSharp.Pdf/enums/PdfTextStringEncoding.cs \ PdfSharp.Pdf.Filters/ASCII85Decode.cs \ PdfSharp.Pdf.Filters/ASCIIHexDecode.cs \ PdfSharp.Pdf.Filters/Filter.cs \ PdfSharp.Pdf.Filters/Filtering.cs \ PdfSharp.Pdf.Filters/FlateDecode.cs \ PdfSharp.Pdf.Filters/LzwDecode.cs \ PdfSharp.Pdf.Internal/AnsiEncoding.cs \ PdfSharp.Pdf.Internal/ColorSpaceHelper.cs \ PdfSharp.Pdf.Internal/DocEncoding.cs \ PdfSharp.Pdf.Internal/GlobalObjectTable.cs \ PdfSharp.Pdf.Internal/PdfEncoders.cs \ PdfSharp.Pdf.Internal/RawEncoding.cs \ PdfSharp.Pdf.Internal/RawUnicodeEncoding.cs \ PdfSharp.Pdf.Internal/ThreadLocalStorage.cs \ PdfSharp.Pdf.IO/Chars.cs \ PdfSharp.Pdf.IO/enums/PasswordValidity.cs \ PdfSharp.Pdf.IO/enums/PdfDocumentOpenMode.cs \ PdfSharp.Pdf.IO/enums/PdfWriterLayout.cs \ PdfSharp.Pdf.IO/enums/PdfWriterOptions.cs \ PdfSharp.Pdf.IO/enums/Symbol.cs \ PdfSharp.Pdf.IO/Lexer.cs \ PdfSharp.Pdf.IO/Parser.cs \ PdfSharp.Pdf.IO/PdfReader.cs \ PdfSharp.Pdf.IO/PdfReaderException.cs \ PdfSharp.Pdf.IO/PdfWriter.cs \ PdfSharp.Pdf.IO/ShiftStack.cs \ PdfSharp.Pdf/KeysBase.cs \ PdfSharp.Pdf/KeysMeta.cs \ PdfSharp.Pdf/PdfArray.cs \ PdfSharp.Pdf/PdfBoolean.cs \ PdfSharp.Pdf/PdfBooleanObject.cs \ PdfSharp.Pdf/PdfCustomValue.cs \ PdfSharp.Pdf/PdfCustomValues.cs \ PdfSharp.Pdf/PdfDate.cs \ PdfSharp.Pdf/PdfDictionary.cs \ PdfSharp.Pdf/PdfDocument.cs \ PdfSharp.Pdf/PdfDocumentInformation.cs \ PdfSharp.Pdf/PdfDocumentOptions.cs \ PdfSharp.Pdf/PdfDocumentSettings.cs \ PdfSharp.Pdf/PdfInteger.cs \ PdfSharp.Pdf/PdfIntegerObject.cs \ PdfSharp.Pdf/PdfItem.cs \ PdfSharp.Pdf/PdfLiteral.cs \ PdfSharp.Pdf/PdfName.cs \ PdfSharp.Pdf/PdfNameObject.cs \ PdfSharp.Pdf/PdfNull.cs \ PdfSharp.Pdf/PdfNullObject.cs \ PdfSharp.Pdf/PdfNumber.cs \ PdfSharp.Pdf/PdfNumberObject.cs \ PdfSharp.Pdf/PdfObject.cs \ PdfSharp.Pdf/PdfObjectID.cs \ PdfSharp.Pdf/PdfOutline.cs \ PdfSharp.Pdf/PdfPage.cs \ PdfSharp.Pdf/PdfPages.cs \ PdfSharp.Pdf/PdfReal.cs \ PdfSharp.Pdf/PdfRealObject.cs \ PdfSharp.Pdf/PdfRectangle.cs \ PdfSharp.Pdf/PdfReferenceTable.cs \ PdfSharp.Pdf/PdfString.cs \ PdfSharp.Pdf/PdfStringObject.cs \ PdfSharp.Pdf/PdfUInteger.cs \ PdfSharp.Pdf/PdfUIntegerObject.cs \ PdfSharp.Pdf/PdfViewerPreferences.cs \ PdfSharp.Pdf.Printing/PdfFilePrinter.cs \ PdfSharp.Pdf.Security/enums/PdfDocumentSecurity.cs \ PdfSharp.Pdf.Security/enums/PdfUserAccessPermission.cs \ PdfSharp.Pdf.Security/PdfSecurityHandler.cs \ PdfSharp.Pdf.Security/PdfSecuritySettings.cs \ PdfSharp.Pdf.Security/PdfStandardSecurityHandler.cs \ PdfSharp/PdfSharpException.cs \ PdfSharp.Pdf/TrimMargins.cs \ PdfSharp/ProductVersionInfo.cs \ PdfSharp/PSSR.cs \ PdfSharp.SharpZipLib/Checksums/Adler32.cs \ PdfSharp.SharpZipLib/Checksums/CRC32.cs \ PdfSharp.SharpZipLib/Checksums/IChecksum.cs \ PdfSharp.SharpZipLib/SharpZip/SharpZipBaseException.cs \ PdfSharp.SharpZipLib/Zip/Compression/DeflaterConstants.cs \ PdfSharp.SharpZipLib/Zip/Compression/Deflater.cs \ PdfSharp.SharpZipLib/Zip/Compression/DeflaterEngine.cs \ PdfSharp.SharpZipLib/Zip/Compression/DeflaterHuffman.cs \ PdfSharp.SharpZipLib/Zip/Compression/DeflaterPending.cs \ PdfSharp.SharpZipLib/Zip/Compression/Inflater.cs \ PdfSharp.SharpZipLib/Zip/Compression/InflaterDynHeader.cs \ PdfSharp.SharpZipLib/Zip/Compression/InflaterHuffmanTree.cs \ PdfSharp.SharpZipLib/Zip/Compression/PendingBuffer.cs \ PdfSharp.SharpZipLib/Zip/Compression/Streams/DeflaterOutputStream.cs \ PdfSharp.SharpZipLib/Zip/Compression/Streams/InflaterInputStream.cs \ PdfSharp.SharpZipLib/Zip/Compression/Streams/OutputWindow.cs \ PdfSharp.SharpZipLib/Zip/Compression/Streams/StreamManipulator.cs \ PdfSharp/VersionInfo.cs \ PdfSharp.Windows/enums/RenderMode.cs \ PdfSharp.Windows/enums/Zoom.cs \ Properties/AssemblyInfo.cs DATA_FILES = RESOURCES = EXTRAS = REFERENCES = \ System \ System.Core \ System.Data \ System.Drawing \ System.Xml DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) \ $(build_resx_resources) $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q = $(subst \ ,?,$1) q2s = $(subst ?,\ ,$1) # use this when result will be quoted unesc2 = $(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc = $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed = $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC = $(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target = $(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets = $(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) DLL_REFERENCES_EXPANDED = $(foreach reference, $(DLL_REFERENCES), $(addprefix $(srcdir)/, $(reference))) build_references_ref = $(call q2s,$(foreach ref, $(call \ s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), \ $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) $(call \ q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES_EXPANDED)), \ -r:$(ref))) $(call q2s,$(foreach ref, $(call \ s2q,$(PROJECT_REFERENCES)), -r:$(ref))) s2q2s = $(call unesc2,$(call s2q,$1)) cp_actual = test -z $1 || cp $1 $2 cp = $(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual = test -z '$1' || rm -f '$2' rm = $(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* pkglib_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) PDFSHARP_DLL_MDB = $(BUILD_DIR)/PdfSharp.dll.mdb all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/PdfSharp/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/PdfSharp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done install-pkglibSCRIPTS: $(pkglib_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(pkglibSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(pkglibSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ else :; fi; \ done uninstall-pkglibSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkglib_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) test -z "$(programfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" @list='$(programfiles_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(programfilesDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(programfilesdir)/$$f'"; \ $(programfilesDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(programfilesdir)/$$f"; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(programfilesdir)/$$f'"; \ rm -f "$(DESTDIR)$(programfilesdir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(programfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-programfilesDATA install-dvi: install-dvi-am install-exec-am: install-binSCRIPTS install-pkglibSCRIPTS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-pkglibSCRIPTS \ uninstall-programfilesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibSCRIPTS install-programfilesDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-binSCRIPTS uninstall-pkglibSCRIPTS \ uninstall-programfilesDATA all: $(ASSEMBLY) $(PROGRAMFILES) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pdfmod-0.9.1/lib/PdfSharp/README0000644000175000001440000000024411240370571016244 0ustar00gabeusers00000000000000PDFSharp is a MIT/X11 licensed project. This is the source for one assembly from the project, PdfSharp.dll. More info at http://sourceforge.net/projects/pdfsharp pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/0000777000175000001440000000000011533760020021310 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfShadingPattern.cs0000644000175000001440000001177111435766646025234 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; #if GDI using System.Drawing; using System.Drawing.Imaging; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; using PdfSharp.Internal; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Represents a shading pattern dictionary. /// public sealed class PdfShadingPattern : PdfDictionaryWithContentStream { /// /// Initializes a new instance of the class. /// public PdfShadingPattern(PdfDocument document) : base(document) { Elements.SetName(Keys.Type, "/Pattern"); Elements[Keys.PatternType] = new PdfInteger(2); } /// /// Setups the shading pattern from the specified brush. /// public void SetupFromBrush(XLinearGradientBrush brush, XMatrix matrix) { if (brush == null) throw new ArgumentNullException("brush"); PdfShading shading = new PdfShading(this.document); shading.SetupFromBrush(brush); Elements[Keys.Shading] = shading; //Elements[Keys.Matrix] = new PdfLiteral("[" + PdfEncoders.ToString(matrix) + "]"); Elements.SetMatrix(Keys.Matrix, matrix); } /// /// Common keys for all streams. /// internal sealed new class Keys : PdfDictionaryWithContentStream.Keys { /// /// (Optional) The type of PDF object that this dictionary describes; if present, /// must be Pattern for a pattern dictionary. /// [KeyInfo(KeyType.Name | KeyType.Required)] public const string Type = "/Type"; /// /// (Required) A code identifying the type of pattern that this dictionary describes; /// must be 2 for a shading pattern. /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string PatternType = "/PatternType"; /// /// (Required) A shading object (see below) defining the shading patterns gradient fill. /// [KeyInfo(KeyType.Dictionary | KeyType.Required)] public const string Shading = "/Shading"; /// /// (Optional) An array of six numbers specifying the pattern matrix. /// Default value: the identity matrix [1 0 0 1 0 0]. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string Matrix = "/Matrix"; /// /// (Optional) A graphics state parameter dictionary containing graphics state parameters /// to be put into effect temporarily while the shading pattern is painted. Any parameters /// that are not so specified are inherited from the graphics state that was in effect /// at the beginning of the content stream in which the pattern is defined as a resource. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional)] public const string ExtGState = "/ExtGState"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfTransparencyGroupAttributes.cs0000644000175000001440000001534011435766646030052 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; #if GDI using System.Drawing; using System.Drawing.Imaging; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; using PdfSharp.Internal; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Represents a PDF transparency group XObject. /// public sealed class PdfTransparencyGroupAttributes : PdfGroupAttributes { internal PdfTransparencyGroupAttributes(PdfDocument thisDocument) : base(thisDocument) { Elements.SetName(Keys.S, "/Transparency"); } /// /// Predefined keys of this dictionary. /// public sealed new class Keys : PdfGroupAttributes.Keys { /// /// (Sometimes required, as discussed below) /// The group color space, which is used for the following purposes: /// As the color space into which colors are converted when painted into the group /// As the blending color space in which objects are composited within the group /// As the color space of the group as a whole when it in turn is painted as an object onto its backdrop /// The group color space may be any device or CIE-based color space that /// treats its components as independent additive or subtractive values in the /// range 0.0 to 1.0, subject to the restrictions described in Section 7.2.3, Blending Color Space. /// These restrictions exclude Lab and lightness-chromaticity ICCBased color spaces, /// as well as the special color spaces Pattern, Indexed, Separation, and DeviceN. /// Device color spaces are subject to remapping according to the DefaultGray, /// DefaultRGB, and DefaultCMYK entries in the ColorSpace subdictionary of the /// current resource dictionary. /// Ordinarily, the CS entry is allowed only for isolated transparency groups /// (those for which I, below, is true), and even then it is optional. However, /// this entry is required in the group attributes dictionary for any transparency /// group XObject that has no parent group or page from which to inherit in /// particular, one that is the value of the G entry in a soft-mask dictionary of /// subtype Luminosity. /// In addition, it is always permissible to specify CS in the group attributes /// dictionary associated with a page object, even if I is false or absent. In the /// normal case in which the page is imposed directly on the output medium, /// the page group is effectively isolated regardless of the I value, and the /// specified CS value is therefore honored. But if the page is in turn used as an /// element of some other page and if the group is non-isolated, CS is ignored /// and the color space is inherited from the actual backdrop with which the /// page is composited. /// Default value: the color space of the parent group or page into which this /// transparency group is painted. (The parents color space in turn can be /// either explicitly specified or inherited.) /// [KeyInfo(KeyType.NameOrArray | KeyType.Optional)] public const string CS = "/CS"; /// /// (Optional) A flag specifying whether the transparency group is isolated. /// If this flag is true, objects within the group are composited against a fully /// transparent initial backdrop; if false, they are composited against the /// groups backdrop. /// Default value: false. /// In the group attributes dictionary for a page, the interpretation of this /// entry is slightly altered. In the normal case in which the page is imposed /// directly on the output medium, the page group is effectively isolated and /// the specified I value is ignored. But if the page is in turn used as an /// element of some other page, it is treated as if it were a transparency /// group XObject; the I value is interpreted in the normal way to determine /// whether the page group is isolated. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string I = "/I"; /// /// (Optional) A flag specifying whether the transparency group is a knockout /// group. If this flag is false, later objects within the group are composited /// with earlier ones with which they overlap; if true, they are composited with /// the groups initial backdrop and overwrite (knock out) any earlier /// overlapping objects. /// Default value: false. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string K = "/K"; /// /// Gets the KeysMeta for these keys. /// internal static new DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/IContentStream.cs0000644000175000001440000000345311435766646024564 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Text; using System.IO; using PdfSharp.Drawing; namespace PdfSharp.Pdf.Advanced { internal interface IContentStream { PdfResources Resources { get; } string GetFontName(XFont font, out PdfFont pdfFont); string GetFontName(string idName, byte[] fontData, out PdfFont pdfFont); string GetImageName(XImage image); string GetFormName(XForm form); } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfFormXObject.cs0000644000175000001440000004203111435766646024474 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; #if GDI using System.Drawing; using System.Drawing.Imaging; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; using PdfSharp.Internal; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Represents an external form object (e.g. an imported page). /// public sealed class PdfFormXObject : PdfXObject, IContentStream { internal PdfFormXObject(PdfDocument thisDocument) : base(thisDocument) { Elements.SetName(Keys.Type, "/XObject"); Elements.SetName(Keys.Subtype, "/Form"); } internal PdfFormXObject(PdfDocument thisDocument, XForm form) : base(thisDocument) { // BUG: form is not used Elements.SetName(Keys.Type, "/XObject"); Elements.SetName(Keys.Subtype, "/Form"); //if (form.IsTemplate) //{ } } internal double DpiX { get { return this.dpiX; } set { this.dpiX = value; } } double dpiX = 72; internal double DpiY { get { return this.dpiY; } set { this.dpiY = value; } } double dpiY = 72; internal PdfFormXObject(PdfDocument thisDocument, PdfImportedObjectTable importedObjectTable, XPdfForm form) : base(thisDocument) { Debug.Assert(Object.ReferenceEquals(thisDocument, importedObjectTable.Owner)); Elements.SetName(Keys.Type, "/XObject"); Elements.SetName(Keys.Subtype, "/Form"); if (form.IsTemplate) { Debug.Assert(importedObjectTable == null); // TODO more initialization here??? return; } Debug.Assert(importedObjectTable != null); XPdfForm pdfForm = (XPdfForm)form; // Get import page PdfPages importPages = importedObjectTable.ExternalDocument.Pages; if (pdfForm.PageNumber < 1 || pdfForm.PageNumber > importPages.Count) PSSR.ImportPageNumberOutOfRange(pdfForm.PageNumber, importPages.Count, form.path); PdfPage importPage = importPages[pdfForm.PageNumber - 1]; // Import resources PdfItem res = importPage.Elements["/Resources"]; if (res != null) // unlikely but possible { #if true // Get root object PdfObject root; if (res is PdfReference) root = ((PdfReference)res).Value; else root = (PdfDictionary)res; root = ImportClosure(importedObjectTable, thisDocument, root); // If the root was a direct object, make it indirect. if (root.Reference == null) thisDocument.irefTable.Add(root); Debug.Assert(root.Reference != null); Elements["/Resources"] = root.Reference; #else // Get transitive closure PdfObject[] resources = importPage.Owner.Internals.GetClosure(resourcesRoot); int count = resources.Length; #if DEBUG_ for (int idx = 0; idx < count; idx++) { Debug.Assert(resources[idx].XRef != null); Debug.Assert(resources[idx].XRef.Document != null); Debug.Assert(resources[idx].Document != null); if (resources[idx].ObjectID.ObjectNumber == 12) GetType(); } #endif // 1st step. Already imported objects are reused and new ones are cloned. for (int idx = 0; idx < count; idx++) { PdfObject obj = resources[idx]; if (importedObjectTable.Contains(obj.ObjectID)) { // external object was already imported PdfReference iref = importedObjectTable[obj.ObjectID]; Debug.Assert(iref != null); Debug.Assert(iref.Value != null); Debug.Assert(iref.Document == this.Owner); // replace external object by the already clone counterpart resources[idx] = iref.Value; } else { // External object was not imported ealier and must be cloned PdfObject clone = obj.Clone(); Debug.Assert(clone.Reference == null); clone.Document = this.Owner; if (obj.Reference != null) { // add it to this (the importer) document this.Owner.irefTable.Add(clone); Debug.Assert(clone.Reference != null); // save old object identifier importedObjectTable.Add(obj.ObjectID, clone.Reference); //Debug.WriteLine("Cloned: " + obj.ObjectID.ToString()); } else { // The root object (the /Resources value) is not an indirect object Debug.Assert(idx == 0); // add it to this (the importer) document this.Owner.irefTable.Add(clone); Debug.Assert(clone.Reference != null); } // replace external object by its clone resources[idx] = clone; } } #if DEBUG_ for (int idx = 0; idx < count; idx++) { Debug.Assert(resources[idx].XRef != null); Debug.Assert(resources[idx].XRef.Document != null); Debug.Assert(resources[idx].Document != null); if (resources[idx].ObjectID.ObjectNumber == 12) GetType(); } #endif // 2nd step. Fix up indirect references that still refers to the import document. for (int idx = 0; idx < count; idx++) { PdfObject obj = resources[idx]; Debug.Assert(obj.Owner != null); FixUpObject(importedObjectTable, importedObjectTable.Owner, obj); } // Set resources key to the root of the clones Elements["/Resources"] = resources[0].Reference; #endif } // Take /Rotate into account PdfRectangle rect = importPage.Elements.GetRectangle(PdfPage.Keys.MediaBox); int rotate = importPage.Elements.GetInteger(PdfPage.Keys.Rotate); //rotate = 0; if (rotate == 0) { // Set bounding box to media box this.Elements["/BBox"] = rect; } else { // TODO: Have to adjust bounding box? (I think not, but I'm not sure -> wait for problem) this.Elements["/BBox"] = rect; // Rotate the image such that it is upright XMatrix matrix = new XMatrix(); //XMatrix.Identity; double width = rect.Width; double height = rect.Height; matrix.RotateAtPrepend(-rotate, new XPoint(width / 2, height / 2)); // Translate the image such that its center lies on the center of the rotated bounding box double offset = (height - width) / 2; if (height > width) matrix.TranslatePrepend(offset, offset); else matrix.TranslatePrepend(-offset, -offset); //string item = "[" + PdfEncoders.ToString(matrix) + "]"; //Elements[Keys.Matrix] = new PdfLiteral(item); Elements.SetMatrix(Keys.Matrix, matrix); } // Preserve filter because the content keeps unmodified PdfContent content = importPage.Contents.CreateSingleContent(); #if !DEBUG content.Compressed = true; #endif PdfItem filter = content.Elements["/Filter"]; if (filter != null) this.Elements["/Filter"] = filter.Clone(); // (no cloning needed because the bytes keep untouched) this.Stream = content.Stream; // new PdfStream(bytes, this); Elements.SetInteger("/Length", content.Stream.Value.Length); } internal PdfResources Resources { get { if (this.resources == null) this.resources = (PdfResources)Elements.GetValue(PdfFormXObject.Keys.Resources, VCF.Create); return this.resources; } } PdfResources resources; PdfResources IContentStream.Resources { get { return Resources; } } internal string GetFontName(XFont font, out PdfFont pdfFont) { pdfFont = this.document.FontTable.GetFont(font); Debug.Assert(pdfFont != null); string name = Resources.AddFont(pdfFont); return name; } string IContentStream.GetFontName(XFont font, out PdfFont pdfFont) { return GetFontName(font, out pdfFont); } /// /// Gets the resource name of the specified font data within this form XObject. /// internal string GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) { pdfFont = this.document.FontTable.GetFont(idName, fontData); Debug.Assert(pdfFont != null); string name = Resources.AddFont(pdfFont); return name; } string IContentStream.GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) { return GetFontName(idName, fontData, out pdfFont); } string IContentStream.GetImageName(XImage image) { throw new NotImplementedException(); } string IContentStream.GetFormName(XForm form) { throw new NotImplementedException(); } #if keep_code_some_time_as_reference /// /// Replace all indirect references to external objects by their cloned counterparts /// owned by the importer document. /// void FixUpObject_old(PdfImportedObjectTable iot, PdfObject value) { // TODO: merge with PdfXObject.FixUpObject PdfDictionary dict; PdfArray array; if ((dict = value as PdfDictionary) != null) { // Set document for cloned direct objects if (dict.Owner == null) dict.Document = this.Owner; else Debug.Assert(dict.Owner == this.Owner); // Search for indirect references in all keys PdfName[] names = dict.Elements.KeyNames; foreach (PdfName name in names) { PdfItem item = dict.Elements[name]; // Is item an iref? PdfReference iref = item as PdfReference; if (iref != null) { // Does the iref already belong to this document? if (iref.Document == this.Owner) { // Yes: fine continue; } else { Debug.Assert(iref.Document == iot.ExternalDocument); // No: replace with iref of cloned object PdfReference newXRef = iot[iref.ObjectID]; Debug.Assert(newXRef != null); Debug.Assert(newXRef.Document == this.Owner); dict.Elements[name] = newXRef; } } else if (item is PdfObject) { // Fix up inner objects FixUpObject_old(iot, (PdfObject)item); } } } else if ((array = value as PdfArray) != null) { // Set document for cloned direct objects if (array.Owner == null) array.Document = this.Owner; else Debug.Assert(array.Owner == this.Owner); // Search for indirect references in all array elements int count = array.Elements.Count; for (int idx = 0; idx < count; idx++) { PdfItem item = array.Elements[idx]; // Is item an iref? PdfReference iref = item as PdfReference; if (iref != null) { // Does the iref belongs to this document? if (iref.Document == this.Owner) { // Yes: fine continue; } else { Debug.Assert(iref.Document == iot.ExternalDocument); // No: replace with iref of cloned object PdfReference newXRef = iot[iref.ObjectID]; Debug.Assert(newXRef != null); Debug.Assert(newXRef.Document == this.Owner); array.Elements[idx] = newXRef; } } else if (item is PdfObject) { // Fix up inner objects FixUpObject_old(iot, (PdfObject)item); } } } } #endif // /// // /// Returns ??? // /// // public override string ToString() // { // return "Form"; // } /// /// Predefined keys of this dictionary. /// public sealed new class Keys : PdfXObject.Keys { /// /// (Optional) The type of PDF object that this dictionary describes; if present, /// must be XObject for a form XObject. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string Type = "/Type"; /// /// (Required) The type of XObject that this dictionary describes; must be Form /// for a form XObject. /// [KeyInfo(KeyType.Name | KeyType.Required)] public const string Subtype = "/Subtype"; /// /// (Optional) A code identifying the type of form XObject that this dictionary /// describes. The only valid value defined at the time of publication is 1. /// Default value: 1. /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string FormType = "/FormType"; /// /// (Required) An array of four numbers in the form coordinate system, giving the /// coordinates of the left, bottom, right, and top edges, respectively, of the /// form XObjects bounding box. These boundaries are used to clip the form XObject /// and to determine its size for caching. /// [KeyInfo(KeyType.Rectangle | KeyType.Required)] public const string BBox = "/BBox"; /// /// (Optional) An array of six numbers specifying the form matrix, which maps /// form space into user space. /// Default value: the identity matrix [1 0 0 1 0 0]. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string Matrix = "/Matrix"; /// /// (Optional but strongly recommended; PDF 1.2) A dictionary specifying any /// resources (such as fonts and images) required by the form XObject. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResources))] public const string Resources = "/Resources"; /// /// (Optional; PDF 1.4) A group attributes dictionary indicating that the contents /// of the form XObject are to be treated as a group and specifying the attributes /// of that group (see Section 4.9.2, Group XObjects). /// Note: If a Ref entry (see below) is present, the group attributes also apply to the /// external page imported by that entry, which allows such an imported page to be /// treated as a group without further modification. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional)] public const string Group = "/Group"; // further keys: //Ref //Metadata //PieceInfo //LastModified //StructParent //StructParents //OPI //OC //Name /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfFont.cs0000644000175000001440000001442311435766646023224 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Pdf.Advanced; using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; using PdfSharp.Fonts; using PdfSharp.Internal; using PdfSharp.Pdf.Filters; namespace PdfSharp.Pdf.Advanced { /// /// Represents a PDF font. /// public class PdfFont : PdfDictionary { /// /// Initializes a new instance of the class. /// public PdfFont(PdfDocument document) : base(document) { } internal PdfFontDescriptor FontDescriptor { get { Debug.Assert(this.fontDescriptor != null); //if (this.fontDescriptor2 == null) // this.fontDescriptor2 = (PdfFontDescriptor)Elements.GetValue(Keys.FontDescriptor, VCF.CreateIndirect); return this.fontDescriptor; } } internal PdfFontDescriptor fontDescriptor; internal PdfFontEncoding FontEncoding; internal PdfFontEmbedding FontEmbedding; //PdfFontOptions FontOptions //{ // get { return this.fontOptions2; } //} //PdfFontOptions fontOptions2; /// /// Gets a value indicating whether this instance is symbol font. /// public bool IsSymbolFont { get { return this.fontDescriptor.IsSymbolFont; } } #if true_ public string BaseFont { get { return Elements.GetName(Keys.BaseFont); } set { Elements.SetName(Keys.BaseFont, value); } } public int FirstChar { get { return Elements.GetInteger(Keys.FirstChar); } set { Elements.SetInteger(Keys.FirstChar, value); } } public int LastChar { get { return Elements.GetInteger(Keys.LastChar); } set { Elements.SetInteger(Keys.LastChar, value); } } public PdfArray Widths { get { return (PdfArray)Elements.GetValue(Keys.Widths, VCF.Create); } } public string Encoding { get { return Elements.GetName(Keys.Encoding); } set { Elements.SetName(Keys.Encoding, value); } } #endif internal void AddChars(string text) { if (this.cmapInfo != null) this.cmapInfo.AddChars(text); } internal void AddGlyphIndices(string glyphIndices) { if (this.cmapInfo != null) this.cmapInfo.AddGlyphIndices(glyphIndices); } /// /// Gets or sets the CMapInfo. /// internal CMapInfo CMapInfo { get { return this.cmapInfo; } set { this.cmapInfo = value; } } internal CMapInfo cmapInfo; /// /// Gets or sets ToUnicodeMap. /// internal PdfToUnicodeMap ToUnicodeMap { get { return this.toUnicode; } set { this.toUnicode = value; } } internal PdfToUnicodeMap toUnicode; /// /// Adds a tag of exactly six uppercase letters to the font name /// according to PDF Reference Section 5.5.3 'Font Subsets' /// internal static string CreateEmbeddedFontSubsetName(string name) { StringBuilder s = new StringBuilder(64); byte[] bytes = Guid.NewGuid().ToByteArray(); for (int idx = 0; idx < 6; idx++) s.Append((char)('A' + bytes[idx] % 26)); s.Append('+'); if (name.StartsWith("/")) s.Append(name.Substring(1)); else s.Append(name); return s.ToString(); } /// /// Predefined keys common to all font dictionaries. /// public class Keys : KeysBase { /// /// (Required) The type of PDF object that this dictionary describes; /// must be Font for a font dictionary. /// [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Font")] public const string Type = "/Type"; /// /// (Required) The type of font. /// [KeyInfo(KeyType.Name | KeyType.Required)] public const string Subtype = "/Subtype"; /// /// (Required) The PostScript name of the font. /// [KeyInfo(KeyType.Name | KeyType.Required)] public const string BaseFont = "/BaseFont"; /// /// (Required except for the standard 14 fonts; must be an indirect reference) /// A font descriptor describing the fonts metrics other than its glyph widths. /// Note: For the standard 14 fonts, the entries FirstChar, LastChar, Widths, and /// FontDescriptor must either all be present or all be absent. Ordinarily, they are /// absent; specifying them enables a standard font to be overridden. /// [KeyInfo(KeyType.Dictionary | KeyType.MustBeIndirect, typeof(PdfFontDescriptor))] public const string FontDescriptor = "/FontDescriptor"; } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfExtGStateTable.cs0000644000175000001440000001167511435766646025144 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections.Generic; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Drawing; using PdfSharp.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Contains all used ExtGState objects of a document. /// internal sealed class PdfExtGStateTable : PdfResourceTable { /// /// Initializes a new instance of this class, which is a singleton for each document. /// public PdfExtGStateTable(PdfDocument document) : base(document) { } /// /// Gets a PdfExtGState with the keys 'CA' and 'ca' set to the specified alpha value. /// public PdfExtGState GetExtGState(double alpha) { string key = MakeKey(alpha); PdfExtGState extGState; if (!this.alphaValues.TryGetValue(key, out extGState)) { extGState = new PdfExtGState(this.owner); extGState.Elements[PdfExtGState.Keys.CA] = new PdfReal(alpha); extGState.Elements[PdfExtGState.Keys.ca] = new PdfReal(alpha); this.alphaValues[key] = extGState; } return extGState; } /// /// Gets a PdfExtGState with the key 'CA' set to the specified alpha value. /// public PdfExtGState GetExtGStateStroke(double alpha) { string key = MakeKey(alpha); PdfExtGState extGState; if (!this.strokeAlphaValues.TryGetValue(key, out extGState)) { extGState = new PdfExtGState(this.owner); extGState.Elements[PdfExtGState.Keys.CA] = new PdfReal(alpha); this.strokeAlphaValues[key] = extGState; } return extGState; } /// /// Gets a PdfExtGState with the key 'ca' set to the specified alpha value. /// public PdfExtGState GetExtGStateNonStroke(double alpha) { string key = MakeKey(alpha); PdfExtGState extGState; ; if (!this.nonStrokeAlphaValues.TryGetValue(key, out extGState)) { extGState = new PdfExtGState(this.owner); extGState.Elements[PdfExtGState.Keys.ca] = new PdfReal(alpha); this.nonStrokeAlphaValues[key] = extGState; } return extGState; } ///// ///// Gets a PdfExtGState with the key 'ca' set to the specified alpha value. ///// //public PdfExtGState GetExtGState(XColor strokeColor, XColor nonStrokeColor) //{ // if (strokeColor.IsEmpty) // { // } // else if (nonStrokeColor.IsEmpty) // { // } // else // { // } // return null; // //string key = MakeKey(alpha); // //PdfExtGState extGState = this.nonStrokeAlphaValues[key] as PdfExtGState; // //if (extGState == null) // //{ // // extGState = new PdfExtGState(this.document); // // extGState.Elements[PdfExtGState.Keys.ca] = new PdfReal(alpha); // // // // this.nonStrokeAlphaValues[key] = extGState; // //} // //return extGState; //} static string MakeKey(double alpha) { return ((int)(1000 * alpha)).ToString(); } /// /// Maps from alpha values (range "0" to "1000") to PdfExtGState objects. /// Dictionary alphaValues = new Dictionary(); Dictionary strokeAlphaValues = new Dictionary(); Dictionary nonStrokeAlphaValues = new Dictionary(); } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfCIDFont.cs0000644000175000001440000004715211435766646023551 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf.Filters; using PdfSharp.Internal; namespace PdfSharp.Pdf.Advanced { /// <summary> /// Represents a CIDFont dictionary. /// </summary> internal class PdfCIDFont : PdfFont { public PdfCIDFont(PdfDocument document) : base(document) { } public PdfCIDFont(PdfDocument document, PdfFontDescriptor fontDescriptor, XFont font) : base(document) { Elements.SetName(Keys.Type, "/Font"); Elements.SetName(Keys.Subtype, "/CIDFontType2"); // This code is foobar. A PDF literal containing strings is not encrypted, but decryped when opening the PDF file. //Elements.SetValue(Keys.CIDSystemInfo, // new PdfLiteral("<< /Ordering (Identity) /Registry (Adobe) /Supplement 0>>")); // Must use real objects because PDF literals containing strings is not encrypted. That causes an error // when the file is decrypted. PdfDictionary cid = new PdfDictionary(); cid.Elements.SetString("/Ordering", "Identity"); cid.Elements.SetString("/Registry", "Adobe"); cid.Elements.SetInteger("/Supplement", 0); Elements.SetValue(Keys.CIDSystemInfo, cid); this.fontDescriptor = fontDescriptor; Owner.irefTable.Add(fontDescriptor); Elements[Keys.FontDescriptor] = fontDescriptor.Reference; FontEncoding = font.PdfOptions.FontEncoding; FontEmbedding = font.PdfOptions.FontEmbedding; } public PdfCIDFont(PdfDocument document, PdfFontDescriptor fontDescriptor, byte[] fontData) : base(document) { Elements.SetName(Keys.Type, "/Font"); Elements.SetName(Keys.Subtype, "/CIDFontType2"); PdfDictionary cid = new PdfDictionary(); cid.Elements.SetString("/Ordering", "Identity"); cid.Elements.SetString("/Registry", "Adobe"); cid.Elements.SetInteger("/Supplement", 0); Elements.SetValue(Keys.CIDSystemInfo, cid); this.fontDescriptor = fontDescriptor; Owner.irefTable.Add(fontDescriptor); Elements[Keys.FontDescriptor] = fontDescriptor.Reference; FontEncoding = PdfFontEncoding.Unicode; FontEmbedding = PdfFontEmbedding.Always; } public string BaseFont { get { return Elements.GetName(Keys.BaseFont); } set { Elements.SetName(Keys.BaseFont, value); } } /// <summary> /// Prepares the object to get saved. /// </summary> internal override void PrepareForSave() { base.PrepareForSave(); #if DEBUG if (this.fontDescriptor.descriptor.fontData.loca == null) { GetType(); } #endif // CID fonts must be always embedded. PDFsharp embedds automatically a subset. FontData subSet = null; if (this.fontDescriptor.descriptor.fontData.loca == null) subSet = this.fontDescriptor.descriptor.fontData; else subSet = this.fontDescriptor.descriptor.fontData.CreateFontSubSet(this.cmapInfo.GlyphIndices, true); byte[] fontData = subSet.Data; #if DEBUG_ TrueTypeFontSubSet fss = new TrueTypeFontSubSet("", this.cmapInfo.descriptor.fontData, this.cmapInfo.GlyphIndices, 0, false, false); byte[] fontSubSet = fss.Process(); fss.CompareBytes(fontSubSet, fontProgram); #endif PdfDictionary fontStream = new PdfDictionary(this.Owner); this.Owner.Internals.AddObject(fontStream); this.fontDescriptor.Elements[PdfFontDescriptor.Keys.FontFile2] = fontStream.Reference; fontStream.Elements["/Length1"] = new PdfInteger(fontData.Length); if (!this.Owner.Options.NoCompression) { fontData = Filtering.FlateDecode.Encode(fontData); fontStream.Elements["/Filter"] = new PdfName("/FlateDecode"); } fontStream.Elements["/Length"] = new PdfInteger(fontData.Length); fontStream.CreateStream(fontData); } /// <summary> /// Predefined keys of this dictionary. /// </summary> public new sealed class Keys : PdfFont.Keys { /// <summary> /// (Required) The type of PDF object that this dictionary describes; /// must be Font for a CIDFont dictionary. /// </summary> [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Font")] public new const string Type = "/Type"; /// <summary> /// (Required) The type of CIDFont; CIDFontType0 or CIDFontType2. /// </summary> [KeyInfo(KeyType.Name | KeyType.Required)] public new const string Subtype = "/Subtype"; /// <summary> /// (Required) The PostScript name of the CIDFont. For Type 0 CIDFonts, this /// is usually the value of the CIDFontName entry in the CIDFont program. For /// Type 2 CIDFonts, it is derived the same way as for a simple TrueType font; /// In either case, the name can have a subset prefix if appropriate. /// </summary> [KeyInfo(KeyType.Name | KeyType.Required)] public new const string BaseFont = "/BaseFont"; /// <summary> /// (Required) A dictionary containing entries that define the character collection /// of the CIDFont. /// </summary> [KeyInfo(KeyType.Dictionary | KeyType.Required)] public const string CIDSystemInfo = "/CIDSystemInfo"; /// <summary> /// (Required; must be an indirect reference) A font descriptor describing the /// CIDFont s default metrics other than its glyph widths. /// </summary> [KeyInfo(KeyType.Dictionary | KeyType.MustBeIndirect, typeof(PdfFontDescriptor))] public new const string FontDescriptor = "/FontDescriptor"; /// <summary> /// (Optional) The default width for glyphs in the CIDFont. /// Default value: 1000. /// </summary> [KeyInfo(KeyType.Integer)] public const string DW = "/DW"; /// <summary> /// (Optional) A description of the widths for the glyphs in the CIDFont. The /// array s elements have a variable format that can specify individual widths /// for consecutive CIDs or one width for a range of CIDs. /// Default value: none (the DW value is used for all glyphs). /// </summary> [KeyInfo(KeyType.Array, typeof(PdfArray))] public const string W = "/W"; /// <summary> /// (Optional; applies only to CIDFonts used for vertical writing) An array of two /// numbers specifying the default metrics for vertical writing. /// Default value: [880 "1000]. /// </summary> [KeyInfo(KeyType.Array)] public const string DW2 = "/DW2"; /// <summary> /// (Optional; applies only to CIDFonts used for vertical writing) A description /// of the metrics for vertical writing for the glyphs in the CIDFont. /// Default value: none (the DW2 value is used for all glyphs). /// </summary> [KeyInfo(KeyType.Array, typeof(PdfArray))] public const string W2 = "/W2"; /// <summary> /// (Optional; Type 2 CIDFonts only) A specification of the mapping from CIDs /// to glyph indices. If the value is a stream, the bytes in the stream contain the /// mapping from CIDs to glyph indices: the glyph index for a particular CID /// value c is a 2-byte value stored in bytes 2 c and 2 c + 1, where the first /// byte is the high-order byte. If the value of CIDToGIDMap is a name, it must /// be Identity, indicating that the mapping between CIDs and glyph indices is /// the identity mapping. /// Default value: Identity. /// This entry may appear only in a Type 2 CIDFont whose associated True-Type font /// program is embedded in the PDF file. /// </summary> [KeyInfo(KeyType.Dictionary | KeyType.StreamOrName)] public const string CIDToGIDMap = "/CIDToGIDMap"; /// <summary> /// Gets the KeysMeta for these keys. /// </summary> internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// <summary> /// Gets the KeysMeta of this dictionary type. /// </summary> internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfImage.FaxEncode.cs0000644000175000001440000010012311435766646025164 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // Thomas Hövel (mailto:Thomas.Hoevel@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. // Some routines were translated from LibTiff. // LibTiff copyright notice: // Copyright (c) 1988-1997 Sam Leffler // Copyright (c) 1991-1997 Silicon Graphics, Inc. // // Permission to use, copy, modify, distribute, and sell this software and // its documentation for any purpose is hereby granted without fee, provided // that (i) the above copyright notices and this permission notice appear in // all copies of the software and related documentation, and (ii) the names of // Sam Leffler and Silicon Graphics may not be used in any advertising or // publicity relating to the software without the specific, prior written // permission of Sam Leffler and Silicon Graphics. // // THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, // EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY // WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. // // IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR // ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, // OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, // WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF // LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE // OF THIS SOFTWARE. #endregion #define USE_GOTO using System; using System.Diagnostics; namespace PdfSharp.Pdf.Advanced { partial class PdfImage { internal readonly static uint[] WhiteTerminatingCodes = { 0x35, 8, //00110101 // 0 0x07, 6, //000111 0x07, 4, //0111 0x08, 4, //1000 0x0b, 4, //1011 0x0c, 4, //1100 0x0e, 4, //1110 0x0f, 4, //1111 0x13, 5, //10011 0x14, 5, //10100 0x07, 5, //00111 // 10 0x08, 5, //01000 0x08, 6, //001000 0x03, 6, //000011 0x34, 6, //110100 0x35, 6, //110101 0x2a, 6, //101010 // 16 0x2b, 6, //101011 0x27, 7, //0100111 0x0c, 7, //0001100 0x08, 7, //0001000 // 20 0x17, 7, //0010111 0x03, 7, //0000011 0x04, 7, //0000100 0x28, 7, //0101000 0x2b, 7, //0101011 0x13, 7, //0010011 0x24, 7, //0100100 0x18, 7, //0011000 0x02, 8, //00000010 0x03, 8, //00000011 // 30 0x1a, 8, //00011010 0x1b, 8, //00011011 // 32 0x12, 8, //00010010 0x13, 8, //00010011 0x14, 8, //00010100 0x15, 8, //00010101 0x16, 8, //00010110 0x17, 8, //00010111 0x28, 8, //00101000 0x29, 8, //00101001 // 40 0x2a, 8, //00101010 0x2b, 8, //00101011 0x2c, 8, //00101100 0x2d, 8, //00101101 0x04, 8, //00000100 0x05, 8, //00000101 0x0a, 8, //00001010 0x0b, 8, //00001011 // 48 0x52, 8, //01010010 0x53, 8, //01010011 // 50 0x54, 8, //01010100 0x55, 8, //01010101 0x24, 8, //00100100 0x25, 8, //00100101 0x58, 8, //01011000 0x59, 8, //01011001 0x5a, 8, //01011010 0x5b, 8, //01011011 0x4a, 8, //01001010 0x4b, 8, //01001011 // 60 0x32, 8, //00110010 0x33, 8, //00110011 0x34, 8, //00110100 // 63 }; internal readonly static uint[] BlackTerminatingCodes = { 0x37, 10, //0000110111 // 0 0x02, 3, //010 0x03, 2, //11 0x02, 2, //10 0x03, 3, //011 0x03, 4, //0011 0x02, 4, //0010 0x03, 5, //00011 0x05, 6, //000101 0x04, 6, //000100 0x04, 7, //0000100 0x05, 7, //0000101 0x07, 7, //0000111 0x04, 8, //00000100 0x07, 8, //00000111 0x18, 9, //000011000 0x17, 10, //0000010111 // 16 0x18, 10, //0000011000 0x08, 10, //0000001000 0x67, 11, //00001100111 0x68, 11, //00001101000 0x6c, 11, //00001101100 0x37, 11, //00000110111 0x28, 11, //00000101000 0x17, 11, //00000010111 0x18, 11, //00000011000 0xca, 12, //000011001010 0xcb, 12, //000011001011 0xcc, 12, //000011001100 0xcd, 12, //000011001101 0x68, 12, //000001101000 // 30 0x69, 12, //000001101001 0x6a, 12, //000001101010 // 32 0x6b, 12, //000001101011 0xd2, 12, //000011010010 0xd3, 12, //000011010011 0xd4, 12, //000011010100 0xd5, 12, //000011010101 0xd6, 12, //000011010110 0xd7, 12, //000011010111 0x6c, 12, //000001101100 0x6d, 12, //000001101101 0xda, 12, //000011011010 0xdb, 12, //000011011011 0x54, 12, //000001010100 0x55, 12, //000001010101 0x56, 12, //000001010110 0x57, 12, //000001010111 0x64, 12, //000001100100 // 48 0x65, 12, //000001100101 0x52, 12, //000001010010 0x53, 12, //000001010011 0x24, 12, //000000100100 0x37, 12, //000000110111 0x38, 12, //000000111000 0x27, 12, //000000100111 0x28, 12, //000000101000 0x58, 12, //000001011000 0x59, 12, //000001011001 0x2b, 12, //000000101011 0x2c, 12, //000000101100 0x5a, 12, //000001011010 0x66, 12, //000001100110 0x67, 12, //000001100111 // 63 }; internal readonly static uint[] WhiteMakeUpCodes = { 0x1b, 5, //11011 64 // 0 0x12, 5, //10010 128 0x17, 6, //010111 192 0x37, 7, //0110111 256 0x36, 8, //00110110 320 0x37, 8, //00110111 384 0x64, 8, //01100100 448 0x65, 8, //01100101 512 0x68, 8, //01101000 576 0x67, 8, //01100111 640 0xcc, 9, //011001100 704 // 10 0xcd, 9, //011001101 768 0xd2, 9, //011010010 832 0xd3, 9, //011010011 896 0xd4, 9, //011010100 960 0xd5, 9, //011010101 1024 0xd6, 9, //011010110 1088 // 16 0xd7, 9, //011010111 1152 0xd8, 9, //011011000 1216 0xd9, 9, //011011001 1280 0xda, 9, //011011010 1344 0xdb, 9, //011011011 1408 0x98, 9, //010011000 1472 0x99, 9, //010011001 1536 0x9a, 9, //010011010 1600 0x18, 6, //011000 1664 0x9b, 9, //010011011 1728 // Common codes for white and black: 0x08, 11, //00000001000 1792 0x0c, 11, //00000001100 1856 0x0d, 11, //00000001101 1920 0x12, 12, //000000010010 1984 0x13, 12, //000000010011 2048 0x14, 12, //000000010100 2112 // 32 0x15, 12, //000000010101 2176 0x16, 12, //000000010110 2240 0x17, 12, //000000010111 2304 0x1c, 12, //000000011100 2368 0x1d, 12, //000000011101 2432 0x1e, 12, //000000011110 2496 0x1f, 12, //000000011111 2560 0x01, 12, //000000000001 EOL // 40 }; internal readonly static uint[] BlackMakeUpCodes = { 0x0f, 10, //0000001111 64 // 0 0xc8, 12, //000011001000 128 0xc9, 12, //000011001001 192 0x5b, 12, //000001011011 256 0x33, 12, //000000110011 320 0x34, 12, //000000110100 384 0x35, 12, //000000110101 448 0x6c, 13, //0000001101100 512 0x6d, 13, //0000001101101 576 0x4a, 13, //0000001001010 640 0x4b, 13, //0000001001011 704 0x4c, 13, //0000001001100 768 0x4d, 13, //0000001001101 832 0x72, 13, //0000001110010 896 0x73, 13, //0000001110011 960 0x74, 13, //0000001110100 1024 0x75, 13, //0000001110101 1088 // 16 0x76, 13, //0000001110110 1152 0x77, 13, //0000001110111 1216 0x52, 13, //0000001010010 1280 0x53, 13, //0000001010011 1344 0x54, 13, //0000001010100 1408 0x55, 13, //0000001010101 1472 0x5a, 13, //0000001011010 1536 0x5b, 13, //0000001011011 1600 0x64, 13, //0000001100100 1664 0x65, 13, //0000001100101 1728 // Common codes for white and black: 0x08, 11, //00000001000 1792 0x0c, 11, //00000001100 1856 0x0d, 11, //00000001101 1920 0x12, 12, //000000010010 1984 0x13, 12, //000000010011 2048 0x14, 12, //000000010100 2112 // 32 0x15, 12, //000000010101 2176 0x16, 12, //000000010110 2240 0x17, 12, //000000010111 2304 0x1c, 12, //000000011100 2368 0x1d, 12, //000000011101 2432 0x1e, 12, //000000011110 2496 0x1f, 12, //000000011111 2560 0x01, 12, //000000000001 EOL // 40 }; internal readonly static uint[] HorizontalCodes = { 0x1, 3 }; /* 001 */ internal readonly static uint[] PassCodes = { 0x1, 4, }; /* 0001 */ internal readonly static uint[] VerticalCodes = { 0x03, 7, /* 0000 011 */ 0x03, 6, /* 0000 11 */ 0x03, 3, /* 011 */ 0x1, 1, /* 1 */ 0x2, 3, /* 010 */ 0x02, 6, /* 0000 10 */ 0x02, 7, /* 0000 010 */ }; readonly static uint[] ZeroRuns = { 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, /* 0x00 - 0x0f */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0x10 - 0x1f */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x20 - 0x2f */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x30 - 0x3f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x40 - 0x4f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x50 - 0x5f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x60 - 0x6f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x70 - 0x7f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 - 0x8f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 - 0x9f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0 - 0xaf */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0 - 0xbf */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xc0 - 0xcf */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xd0 - 0xdf */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0 - 0xef */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xf0 - 0xff */ }; readonly static uint[] OneRuns = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 - 0x0f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 - 0x1f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 - 0x2f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 - 0x3f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x4f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 - 0x5f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x6f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 - 0x7f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x80 - 0x8f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x90 - 0x9f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xa0 - 0xaf */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xb0 - 0xbf */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xc0 - 0xcf */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xd0 - 0xdf */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0xe0 - 0xef */ 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8, /* 0xf0 - 0xff */ }; /// /// Counts the consecutive one bits in an image line. /// /// The reader. /// The bits left. private static uint CountOneBits(BitReader reader, uint bitsLeft) { uint found = 0; for (; ; ) { uint bits; int @byte = reader.PeekByte(out bits); uint hits = OneRuns[@byte]; if (hits < bits) { if (hits > 0) reader.SkipBits(hits); return found + hits; } found += bits; if (found >= bitsLeft) return bitsLeft; reader.NextByte(); } } /// /// Counts the consecutive zero bits in an image line. /// /// The reader. /// The bits left. private static uint CountZeroBits(BitReader reader, uint bitsLeft) { uint found = 0; for (; ; ) { uint bits; int @byte = reader.PeekByte(out bits); uint hits = ZeroRuns[@byte]; if (hits < bits) { if (hits > 0) reader.SkipBits(hits); return found + hits; } found += bits; if (found >= bitsLeft) return bitsLeft; reader.NextByte(); } } /// /// Returns the offset of the next bit in the range /// [bitStart..bitEnd] that is different from the /// specified color. The end, bitEnd, is returned /// if no such bit exists. /// /// The reader. /// The offset of the start bit. /// The offset of the end bit. /// If set to true searches "one" (i. e. white), otherwise searches black. /// The offset of the first non-matching bit. private static uint FindDifference(BitReader reader, uint bitStart, uint bitEnd, bool searchOne) { // Translated from LibTiff reader.SetPosition(bitStart); return (bitStart + (searchOne ? CountOneBits(reader, bitEnd - bitStart) : CountZeroBits(reader, bitEnd - bitStart))); } /// /// Returns the offset of the next bit in the range /// [bitStart..bitEnd] that is different from the /// specified color. The end, bitEnd, is returned /// if no such bit exists. /// Like FindDifference, but also check the /// starting bit against the end in case start > end. /// /// The reader. /// The offset of the start bit. /// The offset of the end bit. /// If set to true searches "one" (i. e. white), otherwise searches black. /// The offset of the first non-matching bit. private static uint FindDifferenceWithCheck(BitReader reader, uint bitStart, uint bitEnd, bool searchOne) { // Translated from LibTiff return ((bitStart < bitEnd) ? FindDifference(reader, bitStart, bitEnd, searchOne) : bitEnd); } /// /// 2d-encode a row of pixels. Consult the CCITT documentation for the algorithm. /// /// The writer. /// Offset of image data in bitmap file. /// The bitmap file. /// Index of the current row. /// Index of the reference row (0xffffffff if there is none). /// The width of the image. /// The height of the image. /// The bytes per line in the bitmap file. static void FaxEncode2DRow(BitWriter writer, uint bytesFileOffset, byte[] imageBits, uint currentRow, uint referenceRow, uint width, uint height, uint bytesPerLineBmp) { // Translated from LibTiff uint bytesOffsetRead = bytesFileOffset + (height - 1 - currentRow) * bytesPerLineBmp; BitReader reader = new BitReader(imageBits, bytesOffsetRead, width); BitReader readerReference; if (referenceRow != 0xffffffff) { uint bytesOffsetReadReference = bytesFileOffset + (height - 1 - referenceRow) * bytesPerLineBmp; readerReference = new BitReader(imageBits, bytesOffsetReadReference, width); } else { byte[] tmpImageBits = new byte[bytesPerLineBmp]; for (int i = 0; i < bytesPerLineBmp; ++i) tmpImageBits[i] = 255; readerReference = new BitReader(tmpImageBits, 0, width); } uint a0 = 0; uint a1 = !reader.GetBit(0) ? 0 : FindDifference(reader, 0, width, true); uint b1 = !readerReference.GetBit(0) ? 0 : FindDifference(readerReference, 0, width, true); // ReSharper disable TooWideLocalVariableScope uint a2, b2; // ReSharper restore TooWideLocalVariableScope for (; ; ) { b2 = FindDifferenceWithCheck(readerReference, b1, width, readerReference.GetBit(b1)); if (b2 >= a1) { int d = (int)b1 - (int)a1; if (!(-3 <= d && d <= 3)) { /* horizontal mode */ a2 = FindDifferenceWithCheck(reader, a1, width, reader.GetBit(a1)); writer.WriteTableLine(HorizontalCodes, 0); if (a0 + a1 == 0 || reader.GetBit(a0)) { WriteSample(writer, a1 - a0, true); WriteSample(writer, a2 - a1, false); } else { WriteSample(writer, a1 - a0, false); WriteSample(writer, a2 - a1, true); } a0 = a2; } else { /* vertical mode */ writer.WriteTableLine(VerticalCodes, (uint)(d + 3)); a0 = a1; } } else { /* pass mode */ writer.WriteTableLine(PassCodes, 0); a0 = b2; } if (a0 >= width) break; bool bitA0 = reader.GetBit(a0); a1 = FindDifference(reader, a0, width, bitA0/*reader.GetBit(a0)*/); b1 = FindDifference(readerReference, a0, width, !bitA0/*reader.GetBit(a0)*/); b1 = FindDifferenceWithCheck(readerReference, b1, width, bitA0/*reader.GetBit(a0)*/); } } /// /// Encodes a bitonal bitmap using 1D CCITT fax encoding. /// /// Space reserved for the fax encoded bitmap. An exception will be thrown if this buffer is too small. /// The bitmap to be encoded. /// Offset of image data in bitmap file. /// The width of the image. /// The height of the image. /// The size of the fax encoded image (0 on failure). private static int DoFaxEncoding(ref byte[] imageData, byte[] imageBits, uint bytesFileOffset, uint width, uint height) { try { uint bytesPerLineBmp = ((width + 31) / 32) * 4; BitWriter writer = new BitWriter(ref imageData); for (uint y = 0; y < height; ++y) { uint bytesOffsetRead = bytesFileOffset + (height - 1 - y) * bytesPerLineBmp; BitReader reader = new BitReader(imageBits, bytesOffsetRead, width); for (uint bitsRead = 0; bitsRead < width; ) { uint white = CountOneBits(reader, width - bitsRead); WriteSample(writer, white, true); bitsRead += white; if (bitsRead < width) { uint black = CountZeroBits(reader, width - bitsRead); WriteSample(writer, black, false); bitsRead += black; } } } writer.FlushBuffer(); return writer.BytesWritten(); } catch (Exception /*ex*/) { //ex.GetType(); return 0; } } //[Obsolete] ///// ///// Encodes a bitonal bitmap using 2D group 3 CCITT fax encoding. ///// ///// Space reserved for the fax encoded bitmap. An exception will be thrown if this buffer is too small. ///// The bitmap to be encoded. ///// Offset of image data in bitmap file. ///// The width of the image. ///// The height of the image. ///// The horizontal dpi of the image (needed to determine K). ///// The K parameter (passed to the PDF file). ///// The size of the fax encoded image (0 on failure). //private static int DoFaxEncoding2D(ref byte[] imageData, byte[] imageBits, uint bytesFileOffset, uint width, uint height, uint dpiY, out uint k) //{ // // It seems that either pure 1D or pure 2D encoding creates smaller files than this mixed 1D/2D encoding. // // Therefore this routine is not currently in use, but is left here for further research. // try // { // k = (dpiY > 199) ? (uint)4 : (uint)2; // uint bytesPerLineBmp = ((width + 31) / 32) * 4; // BitWriter writer = new BitWriter(ref imageData); // uint kTmp = 0; // for (uint y = 0; y < height; ++y) // { // if (kTmp == 0) // { // kTmp = k - 1; // uint bytesOffsetRead = bytesFileOffset + (height - 1 - y) * bytesPerLineBmp; // BitReader reader = new BitReader(imageBits, bytesOffsetRead, width); // for (uint bitsRead = 0; bitsRead < width; ) // { // uint white = CountOneBits(reader, width - bitsRead); // WriteSample(writer, white, true); // bitsRead += white; // if (bitsRead < width) // { // uint black = CountZeroBits(reader, width - bitsRead); // WriteSample(writer, black, false); // bitsRead += black; // } // } // } // else // { // uint refLine = y - 1; // FaxEncode2DRow(writer, bytesFileOffset, imageBits, y, refLine, width, height, bytesPerLineBmp); // --kTmp; // } // } // writer.FlushBuffer(); // return writer.BytesWritten(); // } // catch (Exception ex) // { // ex.GetType(); // k = 0; // return 0; // } //} /// /// Encodes a bitonal bitmap using 2D group 4 CCITT fax encoding. /// /// Space reserved for the fax encoded bitmap. An exception will be thrown if this buffer is too small. /// The bitmap to be encoded. /// Offset of image data in bitmap file. /// The width of the image. /// The height of the image. /// The size of the fax encoded image (0 on failure). private static int DoFaxEncodingGroup4(ref byte[] imageData, byte[] imageBits, uint bytesFileOffset, uint width, uint height) { try { uint bytesPerLineBmp = ((width + 31) / 32) * 4; BitWriter writer = new BitWriter(ref imageData); for (uint y = 0; y < height; ++y) { FaxEncode2DRow(writer, bytesFileOffset, imageBits, y, (y != 0) ? y - 1 : 0xffffffff, width, height, bytesPerLineBmp); } writer.FlushBuffer(); return writer.BytesWritten(); } catch (Exception ex) { ex.GetType(); return 0; } } /// /// Writes the image data. /// /// The writer. /// The count of bits (pels) to encode. /// The color of the pels. private static void WriteSample(BitWriter writer, uint count, bool white) { uint[] terminatingCodes = white ? WhiteTerminatingCodes : BlackTerminatingCodes; uint[] makeUpCodes = white ? WhiteMakeUpCodes : BlackMakeUpCodes; // The make-up code for 2560 will be written as often as required: while (count >= 2624) { writer.WriteTableLine(makeUpCodes, 39); // Magic: 2560 count -= 2560; } // A make-up code for a multiple of 64 will be written if required: if (count > 63) { uint line = count / 64 - 1; writer.WriteTableLine(makeUpCodes, line); count -= (line + 1) * 64; } // And finally the terminating code for the remaining value (0 through 63): writer.WriteTableLine(terminatingCodes, count); } } /// /// The BitReader class is a helper to read bits from an in-memory bitmap file. /// class BitReader { readonly byte[] imageBits; uint bytesOffsetRead; readonly uint bytesFileOffset; byte buffer; uint bitsInBuffer; readonly uint bitsTotal; // Bits we may read (bits per image line) /// /// Initializes a new instance of the class. /// /// The in-memory bitmap file. /// The offset of the line to read. /// The count of bits that may be read (i. e. the width of the image for normal usage). internal BitReader(byte[] imageBits, uint bytesFileOffset, uint bits) { this.imageBits = imageBits; this.bytesFileOffset = bytesFileOffset; bitsTotal = bits; bytesOffsetRead = bytesFileOffset; buffer = imageBits[bytesOffsetRead]; bitsInBuffer = 8; } /// /// Sets the position within the line (needed for 2D encoding). /// /// The new position. internal void SetPosition(uint position) { bytesOffsetRead = bytesFileOffset + (position >> 3); buffer = imageBits[bytesOffsetRead]; bitsInBuffer = 8 - (position & 0x07); } /// /// Gets a single bit at the specified position. /// /// The position. /// True if bit is set. internal bool GetBit(uint position) { if (position >= bitsTotal) return false; SetPosition(position); uint dummy; return (PeekByte(out dummy) & 0x80) > 0; } /// /// Returns the bits that are in the buffer (without changing the position). /// Data is MSB aligned. /// /// The count of bits that were returned (1 through 8). /// The MSB aligned bits from the buffer. internal byte PeekByte(out uint bits) { // TODO: try to make this faster! if (bitsInBuffer == 8) { bits = 8; return buffer; } bits = bitsInBuffer; return (byte)(buffer << (int)(8 - bitsInBuffer)); } /// /// Moves the buffer to the next byte. /// internal void NextByte() { buffer = imageBits[++bytesOffsetRead]; bitsInBuffer = 8; } /// /// "Removes" (eats) bits from the buffer. /// /// The count of bits that were processed. internal void SkipBits(uint bits) { Debug.Assert(bits <= bitsInBuffer, "Buffer underrun"); if (bits == bitsInBuffer) { NextByte(); return; } bitsInBuffer -= bits; } } /// /// A helper class for writing groups of bits into an array of bytes. /// class BitWriter { int bytesOffsetWrite; readonly byte[] imageData; uint buffer; uint bitsInBuffer; /// /// Initializes a new instance of the class. /// /// The byte array to be written to. internal BitWriter(ref byte[] imageData) { this.imageData = imageData; } /// /// Writes the buffered bits into the byte array. /// internal void FlushBuffer() { if (bitsInBuffer > 0) { uint bits = 8 - bitsInBuffer; WriteBits(0, bits); } } /// /// Masks for n bits in a byte (with n = 0 through 8). /// static readonly uint[] masks = { 0, 1, 3, 7, 15, 31, 63, 127, 255 }; /// /// Writes bits to the byte array. /// /// The bits to be written (LSB aligned). /// The count of bits. internal void WriteBits(uint value, uint bits) { #if true // TODO: Try to make this faster! // If we have to write more bits than fit into the buffer, we fill // the buffer and call the same routine recursively for the rest. #if USE_GOTO // Use GOTO instead of end recursion: (is this faster?) SimulateRecursion: #endif if (bits + bitsInBuffer > 8) { // We can't add all bits this time. uint bitsNow = 8 - bitsInBuffer; uint bitsRemainder = bits - bitsNow; WriteBits(value >> (int)(bitsRemainder), bitsNow); // that fits #if USE_GOTO bits = bitsRemainder; goto SimulateRecursion; #else WriteBits(value, bitsRemainder); return; #endif } buffer = (buffer << (int)bits) + (value & masks[bits]); bitsInBuffer += bits; if (bitsInBuffer == 8) { imageData[bytesOffsetWrite] = (byte)buffer; bitsInBuffer = 0; ++bytesOffsetWrite; } #else // Simple implementation writing bit by bit: int mask = 1 << (int)(bits - 1); for (int b = 0; b < bits; ++b) { if ((value & mask) != 0) buffer = (buffer << 1) + 1; else buffer = buffer << 1; ++bitsInBuffer; mask /= 2; if (bitsInBuffer == 8) { imageData[bytesOffsetWrite] = (byte)buffer; bitsInBuffer = 0; ++bytesOffsetWrite; } } #endif } /// /// Writes a line from a look-up table. /// A "line" in the table are two integers, one containing the values, one containing the bit count. /// /// The table. /// The line. internal void WriteTableLine(uint[] table, uint line) { uint value = table[line * 2]; uint bits = table[line * 2 + 1]; WriteBits(value, bits); } [Obsolete] internal void WriteEOL() { // Not needed for PDF. WriteTableLine(PdfImage.WhiteMakeUpCodes, 40); } /// /// Flushes the buffer and returns the count of bytes written to the array. /// /// internal int BytesWritten() { FlushBuffer(); return bytesOffsetWrite; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfType1Font.cs0000644000175000001440000001626511435766646024155 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #if true_NYI using System; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Not implemented - just for illustration of the class hierarchy. /// internal sealed class PdfType1Font : PdfFont { public PdfType1Font(PdfDocument document) : base(document) { this.Elements["\\Type"] = new PdfName("Font"); this.Elements["\\Subtype"] = new PdfName("Type1"); } //public string BaseFont //{ // get {return this.baseFont;} // set {this.baseFont = value;} //} //string baseFont; // internal override void AssignObjectID(ref int objectID) // { // SetObjectID(ref objectID); // } // // internal override void WriteObject(Stream stream) // { // base.WriteObject(stream); // StringBuilder pdf = new StringBuilder(); // pdf.AppendFormat("{0} 0 obj\n<<\n/Type /Font\n/Subtype /Type1\n/BaseFont /Helvetica\n/Encoding /WinAnsiEncoding\n>>\nendobj\n", this.ObjectID); // WriteString(stream, pdf.ToString()); // } /// /// Predefined keys of this dictionary. /// public new sealed class Keys : PdfFont.Keys { /// /// (Required) The type of PDF object that this dictionary describes; /// must be Font for a font dictionary. /// [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Font")] public new const string Type = "/Type"; /// /// (Required) The type of font; must be Type1 for a Type 1 font. /// [KeyInfo(KeyType.Name | KeyType.Required)] public new const string Subtype = "/Subtype"; /// /// (Required in PDF 1.0; optional otherwise) The name by which this font is /// referenced in the Font subdictionary of the current resource dictionary. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string Name = "/Name"; /// /// (Required) The PostScript name of the font. For Type 1 fonts, this is usually /// the value of the FontName entry in the font program; for more information. /// The Post-Script name of the font can be used to find the fonts definition in /// the consumer application or its environment. It is also the name that is used when /// printing to a PostScript output device. /// [KeyInfo(KeyType.Name | KeyType.Required)] public new const string BaseFont = "/BaseFont"; /// /// (Required except for the standard 14 fonts) The first character code defined /// in the fonts Widths array. /// [KeyInfo(KeyType.Integer)] public const string FirstChar = "/FirstChar"; /// /// (Required except for the standard 14 fonts) The last character code defined /// in the fonts Widths array. /// [KeyInfo(KeyType.Integer)] public const string LastChar = "/LastChar"; /// /// (Required except for the standard 14 fonts; indirect reference preferred) /// An array of (LastChar - FirstChar + 1) widths, each element being the glyph width /// for the character code that equals FirstChar plus the array index. For character /// codes outside the range FirstChar to LastChar, the value of MissingWidth from the /// FontDescriptor entry for this font is used. The glyph widths are measured in units /// in which 1000 units corresponds to 1 unit in text space. These widths must be /// consistent with the actual widths given in the font program. /// [KeyInfo(KeyType.Array, typeof(PdfArray))] public const string Widths = "/Widths"; /// /// (Required except for the standard 14 fonts; must be an indirect reference) /// A font descriptor describing the fonts metrics other than its glyph widths. /// Note: For the standard 14 fonts, the entries FirstChar, LastChar, Widths, and /// FontDescriptor must either all be present or all be absent. Ordinarily, they are /// absent; specifying them enables a standard font to be overridden. /// [KeyInfo(KeyType.Dictionary | KeyType.MustBeIndirect, typeof(PdfFontDescriptor))] public new const string FontDescriptor = "/FontDescriptor"; /// /// (Optional) A specification of the fonts character encoding if different from its /// built-in encoding. The value of Encoding is either the name of a predefined /// encoding (MacRomanEncoding, MacExpertEncoding, or WinAnsiEncoding, as described in /// Appendix D) or an encoding dictionary that specifies differences from the fonts /// built-in encoding or from a specified predefined encoding. /// [KeyInfo(KeyType.Name | KeyType.Dictionary)] public const string Encoding = "/Encoding"; /// /// (Optional; PDF 1.2) A stream containing a CMap file that maps character /// codes to Unicode values. /// [KeyInfo(KeyType.Stream | KeyType.Optional)] public const string ToUnicode = "/ToUnicode"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get {return Keys.Meta;} } } } #endifpdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfImportedObjectTable.cs0000644000175000001440000001105711435766646026200 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Pdf.Advanced; using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; using PdfSharp.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Represents the imported objects of an external document. Used to cache objects that are /// already imported when a PdfFormXObject is added to a page. /// internal sealed class PdfImportedObjectTable { /// /// Initializes a new instance of this class with the document the objects are imported from. /// public PdfImportedObjectTable(PdfDocument owner, PdfDocument externalDocument) { if (owner == null) throw new ArgumentNullException("owner"); if (externalDocument == null) throw new ArgumentNullException("externalDocument"); this.owner = owner; this.externalDocumentHandle = externalDocument.Handle; this.xObjects = new PdfFormXObject[externalDocument.PageCount]; } PdfFormXObject[] xObjects; /// /// Gets the document this table belongs to. /// public PdfDocument Owner { get { return this.owner; } } PdfDocument owner; /// /// Gets the external document, or null, if the external document is garbage collected. /// public PdfDocument ExternalDocument { get { if (this.externalDocumentHandle.IsAlive) return this.externalDocumentHandle.Target; return null; } } PdfDocument.DocumentHandle externalDocumentHandle; public PdfFormXObject GetXObject(int pageNumber) { return this.xObjects[pageNumber - 1]; } public void SetXObject(int pageNumber, PdfFormXObject xObject) { this.xObjects[pageNumber - 1] = xObject; } /// /// Indicates whether the specified object is already imported. /// public bool Contains(PdfObjectID externalID) { return this.externalIDs.ContainsKey(externalID.ToString()); } /// /// Adds a cloned object to this table. /// /// The object identifier in the foreign object. /// The cross reference to the clone of the foreign object, which belongs to /// this document. In general the clone has a different object identifier. public void Add(PdfObjectID externalID, PdfReference iref) { this.externalIDs[externalID.ToString()] = iref; } /// /// Gets the cloned object that corresponds to the specified external identifier. /// public PdfReference this[PdfObjectID externalID] { get { return (PdfReference)this.externalIDs[externalID.ToString()]; } } /// /// Maps external object identifiers to cross reference entries of the importing document /// {PdfObjectID -> PdfReference}. /// Dictionary externalIDs = new Dictionary(); } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfGroupAttributes.cs0000644000175000001440000000657511435766646025472 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; #if GDI using System.Drawing; using System.Drawing.Imaging; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; using PdfSharp.Internal; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Represents a PDF group XObject. /// public abstract class PdfGroupAttributes : PdfDictionary { internal PdfGroupAttributes(PdfDocument thisDocument) : base(thisDocument) { Elements.SetName(Keys.Type, "/Group"); } /// /// Predefined keys of this dictionary. /// public class Keys : KeysBase { /// ///(Optional) The type of PDF object that this dictionary describes; ///if present, must be Group for a group attributes dictionary. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string Type = "/Type"; /// /// (Required) The group subtype, which identifies the type of group whose /// attributes this dictionary describes and determines the format and meaning /// of the dictionarys remaining entries. The only group subtype defined in /// PDF 1.4 is Transparency. Other group subtypes may be added in the future. /// [KeyInfo(KeyType.Name | KeyType.Required)] public const string S = "/S"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfInternals.cs0000644000175000001440000002211111435766646024246 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Reflection; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf.Advanced { /// /// Provides access to the internal document data structures. This class prevents the public /// interfaces from pollution with to much internal functions. /// public class PdfInternals // TODO: PdfDocumentInternals... PdfPageInterals etc. { internal PdfInternals(PdfDocument document) { this.document = document; } PdfDocument document; /// /// Gets or sets the first document identifier. /// public string FirstDocumentID { get { return this.document.trailer.GetDocumentID(0); } set { this.document.trailer.SetDocumentID(0, value); } } /// /// Gets the first document identifier as GUID. /// public Guid FirstDocumentGuid { get { return GuidFromString(this.document.trailer.GetDocumentID(0)); } } /// /// Gets or sets the second document identifier. /// public string SecondDocumentID { get { return this.document.trailer.GetDocumentID(1); } set { this.document.trailer.SetDocumentID(1, value); } } /// /// Gets the first document identifier as GUID. /// public Guid SecondDocumentGuid { get { return GuidFromString(this.document.trailer.GetDocumentID(0)); } } Guid GuidFromString(string id) { if (id == null || id.Length != 16) return Guid.Empty; StringBuilder guid = new StringBuilder(); for (int idx = 0; idx < 16; idx++) guid.AppendFormat("{0:X2}", (byte)id[idx]); return new Guid(guid.ToString()); } /// /// Gets the catalog dictionary. /// public PdfCatalog Catalog { get { return this.document.Catalog; } } /// /// Returns the object with the specified Identifier, or null, if no such object exists. /// public PdfObject GetObject(PdfObjectID objectID) { return document.irefTable[objectID].Value; } /// /// Returns the PdfReference of the specified object, or null, if the object is not in the /// document's object table. /// public static PdfReference GetReference(PdfObject obj) { if (obj == null) throw new ArgumentNullException("obj"); return obj.Reference; } /// /// Gets the object identifier of the specified object. /// public static PdfObjectID GetObjectID(PdfObject obj) { if (obj == null) throw new ArgumentNullException("obj"); return obj.ObjectID; } /// /// Gets the object number of the specified object. /// public static int GetObjectNumber(PdfObject obj) { if (obj == null) throw new ArgumentNullException("obj"); return obj.ObjectNumber; } /// /// Gets the generation number of the specified object. /// public static int GenerationNumber(PdfObject obj) { if (obj == null) throw new ArgumentNullException("obj"); return obj.GenerationNumber; } /// /// Gets all indirect objects ordered by their object identifier. /// public PdfObject[] GetAllObjects() { PdfReference[] irefs = this.document.irefTable.AllReferences; int count = irefs.Length; PdfObject[] objects = new PdfObject[count]; for (int idx = 0; idx < count; idx++) objects[idx] = irefs[idx].Value; return objects; } /// /// Gets all indirect objects ordered by their object identifier. /// [Obsolete("Use GetAllObjects.")] // Properties should not return arrays public PdfObject[] AllObjects { get { return GetAllObjects(); } } /// /// Creates the indirect object of the specified type, adds it to the document, and /// returns the object. /// public T CreateIndirectObject() where T : PdfObject { T result = null; ConstructorInfo ctorInfo = typeof(T).GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.ExactBinding, null, new Type[] { typeof(PdfDocument) }, null); if (ctorInfo != null) { result = (T)ctorInfo.Invoke(new object[] { this.document }); Debug.Assert(result != null); AddObject(result); } Debug.Assert(result != null, "CreateIndirectObject failed with type " + typeof(T).FullName); return result; } /// /// Adds an object to the PDF document. This operation and only this operation makes the object /// an indirect object owned by this document. /// public void AddObject(PdfObject obj) { if (obj == null) throw new ArgumentNullException("obj"); if (obj.Owner == null) obj.Document = this.document; else if (obj.Owner != this.document) throw new InvalidOperationException("Object does not belong to this document."); this.document.irefTable.Add(obj); } /// /// Removes an object from the PDF document. /// public void RemoveObject(PdfObject obj) { if (obj == null) throw new ArgumentNullException("obj"); if (obj.Reference == null) throw new InvalidOperationException("Only indirect objects can be removed."); if (obj.Owner != this.document) throw new InvalidOperationException("Object does not belong to this document."); this.document.irefTable.Remove(obj.Reference); } /// /// Returns an array containing the specified object as first element follows by its transitive /// closure. The closure of an object are all objects that can be reached by indirect references. /// The transitive closure is the result of applying the calculation of the closure to a closure /// as long as no new objects came along. This is e.g. useful for getting all objects belonging /// to the resources of a page. /// public PdfObject[] GetClosure(PdfObject obj) { return GetClosure(obj, Int32.MaxValue); } /// /// Returns an array containing the specified object as first element follows by its transitive /// closure limited by the specified number of iterations. /// public PdfObject[] GetClosure(PdfObject obj, int depth) { PdfReference[] references = this.document.irefTable.TransitiveClosure(obj, depth); int count = references.Length + 1; PdfObject[] objects = new PdfObject[count]; objects[0] = obj; for (int idx = 1; idx < count; idx++) objects[idx] = references[idx - 1].Value; return objects; } /// /// Writes a PdfItem into the specified stream. /// // This function exists to keep PdfWriter and PdfItem.WriteObject internal. public void WriteObject(Stream stream, PdfItem item) { // Never write an encrypted object PdfWriter writer = new PdfWriter(stream, null); writer.Options = PdfWriterOptions.OmitStream; item.WriteObject(writer); } /// /// The name of the custom value key. /// public string CustomValueKey = "/PdfSharp.CustomValue"; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfImageTable.cs0000644000175000001440000001014511435766646024305 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections.Generic; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Drawing; using PdfSharp.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Contains all used images of a document. /// internal sealed class PdfImageTable : PdfResourceTable { /// /// Initializes a new instance of this class, which is a singleton for each document. /// public PdfImageTable(PdfDocument document) : base(document) { } /// /// Gets a PdfImage from an XImage. If no PdfImage already exists, a new one is created. /// public PdfImage GetImage(XImage image) { PdfImageTable.ImageSelector selector = image.selector; if (selector == null) { selector = new ImageSelector(image); image.selector = selector; } PdfImage pdfImage; if (!this.images.TryGetValue(selector, out pdfImage)) { pdfImage = new PdfImage(this.owner, image); //pdfImage.Document = this.document; Debug.Assert(pdfImage.Owner == this.owner); this.images[selector] = pdfImage; //if (this.document.EarlyWrite) //{ // //pdfFont.Close(); delete // //pdfFont.AssignObjID(ref this.document.ObjectID); // BUG just test code!!!! // //pdfFont.WriteObject(null); //} } return pdfImage; } /// /// Map from ImageSelector to PdfImage. /// readonly Dictionary images = new Dictionary(); /// /// A collection of information that uniquely identifies a particular PdfImage. /// public class ImageSelector { /// /// Initializes a new instance of ImageSelector from an XImage. /// public ImageSelector(XImage image) { // HACK: implement a way to identify images when they are reused if (image.path == null) image.path = Guid.NewGuid().ToString(); // HACK: just use full path to identify this.path = image.path.ToLower(CultureInfo.InvariantCulture); } public string Path { get { return this.path; } set { this.path = value; } } string path; public override bool Equals(object obj) { ImageSelector selector = obj as ImageSelector; if (obj == null) return false; return this.path == selector.path; ; } public override int GetHashCode() { return this.path.GetHashCode(); } } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfContents.cs0000644000175000001440000001414711435766646024116 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Drawing; using PdfSharp.Drawing.Pdf; using PdfSharp.Pdf; using PdfSharp.Pdf.Internal; using PdfSharp.Pdf.Filters; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf.Advanced { /// /// Represents an array of PDF content streams of a page. /// public sealed class PdfContents : PdfArray { /// /// Initializes a new instance of the class. /// /// The document. public PdfContents(PdfDocument document) : base(document) { } internal PdfContents(PdfArray array) : base(array) { int count = Elements.Count; for (int idx = 0; idx < count; idx++) { // Convert the references from PdfDictionary to PdfContent PdfItem item = Elements[idx]; PdfReference iref = item as PdfReference; if (iref != null && iref.Value is PdfDictionary) { // The following line is correct! new PdfContent((PdfDictionary)iref.Value); } else throw new InvalidOperationException("Unexpected item in a content stream array."); } } /// /// Appends a new content stream and returns it. /// public PdfContent AppendContent() { Debug.Assert(this.Owner != null); SetModified(); PdfContent content = new PdfContent(this.Owner); Owner.irefTable.Add(content); Debug.Assert(content.Reference != null); Elements.Add(content.Reference); return content; } /// /// Prepends a new content stream and returns it. /// public PdfContent PrependContent() { Debug.Assert(this.Owner != null); SetModified(); PdfContent content = new PdfContent(this.Owner); Owner.irefTable.Add(content); Debug.Assert(content.Reference != null); Elements.Insert(0, content.Reference); return content; } /// /// Creates a single content stream with the bytes from the array of the content streams. /// This operation does not modify any of the content streams in this array. /// public PdfContent CreateSingleContent() { byte[] bytes = new byte[0]; byte[] bytes1; byte[] bytes2; foreach (PdfItem iref in Elements) { PdfDictionary cont = (PdfDictionary)((PdfReference)iref).Value; bytes1 = bytes; bytes2 = cont.Stream.UnfilteredValue; bytes = new byte[bytes1.Length + bytes2.Length + 1]; bytes1.CopyTo(bytes, 0); bytes[bytes1.Length] = (byte)'\n'; bytes2.CopyTo(bytes, bytes1.Length + 1); } PdfContent content = new PdfContent(this.Owner); content.Stream = new PdfDictionary.PdfStream(bytes, content); return content; } void SetModified() { if (!this.modified) { this.modified = true; int count = Elements.Count; if (count == 1) { PdfContent content = (PdfContent)((PdfReference)Elements[0]).Value; content.PreserveGraphicsState(); } else if (count > 1) { // Surround content streams with q/Q operations byte[] value; int length; PdfContent content = (PdfContent)((PdfReference)Elements[0]).Value; if (content != null && content.Stream != null) { length = content.Stream.Length; value = new byte[length + 2]; value[0] = (byte)'q'; value[1] = (byte)'\n'; Array.Copy(content.Stream.Value, 0, value, 2, length); content.Stream.Value = value; content.Elements.SetInteger("/Length", length + 2); } content = (PdfContent)((PdfReference)Elements[count - 1]).Value; if (content != null && content.Stream != null) { length = content.Stream.Length; value = new byte[length + 3]; Array.Copy(content.Stream.Value, 0, value, 0, length); value[length] = (byte)' '; value[length + 1] = (byte)'Q'; value[length + 2] = (byte)'\n'; content.Stream.Value = value; content.Elements.SetInteger("/Length", length + 3); } } } } bool modified; internal override void WriteObject(PdfWriter writer) { // Save two bytes in PDF stream... if (Elements.Count == 1) Elements[0].WriteObject(writer); else base.WriteObject(writer); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfContent.cs0000644000175000001440000001455211435766646023733 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Drawing; using PdfSharp.Drawing.Pdf; using PdfSharp.Pdf; using PdfSharp.Pdf.Internal; using PdfSharp.Pdf.Filters; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf.Advanced { /// /// Represents the content of a page. PDFsharp supports only one content stream per page. /// If an imported page has an array of content streams, the streams are concatenated to /// one single stream. /// public sealed class PdfContent : PdfDictionary { /// /// Initializes a new instance of the class. /// public PdfContent(PdfDocument document) : base(document) { } /// /// Initializes a new instance of the class. /// internal PdfContent(PdfPage page) : base(page != null ? page.Owner : null) { //this.pageContent = new PageContent(page); } /// /// Initializes a new instance of the class. /// /// The dict. public PdfContent(PdfDictionary dict) // HACK PdfContent : base(dict) { // A PdfContent dictionary is always unfiltered. Decode(); } /// /// Sets a value indicating whether the content is compressed with the ZIP algorithm. /// public bool Compressed { set { if (value) { PdfItem filter = Elements["/Filter"]; if (filter == null) { byte[] bytes = Filtering.FlateDecode.Encode(Stream.Value); Stream.Value = bytes; Elements.SetInteger("/Length", Stream.Length); Elements.SetName("/Filter", "/FlateDecode"); } } } } /// /// Unfilters the stream. /// void Decode() { if (Stream != null && Stream.Value != null) { PdfItem item = Elements["/Filter"]; if (item != null) { byte[] bytes = Filtering.Decode(Stream.Value, item); if (bytes != null) { Stream.Value = bytes; Elements.Remove("/Filter"); Elements.SetInteger("/Length", Stream.Length); } } } } /// /// Surround content with q/Q operations if necessary. /// internal void PreserveGraphicsState() { // If a content stream is touched by PDFsharp it is typically because graphical operations are // prepended or appended. Some nasty PDF tools does not preserve the graphical state correctly. // Therefore we try to relieve the problem by surrounding the content stream with push/restore // graphic state operation. if (this.Stream != null) { byte[] value = Stream.Value; int length = value.Length; if (length != 0 && ((value[0] != (byte)'q' || value[1] != (byte)'\n'))) { byte[] newValue = new byte[length + 2 + 3]; newValue[0] = (byte)'q'; newValue[1] = (byte)'\n'; Array.Copy(value, 0, newValue, 2, length); newValue[length + 2] = (byte)' '; newValue[length + 3] = (byte)'Q'; newValue[length + 4] = (byte)'\n'; Stream.Value = newValue; Elements.SetInteger("/Length", Stream.Length); } } } internal override void WriteObject(PdfWriter writer) { if (this.pdfRenderer != null) { // GetContent also disposes the underlying XGraphics object, if one exists //Stream = new PdfStream(PdfEncoders.RawEncoding.GetBytes(this.pdfRenderer.GetContent()), this); this.pdfRenderer.Close(); Debug.Assert(this.pdfRenderer == null); } if (Stream != null) { if (this.Owner.Options.CompressContentStreams) { Stream.Value = Filtering.FlateDecode.Encode(Stream.Value); Elements["/Filter"] = new PdfName("/FlateDecode"); } Elements.SetInteger("/Length", Stream.Length); } base.WriteObject(writer); } internal XGraphicsPdfRenderer pdfRenderer; /// /// Predefined keys of this dictionary. /// internal sealed class Keys : PdfDictionary.PdfStream.Keys { /// /// Gets the KeysMeta for these keys. /// public static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfShading.cs0000644000175000001440000002436611435766646023702 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.Collections; using System.Text; using System.IO; #if GDI using System.Drawing; using System.Drawing.Imaging; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; using PdfSharp.Internal; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Represents a shading dictionary. /// public sealed class PdfShading : PdfDictionary { /// /// Initializes a new instance of the class. /// public PdfShading(PdfDocument document) : base(document) { } /// /// Setups the shading from the specified brush. /// public void SetupFromBrush(XLinearGradientBrush brush) { if (brush == null) throw new ArgumentNullException("brush"); PdfColorMode colorMode = this.document.Options.ColorMode; XColor color1 = ColorSpaceHelper.EnsureColorMode(colorMode, brush.color1); XColor color2 = ColorSpaceHelper.EnsureColorMode(colorMode, brush.color2); PdfDictionary function = new PdfDictionary(); Elements[Keys.ShadingType] = new PdfInteger(2); if (colorMode != PdfColorMode.Cmyk) Elements[Keys.ColorSpace] = new PdfName("/DeviceRGB"); else Elements[Keys.ColorSpace] = new PdfName("/DeviceCMYK"); double x1 = 0, y1 = 0, x2 = 0, y2 = 0; if (brush.useRect) { switch (brush.linearGradientMode) { case XLinearGradientMode.Horizontal: x1 = brush.rect.x; y1 = brush.rect.y; x2 = brush.rect.x + brush.rect.width; y2 = brush.rect.y; break; case XLinearGradientMode.Vertical: x1 = brush.rect.x; y1 = brush.rect.y; x2 = brush.rect.x; y2 = brush.rect.y + brush.rect.height; break; case XLinearGradientMode.ForwardDiagonal: x1 = brush.rect.x; y1 = brush.rect.y; x2 = brush.rect.x + brush.rect.width; y2 = brush.rect.y + brush.rect.height; break; case XLinearGradientMode.BackwardDiagonal: x1 = brush.rect.x + brush.rect.width; y1 = brush.rect.y; x2 = brush.rect.x; y2 = brush.rect.y + brush.rect.height; break; } } else { x1 = brush.point1.x; y1 = brush.point1.y; x2 = brush.point2.x; y2 = brush.point2.y; } Elements[Keys.Coords] = new PdfLiteral("[{0:0.###} {1:0.###} {2:0.###} {3:0.###}]", x1, y1, x2, y2); //Elements[Keys.Background] = new PdfRawItem("[0 1 1]"); //Elements[Keys.Domain] = Elements[Keys.Function] = function; //Elements[Keys.Extend] = new PdfRawItem("[true true]"); string clr1 = "[" + PdfEncoders.ToString(color1, colorMode) + "]"; string clr2 = "[" + PdfEncoders.ToString(color2, colorMode) + "]"; function.Elements["/FunctionType"] = new PdfInteger(2); function.Elements["/C0"] = new PdfLiteral(clr1); function.Elements["/C1"] = new PdfLiteral(clr2); function.Elements["/Domain"] = new PdfLiteral("[0 1]"); function.Elements["/N"] = new PdfInteger(1); } /// /// Common keys for all streams. /// internal sealed class Keys : KeysBase { /// /// (Required) The shading type: /// 1 Function-based shading /// 2 Axial shading /// 3 Radial shading /// 4 Free-form Gouraud-shaded triangle mesh /// 5 Lattice-form Gouraud-shaded triangle mesh /// 6 Coons patch mesh /// 7 Tensor-product patch mesh /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string ShadingType = "/ShadingType"; /// /// (Required) The color space in which color values are expressed. This may be any device, /// CIE-based, or special color space except a Pattern space. /// [KeyInfo(KeyType.NameOrArray | KeyType.Required)] public const string ColorSpace = "/ColorSpace"; /// /// (Optional) An array of color components appropriate to the color space, specifying /// a single background color value. If present, this color is used, before any painting /// operation involving the shading, to fill those portions of the area to be painted /// that lie outside the bounds of the shading object. In the opaque imaging model, /// the effect is as if the painting operation were performed twice: first with the /// background color and then with the shading. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string Background = "/Background"; /// /// (Optional) An array of four numbers giving the left, bottom, right, and top coordinates, /// respectively, of the shadings bounding box. The coordinates are interpreted in the /// shadings target coordinate space. If present, this bounding box is applied as a temporary /// clipping boundary when the shading is painted, in addition to the current clipping path /// and any other clipping boundaries in effect at that time. /// [KeyInfo(KeyType.Rectangle | KeyType.Optional)] public const string BBox = "/BBox"; /// /// (Optional) A flag indicating whether to filter the shading function to prevent aliasing /// artifacts. The shading operators sample shading functions at a rate determined by the /// resolution of the output device. Aliasing can occur if the function is not smooththat /// is, if it has a high spatial frequency relative to the sampling rate. Anti-aliasing can /// be computationally expensive and is usually unnecessary, since most shading functions /// are smooth enough or are sampled at a high enough frequency to avoid aliasing effects. /// Anti-aliasing may not be implemented on some output devices, in which case this flag /// is ignored. /// Default value: false. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string AntiAlias = "/AntiAlias"; // ---- Type 2 ---------------------------------------------------------- /// /// (Required) An array of four numbers [x0 y0 x1 y1] specifying the starting and /// ending coordinates of the axis, expressed in the shadings target coordinate space. /// [KeyInfo(KeyType.Array | KeyType.Required)] public const string Coords = "/Coords"; /// /// (Optional) An array of two numbers [t0 t1] specifying the limiting values of a /// parametric variable t. The variable is considered to vary linearly between these /// two values as the color gradient varies between the starting and ending points of /// the axis. The variable t becomes the input argument to the color function(s). /// Default value: [0.0 1.0]. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string Domain = "/Domain"; /// /// (Required) A 1-in, n-out function or an array of n 1-in, 1-out functions (where n /// is the number of color components in the shading dictionarys color space). The /// function(s) are called with values of the parametric variable t in the domain defined /// by the Domain entry. Each functions domain must be a superset of that of the shading /// dictionary. If the value returned by the function for a given color component is out /// of range, it is adjusted to the nearest valid value. /// [KeyInfo(KeyType.Function | KeyType.Required)] public const string Function = "/Function"; /// /// (Optional) An array of two boolean values specifying whether to extend the shading /// beyond the starting and ending points of the axis, respectively. /// Default value: [false false]. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string Extend = "/Extend"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfXObject.cs0000644000175000001440000000437311435766646023657 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; #if GDI using System.Drawing; using System.Drawing.Imaging; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; using PdfSharp.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Base class for all PDF external objects. /// public abstract class PdfXObject : PdfDictionary { /// /// Initializes a new instance of the class. /// /// The document that owns the object. public PdfXObject(PdfDocument document) : base(document) { } /// /// Predefined keys of this dictionary. /// public class Keys : PdfDictionary.PdfStream.Keys { } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfTrueTypeFont.cs0000644000175000001440000003064211435766646024727 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Drawing; using PdfSharp.Internal; using PdfSharp.Fonts; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Filters; namespace PdfSharp.Pdf.Advanced { /// /// Represents a TrueType font. /// internal class PdfTrueTypeFont : PdfFont { public PdfTrueTypeFont(PdfDocument document) : base(document) { } /// /// Initializes a new instance of PdfTrueTypeFont from an XFont. /// public PdfTrueTypeFont(PdfDocument document, XFont font) : base(document) { Elements.SetName(Keys.Type, "/Font"); Elements.SetName(Keys.Subtype, "/TrueType"); // TrueType with WinAnsiEncoding only OpenTypeDescriptor ttDescriptor = (OpenTypeDescriptor)FontDescriptorStock.Global.CreateDescriptor(font); this.fontDescriptor = new PdfFontDescriptor(document, ttDescriptor); this.fontOptions = font.PdfOptions; Debug.Assert(this.fontOptions != null); //this.cmapInfo = new CMapInfo(null/*ttDescriptor*/); this.cmapInfo = new CMapInfo(ttDescriptor); BaseFont = font.Name.Replace(" ", ""); switch (font.Style & (XFontStyle.Bold | XFontStyle.Italic)) { case XFontStyle.Bold: BaseFont += ",Bold"; break; case XFontStyle.Italic: BaseFont += ",Italic"; break; case XFontStyle.Bold | XFontStyle.Italic: BaseFont += ",BoldItalic"; break; } if (this.fontOptions.FontEmbedding == PdfFontEmbedding.Always) BaseFont = PdfFont.CreateEmbeddedFontSubsetName(BaseFont); this.fontDescriptor.FontName = BaseFont; Debug.Assert(this.fontOptions.FontEncoding == PdfFontEncoding.WinAnsi); if (!IsSymbolFont) Encoding = "/WinAnsiEncoding"; // { //#if true // throw new NotImplementedException("Specifying a font file is not yet supported."); //#else // // Testcode // FileStream stream = new FileStream("WAL____I.AFM", FileAccess.Read); // int length = stream.Length; // byte[] fontProgram = new byte[length]; // PdfDictionary fontStream = new PdfDictionary(this.Document); // this.Document.xrefTable.Add(fontStream); // this.fontDescriptor.Elements[PdfFontDescriptor.Keys.FontFile] = fontStream.XRef; // fontStream.Elements["/Length1"] = new PdfInteger(fontProgram.Length); // if (!this.Document.Options.NoCompression) // { // fontProgram = Filtering.FlateDecode.Encode(fontProgram); // fontStream.Elements["/Filter"] = new PdfName("/FlateDecode"); // } // fontStream.Elements["/Length"] = new PdfInteger(fontProgram.Length); // fontStream.CreateStream(fontProgram); //#endif // } Owner.irefTable.Add(this.fontDescriptor); Elements[Keys.FontDescriptor] = this.fontDescriptor.Reference; FontEncoding = font.PdfOptions.FontEncoding; FontEmbedding = font.PdfOptions.FontEmbedding; } XPdfFontOptions FontOptions { get { return this.fontOptions; } } XPdfFontOptions fontOptions; public string BaseFont { get { return Elements.GetName(Keys.BaseFont); } set { Elements.SetName(Keys.BaseFont, value); } } public int FirstChar { get { return Elements.GetInteger(Keys.FirstChar); } set { Elements.SetInteger(Keys.FirstChar, value); } } public int LastChar { get { return Elements.GetInteger(Keys.LastChar); } set { Elements.SetInteger(Keys.LastChar, value); } } public PdfArray Widths { get { return (PdfArray)Elements.GetValue(Keys.Widths, VCF.Create); } } public string Encoding { get { return Elements.GetName(Keys.Encoding); } set { Elements.SetName(Keys.Encoding, value); } } /// /// Prepares the object to get saved. /// internal override void PrepareForSave() { base.PrepareForSave(); if (FontEmbedding == PdfFontEmbedding.Always || FontEmbedding == PdfFontEmbedding.Automatic) { FontData subSet = this.fontDescriptor.descriptor.fontData.CreateFontSubSet(this.cmapInfo.GlyphIndices, false); byte[] fontData = subSet.Data; #if DEBUG_ TrueTypeFontSubSet fss = new TrueTypeFontSubSet("", this.cmapInfo.descriptor.fontData, this.cmapInfo.GlyphIndices, 0, true, false); byte[] fontSubSet = fss.Process(); fss.CompareBytes(fontSubSet, fontProgram); #endif PdfDictionary fontStream = new PdfDictionary(this.Owner); this.Owner.Internals.AddObject(fontStream); this.fontDescriptor.Elements[PdfFontDescriptor.Keys.FontFile2] = fontStream.Reference; fontStream.Elements["/Length1"] = new PdfInteger(fontData.Length); if (!this.Owner.Options.NoCompression) { fontData = Filtering.FlateDecode.Encode(fontData); fontStream.Elements["/Filter"] = new PdfName("/FlateDecode"); } fontStream.Elements["/Length"] = new PdfInteger(fontData.Length); fontStream.CreateStream(fontData); } //if (this.cmapInfo == null) //{ FirstChar = 0; LastChar = 255; PdfArray width = Widths; //width.Elements.Clear(); for (int idx = 0; idx < 256; idx++) width.Elements.Add(new PdfInteger(this.fontDescriptor.descriptor.widths[idx])); //} //else //{ // FirstChar = (char)Math.Min(this.cmapInfo.MinChar, 255u); // LastChar = (char)Math.Min(this.cmapInfo.MaxChar, 255u); // PdfArray width = Widths; // Debug.Assert(width.Elements.Count == 0); // //width.Elements.Clear(); // for (int idx = FirstChar; idx <= LastChar; idx++) // { // int charWidth = 0; // if (this.cmapInfo.Contains((char)idx)) // charWidth = this.fontDescriptor.descriptor.widths[idx]; // width.Elements.Add(new PdfInteger(charWidth)); // } //} } /// /// Predefined keys of this dictionary. /// public new sealed class Keys : PdfFont.Keys { /// /// (Required) The type of PDF object that this dictionary describes; /// must be Font for a font dictionary. /// [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Font")] public new const string Type = "/Type"; /// /// (Required) The type of font; must be TrueType for a TrueType font. /// [KeyInfo(KeyType.Name | KeyType.Required)] public new const string Subtype = "/Subtype"; /// /// (Required in PDF 1.0; optional otherwise) The name by which this font is /// referenced in the Font subdictionary of the current resource dictionary. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string Name = "/Name"; /// /// (Required) The PostScript name of the font. For Type 1 fonts, this is usually /// the value of the FontName entry in the font program; for more information. /// The Post-Script name of the font can be used to find the fonts definition in /// the consumer application or its environment. It is also the name that is used when /// printing to a PostScript output device. /// [KeyInfo(KeyType.Name | KeyType.Required)] public new const string BaseFont = "/BaseFont"; /// /// (Required except for the standard 14 fonts) The first character code defined /// in the fonts Widths array. /// [KeyInfo(KeyType.Integer)] public const string FirstChar = "/FirstChar"; /// /// (Required except for the standard 14 fonts) The last character code defined /// in the fonts Widths array. /// [KeyInfo(KeyType.Integer)] public const string LastChar = "/LastChar"; /// /// (Required except for the standard 14 fonts; indirect reference preferred) /// An array of (LastChar - FirstChar + 1) widths, each element being the glyph width /// for the character code that equals FirstChar plus the array index. For character /// codes outside the range FirstChar to LastChar, the value of MissingWidth from the /// FontDescriptor entry for this font is used. The glyph widths are measured in units /// in which 1000 units corresponds to 1 unit in text space. These widths must be /// consistent with the actual widths given in the font program. /// [KeyInfo(KeyType.Array, typeof(PdfArray))] public const string Widths = "/Widths"; /// /// (Required except for the standard 14 fonts; must be an indirect reference) /// A font descriptor describing the fonts metrics other than its glyph widths. /// Note: For the standard 14 fonts, the entries FirstChar, LastChar, Widths, and /// FontDescriptor must either all be present or all be absent. Ordinarily, they are /// absent; specifying them enables a standard font to be overridden. /// [KeyInfo(KeyType.Dictionary | KeyType.MustBeIndirect, typeof(PdfFontDescriptor))] public new const string FontDescriptor = "/FontDescriptor"; /// /// (Optional) A specification of the fonts character encoding if different from its /// built-in encoding. The value of Encoding is either the name of a predefined /// encoding (MacRomanEncoding, MacExpertEncoding, or WinAnsiEncoding, as described in /// Appendix D) or an encoding dictionary that specifies differences from the fonts /// built-in encoding or from a specified predefined encoding. /// [KeyInfo(KeyType.Name | KeyType.Dictionary)] public const string Encoding = "/Encoding"; /// /// (Optional; PDF 1.2) A stream containing a CMap file that maps character /// codes to Unicode values. /// [KeyInfo(KeyType.Stream | KeyType.Optional)] public const string ToUnicode = "/ToUnicode"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfFontTable.cs0000644000175000001440000003115211435766646024172 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections.Generic; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Drawing; using PdfSharp.Internal; using PdfSharp.Fonts.OpenType; namespace PdfSharp.Pdf.Advanced { internal enum FontType { /// /// TrueType with WinAnsi encoding. /// TrueType = 1, /// /// TrueType with Identity-H or Identity-V encoding (unicode). /// Type0 = 2, } /// /// Contains all used fonts of a document. /// internal sealed class PdfFontTable : PdfResourceTable { /// /// Initializes a new instance of this class, which is a singleton for each document. /// public PdfFontTable(PdfDocument document) : base(document) { } /// /// Gets a PdfFont from an XFont. If no PdfFont already exists, a new one is created. /// public PdfFont GetFont(XFont font) { string fontName = font.Name; PdfFontTable.FontSelector selector = font.selector; if (selector == null) { selector = new FontSelector(font); font.selector = selector; } PdfFont pdfFont; if (!this.fonts.TryGetValue(selector, out pdfFont)) { if (font.Unicode) pdfFont = new PdfType0Font(this.owner, font, font.IsVertical); else pdfFont = new PdfTrueTypeFont(this.owner, font); //pdfFont.Document = this.document; Debug.Assert(pdfFont.Owner == this.owner); this.fonts[selector] = pdfFont; //if (this.owner.EarlyWrite) //{ // //pdfFont.Close(); delete // //pdfFont.AssignObjID(ref this.document.ObjectID); // BUG: just test code!!!! // //pdfFont.WriteObject(null); //} } return pdfFont; #if false goto TrueTypeFont; switch (font.Name) { case "Times": case "Times New Roman": std = 0; break; case "Helvetica": std = 1; break; case "Courier": std = 2; break; case "Symbol": std = 3; break; case "ZapfDingbats": std = 4; break; } if (std != -1) { int idx = (int)font.Style & 0x3; string name = pdfStandardFonts[std][idx]; PdfFont pdfFont = GetFont(name); if (pdfFont == null) { pdfFont = new PdfFont(); pdfFont.SubType = "/Type1"; pdfFont.BaseFont = name; pdfFont.DefaultName = string.Format("F{0}", PdfFontTable.fontNumber++); } return pdfFont; } else { TrueTypeFont: // TrueType font PdfFont pdfFont = new PdfFont(); pdfFont.SubType = "/TrueType"; pdfFont.FirstChar = 0; pdfFont.LastChar = 255; pdfFont.BaseFont = font.Name; pdfFont.DefaultName = string.Format("F{0}", PdfFontTable.fontNumber++); } #endif // TrueType font // PdfFont pdfFont = new PdfFont(); // pdfFont.descriptor = new PdfFontDescriptor((TrueTypeDescriptor)FontDescriptorStock.Global.CreateDescriptor(font)); // pdfFont.SubType = "/TrueType"; // pdfFont.FirstChar = 0; // pdfFont.LastChar = 255; // pdfFont.BaseFont = font.Name; // pdfFont.BaseFont = pdfFont.BaseFont.Replace(" ", ""); // switch (font.Style & (XFontStyle.Bold | XFontStyle.Italic)) // { // case XFontStyle.Bold: // pdfFont.BaseFont += ",Bold"; // break; // // case XFontStyle.Italic: // pdfFont.BaseFont += ",Italic"; // break; // // case XFontStyle.Bold | XFontStyle.Italic: // pdfFont.BaseFont += ",BoldItalic"; // break; // } // pdfFont.descriptor.FontName = pdfFont.BaseFont; // pdfFont.DefaultName = string.Format("F{0}", PdfFontTable.fontNumber++); } //string[][] pdfStandardFonts = //{ // new string[]{"Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic"}, // new string[]{"Helvetica", "Helvetica-Bold", "Helvetica-Oblique", "Helvetica-BoldOblique"}, // new string[]{"Courier", "Courier-Bold", "Courier-Oblique", "Courier-BoldOblique"}, // new string[]{"Symbol", "Symbol", "Symbol", "Symbol"}, // new string[]{"ZapfDingbats", "ZapfDingbats", "ZapfDingbats", "ZapfDingbats"}, //}; #if true /// /// Gets a PdfFont from a font program. If no PdfFont already exists, a new one is created. /// public PdfFont GetFont(string idName, byte[] fontData) { PdfFontTable.FontSelector selector = new FontSelector(idName); PdfFont pdfFont; if (!this.fonts.TryGetValue(selector, out pdfFont)) { //if (font.Unicode) pdfFont = new PdfType0Font(this.owner, idName, fontData, false); //else // pdfFont = new PdfTrueTypeFont(this.owner, font); //pdfFont.Document = this.document; Debug.Assert(pdfFont.Owner == this.owner); this.fonts[selector] = pdfFont; } return pdfFont; } #endif /// /// Tries to gets a PdfFont from the font dictionary. /// Returns null if no such PdfFont exists. /// public PdfFont TryGetFont(string idName) { FontSelector selector = new FontSelector(idName); PdfFont pdfFont; this.fonts.TryGetValue(selector, out pdfFont); return pdfFont; } /// /// Map from PdfFontSelector to PdfFont. /// readonly Dictionary fonts = new Dictionary(); public void PrepareForSave() { foreach (PdfFont font in this.fonts.Values) font.PrepareForSave(); } /// /// A collection of information that uniquely identifies a particular PDF font. /// ... more docu... TODO /// Two PDF fonts are equal if and only if their font selector objects are equal. /// public class FontSelector { /// /// Initializes a new instance of PdfFontSelector from an XFont. /// public FontSelector(XFont font) { this.name = font.Name; // Ignore Strikeout and Underline this.style = font.Style & (XFontStyle.Bold | XFontStyle.Italic); // Clear styles that are not available as a separate type face to prevent embedding of identical font files #if GDI && !WPF if ((this.style & XFontStyle.Bold) == XFontStyle.Bold && !font.FontFamily.IsStyleAvailable(XFontStyle.Bold)) this.style &= ~XFontStyle.Bold; if ((this.style & XFontStyle.Italic) == XFontStyle.Italic && !font.FontFamily.IsStyleAvailable(XFontStyle.Italic)) this.style &= ~XFontStyle.Italic; #endif #if WPF && !GDI #if !SILVERLIGHT Debug.Assert(font.typeface != null); if ((this.style & XFontStyle.Bold) == XFontStyle.Bold && font.typeface.IsBoldSimulated) this.style &= ~XFontStyle.Bold; if ((this.style & XFontStyle.Italic) == XFontStyle.Italic && font.typeface.IsObliqueSimulated) this.style &= ~XFontStyle.Italic; #else // AGHACK #endif #endif #if WPF && GDI Debug.Assert(font.typeface != null); if ((this.style & XFontStyle.Bold) == XFontStyle.Bold && font.typeface.IsBoldSimulated) this.style &= ~XFontStyle.Bold; if ((this.style & XFontStyle.Italic) == XFontStyle.Italic && font.typeface.IsObliqueSimulated) this.style &= ~XFontStyle.Italic; #endif this.fontType = font.Unicode ? FontType.Type0 : FontType.TrueType; } /// /// Initializes a new instance of PdfFontSelector from a unique name. /// public FontSelector(string name) { this.name = name; //// Ignore Strikeout and Underline //this.style = font.Style & (XFontStyle.Bold | XFontStyle.Italic); //// Clear styles that are not available to prevent embedding of identical font files //if ((this.style & XFontStyle.Bold) == XFontStyle.Bold && !font.FontFamily.IsStyleAvailable(XFontStyle.Bold)) // this.style &= ~XFontStyle.Bold; //if ((this.style & XFontStyle.Italic) == XFontStyle.Italic && !font.FontFamily.IsStyleAvailable(XFontStyle.Italic)) // this.style &= ~XFontStyle.Italic; this.fontType = FontType.Type0; } public FontSelector(XFontFamily family, XFontStyle style) { throw new NotImplementedException("PdfFontSelector(XFontFamily family, XFontStyle style)"); } /// /// Gets the (generated) resource name of the font. In our own PDF files equal fonts share the /// same resource name in all contents streams. /// public string Name { get { return this.name; } } string name; /// /// Gets the style. Contains only flags that effects the font face and are available for the specified font. /// /// The style. public XFontStyle Style { get { return this.style; } } XFontStyle style; /// /// Gets the type of the font (TrueType with Ansi Encoding or CID font). /// public FontType FontType { get { return this.fontType; } } FontType fontType; public static bool operator ==(FontSelector selector1, FontSelector selector2) { if (!Object.ReferenceEquals(selector1, null)) selector1.Equals(selector2); return Object.ReferenceEquals(selector2, null); } public static bool operator !=(FontSelector selector1, FontSelector selector2) { return !(selector1 == selector2); } public override bool Equals(object obj) { FontSelector selector = obj as FontSelector; if (obj != null && this.name == selector.name && this.style == selector.style) return this.fontType == selector.fontType; return false; } public override int GetHashCode() { return this.name.GetHashCode() ^ this.style.GetHashCode() ^ this.fontType.GetHashCode(); } /// /// Returns a string for diagnostic purposes only. /// public override string ToString() { string variation = ""; switch (this.style) { case XFontStyle.Regular: variation = "(Regular)"; break; case XFontStyle.Bold: variation = "(Bold)"; break; case XFontStyle.Italic: variation = "(Italic)"; break; case XFontStyle.Bold | XFontStyle.Italic: variation = "(BoldItalic)"; break; } return this.name + variation; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfResourceMap.cs0000644000175000001440000000520411435766646024540 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Collections.Generic; namespace PdfSharp.Pdf.Advanced { /// /// Base class for all dictionaries that map resource names to objects. /// internal class PdfResourceMap : PdfDictionary //, IEnumerable { public PdfResourceMap() { } public PdfResourceMap(PdfDocument document) : base(document) { } protected PdfResourceMap(PdfDictionary dict) : base(dict) { } // public int Count // { // get {return this.resources.Count;} // } // // public PdfObject this[string key] // { // get {return this.resources[key] as PdfObject;} // set {this.resources[key] = value;} // } /// /// Adds all imported resource names to the specified hashtable. /// internal void CollectResourceNames(Dictionary usedResourceNames) { // ?TODO: Imported resources (e.g. fonts) can be reused, but I think this is rather difficult. Will be an issue in PDFsharp 2.0. PdfName[] names = Elements.KeyNames; foreach (PdfName name in names) usedResourceNames.Add(name.ToString(), null); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfFormXObjectTable.cs0000644000175000001440000001717711435766646025461 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections.Generic; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Drawing; using PdfSharp.Internal; using PdfSharp.Fonts.OpenType; namespace PdfSharp.Pdf.Advanced { /// /// Contains all external PDF files from which PdfFormXObjects are imported into the current document. /// internal sealed class PdfFormXObjectTable : PdfResourceTable { // The name PdfFormXObjectTable is technically not correct, because in contrast to PdfFontTable // or PdfImageTable this class holds no PdfFormXObject objects. Actually it holds instances of // the class ImportedObjectTable, one for each external document. The PdfFormXObject instances // are not cached, because they hold a transformation matrix that make them unique. If the user // wants to use a particual page of a PdfFormXObject more than once, he must reuse the object // before he changes the PageNumber or the transformation matrix. In other words this class // caches the indirect objects of an external form, not the form itself. /// /// Initializes a new instance of this class, which is a singleton for each document. /// public PdfFormXObjectTable(PdfDocument document) : base(document) { } /// /// Gets a PdfFormXObject from an XPdfForm. Because the returned objects must be unique, always /// a new instance of PdfFormXObject is created if none exists for the specified form. /// public PdfFormXObject GetForm(XForm form) { // If the form already has a PdfFormXObject, return it. if (form.pdfForm != null) { Debug.Assert(form.IsTemplate, "An XPdfForm must not have a PdfFormXObject."); if (object.ReferenceEquals(form.pdfForm.Owner, this.owner)) return form.pdfForm; //throw new InvalidOperationException("Because of a current limitation of PDFsharp an XPdfForm object can be used only within one single PdfDocument."); // Dispose PdfFromXObject when document has changed form.pdfForm = null; } XPdfForm pdfForm = form as XPdfForm; if (pdfForm != null) { // Is the external PDF file from which is imported already known for the current document? Selector selector = new Selector(form); PdfImportedObjectTable importedObjectTable; if (!this.forms.TryGetValue(selector, out importedObjectTable)) { // No: Get the external document from the form and create ImportedObjectTable. PdfDocument doc = pdfForm.ExternalDocument; importedObjectTable = new PdfImportedObjectTable(this.owner, doc); this.forms[selector] = importedObjectTable; } PdfFormXObject xObject = importedObjectTable.GetXObject(pdfForm.PageNumber); if (xObject == null) { xObject = new PdfFormXObject(this.owner, importedObjectTable, pdfForm); importedObjectTable.SetXObject(pdfForm.PageNumber, xObject); } return xObject; } Debug.Assert(form.GetType() == typeof(XForm)); form.pdfForm = new PdfFormXObject(this.owner, form); return form.pdfForm; } /// /// Gets the imported object table. /// public PdfImportedObjectTable GetImportedObjectTable(PdfPage page) { // Is the external PDF file from which is imported already known for the current document? Selector selector = new Selector(page); PdfImportedObjectTable importedObjectTable; if (!this.forms.TryGetValue(selector, out importedObjectTable)) { importedObjectTable = new PdfImportedObjectTable(this.owner, page.Owner); this.forms[selector] = importedObjectTable; } return importedObjectTable; } public void DetachDocument(PdfDocument.DocumentHandle handle) { if (handle.IsAlive) { foreach (Selector selector in this.forms.Keys) { PdfImportedObjectTable table = (PdfImportedObjectTable)this.forms[selector]; if (table.ExternalDocument != null && table.ExternalDocument.Handle == handle) { this.forms.Remove(selector); break; } } } // Clean table bool itemRemoved = true; while (itemRemoved) { itemRemoved = false; foreach (Selector selector in this.forms.Keys) { PdfImportedObjectTable table = this.forms[selector]; if (table.ExternalDocument == null) { this.forms.Remove(selector); itemRemoved = true; break; } } } } /// /// Map from Selector to PdfImportedObjectTable. /// readonly Dictionary forms = new Dictionary(); /// /// A collection of information that uniquely identifies a particular ImportedObjectTable. /// public class Selector { /// /// Initializes a new instance of FormSelector from an XPdfForm. /// public Selector(XForm form) { // HACK: just use full path to identify this.path = form.path.ToLower(CultureInfo.InvariantCulture); } /// /// Initializes a new instance of FormSelector from a PdfPage. /// public Selector(PdfPage page) { PdfDocument owner = page.Owner; //string path = owner.FullPath; //if (path.Length == 0) path = "*" + owner.Guid.ToString("B"); this.path = path.ToLower(CultureInfo.InvariantCulture); } public string Path { get { return this.path; } set { this.path = value; } } string path; public override bool Equals(object obj) { Selector selector = obj as Selector; if (obj == null) return false; return this.path == selector.path; ; } public override int GetHashCode() { return this.path.GetHashCode(); } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfObjectInternals.cs0000644000175000001440000000560111435766646025402 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Reflection; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf.Advanced { /// /// Provides access to the internal PDF object data structures. This class prevents the public /// interfaces from pollution with to much internal functions. /// public class PdfObjectInternals { internal PdfObjectInternals(PdfObject obj) { this.obj = obj; } PdfObject obj; /// /// Gets the object identifier. Returns PdfObjectID.Empty for direct objects. /// public PdfObjectID ObjectID { get { return this.obj.ObjectID; } } /// /// Gets the object number. /// public int ObjectNumber { get { return this.obj.ObjectID.ObjectNumber; } } /// /// Gets the generation number. /// public int GenerationNumber { get { return this.obj.ObjectID.GenerationNumber; } } /// /// Gets the name of the current type. /// Not a very useful property, but can be used for data binding. /// public string TypeID { get { if (this.obj is PdfArray) return "array"; else if (this.obj is PdfDictionary) return "dictionary"; return this.obj.GetType().Name; } } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfToUnicodeMap.cs0000644000175000001440000001102511435766646024640 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Collections.Generic; using System.Text; using System.IO; using PdfSharp.Drawing; using PdfSharp.Internal; using PdfSharp.Fonts; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Filters; namespace PdfSharp.Pdf.Advanced { /// /// Represents a ToUnicode map for composite font. /// internal sealed class PdfToUnicodeMap : PdfDictionary { public PdfToUnicodeMap(PdfDocument document) : base(document) { } public PdfToUnicodeMap(PdfDocument document, CMapInfo cmapInfo) : base(document) { this.cmapInfo = cmapInfo; } /// /// Gets or sets the CMap info. /// public CMapInfo CMapInfo { get { return this.cmapInfo; } set { this.cmapInfo = value; } } CMapInfo cmapInfo; /// /// Creates the ToUnicode map from the CMapInfo. /// internal override void PrepareForSave() { base.PrepareForSave(); // This code comes literaly from PDF Reference string prefix = "/CIDInit /ProcSet findresource begin\n" + "12 dict begin\n" + "begincmap\n" + "/CIDSystemInfo << /Registry (Adobe)/Ordering (UCS)/Supplement 0>> def\n" + "/CMapName /Adobe-Identity-UCS def /CMapType 2 def\n"; string suffix = "endcmap CMapName currentdict /CMap defineresource pop end end"; Dictionary glyphIndexToCharacter = new Dictionary(); int lowIndex = 65536, hiIndex = -1; foreach (KeyValuePair entry in this.cmapInfo.CharacterToGlyphIndex) { int index = (int)entry.Value; lowIndex = Math.Min(lowIndex, index); hiIndex = Math.Max(hiIndex, index); //glyphIndexToCharacter.Add(index, entry.Key); glyphIndexToCharacter[index] = entry.Key; } MemoryStream ms = new MemoryStream(); #if !SILVERLIGHT StreamWriter wrt = new StreamWriter(ms, Encoding.ASCII); #else StreamWriter wrt = new StreamWriter(ms, Encoding.UTF8); #endif wrt.Write(prefix); wrt.WriteLine("1 begincodespacerange"); wrt.WriteLine(String.Format("<{0:X4}><{1:X4}>", lowIndex, hiIndex)); wrt.WriteLine("endcodespacerange"); // Sorting seems not necessary. The limit is 100 entries, we will see. wrt.WriteLine(String.Format("{0} beginbfrange", glyphIndexToCharacter.Count)); foreach (KeyValuePair entry in glyphIndexToCharacter) wrt.WriteLine(String.Format("<{0:X4}><{0:X4}><{1:X4}>", entry.Key, (int)entry.Value)); wrt.WriteLine("endbfrange"); wrt.Write(suffix); wrt.Close(); // Compress like content streams byte[] bytes = ms.ToArray(); ms.Close(); if (Owner.Options.CompressContentStreams) { Elements.SetName("/Filter", "/FlateDecode"); bytes = Filtering.FlateDecode.Encode(bytes); } PdfStream stream = CreateStream(bytes); } public sealed class Keys : PdfDictionary.PdfStream.Keys { } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfFontDescriptor.cs0000644000175000001440000004150611435766646025265 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Fonts.OpenType; namespace PdfSharp.Pdf.Advanced { /// /// The PDF font descriptor flags. /// [Flags] enum PdfFontDescriptorFlags { /// /// All glyphs have the same width (as opposed to proportional or variable-pitch /// fonts, which have different widths). /// FixedPitch = 1 << 0, /// /// Glyphs have serifs, which are short strokes drawn at an angle on the top and /// bottom of glyph stems. (Sans serif fonts do not have serifs.) /// Serif = 1 << 1, /// /// Font contains glyphs outside the Adobe standard Latin character set. This /// flag and the Nonsymbolic flag cannot both be set or both be clear. /// Symbolic = 1 << 2, /// /// Glyphs resemble cursive handwriting. /// Script = 1 << 3, /// /// Font uses the Adobe standard Latin character set or a subset of it. /// Nonsymbolic = 1 << 5, /// /// Glyphs have dominant vertical strokes that are slanted. /// Italic = 1 << 6, /// /// Font contains no lowercase letters; typically used for display purposes, /// such as for titles or headlines. /// AllCap = 1 << 16, /// /// Font contains both uppercase and lowercase letters. The uppercase letters are /// similar to those in the regular version of the same typeface family. The glyphs /// for the lowercase letters have the same shapes as the corresponding uppercase /// letters, but they are sized and their proportions adjusted so that they have the /// same size and stroke weight as lowercase glyphs in the same typeface family. /// SmallCap = 1 << 17, /// /// Determines whether bold glyphs are painted with extra pixels even at very small /// text sizes. /// ForceBold = 1 << 18, } /// /// A PDF font descriptor specifies metrics and other attributes of a simple font, /// as distinct from the metrics of individual glyphs. /// public sealed class PdfFontDescriptor : PdfDictionary { internal PdfFontDescriptor(PdfDocument document, OpenTypeDescriptor descriptor) : base(document) { this.descriptor = descriptor; Elements.SetName(Keys.Type, "/FontDescriptor"); Elements.SetInteger(Keys.Ascent, this.descriptor.DesignUnitsToPdf(this.descriptor.Ascender)); Elements.SetInteger(Keys.CapHeight, this.descriptor.DesignUnitsToPdf(this.descriptor.CapHeight)); Elements.SetInteger(Keys.Descent, this.descriptor.DesignUnitsToPdf(this.descriptor.Descender)); Elements.SetInteger(Keys.Flags, (int)FlagsFromDescriptor(this.descriptor)); Elements.SetRectangle(Keys.FontBBox, new PdfRectangle( this.descriptor.DesignUnitsToPdf(this.descriptor.XMin), this.descriptor.DesignUnitsToPdf(this.descriptor.YMin), this.descriptor.DesignUnitsToPdf(this.descriptor.XMax), this.descriptor.DesignUnitsToPdf(this.descriptor.YMax))); // not here, done in PdfFont later... //Elements.SetName(Keys.FontName, "abc"); //this.descriptor.FontName); Elements.SetReal(Keys.ItalicAngle, this.descriptor.ItalicAngle); Elements.SetInteger(Keys.StemV, this.descriptor.StemV); Elements.SetInteger(Keys.XHeight, this.descriptor.DesignUnitsToPdf(this.descriptor.XHeight)); } //HACK OpenTypeDescriptor descriptor internal OpenTypeDescriptor descriptor; // public string DefaultName // { // get {return this.defaultName;} // set {this.defaultName = value;} // } // string defaultName; /// /// Gets or sets the name of the font. /// public string FontName { get { return Elements.GetName(Keys.FontName); } set { Elements.SetName(Keys.FontName, value); } } //string fontName; /// /// Gets a value indicating whether this instance is symbol font. /// public bool IsSymbolFont { get { return this.isSymbolFont; } } bool isSymbolFont; // bool SetFontFlags() // { // //if (font->type != pdc_Type3) // //{ // // if (font->isFixedPitch) // // font->flags |= FIXEDWIDTH; // // // // if (font->isstdlatin == pdc_true || // // font->encoding == pdc_winansi || // // font->encoding == pdc_macroman || // // font->encoding == pdc_ebcdic || // // font->encoding == pdc_ebcdic_37) // // font->flags |= ADOBESTANDARD; // // else // // font->flags |= SYMBOL; // // // // if (font->italicAngle < 0 || // // font->style == pdc_Italic || font->style == pdc_BoldItalic) // // font->flags |= ITALIC; // // if (font->italicAngle == 0 && font->flags & ITALIC) // // font->italicAngle = PDC_DEF_ITALICANGLE; // // // // /* heuristic to identify (small) caps fonts */ // // if (font->name && // // (strstr(font->name, "Caps") || // // !strcmp(font->name + strlen(font->name) - 2, "SC"))) // // font->flags |= SMALLCAPS; // // // // if (font->style == pdc_Bold || font->style == pdc_BoldItalic) // // font->StdVW = PDF_STEMV_BOLD; // // // // if (strstr(font->name, "Bold") || font->StdVW > PDF_STEMV_SEMIBOLD) // // font->flags |= FORCEBOLD; // //} // // // //if (font->style != pdc_Normal && // // (font->embedding || font->type == pdc_Type1 || // // font->type == pdc_MMType1 || font->type == pdc_Type3)) // //{ // // pdc_set_errmsg(p->pdc, PDF_E_FONT_EMBEDSTYLE, 0, 0, 0, 0); // // if (font->verbose == pdc_true) // // { // // pdf_cleanup_font(p, font); // // pdc_error(p->pdc, -1, 0, 0, 0, 0); // // } // // return pdc_false; // //} // return true; // } // HACK FlagsFromDescriptor(OpenTypeDescriptor descriptor) PdfFontDescriptorFlags FlagsFromDescriptor(OpenTypeDescriptor descriptor) { PdfFontDescriptorFlags flags = 0; this.isSymbolFont = descriptor.fontData.cmap.symbol; flags |= descriptor.fontData.cmap.symbol ? PdfFontDescriptorFlags.Symbolic : PdfFontDescriptorFlags.Nonsymbolic; return flags; } /// /// Predefined keys of this dictionary. /// public sealed class Keys : KeysBase { /// /// (Required) The type of PDF object that this dictionary describes; must be /// FontDescriptor for a font descriptor. /// [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "FontDescriptor")] public const string Type = "/Type"; /// /// (Required) The PostScript name of the font. This name should be the same as the /// value of BaseFont in the font or CIDFont dictionary that refers to this font descriptor. /// [KeyInfo(KeyType.Name | KeyType.Required)] public const string FontName = "/FontName"; /// /// (Optional; PDF 1.5; strongly recommended for Type 3 fonts in Tagged PDF documents) /// A string specifying the preferred font family name. For example, for the font /// Times Bold Italic, the FontFamily is Times. /// [KeyInfo(KeyType.String | KeyType.Optional)] public const string FontFamily = "/FontFamily"; /// /// (Optional; PDF 1.5; strongly recommended for Type 3 fonts in Tagged PDF documents) /// The font stretch value. It must be one of the following names (ordered from /// narrowest to widest): UltraCondensed, ExtraCondensed, Condensed, SemiCondensed, /// Normal, SemiExpanded, Expanded, ExtraExpanded or UltraExpanded. /// Note: The specific interpretation of these values varies from font to font. /// For example, Condensed in one font may appear most similar to Normal in another. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string FontStretch = "/FontStretch"; /// /// (Optional; PDF 1.5; strongly recommended for Type 3 fonts in Tagged PDF documents) /// The weight (thickness) component of the fully-qualified font name or font specifier. /// The possible values are 100, 200, 300, 400, 500, 600, 700, 800, or 900, where each /// number indicates a weight that is at least as dark as its predecessor. A value of /// 400 indicates a normal weight; 700 indicates bold. /// Note: The specific interpretation of these values varies from font to font. /// For example, 300 in one font may appear most similar to 500 in another. /// [KeyInfo(KeyType.Real | KeyType.Optional)] public const string FontWeight = "/FontWeight"; /// /// (Required) A collection of flags defining various characteristics of the font. /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string Flags = "/Flags"; /// /// (Required, except for Type 3 fonts) A rectangle (see Section 3.8.4, Rectangles), /// expressed in the glyph coordinate system, specifying the font bounding box. This /// is the smallest rectangle enclosing the shape that would result if all of the /// glyphs of the font were placed with their origins coincident and then filled. /// [KeyInfo(KeyType.Rectangle | KeyType.Required)] public const string FontBBox = "/FontBBox"; /// /// (Required) The angle, expressed in degrees counterclockwise from the vertical, of /// the dominant vertical strokes of the font. (For example, the 9-oclock position is 90 /// degrees, and the 3-oclock position is 90 degrees.) The value is negative for fonts /// that slope to the right, as almost all italic fonts do. /// [KeyInfo(KeyType.Real | KeyType.Required)] public const string ItalicAngle = "/ItalicAngle"; /// /// (Required, except for Type 3 fonts) The maximum height above the baseline reached /// by glyphs in this font, excluding the height of glyphs for accented characters. /// [KeyInfo(KeyType.Real | KeyType.Required)] public const string Ascent = "/Ascent"; /// /// (Required, except for Type 3 fonts) The maximum depth below the baseline reached /// by glyphs in this font. The value is a negative number. /// [KeyInfo(KeyType.Real | KeyType.Required)] public const string Descent = "/Descent"; /// /// (Optional) The spacing between baselines of consecutive lines of text. /// Default value: 0. /// [KeyInfo(KeyType.Real | KeyType.Optional)] public const string Leading = "/Leading"; /// /// (Required for fonts that have Latin characters, except for Type 3 fonts) The vertical /// coordinate of the top of flat capital letters, measured from the baseline. /// [KeyInfo(KeyType.Real | KeyType.Required)] public const string CapHeight = "/CapHeight"; /// /// (Optional) The fonts x height: the vertical coordinate of the top of flat nonascending /// lowercase letters (like the letter x), measured from the baseline, in fonts that have /// Latin characters. Default value: 0. /// [KeyInfo(KeyType.Real | KeyType.Optional)] public const string XHeight = "/XHeight"; /// /// (Required, except for Type 3 fonts) The thickness, measured horizontally, of the dominant /// vertical stems of glyphs in the font. /// [KeyInfo(KeyType.Real | KeyType.Required)] public const string StemV = "/StemV"; /// /// (Optional) The thickness, measured vertically, of the dominant horizontal stems /// of glyphs in the font. Default value: 0. /// [KeyInfo(KeyType.Real | KeyType.Optional)] public const string StemH = "/StemH"; /// /// (Optional) The average width of glyphs in the font. Default value: 0. /// [KeyInfo(KeyType.Real | KeyType.Optional)] public const string AvgWidth = "/AvgWidth"; /// /// (Optional) The maximum width of glyphs in the font. Default value: 0. /// [KeyInfo(KeyType.Real | KeyType.Optional)] public const string MaxWidth = "/MaxWidth"; /// /// (Optional) The width to use for character codes whose widths are not specified in a /// font dictionarys Widths array. This has a predictable effect only if all such codes /// map to glyphs whose actual widths are the same as the value of the MissingWidth entry. /// Default value: 0. /// [KeyInfo(KeyType.Real | KeyType.Optional)] public const string MissingWidth = "/MissingWidth"; /// /// (Optional) A stream containing a Type 1 font program. /// [KeyInfo(KeyType.Stream | KeyType.Optional)] public const string FontFile = "/FontFile"; /// /// (Optional; PDF 1.1) A stream containing a TrueType font program. /// [KeyInfo(KeyType.Stream | KeyType.Optional)] public const string FontFile2 = "/FontFile2"; /// /// (Optional; PDF 1.2) A stream containing a font program whose format is specified /// by the Subtype entry in the stream dictionary. /// [KeyInfo(KeyType.Stream | KeyType.Optional)] public const string FontFile3 = "/FontFile3"; /// /// (Optional; meaningful only in Type 1 fonts; PDF 1.1) A string listing the character /// names defined in a font subset. The names in this string must be in PDF syntaxthat is, /// each name preceded by a slash (/). The names can appear in any order. The name .notdef /// should be omitted; it is assumed to exist in the font subset. If this entry is absent, /// the only indication of a font subset is the subset tag in the FontName entry. /// [KeyInfo(KeyType.String | KeyType.Optional)] public const string CharSet = "/CharSet"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfPageInheritableObjects.cs0000644000175000001440000000464311435766646026656 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; using PdfSharp.Drawing; namespace PdfSharp.Pdf.Advanced { /// /// Represents a PDF page object. /// internal class PdfPageInheritableObjects : PdfDictionary { public PdfPageInheritableObjects() { } // TODO Inheritable Resources not yet supported /// /// /// public PdfRectangle MediaBox { get {return this.mediaBox;} set {this.mediaBox = value;} } PdfRectangle mediaBox; public PdfRectangle CropBox { get {return this.cropBox;} set {this.cropBox = value;} } PdfRectangle cropBox; public int Rotate { get {return this.rotate;} set { if (value % 90 != 0) throw new ArgumentException("Rotate", "The value must be a multiple of 90."); this.rotate = value; } } int rotate; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfSoftMask.cs0000644000175000001440000001147711435766646024053 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; #if GDI using System.Drawing; using System.Drawing.Imaging; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; using PdfSharp.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Represents a PDF soft mask. /// public class PdfSoftMask : PdfDictionary { /// /// Initializes a new instance of the class. /// /// The document that owns the object. public PdfSoftMask(PdfDocument document) : base(document) { Elements.SetName(Keys.Type, "/Mask"); } /// /// Predefined keys of this dictionary. /// public class Keys : KeysBase { /// /// (Optional) The type of PDF object that this dictionary describes; /// if present, must be Mask for a soft-mask dictionary. /// [KeyInfo(KeyType.Name | KeyType.Optional, FixedValue = "Mask")] public const string Type = "/Type"; /// /// (Required) A subtype specifying the method to be used in deriving the mask values /// from the transparency group specified by the G entry: /// Alpha: Use the groups computed alpha, disregarding its color. /// Luminosity: Convert the groups computed color to a single-component luminosity value. /// [KeyInfo(KeyType.Name | KeyType.Required)] public const string S = "/S"; /// /// (Required) A transparency group XObject to be used as the source of alpha /// or color values for deriving the mask. If the subtype S is Luminosity, the /// group attributes dictionary must contain a CS entry defining the color space /// in which the compositing computation is to be performed. /// [KeyInfo(KeyType.Stream | KeyType.Required)] public const string G = "/G"; /// /// (Optional) An array of component values specifying the color to be used /// as the backdrop against which to composite the transparency group XObject G. /// This entry is consulted only if the subtype S is Luminosity. The array consists of /// n numbers, where n is the number of components in the color space specified /// by the CS entry in the group attributes dictionary. /// Default value: the color spaces initial value, representing black. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string BC = "/BC"; /// /// (Optional) A function object specifying the transfer function to be used in /// deriving the mask values. The function accepts one input, the computed /// group alpha or luminosity (depending on the value of the subtype S), and /// returns one output, the resulting mask value. Both the input and output /// must be in the range 0.0 to 1.0; if the computed output falls outside this /// range, it is forced to the nearest valid value. The name Identity may be /// specified in place of a function object to designate the identity function. /// Default value: Identity. /// [KeyInfo(KeyType.FunctionOrName | KeyType.Optional)] public const string TR = "/TR"; } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfReference.cs0000644000175000001440000001722511450442737024204 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion // With this define each iref object gets a unique number (uid) to make them distinguishable in the debugger #define UNIQUE_IREF using System; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf.Advanced { /// /// Represents an indirect reference to a PdfObject. /// [DebuggerDisplay("iref({ObjectNumber}, {GenerationNumber})")] public sealed class PdfReference : PdfItem { // About PdfReference // // * A PdfReference holds the either ObjectID or the PdfObject or both. // // * Each PdfObject has a PdfReference if and only if it is an indirect object. Direct objects have // no PdfReference, because they are embedded in a parent objects. // // * PdfReference objects are used to reference PdfObject instances. A value in a PDF dictionary // or array that is a PdfReference represents an indirect reference. A value in a PDF dictionary or // or array that is a PdfObject represents a direct (or embeddded) object. // // * When a PDF file is imported, the PdfXRefTable is filled with PdfReference objects keeping the // ObjectsIDs and file positions (offsets) of all indirect objects. // // * Indirect objects can easily be renumbered because they do not rely on their ObjectsIDs. // // * During modification of a document the ObjectID of an indirect object has no meaning, // except that they must be different in pairs. /// /// Initializes a new PdfReference instance for the specified indirect object. /// public PdfReference(PdfObject pdfObject) { Debug.Assert(pdfObject.Reference == null, "Must not create iref for an object that already has one."); this.value = pdfObject; #if UNIQUE_IREF && DEBUG this.uid = ++PdfReference.counter; #endif } /// /// Initializes a new PdfReference instance from the specified object identifier and file position. /// public PdfReference(PdfObjectID objectID, int position) { this.objectID = objectID; this.position = position; #if UNIQUE_IREF && DEBUG this.uid = ++PdfReference.counter; #endif } /// /// Writes the object in PDF iref table format. /// internal void WriteXRefEnty(PdfWriter writer) { // PDFsharp does not yet support PDF 1.5 object streams. // Each line must be exactly 20 bytes long, otherwise Acrobat repairs the file. string text = String.Format("{0:0000000000} {1:00000} n\n", this.position, this.objectID.GenerationNumber); // this.InUse ? 'n' : 'f'); writer.WriteRaw(text); } /// /// Writes an indirect reference. /// internal override void WriteObject(PdfWriter writer) { writer.Write(this); } /// /// Gets or sets the object identifier. /// public PdfObjectID ObjectID { get { return this.objectID; } set { if (this.objectID != value) { this.objectID = value; if (this.Document != null) { //PdfXRefTable table = this.Document.xrefTable; //table.Remove(this); //this.objectID = value; //table.Add(this); } } } } PdfObjectID objectID; /// /// Gets the object number of the object identifier. /// public int ObjectNumber { get { return this.objectID.ObjectNumber; } } /// /// Gets the generation number of the object identifier. /// public int GenerationNumber { get { return this.objectID.GenerationNumber; } } /// /// Gets or sets the file position of the related PdfObject. /// public int Position { get { return this.position; } set { this.position = value; } } int position; // I know it should be long, but I have never seen a 2GB PDF file. //public bool InUse //{ // get {return this.inUse;} // set {this.inUse = value;} //} //bool inUse; /// /// Gets or sets the referenced PdfObject. /// public PdfObject Value { get { return this.value; } set { Debug.Assert(value != null, "The value of a PdfReference must never be null."); Debug.Assert(value.Reference == null || Object.ReferenceEquals(value.Reference, this), "The reference of the value must be null or this."); this.value = value; // value must never be null value.Reference = this; } } PdfObject value; /// /// Hack for dead objects. /// internal void SetObject(PdfObject value) { this.value = value; } /// /// Gets or sets the document this object belongs to. /// public PdfDocument Document { get { return this.document; } set { this.document = value; } } PdfDocument document; /// /// Gets a string representing the object identifier. /// public override string ToString() { return this.objectID.ToString() + " R"; } internal static PdfReferenceComparer Comparer { get { return new PdfReferenceComparer(); } } /// /// Implements a comparer that compares PdfReference objects by their PdfObjectID. /// internal class PdfReferenceComparer : IComparer { public int Compare(PdfReference x, PdfReference y) { PdfReference l = x; // as PdfReference; PdfReference r = y; // as PdfReference; if (l != null) { if (r != null) return l.objectID.CompareTo(r.objectID); else return -1; } else if (r != null) return 1; else return 0; } } #if UNIQUE_IREF && DEBUG static int counter = 0; int uid; #endif } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfShadingTable.cs0000644000175000001440000001143011435766646024636 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Drawing; using PdfSharp.Internal; #if false namespace PdfSharp.Pdf.Advanced { /// /// Contains all used Shading objects of a document. /// internal sealed class PdfShadingTable : PdfResourceTable { /// /// Initializes a new instance of this class, which is a singleton for each document. /// public PdfShadingTable(PdfDocument document) : base(document) { } /// /// Gets a PdfExtGState with the keys 'CA' and 'ca' set to the specified alpha value. /// public PdfExtGState GetExtGState(double alpha) { string key = MakeKey(alpha); PdfExtGState extGState = this.alphaValues[key] as PdfExtGState; if (extGState == null) { extGState = new PdfExtGState(this.document); extGState.Elements[PdfExtGState.Keys.CA] = new PdfReal(alpha); extGState.Elements[PdfExtGState.Keys.ca] = new PdfReal(alpha); this.alphaValues[key] = extGState; } return extGState; } /// /// Gets a PdfExtGState with the key 'CA' set to the specified alpha value. /// public PdfExtGState GetExtGStateStroke(double alpha) { string key = MakeKey(alpha); PdfExtGState extGState = this.strokeAlphaValues[key] as PdfExtGState; if (extGState == null) { extGState = new PdfExtGState(this.document); extGState.Elements[PdfExtGState.Keys.CA] = new PdfReal(alpha); this.strokeAlphaValues[key] = extGState; } return extGState; } /// /// Gets a PdfExtGState with the key 'ca' set to the specified alpha value. /// public PdfExtGState GetExtGStateNonStroke(double alpha) { string key = MakeKey(alpha); PdfExtGState extGState = this.nonStrokeAlphaValues[key] as PdfExtGState; if (extGState == null) { extGState = new PdfExtGState(this.document); extGState.Elements[PdfExtGState.Keys.ca] = new PdfReal(alpha); this.nonStrokeAlphaValues[key] = extGState; } return extGState; } /// /// Gets a PdfExtGState with the key 'ca' set to the specified alpha value. /// public PdfExtGState GetExtGState(XColor strokeColor, XColor nonStrokeColor) { if (strokeColor.IsEmpty) { } else if (nonStrokeColor.IsEmpty) { } else { } return null; //string key = MakeKey(alpha); //PdfExtGState extGState = this.nonStrokeAlphaValues[key] as PdfExtGState; //if (extGState == null) //{ // extGState = new PdfExtGState(this.document); // extGState.Elements[PdfExtGState.Keys.ca] = new PdfReal(alpha); // // this.nonStrokeAlphaValues[key] = extGState; //} //return extGState; } string MakeKey(double alpha) { return ((int)(1000 * alpha)).ToString(); } /// /// Maps from alpha values (range "0" to "1000") to PdfExtGState objects. /// Hashtable alphaValues = new Hashtable(); Hashtable strokeAlphaValues = new Hashtable(); Hashtable nonStrokeAlphaValues = new Hashtable(); } } #endifpdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfTilingPattern.cs0000644000175000001440000002001011435766646025067 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; #if GDI using System.Drawing; using System.Drawing.Imaging; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; using PdfSharp.Internal; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Represents a tiling pattern dictionary. /// public sealed class PdfTilingPattern : PdfDictionaryWithContentStream { /// /// Initializes a new instance of the class. /// public PdfTilingPattern(PdfDocument document) : base(document) { Elements.SetName(Keys.Type, "/Pattern"); Elements[Keys.PatternType] = new PdfInteger(1); } ///// ///// Setups the shading pattern from the specified brush. ///// //public void SetupFromBrush(XLinearGradientBrush brush, XMatrix matrix) //{ // if (brush == null) // throw new ArgumentNullException("brush"); // PdfShading shading = new PdfShading(this.document); // shading.SetupFromBrush(brush); // Elements[Keys.Shading] = shading; // Elements[Keys.Matrix] = new PdfLiteral("[" + PdfEncoders.ToString(matrix) + "]"); //} /// /// Common keys for all streams. /// internal sealed new class Keys : PdfDictionaryWithContentStream.Keys { /// /// (Optional) The type of PDF object that this dictionary describes; if present, /// must be Pattern for a pattern dictionary. /// [KeyInfo(KeyType.Name | KeyType.Required)] public const string Type = "/Type"; /// /// (Required) A code identifying the type of pattern that this dictionary describes; /// must be 1 for a tiling pattern. /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string PatternType = "/PatternType"; /// /// (Required) A code that determines how the color of the pattern cell is to be specified: /// 1: Colored tiling pattern. The patterns content stream specifies the colors used to /// paint the pattern cell. When the content stream begins execution, the current color /// is the one that was initially in effect in the patterns parent content stream. /// 2: Uncolored tiling pattern. The patterns content stream does not specify any color /// information. Instead, the entire pattern cell is painted with a separately specified color /// each time the pattern is used. Essentially, the content stream describes a stencil /// through which the current color is to be poured. The content stream must not invoke /// operators that specify colors or other color-related parameters in the graphics state; /// otherwise, an error occurs. The content stream may paint an image mask, however, /// since it does not specify any color information. /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string PaintType = "/PaintType"; /// /// (Required) A code that controls adjustments to the spacing of tiles relative to the device /// pixel grid: /// 1: Constant spacing. Pattern cells are spaced consistentlythat is, by a multiple of a /// device pixel. To achieve this, the application may need to distort the pattern cell slightly /// by making small adjustments to XStep, YStep, and the transformation matrix. The amount /// of distortion does not exceed 1 device pixel. /// 2: No distortion. The pattern cell is not distorted, but the spacing between pattern cells /// may vary by as much as 1 device pixel, both horizontally and vertically, when the pattern /// is painted. This achieves the spacing requested by XStep and YStep on average but not /// necessarily for each individual pattern cell. /// 3: Constant spacing and faster tiling. Pattern cells are spaced consistently as in tiling /// type 1 but with additional distortion permitted to enable a more efficient implementation. /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string TilingType = "/TilingType"; /// /// (Required) An array of four numbers in the pattern coordinate system giving the /// coordinates of the left, bottom, right, and top edges, respectively, of the pattern /// cells bounding box. These boundaries are used to clip the pattern cell. /// [KeyInfo(KeyType.Rectangle | KeyType.Optional)] public const string BBox = "/BBox"; /// /// (Required) The desired horizontal spacing between pattern cells, measured in the /// pattern coordinate system. /// [KeyInfo(KeyType.Real | KeyType.Required)] public const string XStep = "/XStep"; /// /// (Required) The desired vertical spacing between pattern cells, measured in the pattern /// coordinate system. Note that XStep and YStep may differ from the dimensions of the /// pattern cell implied by the BBox entry. This allows tiling with irregularly shaped figures. /// XStep and YStep may be either positive or negative but not zero. /// [KeyInfo(KeyType.Real | KeyType.Required)] public const string YStep = "/YStep"; /// /// (Required) A resource dictionary containing all of the named resources required by /// the patterns content stream (see Section 3.7.2, Resource Dictionaries). /// [KeyInfo(KeyType.Dictionary | KeyType.Required)] public new const string Resources = "/Resources"; /// /// (Optional) An array of six numbers specifying the pattern matrix. /// Default value: the identity matrix [1 0 0 1 0 0]. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string Matrix = "/Matrix"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfResources.cs0000644000175000001440000003614211435766646024272 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Text; using System.IO; using PdfSharp.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Represents a PDF resource object. /// public sealed class PdfResources : PdfDictionary { // Resource management works roughly like this: // When the user creates an XFont and uses it in the XGraphics of a PdfPage, then at the first time // a PdfFont is created and cached in the document global font table. If the user creates a new // XFont object for an exisisting PdfFont, the PdfFont object is reused. When the PdfFont is added // to the resources of a PdfPage for the first time, it is added to the page local PdfResourceMap for // fonts and automatically associated with a local resource name. /// /// Initializes a new instance of the class. /// /// The document. public PdfResources(PdfDocument document) : base(document) { Elements[Keys.ProcSet] = new PdfLiteral("[/PDF/Text/ImageB/ImageC/ImageI]"); } internal PdfResources(PdfDictionary dict) : base(dict) { } /// /// Adds the specified font to this resource dictionary and returns its local resource name. /// public string AddFont(PdfFont font) { string name; if (!this.resources.TryGetValue(font, out name)) { name = NextFontName; this.resources[font] = name; if (font.Reference == null) Owner.irefTable.Add(font); Fonts.Elements[name] = font.Reference; } return name; } /// /// Adds the specified image to this resource dictionary /// and returns its local resource name. /// public string AddImage(PdfImage image) { string name; if (!this.resources.TryGetValue(image, out name)) { name = NextImageName; this.resources[image] = name; if (image.Reference == null) Owner.irefTable.Add(image); XObjects.Elements[name] = image.Reference; } return name; } /// /// Adds the specified form object to this resource dictionary /// and returns its local resource name. /// public string AddForm(PdfFormXObject form) { string name; if (!this.resources.TryGetValue(form, out name)) { name = NextFormName; this.resources[form] = name; if (form.Reference == null) Owner.irefTable.Add(form); XObjects.Elements[name] = form.Reference; } return name; } /// /// Adds the specified graphics state to this resource dictionary /// and returns its local resource name. /// public string AddExtGState(PdfExtGState extGState) { string name; if (!this.resources.TryGetValue(extGState, out name)) { name = NextExtGStateName; this.resources[extGState] = name; if (extGState.Reference == null) Owner.irefTable.Add(extGState); ExtGStates.Elements[name] = extGState.Reference; } return name; } /// /// Adds the specified pattern to this resource dictionary /// and returns its local resource name. /// public string AddPattern(PdfShadingPattern pattern) { string name; if (!this.resources.TryGetValue(pattern, out name)) { name = NextPatternName; this.resources[pattern] = name; if (pattern.Reference == null) Owner.irefTable.Add(pattern); Patterns.Elements[name] = pattern.Reference; } return name; } /// /// Adds the specified pattern to this resource dictionary /// and returns its local resource name. /// public string AddPattern(PdfTilingPattern pattern) { string name; if (!this.resources.TryGetValue(pattern, out name)) { name = NextPatternName; this.resources[pattern] = name; if (pattern.Reference == null) Owner.irefTable.Add(pattern); Patterns.Elements[name] = pattern.Reference; } return name; } /// /// Adds the specified shading to this resource dictionary /// and returns its local resource name. /// public string AddShading(PdfShading shading) { string name; if (!this.resources.TryGetValue(shading, out name)) { name = NextShadingName; this.resources[shading] = name; if (shading.Reference == null) Owner.irefTable.Add(shading); Shadings.Elements[name] = shading.Reference; } return name; } /// /// Gets the fonts map. /// internal PdfResourceMap Fonts { get { if (this.fonts == null) this.fonts = (PdfResourceMap)Elements.GetValue(Keys.Font, VCF.Create); return this.fonts; } } PdfResourceMap fonts; /// /// Gets the external objects map. /// internal PdfResourceMap XObjects { get { if (this.xObjects == null) this.xObjects = (PdfResourceMap)Elements.GetValue(Keys.XObject, VCF.Create); return this.xObjects; } } PdfResourceMap xObjects; // TODO: make own class internal PdfResourceMap ExtGStates { get { if (this.extGStates == null) this.extGStates = (PdfResourceMap)Elements.GetValue(Keys.ExtGState, VCF.Create); return this.extGStates; } } PdfResourceMap extGStates; // TODO: make own class internal PdfResourceMap ColorSpaces { get { if (this.colorSpaces == null) this.colorSpaces = (PdfResourceMap)Elements.GetValue(Keys.ColorSpace, VCF.Create); return this.colorSpaces; } } PdfResourceMap colorSpaces; // TODO: make own class internal PdfResourceMap Patterns { get { if (this.patterns == null) this.patterns = (PdfResourceMap)Elements.GetValue(Keys.Pattern, VCF.Create); return this.patterns; } } PdfResourceMap patterns; // TODO: make own class internal PdfResourceMap Shadings { get { if (this.shadings == null) this.shadings = (PdfResourceMap)Elements.GetValue(Keys.Shading, VCF.Create); return this.shadings; } } PdfResourceMap shadings; // TODO: make own class internal PdfResourceMap Properties { get { if (this.properties == null) this.properties = (PdfResourceMap)Elements.GetValue(Keys.Properties, VCF.Create); return this.properties; } } PdfResourceMap properties; /// /// Gets a new local name for this resource. /// string NextFontName { get { string name; while (ExistsResourceNames(name = String.Format("/F{0}", this.fontNumber++))) { } return name; } } int fontNumber; /// /// Gets a new local name for this resource. /// string NextImageName { get { string name; while (ExistsResourceNames(name = String.Format("/I{0}", this.imageNumber++))) { } return name; } } int imageNumber; /// /// Gets a new local name for this resource. /// string NextFormName { get { string name; while (ExistsResourceNames(name = String.Format("/Fm{0}", this.formNumber++))) { } return name; } } int formNumber; /// /// Gets a new local name for this resource. /// string NextExtGStateName { get { string name; while (ExistsResourceNames(name = String.Format("/GS{0}", this.ExtGStateNumber++))) { } return name; } } int ExtGStateNumber; /// /// Gets a new local name for this resource. /// string NextPatternName { get { string name; while (ExistsResourceNames(name = String.Format("/Pa{0}", this.PatternNumber++))) ; return name; } } int PatternNumber; /// /// Gets a new local name for this resource. /// string NextShadingName { get { string name; while (ExistsResourceNames(name = String.Format("/Sh{0}", this.ShadingNumber++))) ; return name; } } int ShadingNumber; /// /// Check whether a resource name is already used in the context of this resource dictionary. /// PDF4NET uses GUIDs as resource names, but I think this weapon is to heavy. /// internal bool ExistsResourceNames(string name) { // TODO: more precise: is this page imported and is PageOptions != Replace // BUG: //if (!this.Owner.IsImported) // return false; // Collect all resouce names of all imported resources. if (this.importedResourceNames == null) { this.importedResourceNames = new Dictionary(); if (Elements[Keys.Font] != null) Fonts.CollectResourceNames(this.importedResourceNames); if (Elements[Keys.XObject] != null) XObjects.CollectResourceNames(this.importedResourceNames); if (Elements[Keys.ExtGState] != null) ExtGStates.CollectResourceNames(this.importedResourceNames); if (Elements[Keys.ColorSpace] != null) ColorSpaces.CollectResourceNames(this.importedResourceNames); if (Elements[Keys.Pattern] != null) Patterns.CollectResourceNames(this.importedResourceNames); if (Elements[Keys.Shading] != null) Shadings.CollectResourceNames(this.importedResourceNames); if (Elements[Keys.Properties] != null) Properties.CollectResourceNames(this.importedResourceNames); } return this.importedResourceNames.ContainsKey(name); // This is superfluous because PDFsharp resource names cannot be double. // this.importedResourceNames.Add(name, null); } /// /// All the names of imported resources. /// Dictionary importedResourceNames; /// /// Maps all PDFsharp resources to their local resource names. /// readonly Dictionary resources = new Dictionary(); /// /// Predefined keys of this dictionary. /// public sealed class Keys : KeysBase { /// /// (Optional) A dictionary that maps resource names to graphics state /// parameter dictionaries. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResourceMap))] public const string ExtGState = "/ExtGState"; /// /// (Optional) A dictionary that maps each resource name to either the name of a /// device-dependent color space or an array describing a color space. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResourceMap))] public const string ColorSpace = "/ColorSpace"; /// /// (Optional) A dictionary that maps each resource name to either the name of a /// device-dependent color space or an array describing a color space. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResourceMap))] public const string Pattern = "/Pattern"; /// /// (Optional; PDF 1.3) A dictionary that maps resource names to shading dictionaries. /// [KeyInfo("1.3", KeyType.Dictionary | KeyType.Optional, typeof(PdfResourceMap))] public const string Shading = "/Shading"; /// /// (Optional) A dictionary that maps resource names to external objects. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResourceMap))] public const string XObject = "/XObject"; /// /// (Optional) A dictionary that maps resource names to font dictionaries. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResourceMap))] public const string Font = "/Font"; /// /// (Optional) An array of predefined procedure set names. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string ProcSet = "/ProcSet"; /// /// (Optional; PDF 1.2) A dictionary that maps resource names to property list /// dictionaries for marked content. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResourceMap))] public const string Properties = "/Properties"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfType0Font.cs0000644000175000001440000002674711435766646024162 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Drawing; using PdfSharp.Internal; using PdfSharp.Fonts; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Filters; namespace PdfSharp.Pdf.Advanced { /// /// Represents a composite font. Used for Unicode encoding. /// internal sealed class PdfType0Font : PdfFont { public PdfType0Font(PdfDocument document) : base(document) { } public PdfType0Font(PdfDocument document, XFont font, bool vertical) : base(document) { Elements.SetName(Keys.Type, "/Font"); Elements.SetName(Keys.Subtype, "/Type0"); Elements.SetName(Keys.Encoding, vertical ? "/Identity-V" : "/Identity-H"); OpenTypeDescriptor ttDescriptor = (OpenTypeDescriptor)FontDescriptorStock.Global.CreateDescriptor(font); this.fontDescriptor = new PdfFontDescriptor(document, ttDescriptor); this.fontOptions = font.PdfOptions; Debug.Assert(this.fontOptions != null); this.cmapInfo = new CMapInfo(ttDescriptor); this.descendantFont = new PdfCIDFont(document, this.fontDescriptor, font); this.descendantFont.CMapInfo = this.cmapInfo; // Create ToUnicode map this.toUnicode = new PdfToUnicodeMap(document, this.cmapInfo); document.Internals.AddObject(toUnicode); Elements.Add(Keys.ToUnicode, toUnicode); //if (this.fontOptions.BaseFont != "") //{ // BaseFont = this.fontOptions.BaseFont; //} //else { BaseFont = font.Name.Replace(" ", ""); switch (font.Style & (XFontStyle.Bold | XFontStyle.Italic)) { case XFontStyle.Bold: this.BaseFont += ",Bold"; break; case XFontStyle.Italic: this.BaseFont += ",Italic"; break; case XFontStyle.Bold | XFontStyle.Italic: this.BaseFont += ",BoldItalic"; break; } } // CID fonts are always embedded BaseFont = PdfFont.CreateEmbeddedFontSubsetName(BaseFont); this.fontDescriptor.FontName = BaseFont; this.descendantFont.BaseFont = BaseFont; PdfArray descendantFonts = new PdfArray(document); Owner.irefTable.Add(descendantFont); descendantFonts.Elements.Add(descendantFont.Reference); Elements[Keys.DescendantFonts] = descendantFonts; } public PdfType0Font(PdfDocument document, string idName, byte[] fontData, bool vertical) : base(document) { Elements.SetName(Keys.Type, "/Font"); Elements.SetName(Keys.Subtype, "/Type0"); Elements.SetName(Keys.Encoding, vertical ? "/Identity-V" : "/Identity-H"); OpenTypeDescriptor ttDescriptor = (OpenTypeDescriptor)FontDescriptorStock.Global.CreateDescriptor(idName, fontData); this.fontDescriptor = new PdfFontDescriptor(document, ttDescriptor); this.fontOptions = new XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always); Debug.Assert(this.fontOptions != null); this.cmapInfo = new CMapInfo(ttDescriptor); this.descendantFont = new PdfCIDFont(document, this.fontDescriptor, fontData); this.descendantFont.CMapInfo = this.cmapInfo; // Create ToUnicode map this.toUnicode = new PdfToUnicodeMap(document, this.cmapInfo); document.Internals.AddObject(toUnicode); Elements.Add(Keys.ToUnicode, toUnicode); BaseFont = ttDescriptor.FontName.Replace(" ", ""); //switch (font.Style & (XFontStyle.Bold | XFontStyle.Italic)) //{ // case XFontStyle.Bold: // this.BaseFont += ",Bold"; // break; // case XFontStyle.Italic: // this.BaseFont += ",Italic"; // break; // case XFontStyle.Bold | XFontStyle.Italic: // this.BaseFont += ",BoldItalic"; // break; //} // CID fonts are always embedded if (!BaseFont.Contains("+")) // HACK in PdfType0Font BaseFont = PdfFont.CreateEmbeddedFontSubsetName(BaseFont); this.fontDescriptor.FontName = BaseFont; this.descendantFont.BaseFont = BaseFont; PdfArray descendantFonts = new PdfArray(document); Owner.irefTable.Add(descendantFont); descendantFonts.Elements.Add(descendantFont.Reference); Elements[Keys.DescendantFonts] = descendantFonts; } XPdfFontOptions FontOptions { get { return this.fontOptions; } } XPdfFontOptions fontOptions; public string BaseFont { get { return Elements.GetName(Keys.BaseFont); } set { Elements.SetName(Keys.BaseFont, value); } } internal PdfCIDFont DescendantFont { get { return this.descendantFont; } } PdfCIDFont descendantFont; internal override void PrepareForSave() { base.PrepareForSave(); #if true // use GetGlyphIndices to create the widths array OpenTypeDescriptor descriptor = (OpenTypeDescriptor)this.fontDescriptor.descriptor; StringBuilder w = new StringBuilder("["); if (this.cmapInfo != null) { int[] glyphIndices = this.cmapInfo.GetGlyphIndices(); int count = glyphIndices.Length; int[] glyphWidths = new int[count]; for (int idx = 0; idx < count; idx++) glyphWidths[idx] = descriptor.GlyphIndexToPdfWidth(glyphIndices[idx]); //TODO: optimize order of indices for (int idx = 0; idx < count; idx++) w.AppendFormat("{0}[{1}]", glyphIndices[idx], glyphWidths[idx]); w.Append("]"); this.descendantFont.Elements.SetValue(PdfCIDFont.Keys.W, new PdfLiteral(w.ToString())); #else TrueTypeDescriptor descriptor = (TrueTypeDescriptor)this.fontDescriptor.descriptor; bool symbol = descriptor.fontData.cmap.symbol; StringBuilder w = new StringBuilder("["); if (this.cmapInfo != null) { char[] chars = this.cmapInfo.Chars; int count = chars.Length; // We don't care about char that share the same glyph int[] glyphIndices = new int[count]; int[] glyphWidths = new int[count]; for (int idx = 0; idx < count; idx++) { char ch = chars[idx]; int glyphIndex; if (symbol) { glyphIndex = (int)ch + (descriptor.fontData.os2.usFirstCharIndex & 0xFF00); glyphIndex = descriptor.CharCodeToGlyphIndex((char)glyphIndex); } else glyphIndex = descriptor.CharCodeToGlyphIndex(ch); descriptor.CharCodeToGlyphIndex(chars[idx]); glyphIndices[idx] = glyphIndex; glyphWidths[idx] = descriptor.GlyphIndexToPdfWidth(glyphIndex); } //TODO: optimize order of indices for (int idx = 0; idx < count; idx++) w.AppendFormat("{0}[{1}]", glyphIndices[idx], glyphWidths[idx]); w.Append("]"); this.descendantFont.Elements.SetValue(PdfCIDFont.Keys.W, new PdfLiteral(w.ToString())); #endif } this.descendantFont.PrepareForSave(); this.toUnicode.PrepareForSave(); } /// /// Predefined keys of this dictionary. /// public new sealed class Keys : PdfFont.Keys { /// /// (Required) The type of PDF object that this dictionary describes; /// must be Font for a font dictionary. /// [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Font")] public new const string Type = "/Type"; /// /// (Required) The type of font; must be Type0 for a Type 0 font. /// [KeyInfo(KeyType.Name | KeyType.Required)] public new const string Subtype = "/Subtype"; /// /// (Required) The PostScript name of the font. In principle, this is an arbitrary /// name, since there is no font program associated directly with a Type 0 font /// dictionary. The conventions described here ensure maximum compatibility /// with existing Acrobat products. /// If the descendant is a Type 0 CIDFont, this name should be the concatenation /// of the CIDFonts BaseFont name, a hyphen, and the CMap name given in the /// Encoding entry (or the CMapName entry in the CMap). If the descendant is a /// Type 2 CIDFont, this name should be the same as the CIDFonts BaseFont name. /// [KeyInfo(KeyType.Name | KeyType.Required)] public new const string BaseFont = "/BaseFont"; /// /// (Required) The name of a predefined CMap, or a stream containing a CMap /// that maps character codes to font numbers and CIDs. If the descendant is a /// Type 2 CIDFont whose associated TrueType font program is not embedded /// in the PDF file, the Encoding entry must be a predefined CMap name. /// [KeyInfo(KeyType.StreamOrName | KeyType.Required)] public const string Encoding = "/Encoding"; /// /// (Required) A one-element array specifying the CIDFont dictionary that is the /// descendant of this Type 0 font. /// [KeyInfo(KeyType.Array | KeyType.Required)] public const string DescendantFonts = "/DescendantFonts"; /// /// ((Optional) A stream containing a CMap file that maps character codes to /// Unicode values. /// [KeyInfo(KeyType.Stream | KeyType.Optional)] public const string ToUnicode = "/ToUnicode"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfTrailer.cs0000644000175000001440000002423311435766646023720 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Security; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Represents a PDF trailer dictionary. Even trailers are dictionaries their never have a cross /// reference entry in PdfReferenceTable. /// internal sealed class PdfTrailer : PdfDictionary { /// /// Initializes a new instance of PdfTrailer. /// public PdfTrailer(PdfDocument document) : base(document) { this.document = document; } public int Size { get {return Elements.GetInteger(Keys.Size);} set {Elements.SetInteger(Keys.Size, value);} } // TODO: needed when linearized... //public int Prev //{ // get {return Elements.GetInteger(Keys.Prev);} //} public PdfDocumentInformation Info { get {return (PdfDocumentInformation)Elements.GetValue(Keys.Info, VCF.CreateIndirect);} } /// /// (Required; must be an indirect reference) /// The catalog dictionary for the PDF document contained in the file. /// public PdfCatalog Root { get {return (PdfCatalog)Elements.GetValue(PdfTrailer.Keys.Root, VCF.CreateIndirect);} } /// /// Gets the first or second document identifier. /// public string GetDocumentID(int index) { if (index < 0 || index > 1) throw new ArgumentOutOfRangeException("index", index, "Index must be 0 or 1."); PdfArray array = Elements[Keys.ID] as PdfArray; if (array == null || array.Elements.Count < 2) return ""; PdfItem item = array.Elements[index]; if (item is PdfString) return ((PdfString)item).Value; return ""; } /// /// Sets the first or second document identifier. /// public void SetDocumentID(int index, string value) { if (index < 0 || index > 1) throw new ArgumentOutOfRangeException("index", index, "Index must be 0 or 1."); PdfArray array = Elements[Keys.ID] as PdfArray; if (array == null || array.Elements.Count < 2) array = CreateNewDocumentIDs(); array.Elements[index] = new PdfString(value, PdfStringFlags.HexLiteral); } /// /// Creates and sets two identical new document IDs. /// internal PdfArray CreateNewDocumentIDs() { PdfArray array = new PdfArray(this.document); byte[] docID = Guid.NewGuid().ToByteArray(); string id = PdfEncoders.RawEncoding.GetString(docID, 0, docID.Length); array.Elements.Add(new PdfString(id, PdfStringFlags.HexLiteral)); array.Elements.Add(new PdfString(id, PdfStringFlags.HexLiteral)); Elements[Keys.ID] = array; return array; } /// /// Gets the standard security handler. /// public PdfStandardSecurityHandler SecurityHandler { get { if (this.securityHandler == null) this.securityHandler = (PdfStandardSecurityHandler)Elements.GetValue(Keys.Encrypt, VCF.CreateIndirect); return this.securityHandler; } } internal PdfStandardSecurityHandler securityHandler; //internal override void WriteDictionaryElement(PdfSharp.Pdf.IO.PdfWriter writer, PdfName key) //{ // //if (key == Keys.ID) // //{ // // PdfArray array = Elements[key] as PdfArray; // // PdfItem item = array.Elements[0]; // // //base.WriteDictionaryElement(writer, key); // // return; // //} // base.WriteDictionaryElement (writer, key); //} internal override void WriteObject(PdfWriter writer) { // Delete /XRefStm entry, if any this.elements.Remove(Keys.XRefStm); // Don't encypt myself PdfStandardSecurityHandler securityHandler = writer.SecurityHandler; writer.SecurityHandler = null; base.WriteObject(writer); writer.SecurityHandler = securityHandler; } /// /// Replace temporary irefs by their correct counterparts from the iref table. /// internal void Finish() { // \Root PdfReference iref = document.trailer.Elements[PdfTrailer.Keys.Root] as PdfReference; if (iref != null && iref.Value == null) { iref = document.irefTable[iref.ObjectID]; Debug.Assert(iref.Value != null); this.document.trailer.Elements[PdfTrailer.Keys.Root] = iref; } // \Info iref = this.document.trailer.Elements[PdfTrailer.Keys.Info] as PdfReference; if (iref != null && iref.Value == null) { iref = document.irefTable[iref.ObjectID]; Debug.Assert(iref.Value != null); this.document.trailer.Elements[PdfTrailer.Keys.Info] = iref; } // \Encrypt iref = this.document.trailer.Elements[PdfTrailer.Keys.Encrypt] as PdfReference; if (iref != null) { iref = document.irefTable[iref.ObjectID]; Debug.Assert(iref.Value != null); this.document.trailer.Elements[PdfTrailer.Keys.Encrypt] = iref; // The encryption dictionary (security handler) was read in before the XRefTable construction // was completed. The next lines fix that state (it take several hours to find that bugs...). iref.Value = this.document.trailer.securityHandler; this.document.trailer.securityHandler.Reference = iref; iref.Value.Reference = iref; } Elements.Remove(Keys.Prev); this.document.irefTable.IsUnderConstruction = false; } /// /// Predefined keys of this dictionary. /// internal sealed class Keys : KeysBase { /// /// (Required; must not be an indirect reference) The total number of entries in the files /// cross-reference table, as defined by the combination of the original section and all /// update sections. Equivalently, this value is 1 greater than the highest object number /// used in the file. /// Note: Any object in a cross-reference section whose number is greater than this value is /// ignored and considered missing. /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string Size = "/Size"; /// /// (Present only if the file has more than one cross-reference section; must not be an indirect /// reference) The byte offset from the beginning of the file to the beginning of the previous /// cross-reference section. /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string Prev = "/Prev"; /// /// (Required; must be an indirect reference) The catalog dictionary for the PDF document /// contained in the file. /// [KeyInfo(KeyType.Dictionary | KeyType.Required, typeof(PdfCatalog))] public const string Root = "/Root"; /// /// (Required if document is encrypted; PDF 1.1) The documents encryption dictionary. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfStandardSecurityHandler))] public const string Encrypt = "/Encrypt"; /// /// (Optional; must be an indirect reference) The documents information dictionary. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfDocumentInformation))] public const string Info = "/Info"; /// /// (Optional, but strongly recommended; PDF 1.1) An array of two strings constituting /// a file identifier for the file. Although this entry is optional, /// its absence might prevent the file from functioning in some workflows /// that depend on files being uniquely identified. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string ID = "/ID"; /// /// (Optional) The byte offset from the beginning of the file of a cross-reference stream. /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string XRefStm = "/XRefStm"; /// /// Gets the KeysMeta for these keys. /// public static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get {return Keys.Meta;} } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfExtGState.cs0000644000175000001440000003011511435766646024162 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; #if GDI using System.Drawing; using System.Drawing.Imaging; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; using PdfSharp.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Represents an extended graphics state object. /// public sealed class PdfExtGState : PdfDictionary { /// /// Initializes a new instance of the class. /// /// The document. public PdfExtGState(PdfDocument document) : base(document) { Elements.SetName(Keys.Type, "/ExtGState"); #if true_ //AIS false //BM /Normal //ca 1 //CA 1 //op false //OP false //OPM 1 //SA true //SMask /None //Type /ExtGState Elements.SetValue(Keys.AIS, new PdfBoolean(false)); // The alpha source Elements.SetName("/BM", "Normal"); Elements.SetValue(Keys.op, new PdfBoolean(false)); Elements.SetValue(Keys.OP, new PdfBoolean(false)); Elements.SetValue(Keys.OPM, new PdfInteger(1)); Elements.SetValue("/SA", new PdfBoolean(true)); Elements.SetName("/SMask", "None"); #endif } internal void SetDefault1() { //<< // /AIS false // /BM /Normal // /ca 1 // /CA 1 // /op false // /OP false // /OPM 1 // /SA true // /SMask /None // /Type /ExtGState //>> Elements.SetBoolean(PdfExtGState.Keys.AIS, false); Elements.SetName(PdfExtGState.Keys.BM, "/Normal"); StrokeAlpha = 1; NonStrokeAlpha = 1; Elements.SetBoolean(PdfExtGState.Keys.op, false); Elements.SetBoolean(PdfExtGState.Keys.OP, false); Elements.SetBoolean(PdfExtGState.Keys.SA, true); Elements.SetName(PdfExtGState.Keys.SMask, "/None"); } /// /// ...for shading patterns /// internal void SetDefault2() { //<< // /AIS false // /BM /Normal // /ca 1 // /CA 1 // /op true // /OP true // /OPM 1 // /SA true // /SMask /None // /Type /ExtGState //>> Elements.SetBoolean(PdfExtGState.Keys.AIS, false); Elements.SetName(PdfExtGState.Keys.BM, "/Normal"); StrokeAlpha = 1; NonStrokeAlpha = 1; Elements.SetBoolean(PdfExtGState.Keys.op, true); Elements.SetBoolean(PdfExtGState.Keys.OP, true); Elements.SetInteger(PdfExtGState.Keys.OPM, 1); Elements.SetBoolean(PdfExtGState.Keys.SA, true); Elements.SetName(PdfExtGState.Keys.SMask, "/None"); } /// /// Sets the alpha value for stroking operations. /// public double StrokeAlpha { set { Elements.SetReal(Keys.CA, value); } } /// /// Sets the alpha value for nonstroking operations. /// public double NonStrokeAlpha { set { Elements.SetReal(Keys.ca, value); } } /// /// Sets a soft mask object. /// public PdfSoftMask SoftMask { set { Elements.SetReference(Keys.SMask, value); } } /// /// Common keys for all streams. /// internal sealed class Keys : KeysBase { /// /// (Optional) The type of PDF object that this dictionary describes; /// must be ExtGState for a graphics state parameter dictionary. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string Type = "/Type"; /// /// (Optional; PDF 1.3) The line width (see Line Width on page 185). /// [KeyInfo(KeyType.Real | KeyType.Optional)] public const string LW = "/LW"; /// /// (Optional; PDF 1.3) The line cap style. /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string LC = "/LC"; /// /// (Optional; PDF 1.3) The line join style. /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string LJ = "/LJ"; /// /// (Optional; PDF 1.3) The miter limit. /// [KeyInfo(KeyType.Real | KeyType.Optional)] public const string ML = "/ML"; /// /// (Optional; PDF 1.3) The line dash pattern, expressed as an array of the form /// [dashArray dashPhase], where dashArray is itself an array and dashPhase is an integer. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string D = "/D"; /// /// (Optional; PDF 1.3) The name of the rendering intent. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string RI = "/RI"; /// /// (Optional) A flag specifying whether to apply overprint. In PDF 1.2 and earlier, /// there is a single overprint parameter that applies to all painting operations. /// Beginning with PDF 1.3, there are two separate overprint parameters: one for stroking /// and one for all other painting operations. Specifying an OP entry sets both parameters /// unless there is also an op entry in the same graphics state parameter dictionary, in /// which case the OP entry sets only the overprint parameter for stroking. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string OP = "/OP"; /// /// (Optional; PDF 1.3) A flag specifying whether to apply overprint for painting operations /// other than stroking. If this entry is absent, the OP entry, if any, sets this parameter. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string op = "/op"; /// /// (Optional; PDF 1.3) The overprint mode. /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string OPM = "/OPM"; /// /// (Optional; PDF 1.3) An array of the form [font size], where font is an indirect /// reference to a font dictionary and size is a number expressed in text space units. /// These two objects correspond to the operands of the Tf operator; however, /// the first operand is an indirect object reference instead of a resource name. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string Font = "/Font"; /// /// (Optional) The black-generation function, which maps the interval [0.0 1.0] /// to the interval [0.0 1.0]. /// [KeyInfo(KeyType.Function | KeyType.Optional)] public const string BG = "/BG"; /// /// (Optional; PDF 1.3) Same as BG except that the value may also be the name Default, /// denoting the black-generation function that was in effect at the start of the page. /// If both BG and BG2 are present in the same graphics state parameter dictionary, /// BG2 takes precedence. /// [KeyInfo(KeyType.FunctionOrName | KeyType.Optional)] public const string BG2 = "/BG2"; /// /// (Optional) The undercolor-removal function, which maps the interval /// [0.0 1.0] to the interval [-1.0 1.0]. /// [KeyInfo(KeyType.Function | KeyType.Optional)] public const string UCR = "/UCR"; /// /// (Optional; PDF 1.3) Same as UCR except that the value may also be the name Default, /// denoting the undercolor-removal function that was in effect at the start of the page. /// If both UCR and UCR2 are present in the same graphics state parameter dictionary, /// UCR2 takes precedence. /// [KeyInfo(KeyType.FunctionOrName | KeyType.Optional)] public const string UCR2 = "/UCR2"; //TR function, array, or name //TR2 function, array, or name //HT dictionary, stream, or name //FL number //SM number /// /// (Optional) A flag specifying whether to apply automatic stroke adjustment. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string SA = "/SA"; /// /// (Optional; PDF 1.4) The current blend mode to be used in the transparent imaging model. /// [KeyInfo(KeyType.NameOrArray | KeyType.Optional)] public const string BM = "/BM"; /// /// (Optional; PDF 1.4) The current soft mask, specifying the mask shape or /// mask opacity values to be used in the transparent imaging model. /// [KeyInfo(KeyType.NameOrDictionary | KeyType.Optional)] public const string SMask = "/SMask"; /// /// (Optional; PDF 1.4) The current stroking alpha constant, specifying the constant /// shape or constant opacity value to be used for stroking operations in the transparent /// imaging model. /// [KeyInfo(KeyType.Real | KeyType.Optional)] public const string CA = "/CA"; /// /// (Optional; PDF 1.4) Same as CA, but for nonstroking operations. /// [KeyInfo(KeyType.Real | KeyType.Optional)] public const string ca = "/ca"; /// /// (Optional; PDF 1.4) The alpha source flag (alpha is shape), specifying whether /// the current soft mask and alpha constant are to be interpreted as shape values (true) /// or opacity values (false). /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string AIS = "/AIS"; /// /// (Optional; PDF 1.4) The text knockout flag, which determines the behavior of /// overlapping glyphs within a text object in the transparent imaging model. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string TK = "/TK"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfDictionaryWithContentStream.cs0000644000175000001440000001332411435766646027765 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; #if GDI using System.Drawing; using System.Drawing.Imaging; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; using PdfSharp.Internal; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Advanced { /// /// Represents a base class for dictionaries with a content stream. /// Implement IContentStream for use with a content writer. /// public abstract class PdfDictionaryWithContentStream : PdfDictionary, IContentStream { /// /// Initializes a new instance of the class. /// public PdfDictionaryWithContentStream() { } /// /// Initializes a new instance of the class. /// /// The document. public PdfDictionaryWithContentStream(PdfDocument document) : base(document) { } /// /// Initializes a new instance from an existing dictionary. Used for object type transformation. /// protected PdfDictionaryWithContentStream(PdfDictionary dict) : base(dict) { } /// /// Gets the resources dictionary of this dictionary. If no such dictionary exists, it is created. /// internal PdfResources Resources { get { if (this.resources == null) this.resources = (PdfResources)Elements.GetValue(Keys.Resources, VCF.Create); return this.resources; } } PdfResources resources; /// /// Implements the interface because the primary function is internal. /// PdfResources IContentStream.Resources { get { return Resources; } } internal string GetFontName(XFont font, out PdfFont pdfFont) { pdfFont = this.document.FontTable.GetFont(font); Debug.Assert(pdfFont != null); string name = Resources.AddFont(pdfFont); return name; } string IContentStream.GetFontName(XFont font, out PdfFont pdfFont) { return GetFontName(font, out pdfFont); } internal string GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) { pdfFont = this.document.FontTable.GetFont(idName, fontData); Debug.Assert(pdfFont != null); string name = Resources.AddFont(pdfFont); return name; } string IContentStream.GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) { return GetFontName(idName, fontData, out pdfFont); } /// /// Gets the resource name of the specified image within this dictionary. /// internal string GetImageName(XImage image) { PdfImage pdfImage = this.document.ImageTable.GetImage(image); Debug.Assert(pdfImage != null); string name = Resources.AddImage(pdfImage); return name; } /// /// Implements the interface because the primary function is internal. /// string IContentStream.GetImageName(XImage image) { throw new NotImplementedException(); } /// /// Gets the resource name of the specified form within this dictionary. /// internal string GetFormName(XForm form) { PdfFormXObject pdfForm = this.document.FormTable.GetForm(form); Debug.Assert(pdfForm != null); string name = Resources.AddForm(pdfForm); return name; } /// /// Implements the interface because the primary function is internal. /// string IContentStream.GetFormName(XForm form) { throw new NotImplementedException(); } /// /// Predefined keys of this dictionary. /// public class Keys : PdfDictionary.PdfStream.Keys { /// /// (Optional but strongly recommended; PDF 1.2) A dictionary specifying any /// resources (such as fonts and images) required by the form XObject. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfResources))] public const string Resources = "/Resources"; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfImage.cs0000644000175000001440000013212311435766646023336 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // Thomas Hvel (mailto:Thomas.Hoevel@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; #if GDI using System.Drawing; using System.Drawing.Imaging; #endif #if WPF using System.Windows.Media; using System.Windows.Media.Imaging; #endif using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; using PdfSharp.Internal; using PdfSharp.Pdf.Filters; namespace PdfSharp.Pdf.Advanced { /// /// Represents an image. /// public sealed partial class PdfImage : PdfXObject { /// /// Initializes a new instance of PdfImage from an XImage. /// public PdfImage(PdfDocument document, XImage image) : base(document) { Elements.SetName(Keys.Type, "/XObject"); Elements.SetName(Keys.Subtype, "/Image"); this.image = image; ////// TODO: identify multiple used images. If the image already exists use the same XRef. ////this.defaultName = PdfImageTable.NextImageName; switch (this.image.Format.Guid.ToString("B").ToUpper()) { // Pdf supports Jpeg, therefore we can write what we've read: case "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}": //XImageFormat.Jpeg InitializeJpeg(); break; // All other image formats are converted to PDF bitmaps: case "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}": //XImageFormat.Png case "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}": //XImageFormat.Gif case "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}": //XImageFormat.Tiff case "{B96B3CB5-0728-11D3-9D7B-0000F81EF32E}": //XImageFormat.Icon // TODO: possible optimization for PNG (do not decompress/recompress)??? // TODO: try Jpeg for size optimization??? InitializeNonJpeg(); break; case "{84570158-DBF0-4C6B-8368-62D6A3CA76E0}": //XImageFormat.Pdf: Debug.Assert(false, "XPdfForm not expected here."); break; default: Debug.Assert(false, "Unexpected image type."); break; } } /// /// Gets the underlying XImage object. /// public XImage Image { get { return image; } } readonly XImage image; /// /// Returns 'Image'. /// public override string ToString() { return "Image"; } /// /// Creates the keys for a JPEG image. /// void InitializeJpeg() { // PDF support JPEG, so there's not much to be done MemoryStream memory; byte[] imageBits = null; int streamLength = 0; #if GDI memory = new MemoryStream(); image.gdiImage.Save(memory, ImageFormat.Jpeg); if ((int)memory.Length == 0) { Debug.Assert(false, "Internal error? JPEG image, but file not found!"); } #endif #if WPF && !SILVERLIGHT // AGHACK //string filename = XImage.GetImageFilename(image.wpfImage); //if (XImage.ReadJpegFile(filename, -1, ref imageBits)) //{ // streamLength = imageBits.Length; //} //else // imageBits = null; memory = image.Memory; #endif if (imageBits == null) { streamLength = (int)memory.Length; imageBits = new byte[streamLength]; memory.Seek(0, SeekOrigin.Begin); memory.Read(imageBits, 0, streamLength); memory.Close(); } FlateDecode fd = new FlateDecode(); byte[] imageDataCompressed = fd.Encode(imageBits); if (imageDataCompressed.Length < imageBits.Length) { Stream = new PdfStream(imageDataCompressed, this); Elements[Keys.Length] = new PdfInteger(imageDataCompressed.Length); PdfArray arrayFilters = new PdfArray(document); arrayFilters.Elements.Add(new PdfName("/FlateDecode")); arrayFilters.Elements.Add(new PdfName("/DCTDecode")); Elements[Keys.Filter] = arrayFilters; } else { Stream = new PdfStream(imageBits, this); Elements[Keys.Length] = new PdfInteger(streamLength); Elements[Keys.Filter] = new PdfName("/DCTDecode"); } Elements[Keys.Width] = new PdfInteger(image.PixelWidth); Elements[Keys.Height] = new PdfInteger(image.PixelHeight); Elements[Keys.BitsPerComponent] = new PdfInteger(8); #if GDI if ((image.gdiImage.Flags & ((int)ImageFlags.ColorSpaceCmyk | (int)ImageFlags.ColorSpaceYcck)) != 0) { // TODO: Test with CMYK JPEG files // THHO: I only found ImageFlags.ColorSpaceYcck JPEG files ... Elements[Keys.ColorSpace] = new PdfName("/DeviceCMYK"); if ((image.gdiImage.Flags & (int)ImageFlags.ColorSpaceYcck) != 0) Elements["/Decode"] = new PdfLiteral("[1 0 1 0 1 0 1 0]"); // Invert colors? Why?? } else if ((image.gdiImage.Flags & (int)ImageFlags.ColorSpaceGray) != 0) { Elements[Keys.ColorSpace] = new PdfName("/DeviceGray"); } else { Elements[Keys.ColorSpace] = new PdfName("/DeviceRGB"); } #endif #if WPF // TODOWPF // WPFTHHO #if !SILVERLIGHT string pixelFormat = image.wpfImage.Format.ToString(); #else string pixelFormat = "xxx"; #endif bool isCmyk = image.IsCmyk; bool isGrey = pixelFormat == "Gray8"; if (isCmyk) { // TODO: Test with CMYK JPEG files // THHO: I only found ImageFlags.ColorSpaceYcck JPEG files ... Elements[Keys.ColorSpace] = new PdfName("/DeviceCMYK"); Elements["/Decode"] = new PdfLiteral("[1 0 1 0 1 0 1 0]"); // Invert colors? Why?? } else if (isGrey) { Elements[Keys.ColorSpace] = new PdfName("/DeviceGray"); } else { Elements[Keys.ColorSpace] = new PdfName("/DeviceRGB"); } #endif } /// /// Creates the keys for a FLATE image. /// void InitializeNonJpeg() { #if GDI && !WPF //bool hasMask = false; switch (image.gdiImage.PixelFormat) { case PixelFormat.Format24bppRgb: ReadTrueColorMemoryBitmap(3, 8, false); break; case PixelFormat.Format32bppRgb: ReadTrueColorMemoryBitmap(4, 8, false); break; case PixelFormat.Format32bppArgb: case PixelFormat.Format32bppPArgb: //hasMask = true; ReadTrueColorMemoryBitmap(3, 8, true); break; case PixelFormat.Format8bppIndexed: ReadIndexedMemoryBitmap(8/*, ref hasMask*/); break; case PixelFormat.Format4bppIndexed: ReadIndexedMemoryBitmap(4/*, ref hasMask*/); break; case PixelFormat.Format1bppIndexed: ReadIndexedMemoryBitmap(1/*, ref hasMask*/); break; default: #if DEBUGxxx image.image.Save("$$$.bmp", ImageFormat.Bmp); #endif throw new NotImplementedException("Image format not supported."); } #endif #if WPF // && !GDI // WPFTHHO: Bitte prfen, siehe System.Windows.Media.PixelFormats //bool hasMask = false; #if !SILVERLIGHT string format = image.wpfImage.Format.ToString(); #else string format = "Bgr24"; #endif switch (format) { case "Bgr24": //Format24bppRgb: ReadTrueColorMemoryBitmap(3, 8, false); break; //case .PixelFormat.Format32bppRgb: // ReadTrueColorMemoryBitmap(4, 8, false); // break; case "Bgra32": //PixelFormat.Format32bppArgb: //case PixelFormat.Format32bppPArgb: //hasMask = true; ReadTrueColorMemoryBitmap(3, 8, true); break; case "Bgr32": // StL: neu //hasMask = false; ReadTrueColorMemoryBitmap(3, 8, true); break; case "Pbgra32": // StL: neu //hasMask = false; ReadTrueColorMemoryBitmap(3, 8, true); break; case "Indexed8": //Format8bppIndexed: case "Gray8": ReadIndexedMemoryBitmap(8/*, ref hasMask*/); break; case "Indexed4": //Format4bppIndexed: case "Gray4": ReadIndexedMemoryBitmap(4/*, ref hasMask*/); break; case "Indexed2": ReadIndexedMemoryBitmap(2/*, ref hasMask*/); break; case "Indexed1": //Format1bppIndexed: case "BlackWhite": //Format1bppIndexed: ReadIndexedMemoryBitmap(1/*, ref hasMask*/); break; default: #if DEBUGxxx image.image.Save("$$$.bmp", ImageFormat.Bmp); #endif throw new NotImplementedException("Image format \"" + format + "\" not supported."); } #endif } private static int ReadWord(byte[] ab, int offset) { return ab[offset] + 256 * ab[offset + 1]; } private static int ReadDWord(byte[] ab, int offset) { return ReadWord(ab, offset) + 0x10000 * ReadWord(ab, offset + 2); } /// /// Reads images that are returned from GDI+ without color palette. /// /// 4 (32bpp RGB), 3 (24bpp RGB, 32bpp ARGB) /// 8 /// true (ARGB), false (RGB) private void ReadTrueColorMemoryBitmap(int components, int bits, bool hasAlpha) { #if DEBUG_ image.image.Save("$$$.bmp", ImageFormat.Bmp); #endif int pdfVersion = Owner.Version; MemoryStream memory = new MemoryStream(); #if GDI image.gdiImage.Save(memory, ImageFormat.Bmp); #endif #if WPF #if !SILVERLIGHT // WPFTHHO: Bitte prfen BmpBitmapEncoder encoder = new BmpBitmapEncoder(); encoder.Frames.Add(BitmapFrame.Create(image.wpfImage)); encoder.Save(memory); #else // AGHACK #endif #endif int streamLength = (int)memory.Length; Debug.Assert(streamLength > 0, "Bitmap image encoding failed."); if (streamLength > 0) { byte[] imageBits = new byte[streamLength]; memory.Seek(0, SeekOrigin.Begin); memory.Read(imageBits, 0, streamLength); memory.Close(); int height = image.PixelHeight; int width = image.PixelWidth; // TODO: we could define structures for // BITMAPFILEHEADER // { BITMAPINFO } // BITMAPINFOHEADER // to avoid ReadWord and ReadDWord ... (but w/o pointers this doesn't help much) if (ReadWord(imageBits, 0) != 0x4d42 || // "BM" ReadDWord(imageBits, 2) != streamLength || ReadDWord(imageBits, 14) != 40 || // sizeof BITMAPINFOHEADER ReadDWord(imageBits, 18) != width || ReadDWord(imageBits, 22) != height) { throw new NotImplementedException("ReadTrueColorMemoryBitmap: unsupported format"); } if (ReadWord(imageBits, 26) != 1 || (!hasAlpha && ReadWord(imageBits, 28) != components * bits || hasAlpha && ReadWord(imageBits, 28) != (components + 1) * bits) || ReadDWord(imageBits, 30) != 0) { throw new NotImplementedException("ReadTrueColorMemoryBitmap: unsupported format #2"); } int nFileOffset = ReadDWord(imageBits, 10); int logicalComponents = components; if (components == 4) logicalComponents = 3; byte[] imageData = new byte[components * width * height]; bool hasMask = false; bool hasAlphaMask = false; byte[] alphaMask = hasAlpha ? new byte[width * height] : null; MonochromeMask mask = hasAlpha ? new MonochromeMask(width, height) : null; int nOffsetRead = 0; if (logicalComponents == 3) { for (int y = 0; y < height; ++y) { int nOffsetWrite = 3 * (height - 1 - y) * width; int nOffsetWriteAlpha = 0; if (hasAlpha) { mask.StartLine(y); nOffsetWriteAlpha = (height - 1 - y) * width; } for (int x = 0; x < width; ++x) { imageData[nOffsetWrite] = imageBits[nFileOffset + nOffsetRead + 2]; imageData[nOffsetWrite + 1] = imageBits[nFileOffset + nOffsetRead + 1]; imageData[nOffsetWrite + 2] = imageBits[nFileOffset + nOffsetRead]; if (hasAlpha) { mask.AddPel(imageBits[nFileOffset + nOffsetRead + 3]); alphaMask[nOffsetWriteAlpha] = imageBits[nFileOffset + nOffsetRead + 3]; if (!hasMask || !hasAlphaMask) { if (imageBits[nFileOffset + nOffsetRead + 3] != 255) { hasMask = true; if (imageBits[nFileOffset + nOffsetRead + 3] != 0) hasAlphaMask = true; } } ++nOffsetWriteAlpha; } nOffsetRead += hasAlpha ? 4 : components; nOffsetWrite += 3; } nOffsetRead = 4 * ((nOffsetRead + 3) / 4); // Align to 32 bit boundary } } else if (components == 1) { // Grayscale throw new NotImplementedException("Image format not supported (grayscales)."); } FlateDecode fd = new FlateDecode(); if (hasMask) { // monochrome mask is either sufficient or // provided for compatibility with older reader versions byte[] maskDataCompressed = fd.Encode(mask.MaskData); PdfDictionary pdfMask = new PdfDictionary(document); pdfMask.Elements.SetName(Keys.Type, "/XObject"); pdfMask.Elements.SetName(Keys.Subtype, "/Image"); Owner.irefTable.Add(pdfMask); pdfMask.Stream = new PdfStream(maskDataCompressed, pdfMask); pdfMask.Elements[Keys.Length] = new PdfInteger(maskDataCompressed.Length); pdfMask.Elements[Keys.Filter] = new PdfName("/FlateDecode"); pdfMask.Elements[Keys.Width] = new PdfInteger(width); pdfMask.Elements[Keys.Height] = new PdfInteger(height); pdfMask.Elements[Keys.BitsPerComponent] = new PdfInteger(1); pdfMask.Elements[Keys.ImageMask] = new PdfBoolean(true); Elements[Keys.Mask] = pdfMask.Reference; } if (hasMask && hasAlphaMask && pdfVersion >= 14) { // The image provides an alpha mask (requires Arcrobat 5.0 or higher) byte[] alphaMaskCompressed = fd.Encode(alphaMask); PdfDictionary smask = new PdfDictionary(document); smask.Elements.SetName(Keys.Type, "/XObject"); smask.Elements.SetName(Keys.Subtype, "/Image"); Owner.irefTable.Add(smask); smask.Stream = new PdfStream(alphaMaskCompressed, smask); smask.Elements[Keys.Length] = new PdfInteger(alphaMaskCompressed.Length); smask.Elements[Keys.Filter] = new PdfName("/FlateDecode"); smask.Elements[Keys.Width] = new PdfInteger(width); smask.Elements[Keys.Height] = new PdfInteger(height); smask.Elements[Keys.BitsPerComponent] = new PdfInteger(8); smask.Elements[Keys.ColorSpace] = new PdfName("/DeviceGray"); Elements[Keys.SMask] = smask.Reference; } byte[] imageDataCompressed = fd.Encode(imageData); Stream = new PdfStream(imageDataCompressed, this); Elements[Keys.Length] = new PdfInteger(imageDataCompressed.Length); Elements[Keys.Filter] = new PdfName("/FlateDecode"); Elements[Keys.Width] = new PdfInteger(width); Elements[Keys.Height] = new PdfInteger(height); Elements[Keys.BitsPerComponent] = new PdfInteger(8); // TODO: CMYK Elements[Keys.ColorSpace] = new PdfName("/DeviceRGB"); if (image.Interpolate) Elements[Keys.Interpolate] = PdfBoolean.True; } } /* BITMAPINFOHEADER struct and byte offsets: typedef struct tagBITMAPINFOHEADER{ DWORD biSize; // 14 LONG biWidth; // 18 LONG biHeight; // 22 WORD biPlanes; // 26 WORD biBitCount; // 28 DWORD biCompression; // 30 DWORD biSizeImage; // 34 LONG biXPelsPerMeter; // 38 LONG biYPelsPerMeter; // 42 DWORD biClrUsed; // 46 DWORD biClrImportant; // 50 } BITMAPINFOHEADER, *PBITMAPINFOHEADER; */ private void ReadIndexedMemoryBitmap(int bits/*, ref bool hasAlpha*/) { #if DEBUG_ image.image.Save("$$$.bmp", ImageFormat.Bmp); #endif int pdfVersion = Owner.Version; int firstMaskColor = -1, lastMaskColor = -1; bool segmentedColorMask = false; MemoryStream memory = new MemoryStream(); #if GDI image.gdiImage.Save(memory, ImageFormat.Bmp); #endif #if WPF #if !SILVERLIGHT // WPFTHHO: StL: keine Ahnung ob das so stimmt. BmpBitmapEncoder encoder = new BmpBitmapEncoder(); encoder.Frames.Add(BitmapFrame.Create(image.wpfImage)); encoder.Save(memory); #else // AGHACK #endif #endif int streamLength = (int)memory.Length; Debug.Assert(streamLength > 0, "Bitmap image encoding failed."); if (streamLength > 0) { byte[] imageBits = new byte[streamLength]; memory.Seek(0, SeekOrigin.Begin); memory.Read(imageBits, 0, streamLength); memory.Close(); int height = image.PixelHeight; int width = image.PixelWidth; if (ReadWord(imageBits, 0) != 0x4d42 || // "BM" ReadDWord(imageBits, 2) != streamLength || ReadDWord(imageBits, 14) != 40 || // sizeof BITMAPINFOHEADER #if WPF // TODOWPF: bug with height and width??? With which files??? ReadDWord(imageBits, 18) != width || ReadDWord(imageBits, 22) != height) #else ReadDWord(imageBits, 18) != width || ReadDWord(imageBits, 22) != height) #endif { throw new NotImplementedException("ReadIndexedMemoryBitmap: unsupported format"); } #if WPF // TODOWPF: bug with height and width width = ReadDWord(imageBits, 18); height = ReadDWord(imageBits, 22); #endif int fileBits = ReadWord(imageBits, 28); if (fileBits != bits) { if (fileBits == 1 || fileBits == 4 || fileBits == 8) bits = fileBits; } if (ReadWord(imageBits, 26) != 1 || ReadWord(imageBits, 28) != bits || ReadDWord(imageBits, 30) != 0) { throw new NotImplementedException("ReadIndexedMemoryBitmap: unsupported format #2"); } int bytesFileOffset = ReadDWord(imageBits, 10); int bytesColorPaletteOffset = 0x36; // GDI+ always returns Windows bitmaps: sizeof BITMAPFILEHEADER + sizeof BITMAPINFOHEADER int paletteColors = ReadDWord(imageBits, 46); if ((bytesFileOffset - bytesColorPaletteOffset) / 4 != paletteColors) { throw new NotImplementedException("ReadIndexedMemoryBitmap: unsupported format #3"); } MonochromeMask mask = new MonochromeMask(width, height); bool isGray = bits == 8 && (paletteColors == 256 || paletteColors == 0); int isBitonal = 0; // 0: false; >0: true; <0: true (inverted) byte[] paletteData = new byte[3 * paletteColors]; for (int color = 0; color < paletteColors; ++color) { paletteData[3 * color] = imageBits[bytesColorPaletteOffset + 4 * color + 2]; paletteData[3 * color + 1] = imageBits[bytesColorPaletteOffset + 4 * color + 1]; paletteData[3 * color + 2] = imageBits[bytesColorPaletteOffset + 4 * color + 0]; if (isGray) isGray = paletteData[3 * color] == paletteData[3 * color + 1] && paletteData[3 * color] == paletteData[3 * color + 2]; if (imageBits[bytesColorPaletteOffset + 4 * color + 3] < 128) { // We treat this as transparency: if (firstMaskColor == -1) firstMaskColor = color; if (lastMaskColor == -1 || lastMaskColor == color - 1) lastMaskColor = color; if (lastMaskColor != color) segmentedColorMask = true; } //else //{ // // We treat this as opacity: //} } if (bits == 1) { if (paletteColors == 0) isBitonal = 1; if (paletteColors == 2) { if (paletteData[0] == 0 && paletteData[1] == 0 && paletteData[2] == 0 && paletteData[3] == 255 && paletteData[4] == 255 && paletteData[5] == 255) isBitonal = 1; // Black on white if (paletteData[5] == 0 && paletteData[4] == 0 && paletteData[3] == 0 && paletteData[2] == 255 && paletteData[1] == 255 && paletteData[0] == 255) isBitonal = -1; // White on black } } // NYI: (no sample found where this was required) // if (segmentedColorMask = true) // { ... } FlateDecode fd = new FlateDecode(); PdfDictionary colorPalette = null; if (isBitonal == 0 && !isGray) { colorPalette = new PdfDictionary(this.document); byte[] packedPaletteData = paletteData.Length >= 48 ? fd.Encode(paletteData) : null; // don't compress small palettes if (packedPaletteData != null && packedPaletteData.Length + 20 < paletteData.Length) // +20: compensate for the overhead (estimated value) { // Create compressed color palette: colorPalette.CreateStream(packedPaletteData); colorPalette.Elements[Keys.Length] = new PdfInteger(packedPaletteData.Length); colorPalette.Elements[Keys.Filter] = new PdfName("/FlateDecode"); } else { // Create uncompressed color palette: colorPalette.CreateStream(paletteData); colorPalette.Elements[Keys.Length] = new PdfInteger(paletteData.Length); } Owner.irefTable.Add(colorPalette); } bool isFaxEncoding = false; byte[] imageData = new byte[((width * bits + 7) / 8) * height]; byte[] imageDataFax = null; int k = 0; if (bits == 1) { // TODO: flag/option? // We try Group 3 1D and Group 4 (2D) encoding here and keep the smaller byte array. //byte[] temp = new byte[imageData.Length]; //int ccittSize = DoFaxEncoding(ref temp, imageBits, (uint)bytesFileOffset, (uint)width, (uint)height); // It seems that Group 3 2D encoding never beats both other encodings, therefore we don't call it here. //byte[] temp2D = new byte[imageData.Length]; //uint dpiY = (uint)image.VerticalResolution; //uint kTmp = 0; //int ccittSize2D = DoFaxEncoding2D((uint)bytesFileOffset, ref temp2D, imageBits, (uint)width, (uint)height, dpiY, out kTmp); //k = (int) kTmp; byte[] tempG4 = new byte[imageData.Length]; int ccittSizeG4 = DoFaxEncodingGroup4(ref tempG4, imageBits, (uint)bytesFileOffset, (uint)width, (uint)height); isFaxEncoding = /*ccittSize > 0 ||*/ ccittSizeG4 > 0; if (isFaxEncoding) { //if (ccittSize == 0) // ccittSize = 0x7fffffff; if (ccittSizeG4 == 0) ccittSizeG4 = 0x7fffffff; //if (ccittSize <= ccittSizeG4) //{ // Array.Resize(ref temp, ccittSize); // imageDataFax = temp; // k = 0; //} //else { Array.Resize(ref tempG4, ccittSizeG4); imageDataFax = tempG4; k = -1; } } } //if (!isFaxEncoding) { int bytesOffsetRead = 0; if (bits == 8 || bits == 4 || bits == 1) { int bytesPerLine = (width * bits + 7) / 8; for (int y = 0; y < height; ++y) { mask.StartLine(y); int bytesOffsetWrite = (height - 1 - y) * ((width * bits + 7) / 8); for (int x = 0; x < bytesPerLine; ++x) { if (isGray) { // Lookup the gray value from the palette: imageData[bytesOffsetWrite] = paletteData[3 * imageBits[bytesFileOffset + bytesOffsetRead]]; } else { // Store the palette index: imageData[bytesOffsetWrite] = imageBits[bytesFileOffset + bytesOffsetRead]; } if (firstMaskColor != -1) { int n = imageBits[bytesFileOffset + bytesOffsetRead]; if (bits == 8) { // TODO???: segmentedColorMask == true => bad mask NYI mask.AddPel((n >= firstMaskColor) && (n <= lastMaskColor)); } else if (bits == 4) { // TODO???: segmentedColorMask == true => bad mask NYI int n1 = (n & 0xf0) / 16; int n2 = (n & 0x0f); mask.AddPel((n1 >= firstMaskColor) && (n1 <= lastMaskColor)); mask.AddPel((n2 >= firstMaskColor) && (n2 <= lastMaskColor)); } else if (bits == 1) { // TODO???: segmentedColorMask == true => bad mask NYI for (int bit = 1; bit <= 8; ++bit) { int n1 = (n & 0x80) / 128; mask.AddPel((n1 >= firstMaskColor) && (n1 <= lastMaskColor)); n *= 2; } } } bytesOffsetRead += 1; bytesOffsetWrite += 1; } bytesOffsetRead = 4 * ((bytesOffsetRead + 3) / 4); // Align to 32 bit boundary } } else { throw new NotImplementedException("ReadIndexedMemoryBitmap: unsupported format #3"); } } if (firstMaskColor != -1 && lastMaskColor != -1) { // Color mask requires Reader 4.0 or higher: if (!segmentedColorMask && pdfVersion >= 13) { PdfArray array = new PdfArray(document); array.Elements.Add(new PdfInteger(firstMaskColor)); array.Elements.Add(new PdfInteger(lastMaskColor)); Elements[Keys.Mask] = array; } else { // Monochrome mask byte[] maskDataCompressed = fd.Encode(mask.MaskData); PdfDictionary pdfMask = new PdfDictionary(document); pdfMask.Elements.SetName(Keys.Type, "/XObject"); pdfMask.Elements.SetName(Keys.Subtype, "/Image"); this.Owner.irefTable.Add(pdfMask); pdfMask.Stream = new PdfStream(maskDataCompressed, pdfMask); pdfMask.Elements[Keys.Length] = new PdfInteger(maskDataCompressed.Length); pdfMask.Elements[Keys.Filter] = new PdfName("/FlateDecode"); pdfMask.Elements[Keys.Width] = new PdfInteger(width); pdfMask.Elements[Keys.Height] = new PdfInteger(height); pdfMask.Elements[Keys.BitsPerComponent] = new PdfInteger(1); pdfMask.Elements[Keys.ImageMask] = new PdfBoolean(true); Elements[Keys.Mask] = pdfMask.Reference; } } byte[] imageDataCompressed = fd.Encode(imageData); byte[] imageDataFaxCompressed = isFaxEncoding ? fd.Encode(imageDataFax) : null; bool usesCcittEncoding = false; if (isFaxEncoding && (imageDataFax.Length < imageDataCompressed.Length || imageDataFaxCompressed.Length < imageDataCompressed.Length)) { // /CCITTFaxDecode creates the smaller file (with or without /FlateDecode): usesCcittEncoding = true; if (imageDataFax.Length < imageDataCompressed.Length) { Stream = new PdfStream(imageDataFax, this); Elements[Keys.Length] = new PdfInteger(imageDataFax.Length); Elements[Keys.Filter] = new PdfName("/CCITTFaxDecode"); //PdfArray array2 = new PdfArray(this.document); PdfDictionary dictionary = new PdfDictionary(); if (k != 0) dictionary.Elements.Add("/K", new PdfInteger(k)); if (isBitonal < 0) dictionary.Elements.Add("/BlackIs1", new PdfBoolean(true)); dictionary.Elements.Add("/EndOfBlock", new PdfBoolean(false)); dictionary.Elements.Add("/Columns", new PdfInteger(width)); dictionary.Elements.Add("/Rows", new PdfInteger(height)); //array2.Elements.Add(dictionary); Elements[Keys.DecodeParms] = dictionary; // array2; } else { Stream = new PdfStream(imageDataFaxCompressed, this); Elements[Keys.Length] = new PdfInteger(imageDataFaxCompressed.Length); PdfArray arrayFilters = new PdfArray(document); arrayFilters.Elements.Add(new PdfName("/FlateDecode")); arrayFilters.Elements.Add(new PdfName("/CCITTFaxDecode")); Elements[Keys.Filter] = arrayFilters; PdfArray arrayDecodeParms = new PdfArray(document); PdfDictionary dictFlateDecodeParms = new PdfDictionary(); //dictFlateDecodeParms.Elements.Add("/Columns", new PdfInteger(1)); PdfDictionary dictCcittFaxDecodeParms = new PdfDictionary(); if (k != 0) dictCcittFaxDecodeParms.Elements.Add("/K", new PdfInteger(k)); if (isBitonal < 0) dictCcittFaxDecodeParms.Elements.Add("/BlackIs1", new PdfBoolean(true)); dictCcittFaxDecodeParms.Elements.Add("/EndOfBlock", new PdfBoolean(false)); dictCcittFaxDecodeParms.Elements.Add("/Columns", new PdfInteger(width)); dictCcittFaxDecodeParms.Elements.Add("/Rows", new PdfInteger(height)); arrayDecodeParms.Elements.Add(dictFlateDecodeParms); // How to add the "null object"? arrayDecodeParms.Elements.Add(dictCcittFaxDecodeParms); Elements[Keys.DecodeParms] = arrayDecodeParms; } } else { // /FlateDecode creates the smaller file (or no monochrome bitmap): Stream = new PdfStream(imageDataCompressed, this); Elements[Keys.Length] = new PdfInteger(imageDataCompressed.Length); Elements[Keys.Filter] = new PdfName("/FlateDecode"); } Elements[Keys.Width] = new PdfInteger(width); Elements[Keys.Height] = new PdfInteger(height); Elements[Keys.BitsPerComponent] = new PdfInteger(bits); // TODO: CMYK // CCITT encoding: we need color palette for isBitonal == 0 // FlateDecode: we need color palette for isBitonal <= 0 unless we have grayscales if ((usesCcittEncoding && isBitonal == 0) || (!usesCcittEncoding && isBitonal <= 0 && !isGray)) { PdfArray arrayColorSpace = new PdfArray(document); arrayColorSpace.Elements.Add(new PdfName("/Indexed")); arrayColorSpace.Elements.Add(new PdfName("/DeviceRGB")); arrayColorSpace.Elements.Add(new PdfInteger(paletteColors - 1)); // ReSharper disable PossibleNullReferenceException arrayColorSpace.Elements.Add(colorPalette.Reference); // ReSharper restore PossibleNullReferenceException Elements[Keys.ColorSpace] = arrayColorSpace; } else { Elements[Keys.ColorSpace] = new PdfName("/DeviceGray"); } if (image.Interpolate) Elements[Keys.Interpolate] = PdfBoolean.True; } } /// /// Common keys for all streams. /// public sealed new class Keys : PdfXObject.Keys { /// /// (Optional) The type of PDF object that this dictionary describes; /// if present, must be XObject for an image XObject. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string Type = "/Type"; /// /// (Required) The type of XObject that this dictionary describes; /// must be Image for an image XObject. /// [KeyInfo(KeyType.Name | KeyType.Required)] public const string Subtype = "/Subtype"; /// /// (Required) The width of the image, in samples. /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string Width = "/Width"; /// /// (Required) The height of the image, in samples. /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string Height = "/Height"; /// /// (Required for images, except those that use the JPXDecode filter; not allowed for image masks) /// The color space in which image samples are specified; it can be any type of color space except /// Pattern. If the image uses the JPXDecode filter, this entry is optional: /// If ColorSpace is present, any color space specifications in the JPEG2000 data are ignored. /// If ColorSpace is absent, the color space specifications in the JPEG2000 data are used. /// The Decode array is also ignored unless ImageMask is true. /// [KeyInfo(KeyType.NameOrArray | KeyType.Required)] public const string ColorSpace = "/ColorSpace"; /// /// (Required except for image masks and images that use the JPXDecode filter) /// The number of bits used to represent each color component. Only a single value may be specified; /// the number of bits is the same for all color components. Valid values are 1, 2, 4, 8, and /// (in PDF 1.5) 16. If ImageMask is true, this entry is optional, and if specified, its value /// must be 1. /// If the image stream uses a filter, the value of BitsPerComponent must be consistent with the /// size of the data samples that the filter delivers. In particular, a CCITTFaxDecode or JBIG2Decode /// filter always delivers 1-bit samples, a RunLengthDecode or DCTDecode filter delivers 8-bit samples, /// and an LZWDecode or FlateDecode filter delivers samples of a specified size if a predictor function /// is used. /// If the image stream uses the JPXDecode filter, this entry is optional and ignored if present. /// The bit depth is determined in the process of decoding the JPEG2000 image. /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string BitsPerComponent = "/BitsPerComponent"; /// /// (Optional; PDF 1.1) The name of a color rendering intent to be used in rendering the image. /// Default value: the current rendering intent in the graphics state. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string Intent = "/Intent"; /// /// (Optional) A flag indicating whether the image is to be treated as an image mask. /// If this flag is true, the value of BitsPerComponent must be 1 and Mask and ColorSpace should /// not be specified; unmasked areas are painted using the current nonstroking color. /// Default value: false. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string ImageMask = "/ImageMask"; /// /// (Optional except for image masks; not allowed for image masks; PDF 1.3) /// An image XObject defining an image mask to be applied to this image, or an array specifying /// a range of colors to be applied to it as a color key mask. If ImageMask is true, this entry /// must not be present. /// [KeyInfo(KeyType.StreamOrArray | KeyType.Optional)] public const string Mask = "/Mask"; /// /// (Optional) An array of numbers describing how to map image samples into the range of values /// appropriate for the images color space. If ImageMask is true, the array must be either /// [0 1] or [1 0]; otherwise, its length must be twice the number of color components required /// by ColorSpace. If the image uses the JPXDecode filter and ImageMask is false, Decode is ignored. /// Default value: see Decode Arrays. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string Decode = "/Decode"; /// /// (Optional) A flag indicating whether image interpolation is to be performed. /// Default value: false. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string Interpolate = "/Interpolate"; /// /// (Optional; PDF 1.3) An array of alternate image dictionaries for this image. The order of /// elements within the array has no significance. This entry may not be present in an image /// XObject that is itself an alternate image. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string Alternates = "/Alternates"; /// /// (Optional; PDF 1.4) A subsidiary image XObject defining a soft-mask image to be used as a /// source of mask shape or mask opacity values in the transparent imaging model. The alpha /// source parameter in the graphics state determines whether the mask values are interpreted as /// shape or opacity. If present, this entry overrides the current soft mask in the graphics state, /// as well as the images Mask entry, if any. (However, the other transparency related graphics /// state parameters blend mode and alpha constant remain in effect.) If SMask is absent, the /// image has no associated soft mask (although the current soft mask in the graphics state may /// still apply). /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string SMask = "/SMask"; /// /// (Optional for images that use the JPXDecode filter, meaningless otherwise; PDF 1.5) /// A code specifying how soft-mask information encoded with image samples should be used: /// 0 If present, encoded soft-mask image information should be ignored. /// 1 The images data stream includes encoded soft-mask values. An application can create /// a soft-mask image from the information to be used as a source of mask shape or mask /// opacity in the transparency imaging model. /// 2 The images data stream includes color channels that have been preblended with a /// background; the image data also includes an opacity channel. An application can create /// a soft-mask image with a Matte entry from the opacity channel information to be used as /// a source of mask shape or mask opacity in the transparency model. If this entry has a /// nonzero value, SMask should not be specified. /// Default value: 0. /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string SMaskInData = "/SMaskInData"; /// /// (Required in PDF 1.0; optional otherwise) The name by which this image XObject is /// referenced in the XObject subdictionary of the current resource dictionary. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string Name = "/Name"; /// /// (Required if the image is a structural content item; PDF 1.3) The integer key of the /// images entry in the structural parent tree. /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string StructParent = "/StructParent"; /// /// (Optional; PDF 1.3; indirect reference preferred) The digital identifier of the images /// parent Web Capture content set. /// [KeyInfo(KeyType.String | KeyType.Optional)] public const string ID = "/ID"; /// /// (Optional; PDF 1.2) An OPI version dictionary for the image. If ImageMask is true, /// this entry is ignored. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional)] public const string OPI = "/OPI"; /// /// (Optional; PDF 1.4) A metadata stream containing metadata for the image. /// [KeyInfo(KeyType.Stream | KeyType.Optional)] public const string Metadata = "/Metadata"; /// /// (Optional; PDF 1.5) An optional content group or optional content membership dictionary, /// specifying the optional content properties for this image XObject. Before the image is /// processed, its visibility is determined based on this entry. If it is determined to be /// invisible, the entire image is skipped, as if there were no Do operator to invoke it. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional)] public const string OC = "/OC"; } } /// /// Helper class for creating bitmap masks (8 pels per byte). /// class MonochromeMask { private readonly int sizeX; private readonly int sizeY; private int writeOffset; private int byteBuffer; private int bitsWritten; /// /// Returns the bitmap mask that will be written to PDF. /// public byte[] MaskData { get { return maskData; } } private readonly byte[] maskData; /// /// Creates a bitmap mask. /// public MonochromeMask(int sizeX, int sizeY) { this.sizeX = sizeX; this.sizeY = sizeY; int byteSize = ((sizeX + 7) / 8) * sizeY; maskData = new byte[byteSize]; StartLine(0); } /// /// Starts a new line. /// public void StartLine(int newCurrentLine) { bitsWritten = 0; byteBuffer = 0; writeOffset = ((sizeX + 7) / 8) * (sizeY - 1 - newCurrentLine); } /// /// Adds a pel to the current line. /// /// public void AddPel(bool isTransparent) { if (bitsWritten < sizeX) { // Mask: 0: opaque, 1: transparent (default mapping) if (isTransparent) byteBuffer = (byteBuffer << 1) + 1; else byteBuffer = byteBuffer << 1; ++bitsWritten; if ((bitsWritten & 7) == 0) { maskData[writeOffset] = (byte)byteBuffer; ++writeOffset; byteBuffer = 0; } else if (bitsWritten == sizeX) { int n = 8 - (bitsWritten & 7); byteBuffer = byteBuffer << n; maskData[writeOffset] = (byte)byteBuffer; } } } /// /// Adds a pel from an alpha mask value. /// public void AddPel(int shade) { // NYI: dithering!!! AddPel(shade < 128); } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfCatalog.cs0000644000175000001440000004120311533755170023651 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.AcroForms; namespace PdfSharp.Pdf.Advanced { /// /// Represents the catalog dictionary. /// public sealed class PdfCatalog : PdfDictionary { /// /// Initializes a new instance of the class. /// public PdfCatalog(PdfDocument document) : base(document) { Elements.SetName(Keys.Type, "/Catalog"); this.version = "1.4"; // HACK in PdfCatalog } PdfCatalog(PdfDictionary dictionary) : base(dictionary) { } /// /// Get or sets the version of the PDF specification to which the document conforms. /// public string Version { get { return this.version; } set { switch (value) { case "1.0": case "1.1": case "1.2": throw new InvalidOperationException("Unsupported PDF version."); case "1.3": case "1.4": this.version = value; break; case "1.5": case "1.6": throw new InvalidOperationException("Unsupported PDF version."); default: throw new ArgumentException("Invalid version."); } } } string version = "1.3"; /// /// Gets the pages collection of this document. /// public PdfPages Pages { get { if (this.pages == null) { this.pages = (PdfPages)Elements.GetValue(Keys.Pages, VCF.CreateIndirect); if (this.Owner.IsImported) this.pages.FlattenPageTree(); } return this.pages; } } PdfPages pages; /// /// Implementation of PdfDocument.PageLayout. /// internal PdfPageLayout PageLayout { get { return (PdfPageLayout)Elements.GetEnumFromName(Keys.PageLayout, PdfPageLayout.SinglePage); } set { Elements.SetEnumAsName(Keys.PageLayout, value); } } /// /// Implementation of PdfDocument.PageMode. /// internal PdfPageMode PageMode { get { return (PdfPageMode)Elements.GetEnumFromName(Keys.PageMode, PdfPageMode.UseNone); } set { Elements.SetEnumAsName(Keys.PageMode, value); } } /// /// Implementation of PdfDocument.ViewerPreferences. /// internal PdfViewerPreferences ViewerPreferences { get { if (this.viewerPreferences == null) this.viewerPreferences = (PdfViewerPreferences)Elements.GetValue(Keys.ViewerPreferences, VCF.CreateIndirect); return this.viewerPreferences; } } PdfViewerPreferences viewerPreferences; /// /// Implementation of PdfDocument.Outlines. /// internal PdfOutline.PdfOutlineCollection Outlines { get { if (this.outline == null) { try { var obj = Elements.GetValue(Keys.Outlines, VCF.CreateIndirect); this.outline = obj as PdfOutline; // If there's a PdfNull object there (pdfopt does this) then remove it // and replace it with a real PdfOutline so that the user can edit the outlines/bookmarks // if they want to if (this.outline == null && obj is PdfNull) { Elements.Remove (Keys.Outlines); this.outline = Elements.GetValue(Keys.Outlines, VCF.CreateIndirect) as PdfOutline; } } catch (InvalidOperationException) { // This happens if the Outline iref points to a null value; remove it and start over Elements.Remove (Keys.Outlines); this.outline = Elements.GetValue(Keys.Outlines, VCF.CreateIndirect) as PdfOutline; } } return this.outline.Outlines; } } PdfOutline outline; /// /// Gets the AcroForm dictionary of this document. /// public PdfAcroForm AcroForm { get { if (this.acroForm == null) this.acroForm = (PdfAcroForm)Elements.GetValue(Keys.AcroForm); return this.acroForm; } } PdfAcroForm acroForm; /// /// Implementation of PdfDocument.PageMode. /// public string Language { get { return Elements.GetString(Keys.Lang); } set { if (value == null) Elements.Remove(Keys.Lang); else Elements.SetString(Keys.Lang, value); } } /// /// Dispatches PrepareForSave to the objects that need it. /// internal override void PrepareForSave() { if (this.pages != null) this.pages.PrepareForSave(); if (this.outline != null && this.outline.Outlines.Count > 0) { if (Elements[Keys.PageMode] == null) PageMode = PdfPageMode.UseOutlines; this.outline.PrepareForSave(); } } internal override void WriteObject(PdfWriter writer) { if (this.outline != null && this.outline.Outlines.Count > 0) { if (Elements[Keys.PageMode] == null) PageMode = PdfPageMode.UseOutlines; } base.WriteObject(writer); } /// /// Predefined keys of this dictionary. /// internal sealed class Keys : KeysBase { /// /// (Required) The type of PDF object that this dictionary describes; /// must be Catalog for the catalog dictionary. /// [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Catalog")] public const string Type = "/Type"; /// /// (Optional; PDF 1.4) The version of the PDF specification to which the document /// conforms (for example, 1.4) if later than the version specified in the files header. /// If the header specifies a later version, or if this entry is absent, the document /// conforms to the version specified in the header. This entry enables a PDF producer /// application to update the version using an incremental update. /// [KeyInfo("1.4", KeyType.Name | KeyType.Optional)] public const string Version = "/Version"; /// /// (Required; must be an indirect reference) The page tree node that is the root of /// the documents page tree. /// [KeyInfo(KeyType.Dictionary | KeyType.Required | KeyType.MustBeIndirect, typeof(PdfPages))] public const string Pages = "/Pages"; /// /// (Optional; PDF 1.3) A number tree defining the page labeling for the document. /// The keys in this tree are page indices; the corresponding values are page label dictionaries. /// Each page index denotes the first page in a labeling range to which the specified page /// label dictionary applies. The tree must include a value for pageindex 0. /// [KeyInfo("1.3", KeyType.NumberTree | KeyType.Optional)] public const string PageLabels = "/PageLabels"; /// /// (Optional; PDF 1.2) The documents name dictionary. /// [KeyInfo("1.2", KeyType.Dictionary | KeyType.Optional)] public const string Names = "/Names"; /// /// (Optional; PDF 1.1; must be an indirect reference) A dictionary of names and /// corresponding destinations. /// [KeyInfo("1.1", KeyType.Dictionary | KeyType.Optional)] public const string Dests = "/Dests"; /// /// (Optional; PDF 1.2) A viewer preferences dictionary specifying the way the document /// is to be displayed on the screen. If this entry is absent, applications should use /// their own current user preference settings. /// [KeyInfo("1.2", KeyType.Dictionary | KeyType.Optional, typeof(PdfViewerPreferences))] public const string ViewerPreferences = "/ViewerPreferences"; /// /// (Optional) A name object specifying the page layout to be used when the document is /// opened: /// SinglePage - Display one page at a time. /// OneColumn - Display the pages in one column. /// TwoColumnLeft - Display the pages in two columns, with oddnumbered pages on the left. /// TwoColumnRight - Display the pages in two columns, with oddnumbered pages on the right. /// TwoPageLeft - (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left /// TwoPageRight - (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string PageLayout = "/PageLayout"; /// /// (Optional) A name object specifying how the document should be displayed when opened: /// UseNone - Neither document outline nor thumbnail images visible. /// UseOutlines - Document outline visible. /// UseThumbs - Thumbnail images visible. /// FullScreen - Full-screen mode, with no menu bar, windowcontrols, or any other window visible. /// UseOC - (PDF 1.5) Optional content group panel visible. /// UseAttachments (PDF 1.6) Attachments panel visible. /// Default value: UseNone. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string PageMode = "/PageMode"; /// /// (Optional; must be an indirect reference) The outline dictionary that is the root /// of the documents outline hierarchy. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional, typeof(PdfOutline))] public const string Outlines = "/Outlines"; /// /// (Optional; PDF 1.1; must be an indirect reference) An array of thread dictionaries /// representing the documents article threads. /// [KeyInfo("1.1", KeyType.Array | KeyType.Optional)] public const string Threads = "/Threads"; /// /// (Optional; PDF 1.1) A value specifying a destination to be displayed or an action to be /// performed when the document is opened. The value is either an array defining a destination /// or an action dictionary representing an action. If this entry is absent, the document /// should be opened to the top of the first page at the default magnification factor. /// [KeyInfo("1.1", KeyType.ArrayOrDictionary | KeyType.Optional)] public const string OpenAction = "/OpenAction"; /// /// (Optional; PDF 1.4) An additional-actions dictionary defining the actions to be taken /// in response to various trigger events affecting the document as a whole. /// [KeyInfo("1.4", KeyType.Dictionary | KeyType.Optional)] public const string AA = "/AA"; /// /// (Optional; PDF 1.1) A URI dictionary containing document-level information for URI /// (uniform resource identifier) actions. /// [KeyInfo("1.1", KeyType.Dictionary | KeyType.Optional)] public const string URI = "/URI"; /// /// (Optional; PDF 1.2) The documents interactive form (AcroForm) dictionary. /// [KeyInfo("1.2", KeyType.Dictionary | KeyType.Optional, typeof(PdfAcroForm))] public const string AcroForm = "/AcroForm"; /// /// (Optional; PDF 1.4; must be an indirect reference) A metadata stream /// containing metadata for the document. /// [KeyInfo("1.4", KeyType.Dictionary | KeyType.Optional | KeyType.MustBeIndirect)] public const string Metadata = "/Metadata"; /// /// (Optional; PDF 1.3) The documents structure tree root dictionary. /// [KeyInfo("1.3", KeyType.Dictionary | KeyType.Optional)] public const string StructTreeRoot = "/StructTreeRoot"; /// /// (Optional; PDF 1.4) A mark information dictionary containing information /// about the documents usage of Tagged PDF conventions. /// [KeyInfo("1.4", KeyType.Dictionary | KeyType.Optional)] public const string MarkInfo = "/MarkInfo"; /// /// (Optional; PDF 1.4) A language identifier specifying the natural language for all /// text in the document except where overridden by language specifications for structure /// elements or marked content. If this entry is absent, the language is considered unknown. /// [KeyInfo("1.4", KeyType.String | KeyType.Optional)] public const string Lang = "/Lang"; /// /// (Optional; PDF 1.3) A Web Capture information dictionary containing state information /// used by the Acrobat Web Capture (AcroSpider) plugin extension. /// [KeyInfo("1.3", KeyType.Dictionary | KeyType.Optional)] public const string SpiderInfo = "/SpiderInfo"; /// /// (Optional; PDF 1.4) An array of output intent dictionaries describing the color /// characteristics of output devices on which the document might be rendered. /// [KeyInfo("1.4", KeyType.Array | KeyType.Optional)] public const string OutputIntents = "/OutputIntents"; /// /// (Optional; PDF 1.4) A page-piece dictionary associated with the document. /// [KeyInfo("1.4", KeyType.Dictionary | KeyType.Optional)] public const string PieceInfo = "/PieceInfo"; /// /// (Optional; PDF 1.5; required if a document contains optional content) The documents /// optional content properties dictionary. /// [KeyInfo("1.5", KeyType.Dictionary | KeyType.Optional)] public const string OCProperties = "/OCProperties"; /// /// (Optional; PDF 1.5) A permissions dictionary that specifies user access permissions /// for the document. /// [KeyInfo("1.5", KeyType.Dictionary | KeyType.Optional)] public const string Perms = "/Perms"; /// /// (Optional; PDF 1.5) A dictionary containing attestations regarding the content of a /// PDF document, as it relates to the legality of digital signatures. /// [KeyInfo("1.5", KeyType.Dictionary | KeyType.Optional)] public const string Legal = "/Legal"; /// /// Gets the KeysMeta for these keys. /// public static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Advanced/PdfResourceTable.cs0000644000175000001440000000353511435766646025057 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Drawing; using PdfSharp.Internal; using PdfSharp.Fonts.OpenType; namespace PdfSharp.Pdf.Advanced { /// /// Base class for FontTable, ImageTable, FormXObjectTable etc. /// internal class PdfResourceTable { public PdfResourceTable(PdfDocument owner) { this.owner = owner; } protected PdfDocument owner; } } pdfmod-0.9.1/lib/PdfSharp/!internal/0000777000175000001440000000000011533760020017242 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/!internal/TargetContext.cs0000644000175000001440000000064111435763705022377 0ustar00gabeusers00000000000000using System; using System.Collections.Generic; using System.Text; using PdfSharp.Drawing; namespace PdfSharp.Internal { #if GDI && WPF /// /// Internal switch indicating what context has to be used if both GDI and WPF are defined. /// static class TargetContextHelper { public static XGraphicTargetContext TargetContext = XGraphicTargetContext.WPF; } #endif }pdfmod-0.9.1/lib/PdfSharp/!internal/Directives.cs0000644000175000001440000000602111435766646021712 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion // // Documentatation of conditional compilation symbol used in PDFsharp 1.1. // Checks correct setting and obsolete conditional compilation symbols. // #if MIGRADOC // empira internal only: Some hacks that make PDFsharp behave like PDFlib when used with Asc.RenderContext. // Applies to MigraDoc 1.2 only. The Open Source MigraDoc lite does not need this define. #endif #if NET_ZIP // obsolete // In .NET 2.0 GZipStream is used instead of SharpZipLib // This does not work. #error Undefine 'NET_ZIP' because it has no effect anymore #endif #if NET_2_0 // obsolete #error Undefine 'NET_2_0' because earlier versions are not supported anymore #endif #if Gdip // obsolete #error Conditional compilation symbol 'Gdip' was renamed to 'GDI' #endif #if GdipUseGdiObjects #error Conditional compilation symbol 'GdipUseGdiObjects' was renamed to 'UseGdiObjects' #endif #if GDI && WPF // PDFsharp based on both System.Drawing and System.Windows classes // This is for developing and cross testing only #elif GDI // PDFsharp based on System.Drawing classes #if GdipUseGdiObjects #error Conditional compilation symbol 'GdipUseGdiObjects' was renamed to 'UseGdiObjects' #endif #if UseGdiObjects // PDFsharp X graphics classes have implicit cast operators for GDI+ objects. // Define this to make it easier to use older code with PDFsharp. // Undefine this to prevent dependencies to GDI+ #endif #elif WPF // PDFsharp based on Windows Presentation Foundation #elif SILVERLIGHT // PDFsharp based on Silverlight #if !WPF #error 'SILVERLIGHT' must be defined together with 'WPF' #endif #else #error Either 'GDI', 'WPF' or 'SILVERLIGHT' must be defined #endif pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Windows/0000777000175000001440000000000011533760020020525 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Windows/enums/0000777000175000001440000000000011533760020021654 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Windows/enums/RenderMode.cs0000644000175000001440000000342111435766646024250 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Windows { /// /// Specifies how to render the preview. /// public enum RenderMode { /// /// Draw retained /// Default = 0, ///// ///// Draw using a metafile ///// //Metafile = 1, ///// ///// Draw using a bitmap image. ///// //Bitmap = 2 } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Windows/enums/Zoom.cs0000644000175000001440000000656011435766646023157 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Windows { /// /// Defines a zoom factor used in the preview control. /// public enum Zoom { /// /// The smallest possible zoom factor. /// Mininum = 10, /// /// The largest possible zoom factor. /// Maximum = 800, /// /// A pre-defined zoom factor. /// Percent800 = 800, /// /// A pre-defined zoom factor. /// Percent600 = 600, /// /// A pre-defined zoom factor. /// Percent400 = 400, /// /// A pre-defined zoom factor. /// Percent200 = 200, /// /// A pre-defined zoom factor. /// Percent150 = 150, /// /// A pre-defined zoom factor. /// Percent100 = 100, /// /// A pre-defined zoom factor. /// Percent75 = 75, /// /// A pre-defined zoom factor. /// Percent50 = 50, /// /// A pre-defined zoom factor. /// Percent25 = 25, /// /// A pre-defined zoom factor. /// Percent10 = 10, /// /// Sets the percent value such that the document fits horizontally into the window. /// BestFit = -1, /// /// Sets the percent value such that the printable area of the document fits horizontally into the window. /// Currently not yet implemented and the same as ZoomBestFit. /// TextFit = -2, /// /// Sets the percent value such that the whole document fits completely into the window. /// FullPage = -3, /// /// Sets the percent value such that the document is displayed in its real physical size. /// OriginalSize = -4, } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Content/0000777000175000001440000000000011533760020021215 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Content/ContentReaderException.cs0000644000175000001440000000453711435766646026212 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Pdf.Content { /// /// Exception thrown by ContentReader. /// public class ContentReaderException : PdfSharpException { /// /// Initializes a new instance of the class. /// public ContentReaderException() { } /// /// Initializes a new instance of the class. /// /// The message. public ContentReaderException(string message) : base(message) { } /// /// Initializes a new instance of the class. /// /// The message. /// The inner exception. public ContentReaderException(string message, Exception innerException) : base(message, innerException) { } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Content/CParser.cs0000644000175000001440000001261711435766646023133 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Reflection; using System.Text; using System.IO; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Content.Objects; namespace PdfSharp.Pdf.Content { /// /// Provides the functionality to parse PDF content streams. /// internal sealed class CParser { PdfPage page; CLexer lexer; public CParser(PdfPage page) { this.page = page; PdfContent content = page.Contents.CreateSingleContent(); byte[] bytes = content.Stream.Value; this.lexer = new CLexer(bytes); } public CParser(byte[] content) { this.lexer = new CLexer(content); } public CSymbol Symbol { get { return this.lexer.Symbol; } } public CSequence ReadContent() { CSequence sequence = new CSequence(); ParseObject(sequence, CSymbol.Eof); return sequence; } /// /// Parses whatever comes until the specified stop symbol is reached. /// void ParseObject(CSequence sequence, CSymbol stop) { CSymbol symbol; while ((symbol = ScanNextToken()) != CSymbol.Eof) { if (symbol == stop) return; switch (symbol) { case CSymbol.Comment: // ignore comments break; case CSymbol.Integer: CInteger n = new CInteger(); n.Value = this.lexer.TokenToInteger; this.operands.Add(n); break; case CSymbol.Real: CReal r = new CReal(); r.Value = this.lexer.TokenToReal; this.operands.Add(r); break; case CSymbol.String: case CSymbol.HexString: case CSymbol.UnicodeString: case CSymbol.UnicodeHexString: CString s = new CString(); s.Value = this.lexer.Token; this.operands.Add(s); break; case CSymbol.Name: CName name = new CName(); name.Name = this.lexer.Token; this.operands.Add(name); break; case CSymbol.Operator: COperator op = CreateOperator(); this.operands.Clear(); sequence.Add(op); break; case CSymbol.BeginArray: CArray array = new CArray(); Debug.Assert(this.operands.Count == 0, "Array within array..."); ParseObject(array, CSymbol.EndArray); array.Add(this.operands); this.operands.Clear(); this.operands.Add((CObject)array); break; case CSymbol.EndArray: throw new ContentReaderException("Unexpected: ']'"); } } } COperator CreateOperator() { string name = this.lexer.Token; COperator op = OpCodes.OperatorFromName(name); if (op.OpCode.OpCodeName== OpCodeName.ID) { this.lexer.ScanInlineImage(); } #if DEBUG if (op.OpCode.Operands != -1 && op.OpCode.Operands != this.operands.Count) { if (op.OpCode.OpCodeName != OpCodeName.ID) { GetType(); Debug.Assert(false, "Invalid number of operands."); } } #endif op.Operands.Add(this.operands); return op; } CSymbol ScanNextToken() { return this.lexer.ScanNextToken(); } CSymbol ScanNextToken(out string token) { CSymbol symbol = this.lexer.ScanNextToken(); token = this.lexer.Token; return symbol; } /// /// Reads the next symbol that must be the specified one. /// CSymbol ReadSymbol(CSymbol symbol) { CSymbol current = this.lexer.ScanNextToken(); if (symbol != current) throw new ContentReaderException(PSSR.UnexpectedToken(this.lexer.Token)); return current; } CSequence operands = new CSequence(); } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Content/ContentReader.cs0000644000175000001440000000444111435766646024325 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using PdfSharp.Pdf.Content.Objects; namespace PdfSharp.Pdf.Content { /// /// Represents the functionality for reading PDF content streams. /// public sealed class ContentReader { // Makes this class static ContentReader() { } /// /// Reads the content stream(s) of the specified page. /// /// The page. static public CSequence ReadContent(PdfPage page) { CParser parser = new CParser(page); CSequence sequence = parser.ReadContent(); return sequence; } /// /// Reads the specified content. /// /// The content. static public CSequence ReadContent(byte[] content) { CParser parser = new CParser(content); CSequence sequence = parser.ReadContent(); return sequence; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Content/enums/0000777000175000001440000000000011533760020022344 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Content/enums/Symbol.cs0000644000175000001440000000330711435766646024164 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Pdf.Content { /// /// Terminal symbols recognized by PDF content stream lexer. /// internal enum CSymbol { None, Comment, Integer, Real, /*Boolean?,*/ String, HexString, UnicodeString, UnicodeHexString, Name, Operator, BeginArray, EndArray, Eof, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Content/CLexer.cs0000644000175000001440000011330611435766646022753 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Content { /// <summary> /// Lexical analyzer for PDF content files. Adobe specifies no grammar, but it seems that it /// is a simple post-fix notation. /// </summary> internal class CLexer { /// <summary> /// Initializes a new instance of the Lexer class. /// </summary> public CLexer(byte[] content) { this.content = content; this.charIndex = 0; } /// <summary> /// Reads the next token and returns its type. /// </summary> public CSymbol ScanNextToken() { Again: ClearToken(); char ch = MoveToNonWhiteSpace(); switch (ch) { case '%': // Eat comments, the parser doesn't handle them //return this.symbol = ScanComment(); ScanComment(); goto Again; case '/': return this.symbol = ScanName(); //case 'R': // if (Lexer.IsWhiteSpace(this.nextChar)) // { // ScanNextChar(); // return Symbol.R; // } // break; case '+': case '-': return this.symbol = ScanNumber(); case '[': ScanNextChar(); return this.symbol = CSymbol.BeginArray; case ']': ScanNextChar(); return this.symbol = CSymbol.EndArray; case '(': return this.symbol = ScanLiteralString(); case '<': return this.symbol = ScanHexadecimalString(); case '.': return this.symbol = ScanNumber(); case '"': case '\'': return this.symbol = ScanOperator(); } if (Char.IsDigit(ch)) return this.symbol = ScanNumber(); if (Char.IsLetter(ch)) return this.symbol = ScanOperator(); if (ch == Chars.EOF) return this.symbol = CSymbol.Eof; Debug.Assert(false, "Unexpected character in content stream (maybe not implemented)."); return this.symbol = CSymbol.None; } /// <summary> /// Scans a comment line. (Not yet used, comments are skipped by lexer.) /// </summary> public CSymbol ScanComment() { Debug.Assert(this.currChar == Chars.Percent); ClearToken(); char ch; while ((ch = AppendAndScanNextChar()) != Chars.LF && ch != Chars.EOF) { } return this.symbol = CSymbol.Comment; } /// <summary> /// Scans the bytes of an inline image /// </summary> public CSymbol ScanInlineImage() { // TODO: while (this.currChar != 'E' && this.nextChar != 'I') ScanNextChar(); return CSymbol.None; } /// <summary> /// Scans a name. /// </summary> public CSymbol ScanName() { Debug.Assert(this.currChar == Chars.Slash); ClearToken(); while (true) { char ch = AppendAndScanNextChar(); if (IsWhiteSpace(ch) || IsDelimiter(ch)) return this.symbol = CSymbol.Name; if (ch == '#') { ScanNextChar(); char[] hex = new char[2]; hex[0] = this.currChar; hex[1] = this.nextChar; ScanNextChar(); // TODO Check syntax ch = (char)(ushort)int.Parse(new string(hex), NumberStyles.AllowHexSpecifier); this.currChar = ch; } } } /// <summary> /// Scans an integer or real number. /// </summary> public CSymbol ScanNumber() { long value = 0; int decimalDigits = 0; bool period = false; bool negative = false; ClearToken(); char ch = this.currChar; if (ch == '+' || ch == '-') { if (ch == '-') negative = true; this.token.Append(ch); ch = ScanNextChar(); } while (true) { if (char.IsDigit(ch)) { this.token.Append(ch); if (decimalDigits < 10) { value = 10 * value + ch - '0'; if (period) decimalDigits++; } } else if (ch == '.') { if (period) throw new ContentReaderException("More than one period in number."); period = true; this.token.Append(ch); } else break; ch = ScanNextChar(); } if (negative) value = -value; if (period) { if (decimalDigits > 0) { tokenAsReal = value / PowersOf10[decimalDigits]; //this.tokenAsLong = value / PowersOf10[decimalDigits]; } else { this.tokenAsReal = value; this.tokenAsLong = value; } return CSymbol.Real; } this.tokenAsLong = value; this.tokenAsReal = Convert.ToDouble(value); //long l = Int64.Parse(this.token.ToString(), CultureInfo.InvariantCulture); Debug.Assert(Int64.Parse(this.token.ToString(), CultureInfo.InvariantCulture) == value); if (value >= Int32.MinValue && value <= Int32.MaxValue) return CSymbol.Integer; //if (l > 0 && l <= UInt32.MaxValue) // return Symbol.UInteger; throw new ContentReaderException("Number exceeds integer range."); } static readonly double[] PowersOf10 = new double[] { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 }; /// <summary> /// Scans an operator. /// </summary> public CSymbol ScanOperator() { ClearToken(); char ch = this.currChar; // Scan token while (IsOperatorChar(ch)) ch = AppendAndScanNextChar(); return this.symbol = CSymbol.Operator; } // TODO public CSymbol ScanLiteralString() { Debug.Assert(this.currChar == Chars.ParenLeft); ClearToken(); int parenLevel = 0; char ch = ScanNextChar(); // Test UNICODE string if (ch == '\xFE' && this.nextChar == '\xFF') { // I'm not sure if the code is correct in any case. // ? Can a UNICODE character not start with ')' as hibyte // ? What about \# escape sequences ScanNextChar(); char chHi = ScanNextChar(); if (chHi == ')') { // The empty unicode string... ScanNextChar(); return this.symbol = CSymbol.String; } char chLo = ScanNextChar(); ch = (char)(chHi * 256 + chLo); while (true) { SkipChar: switch (ch) { case '(': parenLevel++; break; case ')': if (parenLevel == 0) { ScanNextChar(); return this.symbol = CSymbol.String; } parenLevel--; break; case '\\': { // TODO: not sure that this is correct... ch = ScanNextChar(); switch (ch) { case 'n': ch = Chars.LF; break; case 'r': ch = Chars.CR; break; case 't': ch = Chars.HT; break; case 'b': ch = Chars.BS; break; case 'f': ch = Chars.FF; break; case '(': ch = Chars.ParenLeft; break; case ')': ch = Chars.ParenRight; break; case '\\': ch = Chars.BackSlash; break; case Chars.LF: ch = ScanNextChar(); goto SkipChar; default: if (Char.IsDigit(ch)) { // Octal character code int n = ch - '0'; if (Char.IsDigit(this.nextChar)) { n = n * 8 + ScanNextChar() - '0'; if (Char.IsDigit(this.nextChar)) n = n * 8 + ScanNextChar() - '0'; } ch = (char)n; } break; } break; } // TODO ??? //case '#': // Debug.Assert(false, "Not yet implemented"); // break; default: break; } this.token.Append(ch); chHi = ScanNextChar(); if (chHi == ')') { ScanNextChar(); return this.symbol = CSymbol.String; } chLo = ScanNextChar(); ch = (char)(chHi * 256 + chLo); } } else { // 8-bit characters while (true) { SkipChar: switch (ch) { case '(': parenLevel++; break; case ')': if (parenLevel == 0) { ScanNextChar(); return this.symbol = CSymbol.String; } parenLevel--; break; case '\\': { ch = ScanNextChar(); switch (ch) { case 'n': ch = Chars.LF; break; case 'r': ch = Chars.CR; break; case 't': ch = Chars.HT; break; case 'b': ch = Chars.BS; break; case 'f': ch = Chars.FF; break; case '(': ch = Chars.ParenLeft; break; case ')': ch = Chars.ParenRight; break; case '\\': ch = Chars.BackSlash; break; case Chars.LF: ch = ScanNextChar(); goto SkipChar; default: if (Char.IsDigit(ch)) { // Octal character code int n = ch - '0'; if (Char.IsDigit(this.nextChar)) { n = n * 8 + ScanNextChar() - '0'; if (Char.IsDigit(this.nextChar)) n = n * 8 + ScanNextChar() - '0'; } ch = (char)n; } break; } break; } // TODO ??? //case '#': // Debug.Assert(false, "Not yet implemented"); // break; default: break; } this.token.Append(ch); ch = ScanNextChar(); } } } // TODO public CSymbol ScanHexadecimalString() { Debug.Assert(this.currChar == Chars.Less); ClearToken(); char[] hex = new char[2]; ScanNextChar(); while (true) { MoveToNonWhiteSpace(); if (this.currChar == '>') { ScanNextChar(); break; } if (char.IsLetterOrDigit(this.currChar)) { hex[0] = char.ToUpper(this.currChar); hex[1] = char.ToUpper(this.nextChar); int ch = int.Parse(new string(hex), NumberStyles.AllowHexSpecifier); this.token.Append(Convert.ToChar(ch)); ScanNextChar(); ScanNextChar(); } } string chars = this.token.ToString(); int count = chars.Length; if (count > 2 && chars[0] == (char)0xFE && chars[1] == (char)0xFF) { Debug.Assert(count % 2 == 0); this.token.Length = 0; for (int idx = 2; idx < count; idx += 2) this.token.Append((char)(chars[idx] * 256 + chars[idx + 1])); } return this.symbol = CSymbol.HexString; } /// <summary> /// Move current position one character further in content stream. /// </summary> internal char ScanNextChar() { if (ContLength <= this.charIndex) { this.currChar = Chars.EOF; this.nextChar = Chars.EOF; } else { this.currChar = this.nextChar; this.nextChar = (char)this.content[this.charIndex++]; if (this.currChar == Chars.CR) { if (this.nextChar == Chars.LF) { // Treat CR LF as LF this.currChar = this.nextChar; if (ContLength <= this.charIndex) this.nextChar = Chars.EOF; else this.nextChar = (char)this.content[this.charIndex++]; } else { // Treat single CR as LF this.currChar = Chars.LF; } } } return currChar; } /// <summary> /// Resets the current token to the empty string. /// </summary> void ClearToken() { this.token.Length = 0; this.tokenAsLong = 0; this.tokenAsReal = 0; } /// <summary> /// Appends current character to the token and reads next one. /// </summary> internal char AppendAndScanNextChar() { token.Append(this.currChar); return ScanNextChar(); } /// <summary> /// If the current character is not a white space, the function immediately returns it. /// Otherwise the PDF cursor is moved forward to the first non-white space or EOF. /// White spaces are NUL, HT, LF, FF, CR, and SP. /// </summary> public char MoveToNonWhiteSpace() { while (this.currChar != Chars.EOF) { switch (this.currChar) { case Chars.NUL: case Chars.HT: case Chars.LF: case Chars.FF: case Chars.CR: case Chars.SP: ScanNextChar(); break; default: return currChar; } } return currChar; } /// <summary> /// Gets or sets the current symbol. /// </summary> public CSymbol Symbol { get { return this.symbol; } set { this.symbol = value; } } /// <summary> /// Gets the current token. /// </summary> internal string Token { get { return this.token.ToString(); } } /// <summary> /// Interprets current token as integer literal. /// </summary> internal int TokenToInteger { get { Debug.Assert(tokenAsLong == Int32.Parse(this.token.ToString(), CultureInfo.InvariantCulture)); //return Int32.Parse(this.token.ToString(), CultureInfo.InvariantCulture); return (int)this.tokenAsLong; } } /// <summary> /// Interpret current token as real or integer literal. /// </summary> internal double TokenToReal { get { Debug.Assert(tokenAsReal == Double.Parse(token.ToString(), CultureInfo.InvariantCulture)); //return Double.Parse(token.ToString(), CultureInfo.InvariantCulture); return this.tokenAsReal; } } /// <summary> /// Indicates whether the specified character is a content stream white-space character. /// </summary> internal static bool IsWhiteSpace(char ch) { switch (ch) { case Chars.NUL: // 0 Null case Chars.HT: // 9 Tab case Chars.LF: // 10 Line feed case Chars.FF: // 12 Form feed case Chars.CR: // 13 Carriage return case Chars.SP: // 32 Space return true; } return false; } /// <summary> /// Indicates whether the specified character is an content operator character. /// </summary> internal static bool IsOperatorChar(char ch) { if (Char.IsLetter(ch)) return true; switch (ch) { case Chars.Asterisk: // * case Chars.QuoteSingle: // ' case Chars.QuoteDbl: // " return true; } return false; } /// <summary> /// Indicates whether the specified character is a PDF delimiter character. /// </summary> internal static bool IsDelimiter(char ch) { switch (ch) { case '(': case ')': case '<': case '>': case '[': case ']': //case '{': //case '}': case '/': case '%': return true; } return false; } public int ContLength { get { return this.content.Length; } } readonly byte[] content; int charIndex; char currChar; char nextChar; readonly StringBuilder token = new StringBuilder(); long tokenAsLong; double tokenAsReal; CSymbol symbol = CSymbol.None; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Content/ContentWriter.cs0000644000175000001440000004407411435766646024405 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Pdf.Internal; using PdfSharp.Pdf.Content.Objects; namespace PdfSharp.Pdf.Content { /// /// Represents a writer for generation of PDF streams. /// internal class ContentWriter { public ContentWriter(Stream contentStream) { this.stream = contentStream; #if DEBUG //layout = PdfWriterLayout.Verbose; #endif } public void Close(bool closeUnderlyingStream) { if (this.stream != null && closeUnderlyingStream) { this.stream.Close(); this.stream = null; } } public void Close() { Close(true); } public int Position { get { return (int)this.stream.Position; } } //public PdfWriterLayout Layout //{ // get { return this.layout; } // set { this.layout = value; } //} //PdfWriterLayout layout; //public PdfWriterOptions Options //{ // get { return this.options; } // set { this.options = value; } //} //PdfWriterOptions options; // ----------------------------------------------------------- /// /// Writes the specified value to the PDF stream. /// public void Write(bool value) { //WriteSeparator(CharCat.Character); //WriteRaw(value ? bool.TrueString : bool.FalseString); //this.lastCat = CharCat.Character; } #if old /// /// Writes the specified value to the PDF stream. /// public void Write(PdfBoolean value) { WriteSeparator(CharCat.Character); WriteRaw(value.Value ? "true" : "false"); this.lastCat = CharCat.Character; } /// /// Writes the specified value to the PDF stream. /// public void Write(int value) { WriteSeparator(CharCat.Character); WriteRaw(value.ToString()); this.lastCat = CharCat.Character; } /// /// Writes the specified value to the PDF stream. /// public void Write(uint value) { WriteSeparator(CharCat.Character); WriteRaw(value.ToString()); this.lastCat = CharCat.Character; } /// /// Writes the specified value to the PDF stream. /// public void Write(PdfInteger value) { WriteSeparator(CharCat.Character); this.lastCat = CharCat.Character; WriteRaw(value.Value.ToString()); } /// /// Writes the specified value to the PDF stream. /// public void Write(PdfUInteger value) { WriteSeparator(CharCat.Character); this.lastCat = CharCat.Character; WriteRaw(value.Value.ToString()); } /// /// Writes the specified value to the PDF stream. /// public void Write(double value) { WriteSeparator(CharCat.Character); WriteRaw(value.ToString("0.###", CultureInfo.InvariantCulture)); this.lastCat = CharCat.Character; } /// /// Writes the specified value to the PDF stream. /// public void Write(PdfReal value) { WriteSeparator(CharCat.Character); WriteRaw(value.Value.ToString("0.###", CultureInfo.InvariantCulture)); this.lastCat = CharCat.Character; } /// /// Writes the specified value to the PDF stream. /// public void Write(PdfString value) { WriteSeparator(CharCat.Delimiter); #if true PdfStringEncoding encoding = (PdfStringEncoding)(value.Flags & PdfStringFlags.EncodingMask); string pdf; if ((value.Flags & PdfStringFlags.HexLiteral) == 0) pdf = PdfEncoders.ToStringLiteral(value.Value, encoding, SecurityHandler); else pdf = PdfEncoders.ToHexStringLiteral(value.Value, encoding, SecurityHandler); WriteRaw(pdf); #else switch (value.Flags & PdfStringFlags.EncodingMask) { case PdfStringFlags.Undefined: case PdfStringFlags.PDFDocEncoding: if ((value.Flags & PdfStringFlags.HexLiteral) == 0) WriteRaw(PdfEncoders.DocEncode(value.Value, false)); else WriteRaw(PdfEncoders.DocEncodeHex(value.Value, false)); break; case PdfStringFlags.WinAnsiEncoding: throw new NotImplementedException("Unexpected encoding: WinAnsiEncoding"); case PdfStringFlags.Unicode: if ((value.Flags & PdfStringFlags.HexLiteral) == 0) WriteRaw(PdfEncoders.DocEncode(value.Value, true)); else WriteRaw(PdfEncoders.DocEncodeHex(value.Value, true)); break; case PdfStringFlags.StandardEncoding: case PdfStringFlags.MacRomanEncoding: case PdfStringFlags.MacExpertEncoding: default: throw new NotImplementedException("Unexpected encoding"); } #endif this.lastCat = CharCat.Delimiter; } /// /// Writes the specified value to the PDF stream. /// public void Write(PdfName value) { WriteSeparator(CharCat.Delimiter, '/'); string name = value.Value; StringBuilder pdf = new StringBuilder("/"); for (int idx = 1; idx < name.Length; idx++) { char ch = name[idx]; Debug.Assert((int)ch < 256); if (ch > ' ') switch (ch) { // TODO: is this all? case '/': case '<': case '>': case '(': case ')': case '#': break; default: pdf.Append(name[idx]); continue; } pdf.AppendFormat("#{0:X2}", (int)name[idx]); } WriteRaw(pdf.ToString()); this.lastCat = CharCat.Character; } public void Write(PdfLiteral value) { WriteSeparator(CharCat.Character); WriteRaw(value.Value); this.lastCat = CharCat.Character; } public void Write(PdfRectangle rect) { WriteSeparator(CharCat.Delimiter, '/'); WriteRaw(PdfEncoders.Format("[{0:0.###} {1:0.###} {2:0.###} {3:0.###}]", rect.X1, rect.Y1, rect.X2, rect.Y2)); this.lastCat = CharCat.Delimiter; } public void Write(PdfReference iref) { WriteSeparator(CharCat.Character); WriteRaw(iref.ToString()); this.lastCat = CharCat.Character; } public void WriteDocString(string text, bool unicode) { WriteSeparator(CharCat.Delimiter); //WriteRaw(PdfEncoders.DocEncode(text, unicode)); byte[] bytes; if (!unicode) bytes = PdfEncoders.DocEncoding.GetBytes(text); else bytes = PdfEncoders.UnicodeEncoding.GetBytes(text); bytes = PdfEncoders.FormatStringLiteral(bytes, unicode, true, false, this.securityHandler); this.Write(bytes); this.lastCat = CharCat.Delimiter; } public void WriteDocString(string text) { WriteSeparator(CharCat.Delimiter); //WriteRaw(PdfEncoders.DocEncode(text, false)); byte[] bytes = PdfEncoders.DocEncoding.GetBytes(text); bytes = PdfEncoders.FormatStringLiteral(bytes, false, false, false, this.securityHandler); this.Write(bytes); this.lastCat = CharCat.Delimiter; } public void WriteDocStringHex(string text) { WriteSeparator(CharCat.Delimiter); //WriteRaw(PdfEncoders.DocEncodeHex(text)); byte[] bytes = PdfEncoders.DocEncoding.GetBytes(text); bytes = PdfEncoders.FormatStringLiteral(bytes, false, false, true, this.securityHandler); this.stream.Write(bytes, 0, bytes.Length); this.lastCat = CharCat.Delimiter; } /// /// Begins a direct or indirect dictionary or array. /// public void WriteBeginObject(PdfObject value) { bool indirect = value.IsIndirect; if (indirect) { WriteObjectAddress(value); if (this.securityHandler != null) this.securityHandler.SetHashKey(value.ObjectID); } this.stack.Add(new StackItem(value)); if (indirect) { if (value is PdfArray) WriteRaw("[\n"); else if (value is PdfDictionary) WriteRaw("<<\n"); this.lastCat = CharCat.NewLine; } else { if (value is PdfArray) { WriteSeparator(CharCat.Delimiter); WriteRaw('['); this.lastCat = CharCat.Delimiter; } else if (value is PdfDictionary) { NewLine(); WriteSeparator(CharCat.Delimiter); WriteRaw("<<\n"); this.lastCat = CharCat.NewLine; } } if (this.layout == PdfWriterLayout.Verbose) IncreaseIndent(); } /// /// Ends a direct or indirect dictionary or array. /// public void WriteEndObject() { int count = this.stack.Count; Debug.Assert(count > 0, "ContentWriter stack underflow."); StackItem stackItem = (StackItem)this.stack[count - 1]; this.stack.RemoveAt(count - 1); PdfObject value = stackItem.Object; bool indirect = value.IsIndirect; if (this.layout == PdfWriterLayout.Verbose) DecreaseIndent(); if (value is PdfArray) { if (indirect) { WriteRaw("\n]\n"); this.lastCat = CharCat.NewLine; } else { WriteRaw("]"); this.lastCat = CharCat.Delimiter; } } else if (value is PdfDictionary) { if (indirect) { if (!stackItem.HasStream) if (this.lastCat == CharCat.NewLine) WriteRaw(">>\n"); else WriteRaw(" >>\n"); } else { Debug.Assert(!stackItem.HasStream, "Direct object with stream??"); WriteSeparator(CharCat.NewLine); WriteRaw(">>\n"); this.lastCat = CharCat.NewLine; } } if (indirect) { NewLine(); WriteRaw("endobj\n"); if (this.layout == PdfWriterLayout.Verbose) this.WriteRaw("%--------------------------------------------------------------------------------------------------\n"); } } /// /// Writes the stream of the specified dictionary. /// public void WriteStream(PdfDictionary value, bool omitStream) { StackItem stackItem = (StackItem)this.stack[this.stack.Count - 1]; Debug.Assert(stackItem.Object is PdfDictionary); Debug.Assert(stackItem.Object.IsIndirect); stackItem.HasStream = true; if (this.lastCat == CharCat.NewLine) WriteRaw(">>\nstream\n"); else WriteRaw(" >>\nstream\n"); if (omitStream) WriteRaw(" ...stream content omitted...\n"); // useful for debugging only else { byte[] bytes = value.Stream.Value; if (bytes.Length != 0) { if (this.securityHandler != null) { bytes = (byte[])bytes.Clone(); bytes = this.securityHandler.EncryptBytes(bytes); } Write(bytes); if (this.lastCat != CharCat.NewLine) WriteRaw('\n'); } } WriteRaw("endstream\n"); } public void Write(byte[] bytes) { if (bytes == null || bytes.Length == 0) return; this.stream.Write(bytes, 0, bytes.Length); this.lastCat = GetCategory((char)bytes[bytes.Length - 1]); } void WriteObjectAddress(PdfObject value) { if (this.layout == PdfWriterLayout.Verbose) this.WriteRaw(String.Format("{0} {1} obj % {2}\n", value.ObjectID.ObjectNumber, value.ObjectID.GenerationNumber, value.GetType().FullName)); else this.WriteRaw(String.Format("{0} {1} obj\n", value.ObjectID.ObjectNumber, value.ObjectID.GenerationNumber)); } public void WriteFileHeader(PdfDocument document) { StringBuilder header = new StringBuilder("%PDF-"); int version = document.version; header.Append((version / 10).ToString() + "." + (version % 10).ToString() + "\n%\xD3\xF4\xCC\xE1\n"); WriteRaw(header.ToString()); if (this.layout == PdfWriterLayout.Verbose) { this.WriteRaw(String.Format("% PDFsharp Version {0} (verbose mode)\n", VersionInfo.Version)); // Keep some space for later fix-up. this.commentPosition = (int)this.stream.Position + 2; this.WriteRaw("% \n"); this.WriteRaw("% \n"); this.WriteRaw("% \n"); this.WriteRaw("% \n"); this.WriteRaw("% \n"); this.WriteRaw("%--------------------------------------------------------------------------------------------------\n"); } } #endif public void WriteRaw(string rawString) { if (rawString == null || rawString.Length == 0) return; //AppendBlank(rawString[0]); byte[] bytes = PdfEncoders.RawEncoding.GetBytes(rawString); this.stream.Write(bytes, 0, bytes.Length); this.lastCat = GetCategory((char)bytes[bytes.Length - 1]); } public void WriteLineRaw(string rawString) { if (rawString == null || rawString.Length == 0) return; //AppendBlank(rawString[0]); byte[] bytes = PdfEncoders.RawEncoding.GetBytes(rawString); this.stream.Write(bytes, 0, bytes.Length); this.stream.Write(new byte[] { (byte)'\n' }, 0, 1); this.lastCat = GetCategory((char)bytes[bytes.Length - 1]); } public void WriteRaw(char ch) { Debug.Assert((int)ch < 256, "Raw character greater than 255 dedected."); //AppendBlank(ch); this.stream.WriteByte((byte)ch); this.lastCat = GetCategory(ch); } /// /// Gets or sets the indentation for a new indentation level. /// internal int Indent { get { return this.indent; } set { this.indent = value; } } protected int indent = 2; protected int writeIndent = 0; /// /// Increases indent level. /// void IncreaseIndent() { this.writeIndent += indent; } /// /// Decreases indent level. /// void DecreaseIndent() { this.writeIndent -= indent; } /// /// Gets an indent string of current indent. /// string IndentBlanks { get { return new string(' ', this.writeIndent); } } void WriteIndent() { this.WriteRaw(IndentBlanks); } void WriteSeparator(CharCat cat, char ch) { switch (this.lastCat) { //case CharCat.NewLine: // if (this.layout == PdfWriterLayout.Verbose) // WriteIndent(); // break; case CharCat.Delimiter: break; //case CharCat.Character: // if (this.layout == PdfWriterLayout.Verbose) // { // //if (cat == CharCat.Character || ch == '/') // this.stream.WriteByte((byte)' '); // } // else // { // if (cat == CharCat.Character) // this.stream.WriteByte((byte)' '); // } // break; } } void WriteSeparator(CharCat cat) { WriteSeparator(cat, '\0'); } public void NewLine() { if (lastCat != CharCat.NewLine) WriteRaw('\n'); } CharCat GetCategory(char ch) { //if (Lexer.IsDelimiter(ch)) // return CharCat.Delimiter; //if (ch == Chars.LF) // return CharCat.NewLine; return CharCat.Character; } enum CharCat { NewLine, Character, Delimiter, }; CharCat lastCat; /// /// Gets the underlying stream. /// internal Stream Stream { get { return this.stream; } } Stream stream; class StackItem { public StackItem(CObject value) { Object = value; } public CObject Object; //public bool HasStream; } List stack = new List(); } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Content/Chars.cs0000644000175000001440000000636411435766646022636 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Pdf.Content { /// /// Character table by name. Same as PdfSharp.Pdf.IO.Chars. Not yet clear if necessary. /// internal static class Chars { public const char EOF = (char)65535; //unchecked((char)(-1)); public const char NUL = '\0'; // EOF public const char CR = '\x0D'; // ignored by lexer public const char LF = '\x0A'; // Line feed public const char BEL = '\a'; // Bell public const char BS = '\b'; // Backspace public const char FF = '\f'; // Form feed public const char HT = '\t'; // Horizontal tab public const char VT = '\v'; // Vertical tab public const char NonBreakableSpace = (char)160; // char(160) // The following names come from "PDF Reference Third Edition" // Appendix D.1, Latin Character Set and Encoding public const char SP = ' '; public const char QuoteDbl = '"'; public const char QuoteSingle = '\''; public const char ParenLeft = '('; public const char ParenRight = ')'; public const char BraceLeft = '{'; public const char BraceRight = '}'; public const char BracketLeft = '['; public const char BracketRight = ']'; public const char Less = '<'; public const char Greater = '>'; public const char Equal = '='; public const char Period = '.'; public const char Semicolon = ';'; public const char Colon = ':'; public const char Slash = '/'; public const char Bar = '|'; public const char BackSlash = '\\'; public const char Percent = '%'; public const char Dollar = '$'; public const char At = '@'; public const char NumberSign = '#'; public const char Asterisk = '*'; public const char Question = '?'; public const char Hyphen = '-'; // char(45) public const char SoftHyphen = '­'; // char(173) public const char Currency = '¤'; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/0000777000175000001440000000000011533760020017604 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfDictionary.cs0000644000175000001440000015256111533751434022711 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Collections.Generic; using System.Reflection; using System.Text; using System.IO; using PdfSharp.Drawing; using PdfSharp.Internal; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Filters; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf { /// /// Value creation flags. Specifies whether and how a value that not exists is created. /// public enum VCF { /// /// Don't create the value. /// None, /// /// Create the value as direct object. /// Create, /// /// Create the value as indirect object. /// CreateIndirect, } /// /// Represents a PDF dictionary object. /// [DebuggerDisplay("(pairs={Elements.Count})")] public class PdfDictionary : PdfObject, IEnumerable { /// /// The elements of the dictionary. /// protected DictionaryElements elements; /// /// Initializes a new instance of the class. /// public PdfDictionary() { } /// /// Initializes a new instance of the class. /// /// The document. public PdfDictionary(PdfDocument document) : base(document) { } /// /// Initializes a new instance from an existing dictionary. Used for object type transformation. /// protected PdfDictionary(PdfDictionary dict) : base(dict) { if (dict.elements != null) dict.elements.ChangeOwner(this); if (dict.stream != null) dict.stream.SetOwner(this); } /// /// Creates a copy of this dictionary. Direct values are deep copied. Indirect references are not /// modified. /// public new PdfDictionary Clone() { return (PdfDictionary)Copy(); } /// /// This function is useful for importing objects from external documents. The returned object is not /// yet complete. irefs refer to external objects and directed objects are cloned but their document /// property is null. A cloned dictionary or array needs a 'fix-up' to be a valid object. /// protected override object Copy() { PdfDictionary dict = (PdfDictionary)base.Copy(); if (dict.elements != null) { dict.elements = dict.elements.Clone(); dict.elements.ChangeOwner(dict); PdfName[] names = dict.elements.KeyNames; foreach (PdfName name in names) { PdfObject obj = dict.elements[name] as PdfObject; if (obj != null) { obj = obj.Clone(); // Recall that obj.Document is now null dict.elements[name] = obj; } } } if (dict.stream != null) { dict.stream = dict.stream.Clone(); dict.stream.SetOwner(dict); } return dict; } /// /// Gets the hashtable containing the elements of this dictionary. /// public DictionaryElements Elements { get { if (this.elements == null) this.elements = new DictionaryElements(this); return this.elements; } } /// /// Returns an enumerator that iterates through a collection. /// public IEnumerator GetEnumerator() { return Elements.GetEnumerator(); } /// /// Returns a string with the content of this object in a readable form. Useful for debugging purposes only. /// public override string ToString() { // Get keys and sort PdfName[] keys = Elements.KeyNames; List list = new List(keys); list.Sort((IComparer)PdfName.Comparer); list.CopyTo(keys, 0); StringBuilder pdf = new StringBuilder(); pdf.Append("<< "); foreach (PdfName key in keys) pdf.Append(key + " " + this.Elements[key] + " "); pdf.Append(">>"); return pdf.ToString(); } internal override void WriteObject(PdfWriter writer) { writer.WriteBeginObject(this); //int count = Elements.Count; PdfName[] keys = Elements.KeyNames; #if DEBUG // TODO: automatically set length if (this.stream != null) Debug.Assert(Elements.ContainsKey(PdfStream.Keys.Length), "Dictionary has a stream but no length is set."); #endif #if DEBUG // Sort keys for debugging purposes. Comparing PDF files with for example programms like // Araxis Merge is easier with sorted keys. if (writer.Layout == PdfWriterLayout.Verbose) { List list = new List(keys); list.Sort(PdfName.Comparer); list.CopyTo(keys, 0); } #endif foreach (PdfName key in keys) WriteDictionaryElement(writer, key); if (Stream != null) WriteDictionaryStream(writer); writer.WriteEndObject(); } /// /// Writes a key/value pair of this dictionary. This function is intended to be overridden /// in derived classes. /// internal virtual void WriteDictionaryElement(PdfWriter writer, PdfName key) { if (key == null) throw new ArgumentNullException("key"); PdfItem item = Elements[key]; #if DEBUG // TODO: simplify PDFsharp if (item is PdfObject && ((PdfObject)item).IsIndirect) { // Replace an indirect object by its Reference item = ((PdfObject)item).Reference; Debug.Assert(false, "Check when we come here."); } #endif key.WriteObject(writer); item.WriteObject(writer); writer.NewLine(); } /// /// Writes the stream of this dictionary. This function is intended to be overridden /// in a derived class. /// internal virtual void WriteDictionaryStream(PdfWriter writer) { writer.WriteStream(this, (writer.Options & PdfWriterOptions.OmitStream) == PdfWriterOptions.OmitStream); } /// /// Gets or sets the PDF stream belonging to this dictionary. Returns null if the dictionary has /// no stream. To create the stream, call the CreateStream function. /// public PdfStream Stream { get { return this.stream; } set { this.stream = value; } } PdfStream stream; /// /// Creates the stream of this dictionary and initializes it with the specified byte array. /// The function must not be called if the dictionary already has a stream. /// public PdfStream CreateStream(byte[] value) { if (this.stream != null) throw new InvalidOperationException("The dictionary already has a stream."); this.stream = new PdfStream(value, this); // Always set the length Elements[PdfStream.Keys.Length] = new PdfInteger(this.stream.Length); return this.stream; } /// /// When overridden in a derived class, gets the KeysMeta of this dictionary type. /// internal virtual DictionaryMeta Meta { get { return null; } } /// /// Represents the interface to the elements of a PDF dictionary. /// public sealed class DictionaryElements : IDictionary, ICloneable { Dictionary elements; PdfDictionary owner; internal DictionaryElements(PdfDictionary dict) { this.elements = new Dictionary(); this.owner = dict; } object ICloneable.Clone() { DictionaryElements dictionaryElements = (DictionaryElements)MemberwiseClone(); dictionaryElements.elements = new Dictionary(dictionaryElements.elements); dictionaryElements.owner = null; return dictionaryElements; } /// /// Creates a shallow copy of this object. The clone is not owned by a dictionary anymore. /// public DictionaryElements Clone() { return (DictionaryElements)((ICloneable)this).Clone(); } /// /// Moves this instance to another dictionary during object type transformation. /// internal void ChangeOwner(PdfDictionary dict) { this.owner = dict; //??? //if (dict.elements != null) // Debug.Assert(dict.elements == this); dict.elements = this; } [Obsolete("Renamed to ChangeOwner for consistency.")] internal void SetOwner(PdfDictionary dict) { ChangeOwner(dict); } /// /// Gets the dictionary that this elements object belongs to. /// internal PdfDictionary Owner { get { return this.owner; } } /// /// Converts the specified value to boolean. /// If the value not exists, the function returns false. /// If the value is not convertible, the function throws an InvalidCastException. /// public bool GetBoolean(string key, bool create) { object obj = this[key]; if (obj == null) { if (create) this[key] = new PdfBoolean(); return false; } if (obj is PdfReference) obj = ((PdfReference)obj).Value; if (obj is PdfBoolean) return ((PdfBoolean)obj).Value; else if (obj is PdfBooleanObject) return ((PdfBooleanObject)obj).Value; throw new InvalidCastException("GetBoolean: Object is not a boolean."); } /// /// Converts the specified value to boolean. /// If the value not exists, the function returns false. /// If the value is not convertible, the function throws an InvalidCastException. /// public bool GetBoolean(string key) { return GetBoolean(key, false); } /// /// Sets the entry to a direct boolean value. /// public void SetBoolean(string key, bool value) { this[key] = new PdfBoolean(value); } /// /// Converts the specified value to integer. /// If the value not exists, the function returns 0. /// If the value is not convertible, the function throws an InvalidCastException. /// public int GetInteger(string key, bool create) { object obj = this[key]; if (obj == null) { if (create) this[key] = new PdfInteger(); return 0; } if (obj is PdfReference) obj = ((PdfReference)obj).Value; if (obj is PdfInteger) return ((PdfInteger)obj).Value; if (obj is PdfIntegerObject) return ((PdfIntegerObject)obj).Value; throw new InvalidCastException("GetInteger: Object is not an integer."); } /// /// Converts the specified value to integer. /// If the value not exists, the function returns 0. /// If the value is not convertible, the function throws an InvalidCastException. /// public int GetInteger(string key) { return GetInteger(key, false); } /// /// Sets the entry to a direct integer value. /// public void SetInteger(string key, int value) { this[key] = new PdfInteger(value); } /// /// Converts the specified value to double. /// If the value not exists, the function returns 0. /// If the value is not convertible, the function throws an InvalidCastException. /// public double GetReal(string key, bool create) { object obj = this[key]; if (obj == null) { if (create) this[key] = new PdfReal(); return 0; } if (obj is PdfReference) obj = ((PdfReference)obj).Value; if (obj is PdfReal) return ((PdfReal)obj).Value; if (obj is PdfRealObject) return ((PdfRealObject)obj).Value; if (obj is PdfInteger) return ((PdfInteger)obj).Value; if (obj is PdfIntegerObject) return ((PdfIntegerObject)obj).Value; throw new InvalidCastException("GetReal: Object is not a number."); } /// /// Converts the specified value to double. /// If the value not exists, the function returns 0. /// If the value is not convertible, the function throws an InvalidCastException. /// public double GetReal(string key) { return GetReal(key, false); } /// /// Sets the entry to a direct double value. /// public void SetReal(string key, double value) { this[key] = new PdfReal(value); } /// /// Converts the specified value to String. /// If the value not exists, the function returns the empty string. /// public string GetString(string key, bool create) { object obj = this[key]; if (obj == null) { if (create) this[key] = new PdfString(); return ""; } if (obj is PdfReference) obj = ((PdfReference)obj).Value; if (obj is PdfString) return ((PdfString)obj).Value; if (obj is PdfStringObject) return ((PdfStringObject)obj).Value; if (obj is PdfName) return ((PdfName)obj).Value; if (obj is PdfNameObject) return ((PdfNameObject)obj).Value; throw new InvalidCastException("GetString: Object is not a string."); } /// /// Converts the specified value to String. /// If the value not exists, the function returns the empty string. /// public string GetString(string key) { return GetString(key, false); } /// /// Sets the entry to a direct string value. /// public void SetString(string key, string value) { this[key] = new PdfString(value); } /// /// Converts the specified value to a name. /// If the value not exists, the function returns the empty string. /// public string GetName(string key) { object obj = this[key]; if (obj == null) { //if (create) // this[key] = new Pdf(); return String.Empty; } if (obj is PdfReference) obj = ((PdfReference)obj).Value; if (obj is PdfName) return ((PdfName)obj).Value; if (obj is PdfNameObject) return ((PdfNameObject)obj).Value; throw new InvalidCastException("GetName: Object is not a name."); } /// /// Sets the specified name value. /// If the value doesn't start with a slash, it is added automatically. /// public void SetName(string key, string value) { if (value == null) throw new ArgumentNullException("value"); if (value.Length == 0 || value[0] != '/') value = "/" + value; this[key] = new PdfName(value); } /// /// Converts the specified value to PdfRectangle. /// If the value not exists, the function returns an empty rectangle. /// If the value is not convertible, the function throws an InvalidCastException. /// public PdfRectangle GetRectangle(string key, bool create) { PdfRectangle value = new PdfRectangle(); object obj = this[key]; if (obj == null) { if (create) this[key] = value = new PdfRectangle(); return value; } if (obj is PdfReference) obj = ((PdfReference)obj).Value; PdfArray array = obj as PdfArray; if (array != null && array.Elements.Count == 4) { value = new PdfRectangle(array.Elements.GetReal(0), array.Elements.GetReal(1), array.Elements.GetReal(2), array.Elements.GetReal(3)); this[key] = value; } else value = (PdfRectangle)obj; return value; } /// /// Converts the specified value to PdfRectangle. /// If the value not exists, the function returns an empty rectangle. /// If the value is not convertible, the function throws an InvalidCastException. /// public PdfRectangle GetRectangle(string key) { return GetRectangle(key, false); } /// /// Sets the entry to a direct rectangle value, represented by an array with four values. /// public void SetRectangle(string key, PdfRectangle rect) { this.elements[key] = rect; } /// Converts the specified value to XMatrix. /// If the value not exists, the function returns an identity matrix. /// If the value is not convertible, the function throws an InvalidCastException. public XMatrix GetMatrix(string key, bool create) { XMatrix value = new XMatrix(); object obj = this[key]; if (obj == null) { if (create) this[key] = new PdfLiteral("[1 0 0 1 0 0]"); // cannot be parsed, implement a PdfMatrix... return value; } if (obj is PdfReference) obj = ((PdfReference)obj).Value; PdfArray array = obj as PdfArray; if (array != null && array.Elements.Count == 6) { value = new XMatrix(array.Elements.GetReal(0), array.Elements.GetReal(1), array.Elements.GetReal(2), array.Elements.GetReal(3), array.Elements.GetReal(4), array.Elements.GetReal(5)); } else if (obj is PdfLiteral) { throw new NotImplementedException("Parsing matrix from literal."); } else throw new InvalidCastException("Element is not an array with 6 values."); return value; } /// Converts the specified value to XMatrix. /// If the value not exists, the function returns an identity matrix. /// If the value is not convertible, the function throws an InvalidCastException. public XMatrix GetMatrix(string key) { return GetMatrix(key, false); } /// /// Sets the entry to a direct matrix value, represented by an array with six values. /// public void SetMatrix(string key, XMatrix matrix) { this.elements[key] = PdfLiteral.FromMatrix(matrix); } /// /// Converts the specified value to DateTime. /// If the value not exists, the function returns the specified default value. /// If the value is not convertible, the function throws an InvalidCastException. /// public DateTime GetDateTime(string key, DateTime defaultValue) { object obj = this[key]; if (obj == null) { //if (create) // this[key] = new Pdf(); return defaultValue; } if (obj is PdfReference) obj = ((PdfReference)obj).Value; if (obj is PdfDate) return ((PdfDate)obj).Value; string date; if (obj is PdfString) date = ((PdfString)obj).Value; else if (obj is PdfStringObject) date = ((PdfStringObject)obj).Value; else throw new InvalidCastException("GetName: Object is not a name."); if (date != "") { try { defaultValue = Parser.ParseDateTime(date, defaultValue); } catch { } } return defaultValue; } /// /// Sets the entry to a direct datetime value. /// public void SetDateTime(string key, DateTime value) { this.elements[key] = new PdfDate(value); } internal int GetEnumFromName(string key, object defaultValue, bool create) { if (!(defaultValue is Enum)) throw new ArgumentException("defaultValue"); object obj = this[key]; if (obj == null) { if (create) this[key] = new PdfName(defaultValue.ToString()); return (int)defaultValue; } Debug.Assert(obj is Enum); return (int)Enum.Parse(defaultValue.GetType(), obj.ToString().Substring(1), false); } internal int GetEnumFromName(string key, object defaultValue) { return GetEnumFromName(key, defaultValue, false); } internal void SetEnumAsName(string key, object value) { if (!(value is Enum)) throw new ArgumentException("value"); this.elements[key] = new PdfName("/" + value); } /// /// Gets the value for the specified key. If the value does not exist, it is optionally created. /// public PdfItem GetValue(string key, VCF options) { PdfObject obj; PdfDictionary dict; PdfArray array; PdfReference iref; PdfItem value = this[key]; if (value == null) { if (options != VCF.None) { Type type = GetValueType(key); if (type != null) { Debug.Assert(typeof(PdfItem).IsAssignableFrom(type), "Type not allowed."); if (typeof(PdfDictionary).IsAssignableFrom(type)) { value = obj = CreateDictionary(type, null); } else if (typeof(PdfArray).IsAssignableFrom(type)) { value = obj = CreateArray(type, null); } else throw new NotImplementedException("Type other than array or dictionary."); if (options == VCF.CreateIndirect) { this.owner.Owner.irefTable.Add(obj); this[key] = obj.Reference; } else this[key] = obj; } else throw new NotImplementedException("Cannot create value for key: " + key); } } else { // The value exists and can returned. But for imported documents check for necessary // object type transformation. if ((iref = value as PdfReference) != null) { // Case: value is an indirect reference value = iref.Value; if (value == null) { // If we come here PDF file is currupt throw new InvalidOperationException("Indirect reference without value."); } else { if (true) // || this.owner.Document.IsImported) { Type type = GetValueType(key); Debug.Assert(type != null, "No value type specified in meta information. Please send this file to PDFsharp support."); if (type != null && type != value.GetType()) { if (typeof(PdfDictionary).IsAssignableFrom(type)) { Debug.Assert(value is PdfDictionary, "Bug in PDFsharp. Please send this file to PDFsharp support."); value = CreateDictionary(type, (PdfDictionary)value); } else if (typeof(PdfArray).IsAssignableFrom(type)) { Debug.Assert(value is PdfArray, "Bug in PDFsharp. Please send this file to PDFsharp support."); value = CreateArray(type, (PdfArray)value); } else throw new NotImplementedException("Type other than array or dictionary."); } } } return value; } // Transformation is only possible after PDF import. if (true) // || this.owner.Document.IsImported) { // Case: value is a direct object if ((dict = value as PdfDictionary) != null) { Type type = GetValueType(key); Debug.Assert(type != null, "No value type specified in meta information. Please send this file to PDFsharp support."); if (dict.GetType() != type) dict = CreateDictionary(type, dict); return dict; } if ((array = value as PdfArray) != null) { Type type = GetValueType(key); Debug.Assert(type != null, "No value type specified in meta information. Please send this file to PDFsharp support."); if (array.GetType() != type) array = CreateArray(type, array); return array; } } } return value; } /// /// Short cut for GetValue(key, VCF.None). /// public PdfItem GetValue(string key) { return GetValue(key, VCF.None); } /// /// Returns the type of the object to be created as value of the specified key. /// Type GetValueType(string key) // TODO: move to PdfObject { Type type = null; DictionaryMeta meta = this.owner.Meta; if (meta != null) { KeyDescriptor kd = meta[key]; if (kd != null) type = kd.GetValueType(); else Debug.WriteLine("Warning: Key not desciptor table: " + key); // TODO: check what this means... } else Debug.WriteLine("Warning: No meta provided for type: " + this.owner.GetType().Name); // TODO: check what this means... return type; } PdfArray CreateArray(Type type, PdfArray oldArray) { ConstructorInfo ctorInfo; PdfArray array; if (oldArray == null) { // Use contstructor with signature 'Ctor(PdfDocument owner)'. ctorInfo = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[] { typeof(PdfDocument) }, null); Debug.Assert(ctorInfo != null, "No appropriate constructor found for type: " + type.Name); array = ctorInfo.Invoke(new object[] { this.owner.Owner }) as PdfArray; } else { // Use contstructor with signature 'Ctor(PdfDictionary dict)'. ctorInfo = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[] { typeof(PdfArray) }, null); Debug.Assert(ctorInfo != null, "No appropriate constructor found for type: " + type.Name); array = ctorInfo.Invoke(new object[] { oldArray }) as PdfArray; } return array; } PdfDictionary CreateDictionary(Type type, PdfDictionary oldDictionary) { ConstructorInfo ctorInfo; PdfDictionary dict; if (oldDictionary == null) { // Use contstructor with signature 'Ctor(PdfDocument owner)'. ctorInfo = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[] { typeof(PdfDocument) }, null); Debug.Assert(ctorInfo != null, "No appropriate constructor found for type: " + type.Name); dict = ctorInfo.Invoke(new object[] { this.owner.Owner }) as PdfDictionary; } else { // Use contstructor with signature 'Ctor(PdfDictionary dict)'. ctorInfo = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[] { typeof(PdfDictionary) }, null); Debug.Assert(ctorInfo != null, "No appropriate constructor found for type: " + type.Name); dict = ctorInfo.Invoke(new object[] { oldDictionary }) as PdfDictionary; } return dict; } PdfItem CreateValue(Type type, PdfDictionary oldValue) { ConstructorInfo ctorInfo = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[] { typeof(PdfDocument) }, null); PdfObject obj = ctorInfo.Invoke(new object[] { this.owner.Owner }) as PdfObject; if (oldValue != null) { obj.Reference = oldValue.Reference; obj.Reference.Value = obj; if (obj is PdfDictionary) { PdfDictionary dict = (PdfDictionary)obj; dict.elements = oldValue.elements; } } return obj; } /// /// Sets the entry with the specified value. DON'T USE THIS FUNCTION - IT MAY BE REMOVED. /// public void SetValue(string key, PdfItem value) { Debug.Assert((value is PdfObject && ((PdfObject)value).Reference == null) | !(value is PdfObject), "You try to set an indirect object directly into a dictionary."); // HACK? this.elements[key] = value; } /// /// Returns the indirect object if the value of the specified key is a PdfReference. /// [Obsolete("Use GetObject, GetDictionary, GetArray, or GetReference")] public PdfObject GetIndirectObject(string key) { PdfItem item = this[key]; if (item is PdfReference) return ((PdfReference)item).Value; return null; } /// /// Gets the PdfObject with the specified key, or null, if no such object exists. If the key refers to /// a reference, the referenced PdfObject is returned. /// public PdfObject GetObject(string key) { PdfItem item = this[key]; if (item is PdfReference) return ((PdfReference)item).Value; return item as PdfObject; } /// /// Gets the PdfArray with the specified key, or null, if no such object exists. If the key refers to /// a reference, the referenced PdfDictionary is returned. /// public PdfDictionary GetDictionary(string key) { return GetObject(key) as PdfDictionary; } /// /// Gets the PdfArray with the specified key, or null, if no such object exists. If the key refers to /// a reference, the referenced PdfArray is returned. /// public PdfArray GetArray(string key) { return GetObject(key) as PdfArray; } /// /// Gets the PdfReference with the specified key, or null, if no such object exists. /// public PdfReference GetReference(string key) { PdfItem item = this[key]; return item as PdfReference; } /// /// Sets the entry to the specified object. The object must not be an indirect object, /// otherwise an exception is raised. /// public void SetObject(string key, PdfObject obj) { if (obj.Reference != null) throw new ArgumentException("PdfObject must not be an indirect object.", "obj"); this[key] = obj; } /// /// Sets the entry as a reference to the specified object. The object must be an indirect object, /// otherwise an exception is raised. /// public void SetReference(string key, PdfObject obj) { if (obj.Reference == null) throw new ArgumentException("PdfObject must be an indirect object.", "obj"); this[key] = obj.Reference; } #region IDictionary Members /// /// Gets a value indicating whether the object is read-only. /// public bool IsReadOnly { get { return false; } } /// /// Returns an object for the object. /// public IEnumerator> GetEnumerator() { return this.elements.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return ((ICollection)this.elements).GetEnumerator(); } //object IDictionary.this[object key] //{ // get { return this.elements[key]; } // set // { // if (key == null) // throw new ArgumentNullException("key"); // if (!(key is string)) // throw new ArgumentException("Key must be of type System.String."); // if (((string)key) == "") // throw new ArgumentException(PSSR.NameMustStartWithSlash, "key"); // if (((string)key)[0] != '/') // throw new ArgumentException(PSSR.NameMustStartWithSlash, "key"); // this.elements[key] = value; // } //} /// /// Gets or sets an entry in the dictionary. The specified key must be a valid PDF name /// starting with a slash '/'. This property provides full access to the elements of the /// PDF dictionary. Wrong use can lead to errors or corrupt PDF files. /// public PdfItem this[string key] { get { PdfItem item; this.elements.TryGetValue(key, out item); return item; } set { if (value == null) throw new ArgumentNullException("value"); #if DEBUG if (key == "/MediaBox") key.GetType(); //if (value is PdfObject) //{ // PdfObject obj = (PdfObject)value; // if (obj.Reference != null) // throw new ArgumentException("An object with an indirect reference cannot be a direct value. Try to set an indirect refernece."); //} if (value is PdfDictionary) { PdfDictionary dict = (PdfDictionary)value; if (dict.stream != null) throw new ArgumentException("A dictionary with stream cannot be a direct value."); } #endif PdfObject obj = value as PdfObject; if (obj != null && obj.IsIndirect) value = obj.Reference; this.elements[key] = value; } } /// /// Gets or sets an entry in the dictionary identified by a PdfName object. /// public PdfItem this[PdfName key] { get { return this[key.Value]; } set { if (value == null) throw new ArgumentNullException("value"); #if DEBUG if (value is PdfDictionary) { PdfDictionary dict = (PdfDictionary)value; if (dict.stream != null) throw new ArgumentException("A dictionary with stream cannot be a direct value."); } #endif PdfObject obj = value as PdfObject; if (obj != null && obj.IsIndirect) value = obj.Reference; this.elements[key.Value] = value; } } /// /// Removes the value with the specified key. /// public bool Remove(string key) { return this.elements.Remove(key); } /// /// Removes the value with the specified key. /// public bool Remove(KeyValuePair item) { throw new NotImplementedException(); } /// /// Determines whether the dictionary contains the specified name. /// [Obsolete("Use ContainsKey.")] public bool Contains(string key) { return this.elements.ContainsKey(key); } /// /// Determines whether the dictionary contains the specified name. /// public bool ContainsKey(string key) { return this.elements.ContainsKey(key); } /// /// Determines whether the dictionary contains a specific value. /// public bool Contains(KeyValuePair item) { throw new NotImplementedException(); } /// /// Removes all elements from the dictionary. /// public void Clear() { this.elements.Clear(); } //void IDictionary.Add(object key, object value) //{ // if (key == null) // throw new ArgumentNullException("key"); // if (key is PdfName) // key = (key as PdfName).Value; // if (!(key is string)) // throw new ArgumentException("key must be of type System.String."); // if (((string)key) == "") // throw new ArgumentException("key"); // if (((string)key)[0] != '/') // throw new ArgumentException("The key must start with a slash '/'."); // // If object is indirect automatically convert value to reference. // PdfObject obj = value as PdfObject; // if (obj != null && obj.IsIndirect) // value = obj.Reference; // this.elements.Add(key, value); //} /// /// Adds the specified value to the dictionary. /// public void Add(string key, PdfItem value) { if (String.IsNullOrEmpty(key)) throw new ArgumentNullException("key"); if (key[0] != '/') throw new ArgumentException("The key must start with a slash '/'."); // If object is indirect automatically convert value to reference. PdfObject obj = value as PdfObject; if (obj != null && obj.IsIndirect) value = obj.Reference; this.elements.Add(key, value); } /// /// Adds an item to the dictionary. /// public void Add(KeyValuePair item) { Add(item.Key, item.Value); } /// /// Gets all keys currently in use in this dictionary as an array of PdfName objects. /// public PdfName[] KeyNames { get { ICollection values = this.elements.Keys; int count = values.Count; string[] strings = new string[count]; values.CopyTo(strings, 0); PdfName[] names = new PdfName[count]; for (int idx = 0; idx < count; idx++) names[idx] = new PdfName(strings[idx]); return names; } } /// /// Get all keys currently in use in this dictionary as an array of string objects. /// public ICollection Keys { get { ICollection values = this.elements.Keys; int count = values.Count; string[] keys = new string[count]; values.CopyTo(keys, 0); return keys; } } /// /// Gets the value associated with the specified key. /// public bool TryGetValue(string key, out PdfItem value) { return this.elements.TryGetValue(key, out value); } /// /// Gets all values currently in use in this dictionary as an array of PdfItem objects. /// public ICollection Values { get { ICollection values = this.elements.Values; PdfItem[] items = new PdfItem[values.Count]; values.CopyTo(items, 0); return items; } } /// /// Return false. /// public bool IsFixedSize { get { return false; } } #endregion #region ICollection Members /// /// Return false. /// public bool IsSynchronized { get { return false; } } /// /// Gets the number of elements contained in the dictionary. /// public int Count { get { return this.elements.Count; } } ///// The one-dimensional array that is the destination of the elements copied from. ///// The zero-based index in array at which copying begins. //public void CopyTo(Array array, int index) //{ // //this.elements.CopyTo(array, index); // throw new NotImplementedException(); //} /// /// Copies the elements of the dictionary to an array, starting at a particular index. /// public void CopyTo(KeyValuePair[] array, int arrayIndex) { throw new NotImplementedException(); } /// /// The current implementation returns null. /// public object SyncRoot { get { return null; } } #endregion } /// /// The PDF stream objects. /// public sealed class PdfStream { /// /// The dictionary the stream belongs to. /// PdfDictionary owner; internal PdfStream(PdfDictionary owner) { if (owner == null) throw new ArgumentNullException("owner"); this.owner = owner; } /// /// A .NET string can contain char(0) as a valid character. /// internal PdfStream(byte[] value, PdfDictionary owner) : this(owner) { this.value = value; } /// /// Clones this stream by creating a deep copy. /// public PdfStream Clone() { PdfStream stream = (PdfStream)MemberwiseClone(); stream.owner = null; if (stream.value != null) { stream.value = new byte[stream.value.Length]; this.value.CopyTo(stream.value, 0); } return stream; } /// /// Moves this instance to another dictionary during object type transformation. /// internal void SetOwner(PdfDictionary dict) { this.owner = dict; owner.stream = this; } /// /// Gets the length of the stream, i.e. the actual number of bytes in the stream. /// public int Length { get { return this.value != null ? value.Length : 0; } } // /// // /// Gets the native length of the stream, i.e. the number of bytes when they are neither // /// compressed nor encrypted. // /// // public int Length // { // get {return this.length;} // } /// /// Get or sets the bytes of the stream as they are, i.e. if one or more filters exists the bytes are /// not unfiltered. /// public byte[] Value { get { return this.value; } set { if (value == null) throw new ArgumentNullException("value"); this.value = value; this.owner.Elements.SetInteger(Keys.Length, value.Length); } } byte[] value; /// /// Gets the value of the stream unfiltered. The stream content is not modified by this operation. /// public byte[] UnfilteredValue { get { byte[] bytes = null; if (this.value != null) { PdfItem filter = this.owner.Elements["/Filter"]; if (filter != null) { bytes = Filtering.Decode(this.value, filter); if (bytes == null) { string message = String.Format("«Cannot decode filter '{0}'»", filter); bytes = PdfEncoders.RawEncoding.GetBytes(message); } } else { bytes = new byte[this.value.Length]; this.value.CopyTo(bytes, 0); } } return bytes ?? new byte[0]; } } /// /// Tries to unfilter the bytes of the stream. If the stream is filtered and PDFsharp knows the filter /// algorithm, the stream content is replaced by its unfiltered value and the function returns true. /// Otherwise the content remains untouched and the function returns false. /// The function is useful for analyzing existing PDF files. /// public bool TryUnfilter() { if (this.value != null) { PdfItem filter = this.owner.Elements["/Filter"]; if (filter != null) { // PDFsharp can only uncompress streams that are compressed with // the ZIP or LHZ algorithm. byte[] bytes = Filtering.Decode(this.value, filter); if (bytes != null) { this.owner.Elements.Remove(Keys.Filter); Value = bytes; } else return false; } } return true; } /// /// Compresses the stream with the FlateDecode filter. /// If a filter is already defined, the function has no effect. /// public void Zip() { if (this.value == null) return; if (!this.owner.Elements.ContainsKey("/Filter")) { this.value = Filtering.FlateDecode.Encode(this.value); this.owner.Elements["/Filter"] = new PdfName("/FlateDecode"); this.owner.Elements["/Length"] = new PdfInteger(this.value.Length); } } /// /// Returns the stream content as a raw string. /// public override string ToString() { if (this.value == null) return "«null»"; string stream; PdfItem filter = this.owner.Elements["/Filter"]; if (filter != null) { #if true byte[] bytes = Filtering.Decode(this.value, filter); if (bytes != null) stream = PdfEncoders.RawEncoding.GetString(bytes, 0, bytes.Length); #else if (this.owner.Elements.GetString("/Filter") == "/FlateDecode") { stream = Filtering.FlateDecode.DecodeToString(this.value); } #endif else throw new NotImplementedException("Unknown filter"); } else stream = PdfEncoders.RawEncoding.GetString(this.value, 0, this.value.Length); return stream; } //internal void WriteObject_(Stream stream) //{ // if (this.value != null) // stream.Write(this.value, 0, this.value.Length); //} /// /// Converts a raw encoded string into a byte array. /// public static byte[] RawEncode(string content) { return PdfEncoders.RawEncoding.GetBytes(content); } /// /// Common keys for all streams. /// public class Keys : KeysBase { /// /// (Required) The number of bytes from the beginning of the line following the keyword /// stream to the last byte just before the keyword endstream. (There may be an additional /// EOL marker, preceding endstream, that is not included in the count and is not logically /// part of the stream data.) /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string Length = "/Length"; /// /// (Optional) The name of a filter to be applied in processing the stream data found between /// the keywords stream and endstream, or an array of such names. Multiple filters should be /// specified in the order in which they are to be applied. /// [KeyInfo(KeyType.NameOrArray | KeyType.Optional)] public const string Filter = "/Filter"; /// /// (Optional) A parameter dictionary or an array of such dictionaries, used by the filters /// specified by Filter. If there is only one filter and that filter has parameters, DecodeParms /// must be set to the filter’s parameter dictionary unless all the filter’s parameters have /// their default values, in which case the DecodeParms entry may be omitted. If there are /// multiple filters and any of the filters has parameters set to nondefault values, DecodeParms /// must be an array with one entry for each filter: either the parameter dictionary for that /// filter, or the null object if that filter has no parameters (or if all of its parameters have /// their default values). If none of the filters have parameters, or if all their parameters /// have default values, the DecodeParms entry may be omitted. /// [KeyInfo(KeyType.ArrayOrDictionary | KeyType.Optional)] public const string DecodeParms = "/DecodeParms"; /// /// (Optional; PDF 1.2) The file containing the stream data. If this entry is present, the bytes /// between stream and endstream are ignored, the filters are specified by FFilter rather than /// Filter, and the filter parameters are specified by FDecodeParms rather than DecodeParms. /// However, the Length entry should still specify the number of those bytes. (Usually, there are /// no bytes and Length is 0.) /// [KeyInfo("1.2", KeyType.String | KeyType.Optional)] public const string F = "/F"; /// /// (Optional; PDF 1.2) The name of a filter to be applied in processing the data found in the /// stream’s external file, or an array of such names. The same rules apply as for Filter. /// [KeyInfo("1.2", KeyType.NameOrArray | KeyType.Optional)] public const string FFilter = "/FFilter"; /// /// (Optional; PDF 1.2) A parameter dictionary, or an array of such dictionaries, used by the /// filters specified by FFilter. The same rules apply as for DecodeParms. /// [KeyInfo("1.2", KeyType.ArrayOrDictionary | KeyType.Optional)] public const string FDecodeParms = "/FDecodeParms"; /// /// Optional; PDF 1.5) A non-negative integer representing the number of bytes in the decoded /// (defiltered) stream. It can be used to determine, for example, whether enough disk space is /// available to write a stream to a file. /// This value should be considered a hint only; for some stream filters, it may not be possible /// to determine this value precisely. /// [KeyInfo("1.5", KeyType.Integer | KeyType.Optional)] public const string DL = "/DL"; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfRealObject.cs0000644000175000001440000000630511435766646022624 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.Collections; using System.Text; using System.IO; using PdfSharp.Pdf.IO; using PdfSharp.Internal; namespace PdfSharp.Pdf { /// /// Represents an indirect real value. This type is not used by PDFsharp. If it is imported from /// an external PDF file, the value is converted into a direct object. /// public sealed class PdfRealObject : PdfNumberObject { /// /// Initializes a new instance of the class. /// public PdfRealObject() { } /// /// Initializes a new instance of the class. /// /// The value. public PdfRealObject(double value) { this.value = value; } /// /// Initializes a new instance of the class. /// /// The document. /// The value. public PdfRealObject(PdfDocument document, double value) : base(document) { this.value = value; } /// /// Gets or sets the value. /// public double Value { get { return this.value; } set { this.value = value; } } double value; /// /// Returns the real as a culture invariant string. /// public override string ToString() { return this.value.ToString(CultureInfo.InvariantCulture); } /// /// Writes the real literal. /// internal override void WriteObject(PdfWriter writer) { writer.WriteBeginObject(this); writer.Write(this.value); writer.WriteEndObject(); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfLiteral.cs0000644000175000001440000000641111435766646022204 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Drawing; using PdfSharp.Internal; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf { /// /// Represents text that is written 'as it is' into the PDF stream. This class can lead to invalid PDF files. /// E.g. strings in a literal are not encrypted when the document is saved with a password. /// public sealed class PdfLiteral : PdfItem { /// /// Initializes a new instance of the class. /// public PdfLiteral() { } /// /// Initializes a new instance with the specified string. /// public PdfLiteral(string value) { this.value = value; } /// /// Initializes a new instance with the culture invariant formatted specified arguments. /// public PdfLiteral(string format, params object[] args) { this.value = PdfEncoders.Format(format, args); } /// /// Creates a literal from an XMatrix /// public static PdfLiteral FromMatrix(XMatrix matrix) { return new PdfLiteral("[" + PdfEncoders.ToString(matrix) + "]"); } /// /// Gets the value as litaral string. /// public string Value { // This class must behave like a value type. Therefore it cannot be changed (like System.String). get { return this.value; } } readonly string value = String.Empty; /// /// Returns a string that represents the current value. /// public override string ToString() { return this.value; } internal override void WriteObject(PdfWriter writer) { writer.Write(this); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfReferenceTable.cs0000644000175000001440000004502111445447457023453 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Collections.Generic; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Represents the cross reference table of a PDF document. It contains all indirect objects of /// a document. /// internal sealed class PdfReferenceTable // do not derive from PdfObject { public PdfReferenceTable(PdfDocument document) { this.document = document; } PdfDocument document; /// /// Represents the relation between PdfObjectID and PdfReference for a PdfDocument. /// public Dictionary objectTable = new Dictionary(); internal bool IsUnderConstruction { get { return this.isUnderConstruction; } set { this.isUnderConstruction = value; } } bool isUnderConstruction; /// /// Adds a cross reference entry to the table. Used when parsing the trailer. /// public void Add(PdfReference iref) { if (iref.ObjectID.IsEmpty) iref.ObjectID = new PdfObjectID(GetNewObjectNumber()); if (this.objectTable.ContainsKey(iref.ObjectID)) throw new InvalidOperationException("Object already in table."); this.objectTable.Add(iref.ObjectID, iref); } /// /// Adds a PdfObject to the table. /// public void Add(PdfObject value) { if (value.Owner == null) value.Document = this.document; else Debug.Assert(value.Owner == this.document); if (value.ObjectID.IsEmpty) value.SetObjectID(GetNewObjectNumber(), 0); if (this.objectTable.ContainsKey(value.ObjectID)) throw new InvalidOperationException("Object already in table."); this.objectTable.Add(value.ObjectID, value.Reference); } public void Remove(PdfReference iref) { this.objectTable.Remove(iref.ObjectID); } /// /// Gets a cross reference entry from an object identifier. /// Returns null if no object with the specified ID exists in the object table. /// public PdfReference this[PdfObjectID objectID] { get { PdfReference iref; this.objectTable.TryGetValue(objectID, out iref); return iref; } } /// /// Indicates whether the specified object identifier is in the table. /// public bool Contains(PdfObjectID objectID) { return this.objectTable.ContainsKey(objectID); } //public PdfObject GetObject(PdfObjectID objectID) //{ // return this[objectID].Value; //} // /// // /// Gets the entry for the specified object, or null, if the object is not in // /// this XRef table. // /// // internal PdfReference GetEntry(PdfObjectID objectID) // { // return this[objectID]; // } /// /// Returns the next free object number. /// public int GetNewObjectNumber() { // New objects are numbered consecutively. If a document is imported, maxObjectNumber is // set to the highest object number used in the document. return ++this.maxObjectNumber; } internal int maxObjectNumber; /// /// Writes the iref section in pdf stream. /// internal void WriteObject(PdfWriter writer) { writer.WriteRaw("xref\n"); // PdfObjectID[] objectIDs2 = AllObjectIDs; PdfReference[] irefs = AllReferences; // PdfObjectID id1 = objectIDs2[0]; // PdfReference xref1 = irefs[0]; // id1.GetType(); // xref1.GetType(); //ArrayList list = new ArrayList(AllObjectIDs); //list.Sort(); //list.CopyTo(objectIDs); int count = irefs.Length; writer.WriteRaw(String.Format("0 {0}\n", count + 1)); writer.WriteRaw(String.Format("{0:0000000000} {1:00000} {2} \n", 0, 65535, "f")); //PdfEncoders.WriteAnsi(stream, text); for (int idx = 0; idx < count; idx++) { PdfReference iref = irefs[idx]; //text = String.Format("{0} {1}\n", iref.ObjectID.ObjectNumber, 1); //PdfEncoders.WriteAnsi(stream, text); // Acrobat is very pedantic; it must be exactly 20 bytes per line. writer.WriteRaw( String.Format("{0:0000000000} {1:00000} {2} \n", iref.Position, iref.GenerationNumber, "n")); //PdfEncoders.WriteAnsi(stream, text); } } /// /// Gets an array of all object identifier. For debugging purposes only. /// internal PdfObjectID[] AllObjectIDs { get { ICollection collection = this.objectTable.Keys; PdfObjectID[] objectIDs = new PdfObjectID[collection.Count]; collection.CopyTo(objectIDs, 0); return objectIDs; } } /// /// Gets an array of all cross references ordered increasing by their object identifier. /// internal PdfReference[] AllReferences { get { Dictionary.ValueCollection collection = this.objectTable.Values; List list = new List(collection); list.Sort(PdfReference.Comparer); PdfReference[] irefs = new PdfReference[collection.Count]; list.CopyTo(irefs, 0); return irefs; } } internal void HandleOrphanedReferences() { } /// /// Removes all objects that cannot be reached from the trailer. Returns the number of removed objects. /// internal int Compact() { // TODO: remove PdfBooleanObject, PdfIntegerObject etc. int removed = this.objectTable.Count; //CheckConsistence(); // TODO: Is this really so easy? PdfReference[] irefs = TransitiveClosure(this.document.trailer); #if DEBUG_ foreach (PdfReference iref in this.objectTable.Values) { if (iref.Value == null) this.GetType(); Debug.Assert(iref.Value != null); } foreach (PdfReference iref in irefs) { if (!this.objectTable.Contains(iref.ObjectID)) this.GetType(); Debug.Assert(this.objectTable.Contains(iref.ObjectID)); if (iref.Value == null) this.GetType(); Debug.Assert(iref.Value != null); } #endif this.maxObjectNumber = 0; this.objectTable.Clear(); foreach (PdfReference iref in irefs) { this.objectTable.Add(iref.ObjectID, iref); this.maxObjectNumber = Math.Max(this.maxObjectNumber, iref.ObjectNumber); } //CheckConsistence(); removed -= this.objectTable.Count; return removed; } /// /// Renumbers the objects starting at 1. /// internal void Renumber() { //CheckConsistence(); PdfReference[] irefs = AllReferences; this.objectTable.Clear(); // Give all objects a new number int count = irefs.Length; for (int idx = 0; idx < count; idx++) { PdfReference iref = irefs[idx]; #if DEBUG_ if (iref.ObjectNumber == 1108) GetType(); #endif iref.ObjectID = new PdfObjectID(idx + 1); // Rehash with new number this.objectTable.Add(iref.ObjectID, iref); } this.maxObjectNumber = count; //CheckConsistence(); } /// /// Checks the logical consistence for debugging purposes (useful after reconstruction work). /// [Conditional("DEBUG_")] public void CheckConsistence() { Dictionary ht1 = new Dictionary(); foreach (PdfReference iref in this.objectTable.Values) { Debug.Assert(!ht1.ContainsKey(iref), "Duplicate iref."); Debug.Assert(iref.Value != null); ht1.Add(iref, null); } Dictionary ht2 = new Dictionary(); foreach (PdfReference iref in this.objectTable.Values) { Debug.Assert(!ht2.ContainsKey(iref.ObjectID), "Duplicate iref."); ht2.Add(iref.ObjectID, null); } ICollection collection = this.objectTable.Values; int count = collection.Count; PdfReference[] irefs = new PdfReference[count]; collection.CopyTo(irefs, 0); #if true_ for (int i = 0; i < count; i++) for (int j = 0; j < count; j++) if (i != j) { Debug.Assert(Object.ReferenceEquals(irefs[i].Document, this.document)); Debug.Assert(irefs[i] != irefs[j]); Debug.Assert(!Object.ReferenceEquals(irefs[i], irefs[j])); Debug.Assert(!Object.ReferenceEquals(irefs[i].Value, irefs[j].Value)); Debug.Assert(!Object.ReferenceEquals(irefs[i].ObjectID, irefs[j].Value.ObjectID)); Debug.Assert(irefs[i].ObjectNumber != irefs[j].Value.ObjectNumber); Debug.Assert(Object.ReferenceEquals(irefs[i].Document, irefs[j].Document)); GetType(); } #endif } ///// ///// The garbage collector for PDF objects. ///// //public sealed class GC //{ // PdfXRefTable xrefTable; // // internal GC(PdfXRefTable xrefTable) // { // this.xrefTable = xrefTable; // } // // public void Collect() // { // } // // public PdfReference[] ReachableObjects() // { // Hashtable objects = new Hashtable(); // TransitiveClosure(objects, this.xrefTable.document.trailer); // } /// /// Calculates the transitive closure of the specified PdfObject, i.e. all indirect objects /// recursively reachable from the specified object. /// public PdfReference[] TransitiveClosure(PdfObject pdfObject) { return TransitiveClosure(pdfObject, Int16.MaxValue); } /// /// Calculates the transitive closure of the specified PdfObject with the specified depth, i.e. all indirect objects /// recursively reachable from the specified object in up to maximally depth steps. /// public PdfReference[] TransitiveClosure(PdfObject pdfObject, int depth) { CheckConsistence(); Dictionary objects = new Dictionary(); this.overflow = new Dictionary(); TransitiveClosureImplementation(objects, pdfObject, ref depth); TryAgain: if (this.overflow.Count > 0) { PdfObject[] array = new PdfObject[this.overflow.Count]; this.overflow.Keys.CopyTo(array, 0); this.overflow = new Dictionary(); for (int idx = 0; idx < array.Length; idx++) { //PdfObject o = array[idx]; //o.GetType(); PdfObject obj = array[idx]; //if (!objects.Contains(obj)) // objects.Add(obj, null); TransitiveClosureImplementation(objects, obj, ref depth); } goto TryAgain; } CheckConsistence(); ICollection collection = objects.Keys; int count = collection.Count; PdfReference[] irefs = new PdfReference[count]; collection.CopyTo(irefs, 0); #if true_ for (int i = 0; i < count; i++) for (int j = 0; j < count; j++) if (i != j) { Debug.Assert(Object.ReferenceEquals(irefs[i].Document, this.document)); Debug.Assert(irefs[i] != irefs[j]); Debug.Assert(!Object.ReferenceEquals(irefs[i], irefs[j])); Debug.Assert(!Object.ReferenceEquals(irefs[i].Value, irefs[j].Value)); Debug.Assert(!Object.ReferenceEquals(irefs[i].ObjectID, irefs[j].Value.ObjectID)); Debug.Assert(irefs[i].ObjectNumber != irefs[j].Value.ObjectNumber); Debug.Assert(Object.ReferenceEquals(irefs[i].Document, irefs[j].Document)); GetType(); } #endif return irefs; } static int nestingLevel; Dictionary overflow = new Dictionary(); void TransitiveClosureImplementation(Dictionary objects, PdfObject pdfObject, ref int depth) { if (depth-- == 0) return; try { nestingLevel++; if (nestingLevel >= 1000) { //Debug.WriteLine(String.Format("Nestinglevel={0}", nestingLevel)); //GetType(); if (!this.overflow.ContainsKey(pdfObject)) this.overflow.Add(pdfObject, null); return; } #if DEBUG_ //enterCount++; if (enterCount == 5400) GetType(); //if (!Object.ReferenceEquals(pdfObject.Owner, this.document)) // GetType(); //////Debug.Assert(Object.ReferenceEquals(pdfObject27.Document, this.document)); // if (item is PdfObject && ((PdfObject)item).ObjectID.ObjectNumber == 5) // Debug.WriteLine("items: " + ((PdfObject)item).ObjectID.ToString()); //if (pdfObject.ObjectNumber == 5) // GetType(); #endif IEnumerable enumerable = null; //(IEnumerator)pdfObject; if (pdfObject is PdfDictionary) enumerable = ((PdfDictionary)pdfObject).Elements.Values; else if (pdfObject is PdfArray) enumerable = ((PdfArray)pdfObject).Elements; if (enumerable != null) { foreach (PdfItem item in enumerable) { PdfReference iref = item as PdfReference; if (iref != null) { // Is this an indirect reference to an object that not exists? //if (iref.Document == null) //{ // Debug.WriteLine("Dead object dedected: " + iref.ObjectID.ToString()); // PdfReference dead = DeadObject; // iref.ObjectID = dead.ObjectID; // iref.Document = this.document; // iref.SetObject(dead.Value); // PdfDictionary dict = (PdfDictionary)dead.Value; // // dict.Elements["/DeadObjectCount"] = // new PdfInteger(dict.Elements.GetInteger("/DeadObjectCount") + 1); // // iref = dead; //} if (!Object.ReferenceEquals(iref.Document, this.document)) { GetType(); Debug.WriteLine(String.Format("Bad iref: {0}", iref.ObjectID.ToString())); } Debug.Assert(Object.ReferenceEquals(iref.Document, this.document) || iref.Document == null, "External object detected!"); #if DEBUG if (iref.ObjectID.ObjectNumber == 23) GetType(); #endif if (!objects.ContainsKey(iref)) { PdfObject value = iref.Value; // Ignore unreachable objets if (iref.Document != null) { // ... from trailer hack if (value == null) { iref = this.objectTable[iref.ObjectID]; Debug.Assert(iref.Value != null); value = iref.Value; } Debug.Assert(Object.ReferenceEquals(iref.Document, this.document)); objects.Add(iref, null); //Debug.WriteLine(String.Format("objects.Add('{0}', null);", iref.ObjectID.ToString())); if (value is PdfArray || value is PdfDictionary) TransitiveClosureImplementation(objects, value, ref depth); } //else //{ // objects2.Add(this[iref.ObjectID], null); //} } } else { PdfObject pdfObject28 = item as PdfObject; //if (pdfObject28 != null) // Debug.Assert(Object.ReferenceEquals(pdfObject28.Document, this.document)); if (pdfObject28 != null && (pdfObject28 is PdfDictionary || pdfObject28 is PdfArray)) TransitiveClosureImplementation(objects, pdfObject28, ref depth); } } } } finally { nestingLevel--; } } /// /// Gets the cross reference to an objects used for undefined indirect references. /// public PdfReference DeadObject { get { if (false || this.deadObject == null) { this.deadObject = new PdfDictionary(this.document); Add(this.deadObject); this.deadObject.Elements.Add("/DeadObjectCount", new PdfInteger()); } return this.deadObject.Reference; } } PdfDictionary deadObject; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfNameObject.cs0000644000175000001440000001122611435766646022617 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Represents an indirect name value. This type is not used by PDFsharp. If it is imported from /// an external PDF file, the value is converted into a direct object. Acrobat sometime uses indirect /// names to save space, because an indirect reference to a name may be shorter than a long name. /// [DebuggerDisplay("({Value})")] public sealed class PdfNameObject : PdfObject { /// /// Initializes a new instance of the class. /// public PdfNameObject() { this.value = "/"; // Empty name. } /// /// Initializes a new instance of the class. /// /// The document. /// The value. public PdfNameObject(PdfDocument document, string value) : base(document) { if (value == null) throw new ArgumentNullException("value"); if (value.Length == 0 || value[0] != '/') throw new ArgumentException(PSSR.NameMustStartWithSlash); this.value = value; } /// /// Determines whether the specified object is equal to the current object. /// public override bool Equals(object obj) { return this.value.Equals(obj); } /// /// Serves as a hash function for this type. /// public override int GetHashCode() { return this.value.GetHashCode(); } /// /// Gets or sets the name value. /// public string Value { get { return this.value; } set { this.value = value; } } string value; /// /// Returns the name. The string always begins with a slash. /// public override string ToString() { return this.value; } /// /// Determines whether a name is equal to a string. /// public static bool operator ==(PdfNameObject name, string str) { return name.value == str; } /// /// Determines whether a name is not equal to a string. /// public static bool operator !=(PdfNameObject name, string str) { return name.value != str; } #if leads_to_ambiguity public static bool operator ==(string str, PdfName name) { return str == name.value; } public static bool operator !=(string str, PdfName name) { return str == name.value; } public static bool operator ==(PdfName name1, PdfName name2) { return name1.value == name2.value; } public static bool operator !=(PdfName name1, PdfName name2) { return name1.value != name2.value; } #endif /// /// Writes the name including the leading slash. /// internal override void WriteObject(PdfWriter writer) { writer.WriteBeginObject(this); writer.Write(new PdfName(this.value)); writer.WriteEndObject(); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfCustomValues.cs0000644000175000001440000001146011435766646023242 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; namespace PdfSharp.Pdf { /// /// This class is intended for empira internal use only and may change or drop in future releases. /// public class PdfCustomValues : PdfDictionary { internal PdfCustomValues() { } internal PdfCustomValues(PdfDocument document) : base(document) { } internal PdfCustomValues(PdfDictionary dict) : base(dict) { } /// /// This function is intended for empira internal use only. /// public PdfCustomValueCompressionMode CompressionMode { set { throw new NotImplementedException(); } } /// /// This function is intended for empira internal use only. /// public bool Contains(string key) { return Elements.ContainsKey(key); } /// /// This function is intended for empira internal use only. /// public PdfCustomValue this[string key] { get { PdfDictionary dict = Elements.GetDictionary(key); if (dict == null) return null; PdfCustomValue cust = dict as PdfCustomValue; if (cust == null) cust = new PdfCustomValue(dict); return cust; } set { if (value == null) { Elements.Remove(key); } else { Owner.Internals.AddObject(value); Elements.SetReference(key, value); } } #if old get { PdfDictionary dict = Elements.GetDictionary(key); if (dict == null) return null; if (!(dict is PdfCustomValue)) dict = new PdfCustomValue(dict); return dict.Stream.Value; } set { PdfCustomValue cust; PdfDictionary dict = Elements.GetDictionary(key); if (dict == null) { cust = new PdfCustomValue(); Owner.Internals.AddObject(cust); Elements.Add(key, cust); } else { cust = dict as PdfCustomValue; if (cust == null) cust = new PdfCustomValue(dict); } cust.Value = value; } #endif } /// /// This function is intended for empira internal use only. /// public static void ClearAllCustomValues(PdfDocument document) { document.CustomValues = null; foreach (PdfPage page in document.Pages) page.CustomValues = null; } //public static string Key = "/PdfSharp.CustomValue"; internal static PdfCustomValues Get(DictionaryElements elem) { string key = elem.Owner.Owner.Internals.CustomValueKey; PdfCustomValues customValues; PdfDictionary dict = elem.GetDictionary(key); if (dict == null) { customValues = new PdfCustomValues(); elem.Owner.Owner.Internals.AddObject(customValues); elem.Add(key, customValues); } else { customValues = dict as PdfCustomValues; if (customValues == null) customValues = new PdfCustomValues(dict); } return customValues; } internal static void Remove(DictionaryElements elem) { elem.Remove(elem.Owner.Owner.Internals.CustomValueKey); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfStringObject.cs0000644000175000001440000001217111435766646023205 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf { /// /// Represents an indirect text string value. This type is not used by PDFsharp. If it is imported from /// an external PDF file, the value is converted into a direct object. /// [DebuggerDisplay("({Value})")] public sealed class PdfStringObject : PdfObject { /// /// Initializes a new instance of the class. /// public PdfStringObject() { this.flags = PdfStringFlags.RawEncoding; } /// /// Initializes a new instance of the class. /// /// The document. /// The value. public PdfStringObject(PdfDocument document, string value) : base(document) { this.value = value; this.flags = PdfStringFlags.RawEncoding; } /// /// Initializes a new instance of the class. /// /// The value. /// The encoding. public PdfStringObject(string value, PdfStringEncoding encoding) { this.value = value; //if ((flags & PdfStringFlags.EncodingMask) == 0) // flags |= PdfStringFlags.PDFDocEncoding; this.flags = (PdfStringFlags)encoding; } internal PdfStringObject(string value, PdfStringFlags flags) { this.value = value; //if ((flags & PdfStringFlags.EncodingMask) == 0) // flags |= PdfStringFlags.PDFDocEncoding; this.flags = flags; } /// /// Gets the number of characters in this string. /// public int Length { get { return this.value == null ? 0 : this.value.Length; } } /// /// Gets or sets the encoding. /// public PdfStringEncoding Encoding { get { return (PdfStringEncoding)(this.flags & PdfStringFlags.EncodingMask); } set { this.flags = (this.flags & ~PdfStringFlags.EncodingMask) | ((PdfStringFlags)value & PdfStringFlags.EncodingMask); } } /// /// Gets a value indicating whether the string is a hexadecimal literal. /// public bool HexLiteral { get { return (this.flags & PdfStringFlags.HexLiteral) != 0; } set { this.flags = value ? this.flags | PdfStringFlags.HexLiteral : this.flags & ~PdfStringFlags.HexLiteral; } } PdfStringFlags flags; /// /// Gets or sets the value as string /// public string Value { get { return this.value ?? ""; } set { this.value = value ?? ""; } } string value; /// /// Gets or sets the string value for encryption purposes. /// internal byte[] EncryptionValue { // TODO: Unicode case is not handled! get { return this.value == null ? new byte[0] : PdfEncoders.RawEncoding.GetBytes(this.value); } set { this.value = PdfEncoders.RawEncoding.GetString(value, 0, value.Length); } } /// /// Returns the string. /// public override string ToString() { return this.value; } /// /// Writes the string literal with encoding DOCEncoded. /// internal override void WriteObject(PdfWriter writer) { writer.WriteBeginObject(this); writer.Write(new PdfString(this.value, this.flags)); writer.WriteEndObject(); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfReal.cs0000644000175000001440000000540211435766646021472 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Represents a direct real value. /// [DebuggerDisplay("({Value})")] public sealed class PdfReal : PdfNumber { /// /// Initializes a new instance of the class. /// public PdfReal() { } /// /// Initializes a new instance of the class. /// /// The value. public PdfReal(double value) { this.value = value; } /// /// Gets the value as double. /// public double Value { // This class must behave like a value type. Therefore it cannot be changed (like System.String). get { return this.value; } } double value; /// /// Returns the real number as string. /// public override string ToString() { return this.value.ToString("0.###", CultureInfo.InvariantCulture); } /// /// Writes the real value with up to three digits. /// internal override void WriteObject(PdfWriter writer) { writer.Write(this); } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/TrimMargins.cs0000644000175000001440000000676411435766646022425 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using PdfSharp.Drawing; namespace PdfSharp.Pdf { /// /// Represents trim margins added to the page. /// [DebuggerDisplay("(Left={left.Millimeter}mm, Right={right.Millimeter}mm, Top={top.Millimeter}mm, Bottom={bottom.Millimeter}mm)")] public sealed class TrimMargins { ///// ///// Clones this instance. ///// //public TrimMargins Clone() //{ // TrimMargins trimMargins = new TrimMargins(); // trimMargins.left = this.left; // trimMargins.top = this.top; // trimMargins.right = this.right; // trimMargins.bottom = this.bottom; // return trimMargins; //} /// /// Sets all four crop margins simultaneously. /// public XUnit All { set { this.left = value; this.right = value; this.top = value; this.bottom = value; } } /// /// Gets or sets the left crop margin. /// public XUnit Left { get { return this.left; } set { this.left = value; } } XUnit left; /// /// Gets or sets the right crop margin. /// public XUnit Right { get { return this.right; } set { this.right = value; } } XUnit right; /// /// Gets or sets the top crop margin. /// public XUnit Top { get { return this.top; } set { this.top = value; } } XUnit top; /// /// Gets or sets the bottom crop margin. /// public XUnit Bottom { get { return this.bottom; } set { this.bottom = value; } } XUnit bottom; /// /// Gets a value indicating whether this instance has at least one margin with a value other than zero. /// public bool AreSet { get { return this.left.Value != 0 || this.right.Value != 0 || this.top.Value != 0 || this.bottom.Value != 0; } } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfDocument.cs0000644000175000001440000006266311445447301022362 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Reflection; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Internal; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.AcroForms; using PdfSharp.Pdf.Security; namespace PdfSharp.Pdf { /// /// Represents a PDF document. /// [DebuggerDisplay("(Name={Name})")] // A name makes debugging easier public sealed class PdfDocument : PdfObject, IDisposable { internal DocumentState state; internal PdfDocumentOpenMode openMode; #if DEBUG_ static PdfDocument() { PSSR.TestResourceMessages(); //string test = PSSR.ResMngr.GetString("SampleMessage1"); //test.GetType(); } #endif /// /// Creates a new PDF document in memory. /// To open an existing PDF file, use the PdfReader class. /// public PdfDocument() { //PdfDocument.Gob.AttatchDocument(this.Handle); this.creation = DateTime.Now; this.state = DocumentState.Created; this.version = 14; Initialize(); Info.CreationDate = this.creation; } /// /// Creates a new PDF document with the specified file name. The file is immediately created and keeps /// looked until the document is saved. /// To open an existing PDF file and import it, use the PdfReader class. /// public PdfDocument(string filename) { //PdfDocument.Gob.AttatchDocument(this.Handle); this.creation = DateTime.Now; this.state = DocumentState.Created; this.version = 14; Initialize(); Info.CreationDate = this.creation; this.outStream = new FileStream(filename, FileMode.Create); } /// /// Creates a new PDF document using the specified stream. /// To open an existing PDF file, use the PdfReader class. /// public PdfDocument(Stream outputStream) { //PdfDocument.Gob.AttatchDocument(this.Handle); this.creation = DateTime.Now; this.state = DocumentState.Created; Initialize(); Info.CreationDate = this.creation; this.outStream = outputStream; } internal PdfDocument(Lexer lexer) { //PdfDocument.Gob.AttatchDocument(this.Handle); this.creation = DateTime.Now; this.state = DocumentState.Imported; //this.info = new PdfInfo(this); //this.pages = new PdfPages(this); //this.fontTable = new PdfFontTable(); //this.catalog = new PdfCatalog(this); ////this.font = new PdfFont(); //this.objects = new PdfObjectTable(this); //this.trailer = new PdfTrailer(this); this.irefTable = new PdfReferenceTable(this); this.lexer = lexer; } void Initialize() { //this.info = new PdfInfo(this); this.fontTable = new PdfFontTable(this); this.imageTable = new PdfImageTable(this); this.trailer = new PdfTrailer(this); this.irefTable = new PdfReferenceTable(this); this.trailer.CreateNewDocumentIDs(); } //~PdfDocument() //{ // Dispose(false); //} /// /// Disposes all references to this document stored in other documents. This function should be called /// for documents you finished importing pages from. Calling Dispose is technically not necessary but /// useful for earlier reclaiming memory of documents you do not need anymore. /// public void Dispose() { Dispose(true); //GC.SuppressFinalize(this); } void Dispose(bool disposing) { if (this.state != DocumentState.Disposed) { if (disposing) { // Dispose managed resources. } //PdfDocument.Gob.DetatchDocument(Handle); } this.state = DocumentState.Disposed; } /// /// Gets or sets a user defined object that contains arbitrary information associated with this document. /// The tag is not used by PDFsharp. /// public object Tag { get { return this.tag; } set { this.tag = value; } } object tag; /// /// Gets or sets a value used to distinguish PdfDocument objects. /// The name is not used by PDFsharp. /// string Name { get { return this.name; } set { this.name = value; } } string name = NewName(); /// /// Get a new default name for a new document. /// static string NewName() { #if DEBUG_ if (PdfDocument.nameCount == 57) PdfDocument.nameCount.GetType(); #endif return "Document " + nameCount++; } static int nameCount; internal bool CanModify { //get {return this.state == DocumentState.Created || this.state == DocumentState.Modifyable;} // THHO4STLA: TODO: correct implementation get { return openMode == PdfDocumentOpenMode.Modify; } // TODO: correct implementation } /// /// Closes this instance. /// public void Close() { if (!CanModify) throw new InvalidOperationException(PSSR.CannotModify); if (this.outStream != null) { // Get security handler if document gets encrypted PdfStandardSecurityHandler securityHandler = null; if (SecuritySettings.DocumentSecurityLevel != PdfDocumentSecurityLevel.None) securityHandler = SecuritySettings.SecurityHandler; PdfWriter writer = new PdfWriter(this.outStream, securityHandler); try { DoSave(writer); } finally { writer.Close(); } } } /// /// Saves the document to the specified path. If a file already exists, it will be overwritten. /// public void Save(string path) { if (!CanModify) throw new InvalidOperationException(PSSR.CannotModify); Stream stream = new FileStream(path, FileMode.Create, FileAccess.Write); Save(stream); } /// /// Saves the document to the specified stream. /// public void Save(Stream stream, bool closeStream) { if (!CanModify) throw new InvalidOperationException(PSSR.CannotModify); // TODO: more diagnostic checks string message = ""; if (!CanSave(ref message)) throw new PdfSharpException(message); // Get security handler if document gets encrypted PdfStandardSecurityHandler securityHandler = null; if (SecuritySettings.DocumentSecurityLevel != PdfDocumentSecurityLevel.None) securityHandler = SecuritySettings.SecurityHandler; PdfWriter writer = new PdfWriter(stream, securityHandler); try { DoSave(writer); } finally { if (stream != null) { if (closeStream) stream.Close(); else stream.Position = 0; // Reset the stream position if the stream is left open. } if (writer != null) writer.Close(closeStream); } } /// /// Saves the document to the specified stream and closes the stream. /// public void Save(Stream stream) { Save(stream, true); } /// /// Implements saving a PDF file. /// void DoSave(PdfWriter writer) { if (this.pages == null || this.pages.Count == 0) throw new InvalidOperationException("Cannot save a PDF document with no pages."); try { bool encrypt = this.securitySettings.DocumentSecurityLevel != PdfDocumentSecurityLevel.None; if (encrypt) { PdfStandardSecurityHandler securityHandler = this.securitySettings.SecurityHandler; if (securityHandler.Reference == null) this.irefTable.Add(securityHandler); else Debug.Assert(this.irefTable.Contains(securityHandler.ObjectID)); this.trailer.Elements[PdfTrailer.Keys.Encrypt] = this.securitySettings.SecurityHandler.Reference; } else this.trailer.Elements.Remove(PdfTrailer.Keys.Encrypt); PrepareForSave(); if (encrypt) this.securitySettings.SecurityHandler.PrepareEncryption(); writer.WriteFileHeader(this); PdfReference[] irefs = this.irefTable.AllReferences; int count = irefs.Length; for (int idx = 0; idx < count; idx++) { PdfReference iref = irefs[idx]; #if DEBUG_ if (iref.ObjectNumber == 378) GetType(); #endif iref.Position = writer.Position; iref.Value.WriteObject(writer); } int startxref = writer.Position; this.irefTable.WriteObject(writer); writer.WriteRaw("trailer\n"); this.trailer.Elements.SetInteger("/Size", count + 1); this.trailer.WriteObject(writer); writer.WriteEof(this, startxref); //if (encrypt) //{ // this.state &= ~DocumentState.SavingEncrypted; // //this.securitySettings.SecurityHandler.EncryptDocument(); //} } finally { if (writer != null) { writer.Stream.Flush(); // DO NOT CLOSE WRITER HERE //writer.Close(); } } } /// /// Dispatches PrepareForSave to the objects that need it. /// internal override void PrepareForSave() { PdfDocumentInformation info = Info; // Set Creator if value is undefined if (info.Elements[PdfDocumentInformation.Keys.Creator] == null) info.Creator = VersionInfo.Producer; // Keep original producer if file was imported string producer = info.Producer; if (producer.Length == 0) producer = VersionInfo.Producer; else { // Prevent endless concatenation if file is edited with PDFsharp more than once if (!producer.StartsWith(VersionInfo.Title)) producer = VersionInfo.Producer + " (Original: " + producer + ")"; } info.Elements.SetString(PdfDocumentInformation.Keys.Producer, producer); // Prepare used fonts if (this.fontTable != null) this.fontTable.PrepareForSave(); // Let catalog do the rest Catalog.PrepareForSave(); #if true // Remove all unreachable objects (e.g. from deleted pages) int removed = this.irefTable.Compact(); if (removed != 0) Debug.WriteLine("PrepareForSave: Number of deleted unreachable objects: " + removed); this.irefTable.Renumber(); #endif } /// /// Determines whether the document can be saved. /// public bool CanSave(ref string message) { if (!SecuritySettings.CanSave(ref message)) return false; return true; } internal bool HasVersion(string version) { return String.Compare(Catalog.Version, version) >= 0; } /// /// Gets the document options used for saving the document. /// public PdfDocumentOptions Options { get { if (this.options == null) this.options = new PdfDocumentOptions(this); return this.options; } } PdfDocumentOptions options; /// /// Gets PDF specific document settings. /// public PdfDocumentSettings Settings { get { if (this.settings == null) this.settings = new PdfDocumentSettings(this); return this.settings; } } PdfDocumentSettings settings; /// /// NYI Indicates whether large objects are written immediately to the output stream to relieve /// memory consumption. /// internal bool EarlyWrite { get { return false; } } /// /// Gets or sets the PDF version number. Return value 14 e.g. means PDF 1.4 / Acrobat 5 etc. /// public int Version { get { return this.version; } set { if (!CanModify) throw new InvalidOperationException(PSSR.CannotModify); if (value < 12 || value > 17) // TODO not really implemented throw new ArgumentException(PSSR.InvalidVersionNumber, "value"); this.version = value; } } internal int version; /// /// Gets the number of pages in the document. /// public int PageCount { get { if (CanModify) return Pages.Count; // PdfOpenMode is InformationOnly PdfDictionary pageTreeRoot = (PdfDictionary)Catalog.Elements.GetObject(PdfCatalog.Keys.Pages); return pageTreeRoot.Elements.GetInteger(PdfPages.Keys.Count); } } /// /// Gets the file size of the document. /// public long FileSize { get { return this.fileSize; } } internal long fileSize; /// /// Gets the full qualified file name if the document was read form a file, or an empty string otherwise. /// public string FullPath { get { return this.fullPath; } } internal string fullPath = String.Empty; /// /// Gets a Guid that uniquely identifies this instance of PdfDocument. /// public Guid Guid { get { return this.guid; } } Guid guid = Guid.NewGuid(); internal DocumentHandle Handle { get { if (this.handle == null) this.handle = new DocumentHandle(this); return this.handle; } } DocumentHandle handle; /// /// Returns a value indicating whether the document was newly created or opened from an existing document. /// Returns true if the document was opened with the PdfReader.Open function, false otherwise. /// public bool IsImported { get { return (this.state & DocumentState.Imported) != 0; } } /// /// Returns a value indicating whether the document is read only or can be modified. /// public bool IsReadOnly { get { return (this.openMode != PdfDocumentOpenMode.Modify); } } internal Exception DocumentNotImported() { return new InvalidOperationException("Document not imported."); } /// /// Gets information about the document. /// public PdfDocumentInformation Info { get { if (this.info == null) this.info = this.trailer.Info; return this.info; } } PdfDocumentInformation info; // never changes if once created /// /// This function is intended to be undocumented. /// public PdfCustomValues CustomValues { get { if (this.customValues == null) this.customValues = PdfCustomValues.Get(Catalog.Elements); return this.customValues; } set { if (value != null) throw new ArgumentException("Only null is allowed to clear all custom values."); PdfCustomValues.Remove(Catalog.Elements); this.customValues = null; } } PdfCustomValues customValues; /// /// Get the pages dictionary. /// public PdfPages Pages { get { if (this.pages == null) this.pages = Catalog.Pages; return this.pages; } } PdfPages pages; // never changes if once created /// /// Gets or sets a value specifying the page layout to be used when the document is opened. /// public PdfPageLayout PageLayout { get { return Catalog.PageLayout; } set { if (!CanModify) throw new InvalidOperationException(PSSR.CannotModify); Catalog.PageLayout = value; } } /// /// Gets or sets a value specifying how the document should be displayed when opened. /// public PdfPageMode PageMode { get { return Catalog.PageMode; } set { if (!CanModify) throw new InvalidOperationException(PSSR.CannotModify); Catalog.PageMode = value; } } /// /// Gets the viewer preferences of this document. /// public PdfViewerPreferences ViewerPreferences { get { return Catalog.ViewerPreferences; } } /// /// Gets the root of the outline (or bookmark) tree. /// public PdfOutline.PdfOutlineCollection Outlines { get { return Catalog.Outlines; } } /// /// Get the AcroForm dictionary. /// public PdfAcroForm AcroForm { get { return Catalog.AcroForm; } } /// /// Gets or sets the default language of the document. /// public string Language { get { return Catalog.Elements.GetString(PdfCatalog.Keys.Lang); } set { Catalog.Elements.SetString(PdfCatalog.Keys.Lang, value); } } /// /// Gets the security settings of this document. /// public PdfSecuritySettings SecuritySettings { get { if (this.securitySettings == null) this.securitySettings = new PdfSecuritySettings(this); return this.securitySettings; } } internal PdfSecuritySettings securitySettings; /// /// Gets the document font table that holds all fonts used in the current document. /// internal PdfFontTable FontTable { get { if (this.fontTable == null) this.fontTable = new PdfFontTable(this); return this.fontTable; } } PdfFontTable fontTable; /// /// Gets the document image table that holds all images used in the current document. /// internal PdfImageTable ImageTable { get { if (this.imageTable == null) this.imageTable = new PdfImageTable(this); return this.imageTable; } } PdfImageTable imageTable; /// /// Gets the document form table that holds all form external objects used in the current document. /// internal PdfFormXObjectTable FormTable { get { if (this.formTable == null) this.formTable = new PdfFormXObjectTable(this); return this.formTable; } } PdfFormXObjectTable formTable; /// /// Gets the document ExtGState table that holds all form state objects used in the current document. /// internal PdfExtGStateTable ExtGStateTable { get { if (this.extGStateTable == null) this.extGStateTable = new PdfExtGStateTable(this); return this.extGStateTable; } } PdfExtGStateTable extGStateTable; /// /// Gets the PdfCatalog of the current document. /// internal PdfCatalog Catalog { get { if (this.catalog == null) this.catalog = this.trailer.Root; return catalog; } } PdfCatalog catalog; // never changes if once created /// /// Gets the PdfInternals object of this document, that grants access to some internal structures /// which are not part of the public interface of PdfDocument. /// public new PdfInternals Internals { get { if (this.internals == null) this.internals = new PdfInternals(this); return this.internals; } } PdfInternals internals; /// /// Creates a new page and adds it to this document. /// public PdfPage AddPage() { if (!CanModify) throw new InvalidOperationException(PSSR.CannotModify); return Catalog.Pages.Add(); } /// /// Adds the specified page to this document. If the page is from an external document, /// it is imported to this document. In this case the returned page is not the same /// object as the specified one. /// public PdfPage AddPage(PdfPage page) { if (!CanModify) throw new InvalidOperationException(PSSR.CannotModify); return Catalog.Pages.Add(page); } /// /// Creates a new page and inserts it in this document at the specified position. /// public PdfPage InsertPage(int index) { if (!CanModify) throw new InvalidOperationException(PSSR.CannotModify); return Catalog.Pages.Insert(index); } /// /// Inserts the specified page in this document. If the page is from an external document, /// it is imported to this document. In this case the returned page is not the same /// object as the specified one. /// public PdfPage InsertPage(int index, PdfPage page) { if (!CanModify) throw new InvalidOperationException(PSSR.CannotModify); return Catalog.Pages.Insert(index, page); } /// /// Gets the security handler. /// public PdfStandardSecurityHandler SecurityHandler { get { return this.trailer.SecurityHandler; } } internal PdfTrailer trailer; internal PdfReferenceTable irefTable; internal Stream outStream; // Imported Document internal Lexer lexer; internal DateTime creation; /// /// Occurs when the specified document is not used anymore for importing content. /// internal void OnExternalDocumentFinalized(PdfDocument.DocumentHandle handle) { if (tls != null) { //PdfDocument[] documents = tls.Documents; tls.DetachDocument(handle); } if (this.formTable != null) formTable.DetachDocument(handle); } //internal static GlobalObjectTable Gob = new GlobalObjectTable(); /// /// Gets the ThreadLocalStorage object. It is used for caching objects that should created /// only once. /// internal static ThreadLocalStorage Tls { get { if (tls == null) tls = new ThreadLocalStorage(); return tls; } } [ThreadStatic] static ThreadLocalStorage tls; [DebuggerDisplay("(ID={ID}, alive={IsAlive})")] internal class DocumentHandle { public DocumentHandle(PdfDocument document) { this.weakRef = new WeakReference(document); this.ID = document.guid.ToString("B").ToUpper(); } public bool IsAlive { get { return this.weakRef.IsAlive; } } public PdfDocument Target { get { return this.weakRef.Target as PdfDocument; } } WeakReference weakRef; public string ID; public override bool Equals(object obj) { DocumentHandle handle = obj as DocumentHandle; if (!Object.ReferenceEquals(handle, null)) return this.ID == handle.ID; return false; } public override int GetHashCode() { return this.ID.GetHashCode(); } public static bool operator ==(DocumentHandle left, DocumentHandle right) { if (Object.ReferenceEquals(left, null)) return Object.ReferenceEquals(right, null); return left.Equals(right); } public static bool operator !=(DocumentHandle left, DocumentHandle right) { return !(left == right); } } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfObject.cs0000644000175000001440000004410011435766646022013 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Base class of all composite PDF objects. /// public abstract class PdfObject : PdfItem { /// /// Initializes a new instance of the class. /// protected PdfObject() { } /// /// Initializes a new instance of the class. /// protected PdfObject(PdfDocument document) { Document = document; } /// /// Initializes a new instance from an existing object. Used for object type transformation. /// protected PdfObject(PdfObject obj) { Document = obj.Owner; // If the object that was transformed to an instance of a derived class was an indirect object // set the value of the reference to this. if (obj.iref != null) obj.iref.Value = this; #if DEBUG else { // If this occurs it is an internal error Debug.Assert(false, "Object type transformation must not be done with direct objects"); } #endif } /// /// Creates a copy of this object. The clone does not belong to a document, i.e. its owner and its iref are null. /// public new PdfObject Clone() { return (PdfObject)Copy(); } /// /// Implements the copy mechanism. Must be overridden in derived classes. /// protected override object Copy() { PdfObject obj = (PdfObject)base.Copy(); obj.document = null; obj.iref = null; return obj; } #if true_ // works, but may lead to other problems that I cannot assess /// /// Determines whether the specified object is equal to the current PdfObject. /// public override bool Equals(object obj) { if (obj is PdfObject) { PdfObject other = (PdfObject)obj; // Take object type transformation into account if (this.iref != null && other.iref != null) { Debug.Assert(this.iref.Value != null, "iref without value."); Debug.Assert(other.iref.Value != null, "iref without value."); return Object.ReferenceEquals(this.iref.Value, other.iref.Value); } } return base.Equals(obj); } public override int GetHashCode() { if (this.iref != null) { Debug.Assert(this.iref.Value != null, "iref without value."); return this.iref.GetHashCode(); } return base.GetHashCode(); } #endif /// /// Sets the object and generation number /// Setting the object identifier makes this object an indirect object, i.e. the object gets /// a PdfReference entry in the PdfReferenceTable. /// internal void SetObjectID(int objectNumber, int generationNumber) { PdfObjectID objectID = new PdfObjectID(objectNumber, generationNumber); // TODO: check imported if (this.iref == null) this.iref = this.document.irefTable[objectID]; if (this.iref == null) { this.iref = new PdfReference(this); this.iref.ObjectID = objectID; } this.iref.Value = this; this.iref.Document = this.document; } //internal void SetObjectID2(PdfObjectID objectID) //{ // if (this.iref == null) // this.iref = this.document.irefTable[objectID]; // //this.iref = new PdfReference(this); // //this.iref.ObjectID = objectID; // this.iref.Value = this; //} /// /// Gets the PdfDocument this object belongs to. /// public virtual PdfDocument Owner { get { return this.document; } } /// /// Gets or sets the PdfDocument this object belongs to. /// internal virtual PdfDocument Document { set { if (!ReferenceEquals(this.document, value)) { if (this.document != null) throw new InvalidOperationException("Cannot change document."); this.document = value; if (this.iref != null) this.iref.Document = value; } } } internal PdfDocument document; /// /// Indicates whether the object is an indirect object. /// public bool IsIndirect { // An object is an indirect object if and only if is has an indirect reference value. get { return this.iref != null; } } /// /// Gets the PdfInternals object of this document, that grants access to some internal structures /// which are not part of the public interface of PdfDocument. /// public PdfObjectInternals Internals { get { if (this.internals == null) this.internals = new PdfObjectInternals(this); return this.internals; } } PdfObjectInternals internals; /// /// When overridden in a derived class, prepares the object to get saved. /// internal virtual void PrepareForSave() { } /// /// Saves the stream position. 2nd Edition. /// internal override void WriteObject(PdfWriter writer) { Debug.Assert(false, "Must not come here!"); // Debug.Assert(this.inStreamOffset <= 0); // if (this.inStreamOffset == 0) // { // //this.InStreamOffset = stream.Position; // this.document.xrefTable.AddObject(this); // return Format("{0} {1} obj\n", this.objectID, this.generation); // } // else if (this.inStreamOffset == -1) // { // // } // return null; // } /// /// Gets the object identifier. Returns PdfObjectID.Empty for direct objects. /// internal PdfObjectID ObjectID { get { return this.iref != null ? this.iref.ObjectID : PdfObjectID.Empty; } } /// /// Gets the object number. /// internal int ObjectNumber { get { return ObjectID.ObjectNumber; } } /// /// Gets the generation number. /// internal int GenerationNumber { get { return ObjectID.GenerationNumber; } } ///// ///// Creates a deep copy of the specified value and its transitive closure and adds the ///// new objects to the specified owner document. ///// /// The document that owns the cloned objects. /// The root object to be cloned. /// The clone of the root object internal static PdfObject DeepCopyClosure(PdfDocument owner, PdfObject externalObject) { // Get transitive closure PdfObject[] elements = externalObject.Owner.Internals.GetClosure(externalObject); int count = elements.Length; #if DEBUG_ for (int idx = 0; idx < count; idx++) { Debug.Assert(elements[idx].XRef != null); Debug.Assert(elements[idx].XRef.Document != null); Debug.Assert(elements[idx].Document != null); if (elements[idx].ObjectID.ObjectNumber == 12) GetType(); } #endif // 1st loop. Replace all objects by their clones. PdfImportedObjectTable iot = new PdfImportedObjectTable(owner, externalObject.Owner); for (int idx = 0; idx < count; idx++) { PdfObject obj = elements[idx]; PdfObject clone = obj.Clone(); Debug.Assert(clone.Reference == null); clone.Document = owner; if (obj.Reference != null) { // Case: The cloned object was an indirect object. // add clone to new owner document owner.irefTable.Add(clone); // the clone gets an iref by adding it to its new owner Debug.Assert(clone.Reference != null); // save an association from old object identifier to new iref iot.Add(obj.ObjectID, clone.Reference); } else { // Case: The cloned object was an direct object. // only the root object can be a direct object Debug.Assert(idx == 0); } // replace external object by its clone elements[idx] = clone; } #if DEBUG_ for (int idx = 0; idx < count; idx++) { Debug.Assert(elements[idx].XRef != null); Debug.Assert(elements[idx].XRef.Document != null); Debug.Assert(resources[idx].Document != null); if (elements[idx].ObjectID.ObjectNumber == 12) GetType(); } #endif // 2nd loop. Fix up all indirect references that still refers to the import document. for (int idx = 0; idx < count; idx++) { PdfObject obj = elements[idx]; Debug.Assert(obj.Owner == owner); FixUpObject(iot, owner, obj); } // return the clone of the former root object return elements[0]; } ///// ///// Imports an object and its transitive closure to the specified document. ///// /// The imported object table of the owner for the external document. /// The document that owns the cloned objects. /// The root object to be cloned. /// The clone of the root object internal static PdfObject ImportClosure(PdfImportedObjectTable importedObjectTable, PdfDocument owner, PdfObject externalObject) { Debug.Assert(ReferenceEquals(importedObjectTable.Owner, owner), "importedObjectTable does not belong to the owner."); Debug.Assert(ReferenceEquals(importedObjectTable.ExternalDocument, externalObject.Owner), "The ExternalDocument of the importedObjectTable does not belong to the owner of object to be imported."); // Get transitive closure of external object PdfObject[] elements = externalObject.Owner.Internals.GetClosure(externalObject); int count = elements.Length; #if DEBUG_ for (int idx = 0; idx < count; idx++) { Debug.Assert(elements[idx].XRef != null); Debug.Assert(elements[idx].XRef.Document != null); Debug.Assert(elements[idx].Document != null); if (elements[idx].ObjectID.ObjectNumber == 12) GetType(); } #endif // 1st loop. Already imported objects are reused and new ones are cloned. for (int idx = 0; idx < count; idx++) { PdfObject obj = elements[idx]; Debug.Assert(!ReferenceEquals(obj.Owner, owner)); if (importedObjectTable.Contains(obj.ObjectID)) { // External object was already imported PdfReference iref = importedObjectTable[obj.ObjectID]; Debug.Assert(iref != null); Debug.Assert(iref.Value != null); Debug.Assert(iref.Document == owner); // replace external object by the already cloned counterpart elements[idx] = iref.Value; } else { // External object was not imported ealier and must be cloned PdfObject clone = obj.Clone(); Debug.Assert(clone.Reference == null); clone.Document = owner; if (obj.Reference != null) { // Case: The cloned object was an indirect object. // add clone to new owner document owner.irefTable.Add(clone); Debug.Assert(clone.Reference != null); // save an association from old object identifier to new iref importedObjectTable.Add(obj.ObjectID, clone.Reference); } else { // Case: The cloned object was a direct object. // only the root object can be a direct object Debug.Assert(idx == 0); //// add it to this (the importer) document //owner.irefTable.Add(clone); //Debug.Assert(clone.Reference != null); } // replace external object by its clone elements[idx] = clone; } } #if DEBUG_ for (int idx = 0; idx < count; idx++) { Debug.Assert(elements[idx].XRef != null); Debug.Assert(elements[idx].XRef.Document != null); Debug.Assert(elements[idx].Document != null); if (resources[idx].ObjectID.ObjectNumber == 12) GetType(); } #endif // 2nd loop. Fix up indirect references that still refers to the external document. for (int idx = 0; idx < count; idx++) { PdfObject obj = elements[idx]; Debug.Assert(owner != null); FixUpObject(importedObjectTable, importedObjectTable.Owner, obj); } // return the imported root object return elements[0]; } /// /// Replace all indirect references to external objects by their cloned counterparts /// owned by the importer document. /// internal static void FixUpObject(PdfImportedObjectTable iot, PdfDocument owner, PdfObject value) { Debug.Assert(ReferenceEquals(iot.Owner, owner)); PdfDictionary dict; PdfArray array; if ((dict = value as PdfDictionary) != null) { // Set document for cloned direct objects if (dict.Owner == null) dict.Document = owner; else Debug.Assert(dict.Owner == owner); // Search for indirect references in all keys PdfName[] names = dict.Elements.KeyNames; foreach (PdfName name in names) { PdfItem item = dict.Elements[name]; // Is item an iref? PdfReference iref = item as PdfReference; if (iref != null) { // Does the iref already belongs to the owner? if (iref.Document == owner) { // Yes: fine. Happens when an already cloned object is reused. continue; } else { //Debug.Assert(iref.Document == iot.Document); // No: replace with iref of cloned object PdfReference newXRef = iot[iref.ObjectID]; Debug.Assert(newXRef != null); Debug.Assert(newXRef.Document == owner); dict.Elements[name] = newXRef; } } else if (item is PdfObject) { // Fix up inner objects FixUpObject(iot, owner, (PdfObject)item); } } } else if ((array = value as PdfArray) != null) { // Set document for cloned direct objects if (array.Owner == null) array.Document = owner; else Debug.Assert(array.Owner == owner); // Search for indirect references in all array elements int count = array.Elements.Count; for (int idx = 0; idx < count; idx++) { PdfItem item = array.Elements[idx]; // Is item an iref? PdfReference iref = item as PdfReference; if (iref != null) { // Does the iref already belongs to the owner? if (iref.Document == owner) { // Yes: fine. Happens when an already cloned object is reused. continue; } else { Debug.Assert(iref.Document == iot.ExternalDocument); // No: replace with iref of cloned object PdfReference newXRef = iot[iref.ObjectID]; Debug.Assert(newXRef != null); Debug.Assert(newXRef.Document == owner); array.Elements[idx] = newXRef; } } else if (item is PdfObject) { // Fix up inner objects FixUpObject(iot, owner, (PdfObject)item); } } } } /// /// Gets the indirect reference of this object. If the value is null, this object is a direct object. /// public PdfReference Reference { get { return this.iref; } set { //Debug.Assert(value.Value == null); this.iref = value; } } internal PdfReference iref; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfRectangle.cs0000644000175000001440000003531011435766646022514 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.Collections; using System.Text; #if GDI using System.Drawing; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Internal; using PdfSharp.Drawing; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf { /// /// Represents a PDF rectangle value, that is internally an array with 4 real values. /// // TODO: Can the format be expressed less verbose? [DebuggerDisplay("X1={X1.ToString(\"0.####\",System.Globalization.CultureInfo.InvariantCulture)}, X2={X2.ToString(\"0.####\",System.Globalization.CultureInfo.InvariantCulture)}, Y1={Y1.ToString(\"0.####\",System.Globalization.CultureInfo.InvariantCulture)}, Y2={Y2.ToString(\"0.####\",System.Globalization.CultureInfo.InvariantCulture)}")] public sealed class PdfRectangle : PdfItem { // This class must behave like a value type. Therefore it cannot be changed (like System.String). /// /// Initializes a new instance of the PdfRectangle class. /// public PdfRectangle() { } /// /// Initializes a new instance of the PdfRectangle class with two points specifying /// two diagonally opposite corners. Notice that in contrast to GDI+ convention the /// 3rd and the 4th parameter specify a point and not a width. This is so much confusing /// that this function is for internal use only. /// internal PdfRectangle(double x1, double y1, double x2, double y2) { this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; } #if GDI /// /// Initializes a new instance of the PdfRectangle class with two points specifying /// two diagonally opposite corners. /// public PdfRectangle(PointF pt1, PointF pt2) { this.x1 = pt1.X; this.y1 = pt1.Y; this.x2 = pt2.X; this.y2 = pt2.Y; } #endif /// /// Initializes a new instance of the PdfRectangle class with two points specifying /// two diagonally opposite corners. /// public PdfRectangle(XPoint pt1, XPoint pt2) { this.x1 = pt1.X; this.y1 = pt1.Y; this.x2 = pt2.X; this.y2 = pt2.Y; } #if GDI /// /// Initializes a new instance of the PdfRectangle class with the specified location and size. /// public PdfRectangle(PointF pt, SizeF size) { this.x1 = pt.X; this.y1 = pt.Y; this.x2 = pt.X + size.Width; this.y2 = pt.Y + size.Height; } #endif /// /// Initializes a new instance of the PdfRectangle class with the specified location and size. /// public PdfRectangle(XPoint pt, XSize size) { this.x1 = pt.X; this.y1 = pt.Y; this.x2 = pt.X + size.Width; this.y2 = pt.Y + size.Height; } /// /// Initializes a new instance of the PdfRectangle class with the specified XRect. /// public PdfRectangle(XRect rect) { this.x1 = rect.x; this.y1 = rect.y; this.x2 = rect.x + rect.width; this.y2 = rect.y + rect.height; } /// /// Initializes a new instance of the PdfRectangle class with the specified PdfArray. /// internal PdfRectangle(PdfItem item) { if (item == null || item is PdfNull) return; if (item is PdfReference) item = ((PdfReference)item).Value; PdfArray array = item as PdfArray; if (array == null) throw new InvalidOperationException(PSSR.UnexpectedTokenInPdfFile); this.x1 = array.Elements.GetReal(0); this.y1 = array.Elements.GetReal(1); this.x2 = array.Elements.GetReal(2); this.y2 = array.Elements.GetReal(3); } /// /// Clones this instance. /// public new PdfRectangle Clone() { return (PdfRectangle)Copy(); } /// /// Implements cloning this instance. /// protected override object Copy() { PdfRectangle rect = (PdfRectangle)base.Copy(); return rect; } /// /// Tests whether all coordinate are zero. /// public bool IsEmpty { get { return this.x1 == 0 && this.y1 == 0 && this.x2 == 0 && this.y2 == 0; } } /// /// Tests whether the specified object is a PdfRectangle and has equal coordinates. /// public override bool Equals(object obj) { if (obj is PdfRectangle) { PdfRectangle rect = (PdfRectangle)obj; return rect.x1 == this.x1 && rect.y1 == this.y1 && rect.x2 == this.x2 && rect.y2 == this.y2; } return false; } /// /// Serves as a hash function for a particular type. /// public override int GetHashCode() { // This code is from System.Drawing... return (int)(((((uint)this.x1) ^ ((((uint)this.y1) << 13) | (((uint)this.y1) >> 0x13))) ^ ((((uint)this.x2) << 0x1a) | (((uint)this.x2) >> 6))) ^ ((((uint)this.y2) << 7) | (((uint)this.y2) >> 0x19))); } /// /// Tests whether two structures have equal coordinates. /// public static bool operator ==(PdfRectangle left, PdfRectangle right) { if ((object)left != null) { if ((object)right != null) return left.x1 == right.x1 && left.y1 == right.y1 && left.x2 == right.x2 && left.y2 == right.y2; else return false; } else return (object)right == null; } /// /// Tests whether two structures differ in one or more coordinates. /// public static bool operator !=(PdfRectangle left, PdfRectangle right) { return !(left == right); } /// /// Gets or sets the x-coordinate of the first corner of this PdfRectangle. /// public double X1 { get { return this.x1; } } double x1; /// /// Gets or sets the y-coordinate of the first corner of this PdfRectangle. /// public double Y1 { get { return this.y1; } } double y1; /// /// Gets or sets the x-coordinate of the second corner of this PdfRectangle. /// public double X2 { get { return this.x2; } } double x2; /// /// Gets or sets the y-coordinate of the second corner of this PdfRectangle. /// public double Y2 { get { return this.y2; } } double y2; /// /// Gets X2 - X1. /// public double Width { get { return this.x2 - this.x1; } } /// /// Gets Y2 - Y1. /// public double Height { get { return this.y2 - this.y1; } } /// /// Gets or sets the coordinates of the first point of this PdfRectangle. /// public XPoint Location { get { return new XPoint(this.x1, this.y1); } } /// /// Gets or sets the size of this PdfRectangle. /// public XSize Size { get { return new XSize(this.x2 - this.x1, this.y2 - this.y1); } } #if GDI /// /// Determines if the specified point is contained within this PdfRectangle. /// public bool Contains(PointF pt) { return Contains(pt.X, pt.Y); } #endif /// /// Determines if the specified point is contained within this PdfRectangle. /// public bool Contains(XPoint pt) { return Contains(pt.X, pt.Y); } /// /// Determines if the specified point is contained within this PdfRectangle. /// public bool Contains(double x, double y) { // Treat rectangle inclusive/inclusive. return this.x1 <= x && x <= this.x2 && this.y1 <= y && y <= this.y2; } #if GDI /// /// Determines if the rectangular region represented by rect is entirely contained within this PdfRectangle. /// public bool Contains(RectangleF rect) { return this.x1 <= rect.X && (rect.X + rect.Width) <= this.x2 && this.y1 <= rect.Y && (rect.Y + rect.Height) <= this.y2; } #endif /// /// Determines if the rectangular region represented by rect is entirely contained within this PdfRectangle. /// public bool Contains(XRect rect) { return this.x1 <= rect.X && (rect.X + rect.Width) <= this.x2 && this.y1 <= rect.Y && (rect.Y + rect.Height) <= this.y2; } /// /// Determines if the rectangular region represented by rect is entirely contained within this PdfRectangle. /// public bool Contains(PdfRectangle rect) { return this.x1 <= rect.x1 && rect.x2 <= this.x2 && this.y1 <= rect.y1 && rect.y2 <= this.y2; } /// /// Returns the rectangle as an XRect object. /// public XRect ToXRect() { return new XRect(this.x1, this.y1, this.Width, this.Height); } /// /// Returns the rectangle as a string in the form [x1 y1 x2 y2]. /// public override string ToString() { return PdfEncoders.Format("[{0:0.###} {1:0.###} {2:0.###} {3:0.###}]", this.x1, this.y1, this.x2, this.y2); } /// /// Writes the rectangle. /// internal override void WriteObject(PdfWriter writer) { writer.Write(this); } // /// // /// Adjusts the location of this PdfRectangle by the specified amount. // /// // public void Offset(PointF pos) // { // Offset(pos.X, pos.Y); // } // // /// // /// Adjusts the location of this PdfRectangle by the specified amount. // /// // public void Offset(double x, double y) // { // this.x1 += x; // this.y1 += y; // this.x2 += x; // this.y2 += y; // } // // /// // /// Inflates this PdfRectangle by the specified amount. // /// // public void Inflate(double x, double y) // { // this.x1 -= x; // this.y1 -= y; // this.x2 += x; // this.y2 += y; // } // // /// // /// Inflates this PdfRectangle by the specified amount. // /// // public void Inflate(SizeF size) // { // Inflate(size.Width, size.Height); // } // // /// // /// Creates and returns an inflated copy of the specified PdfRectangle. // /// // public static PdfRectangle Inflate(PdfRectangle rect, double x, double y) // { // rect.Inflate(x, y); // return rect; // } // // /// // /// Replaces this PdfRectangle with the intersection of itself and the specified PdfRectangle. // /// // public void Intersect(PdfRectangle rect) // { // PdfRectangle rect2 = PdfRectangle.Intersect(rect, this); // this.x1 = rect2.x1; // this.y1 = rect2.y1; // this.x2 = rect2.x2; // this.y2 = rect2.y2; // } // // /// // /// Returns a PdfRectangle that represents the intersection of two rectangles. If there is no intersection, // /// an empty PdfRectangle is returned. // /// // public static PdfRectangle Intersect(PdfRectangle rect1, PdfRectangle rect2) // { // double xx1 = Math.Max(rect1.x1, rect2.x1); // double xx2 = Math.Min(rect1.x2, rect2.x2); // double yy1 = Math.Max(rect1.y1, rect2.y1); // double yy2 = Math.Min(rect1.y2, rect2.y2); // if (xx2 >= xx1 && yy2 >= yy1) // return new PdfRectangle(xx1, yy1, xx2, yy2); // return PdfRectangle.Empty; // } // // /// // /// Determines if this rectangle intersects with the specified PdfRectangle. // /// // public bool IntersectsWith(PdfRectangle rect) // { // return rect.x1 < this.x2 && this.x1 < rect.x2 && rect.y1 < this.y2 && this.y1 < rect.y2; // } // // /// // /// Creates the smallest rectangle that can contain both of two specified rectangles. // /// // public static PdfRectangle Union(PdfRectangle rect1, PdfRectangle rect2) // { // return new PdfRectangle( // Math.Min(rect1.x1, rect2.x1), Math.Max(rect1.x2, rect2.x2), // Math.Min(rect1.y1, rect2.y1), Math.Max(rect1.y2, rect2.y2)); // } /// /// Represents an empty PdfRectangle. /// public static readonly PdfRectangle Empty = new PdfRectangle(); } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfViewerPreferences.cs0000644000175000001440000003226311435766646024237 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp; namespace PdfSharp.Pdf { /// /// Represents the PDF document viewer preferences dictionary. /// public sealed class PdfViewerPreferences : PdfDictionary { internal PdfViewerPreferences(PdfDocument document) : base(document) { } /// /// Initializes a new instance of the class. /// PdfViewerPreferences(PdfDictionary dict) : base(dict) { } /// /// Gets or sets a value indicating whether to hide the viewer applications tool /// bars when the document is active. /// public bool HideToolbar { get { return Elements.GetBoolean(Keys.HideToolbar); } set { Elements.SetBoolean(Keys.HideToolbar, value); } } /// /// Gets or sets a value indicating whether to hide the viewer applications /// menu bar when the document is active. /// public bool HideMenubar { get { return Elements.GetBoolean(Keys.HideMenubar); } set { Elements.SetBoolean(Keys.HideMenubar, value); } } /// /// Gets or sets a value indicating whether to hide user interface elements in /// the documents window (such as scroll bars and navigation controls), /// leaving only the documents contents displayed. /// public bool HideWindowUI { get { return Elements.GetBoolean(Keys.HideWindowUI); } set { Elements.SetBoolean(Keys.HideWindowUI, value); } } /// /// Gets or sets a value indicating whether to resize the documents window to /// fit the size of the first displayed page. /// public bool FitWindow { get { return Elements.GetBoolean(Keys.FitWindow); } set { Elements.SetBoolean(Keys.FitWindow, value); } } /// /// Gets or sets a value indicating whether to position the documents window /// in the center of the screen. /// public bool CenterWindow { get { return Elements.GetBoolean(Keys.CenterWindow); } set { Elements.SetBoolean(Keys.CenterWindow, value); } } /// /// Gets or sets a value indicating whether the windows title bar /// should display the document title taken from the Title entry of the document /// information dictionary. If false, the title bar should instead display the name /// of the PDF file containing the document. /// public bool DisplayDocTitle { get { return Elements.GetBoolean(Keys.DisplayDocTitle); } set { Elements.SetBoolean(Keys.DisplayDocTitle, value); } } /// /// The predominant reading order for text: LeftToRight or RightToLeft /// (including vertical writing systems, such as Chinese, Japanese, and Korean). /// This entry has no direct effect on the documents contents or page numbering /// but can be used to determine the relative positioning of pages when displayed /// side by side or printed n-up. Default value: LeftToRight. /// public PdfReadingDirection? Direction { get { switch (Elements.GetName(Keys.Direction)) { case "L2R": return PdfReadingDirection.LeftToRight; case "R2L": return PdfReadingDirection.RightToLeft; } return null; } set { if (value.HasValue) { switch (value.Value) { case PdfReadingDirection.RightToLeft: Elements.SetName(Keys.Direction, "R2L"); break; default: Elements.SetName(Keys.Direction, "L2R"); break; } } else Elements.Remove(Keys.Direction); } } /// /// Predefined keys of this dictionary. /// internal sealed class Keys : KeysBase { /// /// (Optional) A flag specifying whether to hide the viewer applications tool /// bars when the document is active. Default value: false. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string HideToolbar = "/HideToolbar"; /// /// (Optional) A flag specifying whether to hide the viewer applications /// menu bar when the document is active. Default value: false. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string HideMenubar = "/HideMenubar"; /// /// (Optional) A flag specifying whether to hide user interface elements in /// the documents window (such as scroll bars and navigation controls), /// leaving only the documents contents displayed. Default value: false. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string HideWindowUI = "/HideWindowUI"; /// /// (Optional) A flag specifying whether to resize the documents window to /// fit the size of the first displayed page. Default value: false. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string FitWindow = "/FitWindow"; /// /// (Optional) A flag specifying whether to position the documents window /// in the center of the screen. Default value: false. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string CenterWindow = "/CenterWindow"; /// /// (Optional; PDF 1.4) A flag specifying whether the windows title bar /// should display the document title taken from the Title entry of the document /// information dictionary. If false, the title bar should instead display the name /// of the PDF file containing the document. Default value: false. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string DisplayDocTitle = "/DisplayDocTitle"; /// /// (Optional) The documents page mode, specifying how to display the document on /// exiting full-screen mode: /// UseNone Neither document outline nor thumbnail images visible /// UseOutlines Document outline visible /// UseThumbs Thumbnail images visible /// UseOC Optional content group panel visible /// This entry is meaningful only if the value of the PageMode entry in the catalog /// dictionary is FullScreen; it is ignored otherwise. Default value: UseNone. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string NonFullScreenPageMode = "/NonFullScreenPageMode"; /// /// (Optional; PDF 1.3) The predominant reading order for text: /// L2R Left to right /// R2L Right to left (including vertical writing systems, such as Chinese, Japanese, and Korean) /// This entry has no direct effect on the documents contents or page numbering /// but can be used to determine the relative positioning of pages when displayed /// side by side or printed n-up. Default value: L2R. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string Direction = "/Direction"; /// /// (Optional; PDF 1.4) The name of the page boundary representing the area of a page /// to be displayed when viewing the document on the screen. The value is the key /// designating the relevant page boundary in the page object. If the specified page /// boundary is not defined in the page object, its default value is used. /// Default value: CropBox. /// Note: This entry is intended primarily for use by prepress applications that /// interpret or manipulate the page boundaries as described in Section 10.10.1, Page Boundaries. /// Most PDF consumer applications disregard it. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string ViewArea = "/ViewArea"; /// /// (Optional; PDF 1.4) The name of the page boundary to which the contents of a page /// are to be clipped when viewing the document on the screen. The value is the key /// designating the relevant page boundary in the page object. If the specified page /// boundary is not defined in the page object, its default value is used. /// Default value: CropBox. /// Note: This entry is intended primarily for use by prepress applications that /// interpret or manipulate the page boundaries as described in Section 10.10.1, Page Boundaries. /// Most PDF consumer applications disregard it. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string ViewClip = "/ViewClip"; /// /// (Optional; PDF 1.4) The name of the page boundary representing the area of a page /// to be rendered when printing the document. The value is the key designating the /// relevant page boundary in the page object. If the specified page boundary is not /// defined in the page object, its default value is used. /// Default value: CropBox. /// Note: This entry is intended primarily for use by prepress applications that /// interpret or manipulate the page boundaries as described in Section 10.10.1, Page Boundaries. /// Most PDF consumer applications disregard it. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string PrintArea = "/PrintArea"; /// /// (Optional; PDF 1.4) The name of the page boundary to which the contents of a page /// are to be clipped when printing the document. The value is the key designating the /// relevant page boundary in the page object. If the specified page boundary is not /// defined in the page object, its default value is used. /// Default value: CropBox. /// Note: This entry is intended primarily for use by prepress applications that interpret /// or manipulate the page boundaries. Most PDF consumer applications disregard it. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string PrintClip = "/PrintClip"; /// /// (Optional; PDF 1.6) The page scaling option to be selected when a print dialog is /// displayed for this document. Valid values are None, which indicates that the print /// dialog should reflect no page scaling, and AppDefault, which indicates that /// applications should use the current print scaling. If this entry has an unrecognized /// value, applications should use the current print scaling. /// Default value: AppDefault. /// Note: If the print dialog is suppressed and its parameters are provided directly /// by the application, the value of this entry should still be used. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string PrintScaling = "/PrintScaling"; /// /// Gets the KeysMeta for these keys. /// public static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfDocumentOptions.cs0000644000175000001440000000532211435766646023742 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; namespace PdfSharp.Pdf { /// /// Holds information how to handle the document when it is saved as PDF stream. /// public sealed class PdfDocumentOptions { internal PdfDocumentOptions(PdfDocument document) { //this.deflateContents = true; //this.writeProcedureSets = true; } /// /// Gets or sets the color mode. /// public PdfColorMode ColorMode { get { return this.colorMode; } set { this.colorMode = value; } } PdfColorMode colorMode; /// /// Gets or sets a value indicating whether to compress content streams of PDF pages. /// public bool CompressContentStreams { get { return this.compressContentStreams; } set { this.compressContentStreams = value; } } #if DEBUG bool compressContentStreams = false; #else bool compressContentStreams = true; #endif /// /// Gets or sets a value indicating that all objects are not compressed. /// public bool NoCompression { get { return this.noCompression; } set { this.noCompression = value; } } bool noCompression; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfNumberObject.cs0000644000175000001440000000415011435766646023165 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; namespace PdfSharp.Pdf { /// /// Base class for indirect number values (not yet used, maybe superfluous). /// public abstract class PdfNumberObject : PdfObject { /// /// Initializes a new instance of the class. /// protected PdfNumberObject() { } /// /// Initializes a new instance of the class. /// /// The document. protected PdfNumberObject(PdfDocument document) : base(document) { } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfOutline.cs0000644000175000001440000005674611450442737022234 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Linq; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Drawing; using PdfSharp.Internal; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf { /// /// Represents an outline item in the outlines tree. An outline is also knows as a bookmark. /// public sealed class PdfOutline : PdfDictionary { /// /// Initializes a new instance of the class. /// public PdfOutline() { //this.outlines = new PdfOutlineCollection(this); } /// /// Initializes a new instance of the class. /// /// The document. internal PdfOutline(PdfDocument document) : base(document) { //this.outlines = new PdfOutlineCollection(this); } /// /// Initializes a new instance from an existing dictionary. Used for object type transformation. /// public PdfOutline(PdfDictionary dict) : base(dict) { } /// /// Initializes a new instance of the class. /// /// The outline text. /// The destination page. /// Specifies whether the node is displayed expanded (opened) or collapsed. /// The font style used to draw the outline text. /// The color used to draw the outline text. public PdfOutline(string title, PdfPage destinationPage, bool opened, PdfOutlineStyle style, XColor textColor) { Title = title; DestinationPage = destinationPage; Opened = opened; Style = style; TextColor = textColor; } /// /// Initializes a new instance of the class. /// /// The outline text. /// The destination page. /// Specifies whether the node is displayed expanded (opened) or collapsed. /// The font style used to draw the outline text. public PdfOutline(string title, PdfPage destinationPage, bool opened, PdfOutlineStyle style) { Title = title; DestinationPage = destinationPage; Opened = opened; Style = style; } /// /// Initializes a new instance of the class. /// /// The outline text. /// The destination page. /// Specifies whether the node is displayed expanded (opened) or collapsed. public PdfOutline(string title, PdfPage destinationPage, bool opened) { Title = title; DestinationPage = destinationPage; Opened = opened; } /// /// Initializes a new instance of the class. /// /// The outline text. /// The destination page. public PdfOutline(string title, PdfPage destinationPage) { Title = title; DestinationPage = destinationPage; } internal int Count { get { return this.count; } set { this.count = value; } } int count; /// /// The total number of open descendants at all lower levels. /// internal int openCount; //internal int CountOpen() //{ // int count = this.opened ? 1 : 0; // if (this.outlines != null) // count += this.outlines.CountOpen(); // return count; //} internal PdfOutline Parent { get { return this.parent; } set { this.parent = value; } } PdfOutline parent; /// /// Gets or sets the title. /// public string Title { get { return Elements.GetString(Keys.Title); } set { PdfString s = new PdfString(value, PdfStringEncoding.PDFDocEncoding); Elements.SetValue(Keys.Title, s); } } /// /// Gets or sets the destination page. /// public PdfPage DestinationPage { get { if (this.destinationPage == null) { var ary = Elements.GetArray (Keys.Dest); if (ary != null) { destinationPage = (PdfPage)ary.Elements.GetObject (0); } } return this.destinationPage; } set { this.destinationPage = value; } } PdfPage destinationPage; /// /// Gets or sets whether the outline item is opened (or expanded). /// public bool Opened { get { return this.opened2; } set { this.opened2 = value; } // TODO: adjust openCount of ascendant... #if false set { if (this.opened != value) { this.opened = value; int sign = value ? 1 : -1; PdfOutline parent = this.parent; if (this.opened) { while (parent != null) { parent.openCount += 1 + this.openCount; } } else { } } } #endif } bool opened2; /// /// Gets or sets the style. /// public PdfOutlineStyle Style { get { return (PdfOutlineStyle)Elements.GetInteger(Keys.F); } set { Elements.SetInteger(Keys.F, (int)value); } } /// /// Gets or sets the color of the text. /// /// The color of the text. public XColor TextColor { get { return this.textColor; } set { this.textColor = value; } } XColor textColor; /// /// Gets the outline collection of this node. /// public PdfOutlineCollection Outlines { get { if (this.outlines == null) this.outlines = new PdfOutlineCollection(this.Owner, this); return this.outlines; } } PdfOutlineCollection outlines; public void Remove () { // Remove all our children var children = Outlines.Cast ().ToList (); foreach (var child in children) { child.Remove (); } // Remove ourself if (Parent != null) { Parent.Outlines.Remove (this); } } /// /// Creates key/values pairs according to the object structure. /// internal override void PrepareForSave() { bool hasKids = Outlines != null && Outlines.Count > 0; if (this.parent != null || hasKids) { if (this.parent == null) { // This is the outline dictionary (the root) Elements[Keys.First] = Outlines[0].Reference; Elements[Keys.Last] = Outlines[Outlines.Count - 1].Reference; // TODO: /Count - the meaning is not completely clear to me if (this.openCount > 0) Elements[Keys.Count] = new PdfInteger(this.openCount); } else { // This is an outline item dictionary Elements[Keys.Parent] = this.parent.Reference; int count = this.parent.outlines.Count; int index = this.parent.outlines.IndexOf(this); Debug.Assert(index != -1); if (DestinationPage != null) { Elements[Keys.Dest] = new PdfArray(this.Owner, DestinationPage.Reference, new PdfLiteral("/XYZ null null 0")); } else { Elements.Remove (Keys.Dest); } if (index > 0) Elements[Keys.Prev] = this.parent.outlines[index - 1].Reference; else Elements.Remove (Keys.Prev); if (index < count - 1) Elements[Keys.Next] = this.parent.outlines[index + 1].Reference; else Elements.Remove (Keys.Next); if (hasKids) { Elements[Keys.First] = Outlines[0].Reference; Elements[Keys.Last] = Outlines[Outlines.Count - 1].Reference; } else { Elements.Remove (Keys.First); Elements.Remove (Keys.Last); } // TODO: /Count - the meaning is not completely clear to me if (this.openCount > 0) Elements[Keys.Count] = new PdfInteger((this.opened2 ? 1 : -1) * this.openCount); else Elements.Remove (Keys.Count); if (this.textColor != XColor.Empty && this.Owner.HasVersion("1.4")) Elements[Keys.C] = new PdfLiteral("[{0}]", PdfEncoders.ToString(this.textColor, PdfColorMode.Rgb)); else Elements.Remove (Keys.C); // if (this.Style != PdfOutlineStyle.Regular && this.Document.HasVersion("1.4")) // //pdf.AppendFormat("/F {0}\n", (int)this.style); // Elements[Keys.F] = new PdfInteger((int)this.style); } // Prepare kids if (hasKids) foreach (PdfOutline outline in Outlines) outline.PrepareForSave(); } } internal override void WriteObject(PdfWriter writer) { bool hasKids = Outlines != null && Outlines.Count > 0; if (this.parent != null || hasKids) { // Everything done in PrepareForSave if (this.parent == null) { // This is the outline dictionary (the root) } else { // This is an outline item dictionary } base.WriteObject(writer); } } /// /// Represents a collection of outlines. /// public class PdfOutlineCollection : PdfObject, IEnumerable { internal PdfOutlineCollection(PdfDocument document, PdfOutline parent) : base(document) { this.parent = parent; var first = (PdfOutline)parent.Elements.GetValue (Keys.First); while (first != null) { first.Parent = parent; first.Document = parent.Owner; outlines.Add (first); first = (PdfOutline)first.Elements.GetValue (Keys.Next); } } /// /// Indicates whether the outline has at least one entry. /// public bool HasOutline { get { return this.outlines != null && this.outlines.Count > 0; } } /// /// Gets the number of entries in this collection. /// public int Count { get { return this.outlines.Count; } } public void Remove (PdfOutline outline) { if (outline == null) throw new ArgumentNullException("outline"); if (!outlines.Contains (outline)) throw new ArgumentException("outline not contained in this collection"); outlines.Remove (outline); this.Owner.irefTable.Remove(outline.Reference); } //internal int CountOpen() //{ // int count = 0; // foreach (PdfOutline outline in this.outlines) // count += outline.CountOpen(); // return count; //} /// /// Adds the specified outline. /// public void Insert(PdfOutline outline, int position) { if (outline == null) throw new ArgumentNullException("outline"); if (!Object.ReferenceEquals(Owner, outline.DestinationPage.Owner)) throw new ArgumentException("Destination page must belong to this document."); // TODO check the parent problems... outline.Document = Owner; outline.parent = this.parent; if (position == -1) { this.outlines.Add(outline); } else { this.outlines.Insert (position, outline); } this.Owner.irefTable.Add(outline); if (outline.Opened) { outline = this.parent; while (outline != null) { outline.openCount++; outline = outline.parent; } } } public void Add(PdfOutline outline) { Insert (outline, -1); } /// /// Adds the specified outline entry. /// /// The outline text. /// The destination page. /// Specifies whether the node is displayed expanded (opened) or collapsed. /// The font style used to draw the outline text. /// The color used to draw the outline text. public PdfOutline Add(string title, PdfPage destinationPage, bool opened, PdfOutlineStyle style, XColor textColor) { PdfOutline outline = new PdfOutline(title, destinationPage, opened, style, textColor); Add(outline); return outline; } /// /// Adds the specified outline entry. /// /// The outline text. /// The destination page. /// Specifies whether the node is displayed expanded (opened) or collapsed. /// The font style used to draw the outline text. public PdfOutline Add(string title, PdfPage destinationPage, bool opened, PdfOutlineStyle style) { PdfOutline outline = new PdfOutline(title, destinationPage, opened, style); Add(outline); return outline; } /// /// Adds the specified outline entry. /// /// The outline text. /// The destination page. /// Specifies whether the node is displayed expanded (opened) or collapsed. public PdfOutline Add(string title, PdfPage destinationPage, bool opened) { PdfOutline outline = new PdfOutline(title, destinationPage, opened); Add(outline); return outline; } /// /// Adds the specified outline entry. /// /// The outline text. /// The destination page. public PdfOutline Add(string title, PdfPage destinationPage) { PdfOutline outline = new PdfOutline(title, destinationPage); Add(outline); return outline; } /// /// Gets the index of the specified outline. /// public int IndexOf(PdfOutline item) { return this.outlines.IndexOf(item); } /// /// Gets the at the specified index. /// public PdfOutline this[int index] { get { if (index < 0 || index >= this.outlines.Count) throw new ArgumentOutOfRangeException("index", index, PSSR.OutlineIndexOutOfRange); return (PdfOutline)this.outlines[index]; } //set //{ // if (index < 0 || index >= this.outlines.Count) // throw new ArgumentOutOfRangeException("index", index, PSSR.OutlineIndexOutOfRange); // this.outlines[index] = value; //} } /// /// Returns an enumerator that iterates through a collection. /// public IEnumerator GetEnumerator() { return outlines.GetEnumerator(); } private PdfOutline parent; private List outlines = new List(); } /// /// Predefined keys of this dictionary. /// internal sealed class Keys : KeysBase { /// /// (Optional) The type of PDF object that this dictionary describes; if present, /// must be Outlines for an outline dictionary. /// [KeyInfo(KeyType.Name | KeyType.Optional, FixedValue = "Outlines")] public const string Type = "/Type"; // Outline and outline item are combined ///// ///// (Required if there are any open or closed outline entries; must be an indirect reference) ///// An outline item dictionary representing the first top-level item in the outline. ///// //[KeyInfo(KeyType.Dictionary)] //public const string First = "/First"; // ///// ///// (Required if there are any open or closed outline entries; must be an indirect reference) ///// An outline item dictionary representing the last top-level item in the outline. ///// //[KeyInfo(KeyType.Dictionary)] //public const string Last = "/Last"; // ///// ///// (Required if the document has any open outline entries) The total number of open items at all ///// levels of the outline. This entry should be omitted if there are no open outline items. ///// //[KeyInfo(KeyType.Integer)] //public const string Count = "/Count"; /// /// (Required) The text to be displayed on the screen for this item. /// [KeyInfo(KeyType.String | KeyType.Required)] public const string Title = "/Title"; /// /// (Required; must be an indirect reference) The parent of this item in the outline hierarchy. /// The parent of a top-level item is the outline dictionary itself. /// [KeyInfo(KeyType.Dictionary | KeyType.Required)] public const string Parent = "/Parent"; /// /// (Required for all but the first item at each level; must be an indirect reference) /// The previous item at this outline level. /// [KeyInfo(KeyType.Dictionary | KeyType.Required, typeof(PdfOutline))] public const string Prev = "/Prev"; /// /// (Required for all but the last item at each level; must be an indirect reference) /// The next item at this outline level. /// [KeyInfo(KeyType.Dictionary | KeyType.Required, typeof(PdfOutline))] public const string Next = "/Next"; /// /// (Required if the item has any descendants; must be an indirect reference) /// The first of this items immediate children in the outline hierarchy. /// [KeyInfo(KeyType.Dictionary | KeyType.Required, typeof(PdfOutline))] public const string First = "/First"; /// /// (Required if the item has any descendants; must be an indirect reference) /// The last of this items immediate children in the outline hierarchy. /// [KeyInfo(KeyType.Dictionary | KeyType.Required, typeof(PdfOutline))] public const string Last = "/Last"; /// /// (Required if the item has any descendants) If the item is open, the total number of its /// open descendants at all lower levels of the outline hierarchy. If the item is closed, a /// negative integer whose absolute value specifies how many descendants would appear if the /// item were reopened. /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string Count = "/Count"; /// /// (Optional; not permitted if an A entry is present) The destination to be displayed when this /// item is activated. /// [KeyInfo(KeyType.ArrayOrNameOrString | KeyType.Optional)] public const string Dest = "/Dest"; /// /// (Optional; not permitted if an A entry is present) The destination to be displayed when /// this item is activated. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional)] public const string A = "/A"; /// /// (Optional; PDF 1.3; must be an indirect reference) The structure element to which the item /// refers. /// Note: The ability to associate an outline item with a structure element (such as the beginning /// of a chapter) is a PDF 1.3 feature. For backward compatibility with earlier PDF versions, such /// an item should also specify a destination (Dest) corresponding to an area of a page where the /// contents of the designated structure element are displayed. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional)] public const string SE = "/SE"; /// /// (Optional; PDF 1.4) An array of three numbers in the range 0.0 to 1.0, representing the /// components in the DeviceRGB color space of the color to be used for the outline entrys text. /// Default value: [0.0 0.0 0.0]. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string C = "/C"; /// /// (Optional; PDF 1.4) A set of flags specifying style characteristics for displaying the outline /// items text. Default value: 0. /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string F = "/F"; /// /// Gets the KeysMeta for these keys. /// public static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/enums/0000777000175000001440000000000011533760020020733 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/enums/PdfOutlineStyle.cs0000644000175000001440000000356611435766646024407 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Pdf { /// /// Specifies the font style for the outline (bookmark) text. /// [Flags] public enum PdfOutlineStyle { /// /// Regular font. /// Regular = 0, /// /// Italic font. /// Italic = 1, /// /// Bold font. /// Bold = 2, /// /// Bold and italic font. /// BoldItalic = 3, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/enums/PdfPageMode.cs0000644000175000001440000000426611435766646023426 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Pdf { /// /// Specifies how the document should be displayed by a viewer when opened. /// public enum PdfPageMode { /// /// Neither document outline nor thumbnail images visible. /// UseNone, /// /// Document outline visible. /// UseOutlines, /// /// Thumbnail images visible. /// UseThumbs, /// /// Full-screen mode, with no menu bar, windowcontrols, or any other window visible. /// FullScreen, /// /// (PDF 1.5) Optional content group panel visible. /// UseOC, /// /// (PDF 1.6) Attachments panel visible. /// UseAttachments, } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/enums/PdfFontEmbedding.cs0000644000175000001440000000400711435766646024443 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Pdf { /// /// Specifies the embedding options of an XFont when converted into PDF. /// public enum PdfFontEmbedding { /// /// Unicode fonts are embedded, WinAnsi fonts are not embedded. /// Default, /// /// Fonts are not embedded. /// None, /// /// All fonts are embedded. /// Always, /// /// Not yet implemented. /// Automatic, } class DocumentFontOptions { //public int SubsettingLimit; //public int SubSetMinSize; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/enums/PdfReadingDirection.cs0000644000175000001440000000342011435766646025146 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Pdf { /// /// Specifies how the document should be displayed by a viewer when opened. /// public enum PdfReadingDirection { /// /// Left to right. /// LeftToRight, /// /// Right to left (including vertical writing systems, such as Chinese, Japanese, and Korean) /// RightToLeft, } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/enums/PdfTextStringEncoding.cs0000644000175000001440000000361111435766646025520 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Pdf { /// /// Specifies how text strings are encoded. A text string is any text used outside of a page content /// stream, e.g. document information, outline text, annotation text etc. /// public enum PdfTextStringEncoding { /// /// Specifies that hypertext uses PDF DocEncoding. /// PDFDocEncoding = 0, /// /// Specifies that hypertext uses unicode encoding. /// Unicode = 1, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/enums/DocumentState.cs0000644000175000001440000000354311435766646024067 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Pdf { /// /// Identifies the state of the document /// [Flags] enum DocumentState { /// /// The document was created from scratch. /// Created = 0x0001, /// /// The document was created by opening an existing PDF file. /// Imported = 0x0002, /// /// The document is disposed. /// Disposed = 0x8000, } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/enums/PdfColorMode.cs0000644000175000001440000000352411435766646023624 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Pdf { /// /// Specifies what color model is used in a PDF document. /// public enum PdfColorMode { /// /// All color values are written as specified in the XColor objects they come from. /// Undefined, /// /// All colors are converted to RGB. /// Rgb, /// /// All colors are converted to CMYK. /// Cmyk, } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/enums/PdfCustomValueCompression.cs0000644000175000001440000000355211435766646026433 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Pdf { /// /// This class is undocumented and may change or drop in future releases. /// public enum PdfCustomValueCompressionMode { /// /// Use document default to determine compression. /// Default, /// /// Leave custom values uncompressed. /// Uncompressed, /// /// Compress custom values using FlateDecode. /// Compressed, } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/enums/PdfFontEncoding.cs0000644000175000001440000000361711435766646024321 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Pdf { /// /// Specifies the encoding schema used for an XFont when converted into PDF. /// public enum PdfFontEncoding { /// /// Windows ANSI encoding. /// WinAnsi = 0, /// /// Alternate name for Windows ANSI encoding. /// [Obsolete("Use WinAnsi.")] CP1252 = 0, //BuildIn, // FontSpecific /// /// Unicode encoding. /// Unicode = 1, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/enums/PdfPageLayout.cs0000644000175000001440000000444711435766646024020 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Pdf { /// /// Specifies the page layout to be used by a viewer when the document is opened. /// public enum PdfPageLayout { /// /// Display one page at a time. /// SinglePage, /// /// Display the pages in one column. /// OneColumn, /// /// Display the pages in two columns, with oddnumbered pages on the left. /// TwoColumnLeft, /// /// Display the pages in two columns, with oddnumbered pages on the right. /// TwoColumnRight, /// /// (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left. /// TwoPageLeft, /// /// (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right. /// TwoPageRight, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfItem.cs0000644000175000001440000000465411435766646021515 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// The base class of all PDF objects and simple types. /// public abstract class PdfItem : ICloneable { // All simple types (i.e. derived from PdfItem but not from PdfObject) must be immutable. object ICloneable.Clone() { return Copy(); } /// /// Creates a copy of this object. /// public PdfItem Clone() { return (PdfItem)Copy(); } /// /// Implements the copy mechanism. Must be overridden in derived classes. /// protected virtual object Copy() { return MemberwiseClone(); } /// /// When overridden in a derived class, appends a raw string representation of this object /// to the specified PdfWriter. /// internal abstract void WriteObject(PdfWriter writer); } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfCustomValue.cs0000644000175000001440000000517011435766646023060 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; namespace PdfSharp.Pdf { /// /// This class is intended for empira internal use only and may change or drop in future releases. /// public class PdfCustomValue : PdfDictionary { /// /// This function is intended for empira internal use only. /// public PdfCustomValue() { CreateStream(new byte[] { }); } /// /// This function is intended for empira internal use only. /// public PdfCustomValue(byte[] bytes) { CreateStream(bytes); } internal PdfCustomValue(PdfDocument document) : base(document) { CreateStream(new byte[] { }); } internal PdfCustomValue(PdfDictionary dict) : base(dict) { // TODO: uncompress stream } /// /// This property is intended for empira internal use only. /// public PdfCustomValueCompressionMode CompressionMode; /// /// This property is intended for empira internal use only. /// public byte[] Value { get { return Stream.Value; } set { Stream.Value = value; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfInteger.cs0000644000175000001440000001142211435766646022203 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Represents a direct integer value. /// [DebuggerDisplay("({Value})")] public sealed class PdfInteger : PdfNumber, IConvertible { /// /// Initializes a new instance of the class. /// public PdfInteger() { } /// /// Initializes a new instance of the class. /// /// The value. public PdfInteger(int value) { this.value = value; } /// /// Gets the value as integer /// public int Value { // This class must behave like a value type. Therefore it cannot be changed (like System.String). get { return this.value; } } readonly int value; /// /// Returns the integer as string. /// public override string ToString() { return this.value.ToString(); } /// /// Writes the integer as string. /// internal override void WriteObject(PdfWriter writer) { writer.Write(this); } #region IConvertible Members ulong IConvertible.ToUInt64(IFormatProvider provider) { return Convert.ToUInt64(this.value); } sbyte IConvertible.ToSByte(IFormatProvider provider) { throw new InvalidCastException(); } double IConvertible.ToDouble(IFormatProvider provider) { return value; } DateTime IConvertible.ToDateTime(IFormatProvider provider) { // TODO: Add PdfInteger.ToDateTime implementation return new DateTime(); } float IConvertible.ToSingle(IFormatProvider provider) { return value; } bool IConvertible.ToBoolean(IFormatProvider provider) { return Convert.ToBoolean(this.value); } int IConvertible.ToInt32(IFormatProvider provider) { return value; } ushort IConvertible.ToUInt16(IFormatProvider provider) { return Convert.ToUInt16(this.value); } short IConvertible.ToInt16(IFormatProvider provider) { return Convert.ToInt16(this.value); } string IConvertible.ToString(IFormatProvider provider) { return value.ToString(provider); } byte IConvertible.ToByte(IFormatProvider provider) { return Convert.ToByte(this.value); } char IConvertible.ToChar(IFormatProvider provider) { return Convert.ToChar(this.value); } long IConvertible.ToInt64(IFormatProvider provider) { return value; } /// /// Returns TypeCode for 32-bit integers. /// public TypeCode GetTypeCode() { return TypeCode.Int32; } decimal IConvertible.ToDecimal(IFormatProvider provider) { return value; } object IConvertible.ToType(Type conversionType, IFormatProvider provider) { // TODO: Add PdfInteger.ToType implementation return null; } uint IConvertible.ToUInt32(IFormatProvider provider) { return Convert.ToUInt32(this.value); } #endregion } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfPages.cs0000644000175000001440000004126111450442737021636 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Annotations; namespace PdfSharp.Pdf { /// /// Represents the pages of the document. /// [DebuggerDisplay("(PageCount={Count})")] public sealed class PdfPages : PdfDictionary, IEnumerable { internal PdfPages(PdfDocument document) : base(document) { Elements.SetName(Keys.Type, "/Pages"); Elements[Keys.Count] = new PdfInteger(0); } internal PdfPages(PdfDictionary dictionary) : base(dictionary) { } /// /// Gets the number of pages. /// public int Count { get { return PagesArray.Elements.Count; } } /// /// Gets the page with the specified index. /// public PdfPage this[int index] { get { if (index < 0 || index >= Count) throw new ArgumentOutOfRangeException("index", index, PSSR.PageIndexOutOfRange); PdfDictionary dict = (PdfDictionary)((PdfReference)PagesArray.Elements[index]).Value; if (!(dict is PdfPage)) dict = new PdfPage(dict); return (PdfPage)dict; } //set //{ // if (index < 0 || index >= this.pages.Count) // throw new ArgumentOutOfRangeException("index", index, PSSR.PageIndexOutOfRange); // this.pages[index] = value; //} } /// /// Creates a new PdfPage, adds it to this document, and returns it. /// public PdfPage Add() { PdfPage page = new PdfPage(); Insert(Count, page); return page; } /// /// Adds the specified PdfPage to this document and maybe returns a new PdfPage object. /// The value returned is a new object if the added page comes from a foreign document. /// public PdfPage Add(PdfPage page) { return Insert(Count, page); } /// /// Creates a new PdfPage, inserts it at the specified position into this document, and returns it. /// public PdfPage Insert(int index) { PdfPage page = new PdfPage(); Insert(index, page); return page; } /// /// Inserts the specified PdfPage at the specified position to this document and maybe returns a new PdfPage object. /// The value returned is a new object if the inserted page comes from a foreign document. /// public PdfPage Insert(int index, PdfPage page) { if (page == null) throw new ArgumentNullException("page"); // Is the page already owned by this document if (page.Owner == Owner) { // Case: Page is removed and than inserted a another position. int count = Count; for (int idx = 0; idx < count; idx++) { if (ReferenceEquals(this[idx], page)) throw new InvalidOperationException(PSSR.MultiplePageInsert); } // TODO: check this case Owner.irefTable.Add(page); PagesArray.Elements.Insert(index, page.Reference); Elements.SetInteger(PdfPages.Keys.Count, PagesArray.Elements.Count); return page; } // All page insertions come here if (page.Owner == null) { // Case: New page was created and inserted now. page.Document = Owner; Owner.irefTable.Add(page); PagesArray.Elements.Insert(index, page.Reference); Elements.SetInteger(PdfPages.Keys.Count, PagesArray.Elements.Count); } else { // Case: Page is from an external document -> import it. page = ImportExternalPage(page); Owner.irefTable.Add(page); PagesArray.Elements.Insert(index, page.Reference); Elements.SetInteger(PdfPages.Keys.Count, PagesArray.Elements.Count); PdfAnnotations.FixImportedAnnotation(page); } if (Owner.Settings.TrimMargins.AreSet) page.TrimMargins = Owner.Settings.TrimMargins; return page; } /// /// Removes the specified page from the document. /// public void Remove(PdfPage page) { PagesArray.Elements.Remove(page.Reference); Elements.SetInteger(PdfPages.Keys.Count, PagesArray.Elements.Count); } /// /// Removes the specified page from the document. /// public void RemoveAt(int index) { PagesArray.Elements.RemoveAt(index); Elements.SetInteger(PdfPages.Keys.Count, PagesArray.Elements.Count); } /// /// Moves a page within the page sequence. /// /// The page index before this operation. /// The page index after this operation. public void MovePage(int oldIndex, int newIndex) { if (oldIndex < 0 || oldIndex >= Count) throw new ArgumentOutOfRangeException("oldIndex"); if (newIndex < 0 || newIndex >= Count) throw new ArgumentOutOfRangeException("newIndex"); if (oldIndex == newIndex) return; //PdfPage page = (PdfPage)pagesArray.Elements[oldIndex]; PdfReference page = (PdfReference)pagesArray.Elements[oldIndex]; pagesArray.Elements.RemoveAt(oldIndex); pagesArray.Elements.Insert(newIndex, page); } /// /// Imports an external page. The elements of the imported page are cloned and added to this document. /// Important: In contrast to PdfFormXObject adding an external page always make a deep copy /// of their transitive closure. Any reuse of already imported objects is not intended because /// any modification of an imported page must not change another page. /// PdfPage ImportExternalPage(PdfPage importPage) { if (importPage.Owner.openMode != PdfDocumentOpenMode.Import) throw new InvalidOperationException("A PDF document must be opened with PdfDocumentOpenMode.Import to import pages from it."); PdfPage page = new PdfPage(this.document); CloneElement(page, importPage, PdfPage.Keys.Resources, false); CloneElement(page, importPage, PdfPage.Keys.Contents, false); CloneElement(page, importPage, PdfPage.Keys.MediaBox, true); CloneElement(page, importPage, PdfPage.Keys.CropBox, true); CloneElement(page, importPage, PdfPage.Keys.Rotate, true); CloneElement(page, importPage, PdfPage.Keys.BleedBox, true); CloneElement(page, importPage, PdfPage.Keys.TrimBox, true); CloneElement(page, importPage, PdfPage.Keys.ArtBox, true); #if true // Do not deep copy annotations. CloneElement(page, importPage, PdfPage.Keys.Annots, false); #else // Deep copy annotations. CloneElement(page, importPage, PdfPage.Keys.Annots, true); #endif // TODO more elements? return page; } /// /// Helper function for ImportExternalPage. /// void CloneElement(PdfPage page, PdfPage importPage, string key, bool deepcopy) { Debug.Assert(page.Owner == this.document); Debug.Assert(importPage.Owner != null); Debug.Assert(importPage.Owner != this.document); PdfItem item = importPage.Elements[key]; if (item != null) { PdfImportedObjectTable importedObjectTable = null; if (!deepcopy) importedObjectTable = Owner.FormTable.GetImportedObjectTable(importPage); // The item can be indirect. If so, replace it by its value. if (item is PdfReference) item = ((PdfReference)item).Value; if (item is PdfObject) { PdfObject root = (PdfObject)item; if (deepcopy) { Debug.Assert(root.Owner != null, "See 'else' case for details"); root = PdfObject.DeepCopyClosure(this.document, root); } else { // The owner can be null if the item is not a reference if (root.Owner == null) root.Document = importPage.Owner; root = PdfObject.ImportClosure(importedObjectTable, page.Owner, root); } if (root.Reference == null) page.Elements[key] = root; else page.Elements[key] = root.Reference; } else { // Simple items are just cloned. page.Elements[key] = item.Clone(); } } } /// /// Gets a PdfArray containing all pages of this document. The array must not be modified. /// public PdfArray PagesArray { get { if (this.pagesArray == null) this.pagesArray = (PdfArray)Elements.GetValue(Keys.Kids, VCF.Create); return this.pagesArray; } } PdfArray pagesArray; /// /// Replaces the page tree by a flat array of indirect references to the pages objects. /// internal void FlattenPageTree() { // Acrobat creates a balanced tree if the number of pages is rougly more than ten. This is // not difficult but obviously also not necessary. I created a document with 50000 pages with // PDF4NET and Acrobat opened it in less than 2 seconds. //PdfReference xrefRoot = this.Document.Catalog.Elements[PdfCatalog.Keys.Pages] as PdfReference; //PdfDictionary[] pages = GetKids(xrefRoot, null); // Promote inheritable values down the page tree PdfPage.InheritedValues values = new PdfPage.InheritedValues(); PdfPage.InheritValues(this, ref values); PdfDictionary[] pages = GetKids(Reference, values, null); // Replace /Pages in catalog by this object // xrefRoot.Value = this; PdfArray array = new PdfArray(Owner); foreach (PdfDictionary page in pages) { // Fix the parent page.Elements[PdfPage.Keys.Parent] = Reference; array.Elements.Add(page.Reference); } Elements.SetName(Keys.Type, "/Pages"); #if true // direct array Elements.SetValue(Keys.Kids, array); #else // incdirect array this.Document.xrefTable.Add(array); Elements.SetValue(Keys.Kids, array.XRef); #endif Elements.SetInteger(Keys.Count, array.Elements.Count); } /// /// Recursively converts the page tree into a flat array. /// PdfDictionary[] GetKids(PdfReference iref, PdfPage.InheritedValues values, PdfDictionary parent) { // TODO: inherit inheritable keys... PdfDictionary kid = (PdfDictionary)iref.Value; if (kid.Elements.GetName(Keys.Type) == "/Page") { PdfPage.InheritValues(kid, values); return new PdfDictionary[] { kid }; } else { Debug.Assert(kid.Elements.GetName(Keys.Type) == "/Pages"); PdfPage.InheritValues(kid, ref values); List list = new List(); PdfArray kids = kid.Elements["/Kids"] as PdfArray; //newTHHO 15.10.2007 begin if (kids == null) { PdfReference xref3 = kid.Elements["/Kids"] as PdfReference; kids = xref3.Value as PdfArray; } //newTHHO 15.10.2007 end foreach (PdfReference xref2 in kids) list.AddRange(GetKids(xref2, values, kid)); int count = list.Count; Debug.Assert(count == kid.Elements.GetInteger("/Count")); //return (PdfDictionary[])list.ToArray(typeof(PdfDictionary)); return list.ToArray(); } } /// /// Prepares the document for saving. /// internal override void PrepareForSave() { // TODO: Close all open content streams // TODO: Create the page tree. // Arrays have a limit of 8192 entries, but I successfully tested documents // with 50000 pages and no page tree. // ==> wait for bug report. int count = this.pagesArray.Elements.Count; for (int idx = 0; idx < count; idx++) { PdfPage page = this[idx]; page.PrepareForSave(); } } /// /// Gets the enumerator. /// public new IEnumerator GetEnumerator() { return new PdfPagesEnumerator(this); } private class PdfPagesEnumerator : IEnumerator { private PdfPage currentElement; private int index; private PdfPages list; internal PdfPagesEnumerator(PdfPages list) { this.list = list; this.index = -1; } public bool MoveNext() { if (this.index < this.list.Count - 1) { this.index++; this.currentElement = this.list[this.index]; return true; } this.index = this.list.Count; return false; } public void Reset() { this.currentElement = null; this.index = -1; } object IEnumerator.Current { get { return Current; } } public PdfPage Current { get { if (this.index == -1 || this.index >= this.list.Count) throw new InvalidOperationException(PSSR.ListEnumCurrentOutOfRange); return this.currentElement; } } } /// /// Predefined keys of this dictionary. /// internal sealed class Keys : PdfPage.InheritablePageKeys { /// /// (Required) The type of PDF object that this dictionary describes; /// must be Pages for a page tree node. /// [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Pages")] public const string Type = "/Type"; /// /// (Required except in root node; must be an indirect reference) /// The page tree node that is the immediate parent of this one. /// [KeyInfo(KeyType.Dictionary | KeyType.Required)] public const string Parent = "/Parent"; /// /// (Required) An array of indirect references to the immediate children of this node. /// The children may be page objects or other page tree nodes. /// [KeyInfo(KeyType.Array | KeyType.Required)] public const string Kids = "/Kids"; /// /// (Required) The number of leaf nodes (page objects) that are descendants of this node /// within the page tree. /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string Count = "/Count"; /// /// Gets the KeysMeta for these keys. /// public static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfUIntegerObject.cs0000644000175000001440000000637311435766646023470 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Represents an indirect integer value. This type is not used by PDFsharp. If it is imported from /// an external PDF file, the value is converted into a direct object. /// [DebuggerDisplay("({Value})")] public sealed class PdfUIntegerObject : PdfNumberObject { /// /// Initializes a new instance of the class. /// public PdfUIntegerObject() { } /// /// Initializes a new instance of the class. /// /// The value. public PdfUIntegerObject(uint value) { this.value = value; } /// /// Initializes a new instance of the class. /// /// The document. /// The value. public PdfUIntegerObject(PdfDocument document, uint value) : base(document) { this.value = value; } /// /// Gets the value as unsigned integer. /// public uint Value { get { return this.value; } //set {this.value = value;} } uint value; /// /// Returns the integer as string. /// public override string ToString() { return this.value.ToString(); } /// /// Writes the integer literal. /// internal override void WriteObject(PdfWriter writer) { writer.WriteBeginObject(this); writer.Write(this.value); writer.WriteEndObject(); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfDocumentSettings.cs0000644000175000001440000000565611435766646024121 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Drawing; using PdfSharp.Internal; namespace PdfSharp.Pdf { /// /// Holds PDF specific information of the document. /// public sealed class PdfDocumentSettings { internal PdfDocumentSettings(PdfDocument document) { } /// /// Sets the private font collection. /// public XPrivateFontCollection PrivateFontCollection { internal get { return this.privateFontCollection; } set { if (this.privateFontCollection != null) throw new InvalidOperationException("PrivateFontCollection can only be set once."); this.privateFontCollection = value; } } private XPrivateFontCollection privateFontCollection; /// /// Gets or sets the default trim margins. /// public TrimMargins TrimMargins { get { if (this.trimMargins == null) this.trimMargins = new TrimMargins(); return this.trimMargins; } set { if (this.trimMargins == null) this.trimMargins = new TrimMargins(); if (value != null) { this.trimMargins.Left = value.Left; this.trimMargins.Right = value.Right; this.trimMargins.Top = value.Top; this.trimMargins.Bottom = value.Bottom; } else this.trimMargins.All = 0; } } TrimMargins trimMargins = new TrimMargins(); } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfObjectID.cs0000644000175000001440000001272211435766646022235 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Represents a PDF object identifier, a pair of object and generation number. /// [DebuggerDisplay("({ObjectNumber}, {GenerationNumber})")] public struct PdfObjectID : IComparable { /// /// Initializes a new instance of the class. /// /// The object number. public PdfObjectID(int objectNumber) { Debug.Assert(objectNumber >= 1, "Object number out of range."); this.objectNumber = objectNumber; this.generationNumber = 0; } /// /// Initializes a new instance of the class. /// /// The object number. /// The generation number. public PdfObjectID(int objectNumber, int generationNumber) { Debug.Assert(objectNumber >= 1, "Object number out of range."); //Debug.Assert(generationNumber >= 0 && generationNumber <= 65535, "Generation number out of range."); #if DEBUG // iText creates generation numbers with a value of 65536... if (generationNumber > 65535) Debug.WriteLine(String.Format("Generation number: {0}", generationNumber)); #endif this.objectNumber = objectNumber; this.generationNumber = (ushort)generationNumber; } /// /// Gets or sets the object number. /// public int ObjectNumber { get { return this.objectNumber; } set { this.objectNumber = value; } } int objectNumber; /// /// Gets or sets the generation number. /// public int GenerationNumber { get { return this.generationNumber; } set { this.generationNumber = (ushort)value; } } ushort generationNumber; /// /// Indicates whether this object is an empty object identifier. /// public bool IsEmpty { get { return this.objectNumber == 0; } } /// /// Indicates whether this instance and a specified object are equal. /// public override bool Equals(object obj) { if (obj is PdfObjectID) { PdfObjectID id = (PdfObjectID)obj; if (this.objectNumber == id.objectNumber) return this.generationNumber == id.generationNumber; } return false; } /// /// Returns the hash code for this instance. /// public override int GetHashCode() { return this.objectNumber ^ this.generationNumber; } /// /// Determines whether the tow objects are equal. /// public static bool operator ==(PdfObjectID left, PdfObjectID right) { return left.Equals(right); } /// /// Determines whether the tow objects not are equal. /// public static bool operator !=(PdfObjectID left, PdfObjectID right) { return !left.Equals(right); } /// /// Returns the object and generation numbers as a string. /// public override string ToString() { return this.objectNumber.ToString() + " " + this.generationNumber.ToString(); } /// /// Creates an empty object identifier. /// public static PdfObjectID Empty { get { return new PdfObjectID(); } } /// /// Compares the current object id with another object. /// public int CompareTo(object obj) { if (obj is PdfObjectID) { PdfObjectID id = (PdfObjectID)obj; if (this.objectNumber == id.objectNumber) return this.generationNumber - id.generationNumber; return this.objectNumber - id.objectNumber; } return 1; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfPage.cs0000644000175000001440000010530611533745361021455 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.Collections; using System.ComponentModel; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; using PdfSharp.Drawing; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Annotations; namespace PdfSharp.Pdf { /// /// Represents a page in a PDF document. /// public sealed class PdfPage : PdfDictionary, IContentStream { /// /// Initializes a new page. The page must be added to a document before it can be used. /// public PdfPage() { Elements.SetName(Keys.Type, "/Page"); Initialize(); } /// /// Initializes a new instance of the class. /// /// The document. public PdfPage(PdfDocument document) : base(document) { Elements.SetName(Keys.Type, "/Page"); Elements[Keys.Parent] = document.Pages.Reference; Initialize(); } internal PdfPage(PdfDictionary dict) : base(dict) { // Set Orientation depending on /Rotate int rotate = Elements.GetInteger(PdfPage.Keys.Rotate); if (Math.Abs((rotate / 90)) % 2 == 1) this.orientation = PageOrientation.Landscape; } void Initialize() { Size = RegionInfo.CurrentRegion != null && RegionInfo.CurrentRegion.IsMetric ? PageSize.A4 : PageSize.Letter; #pragma warning disable 168 // Force creation of MediaBox object by invoking property PdfRectangle rect = MediaBox; #pragma warning restore 168 } /// /// Gets or sets a user defined object that contains arbitrary information associated with this PDF page. /// The tag is not used by PDFsharp. /// public object Tag { get { return this.tag; } set { this.tag = value; } } object tag; /// /// Closes the page. A closes page cannot be modified anymore and it is not possible to /// get an XGraphics object for a closed page. Closing a page is not required, but may saves /// resources if the document has many pages. /// public void Close() { //// Close renderer, if any //if (this.content.pdfRenderer != null) // this.content.pdfRenderer.endp.Close(); closed = true; } bool closed; /// /// Gets a value indicating whether the page is closed. /// internal bool IsClosed { get { return this.closed; } } /// /// Gets or sets the PdfDocument this page belongs to. /// internal override PdfDocument Document { set { if (!ReferenceEquals(this.document, value)) { if (this.document != null) throw new InvalidOperationException("Cannot change document."); this.document = value; if (this.iref != null) this.iref.Document = value; Elements[PdfPage.Keys.Parent] = document.Pages.Reference; } } } /// /// Gets or sets the orientation of the page. The default value PageOrientation.Portrait. /// If an imported page has a /Rotate value that matches the formula 90 + n * 180 the /// orientation is set to PageOrientation.Landscape. /// public PageOrientation Orientation { get { return orientation; } set { orientation = value; } } PageOrientation orientation; /// /// Gets or sets one of the predefined standard sizes like. /// public PageSize Size { get { return this.pageSize; } set { if (!Enum.IsDefined(typeof(PageSize), value)) throw new InvalidEnumArgumentException("value", (int)value, typeof(PageSize)); XSize size = PageSizeConverter.ToSize(value); // THHO: MediaBox is always in Portrait mode (see Height, Width) /*if (this.orientation == PageOrientation.Portrait)*/ MediaBox = new PdfRectangle(0, 0, size.Width, size.Height); /*else MediaBox = new PdfRectangle(0, 0, size.Height, size.Width);*/ pageSize = value; } } PageSize pageSize; /// /// Gets or sets the trim margins. /// public TrimMargins TrimMargins { get { if (this.trimMargins == null) this.trimMargins = new TrimMargins(); return this.trimMargins; } set { if (this.trimMargins == null) this.trimMargins = new TrimMargins(); if (value != null) { this.trimMargins.Left = value.Left; this.trimMargins.Right = value.Right; this.trimMargins.Top = value.Top; this.trimMargins.Bottom = value.Bottom; } else this.trimMargins.All = 0; } } TrimMargins trimMargins = new TrimMargins(); /// /// Gets or sets the media box directly. XGrahics is not prepared to work with a media box /// with an origin other than (0,0). /// public PdfRectangle MediaBox { get { return Elements.GetRectangle(Keys.MediaBox, true); } set { Elements.SetRectangle(Keys.MediaBox, value); } } /// /// Gets or sets the crop box. /// public PdfRectangle CropBox { get { return Elements.GetRectangle(Keys.CropBox, true); } set { Elements.SetRectangle(Keys.CropBox, value); } } /// /// Gets or sets the bleed box. /// public PdfRectangle BleedBox { get { return Elements.GetRectangle(Keys.BleedBox, true); } set { Elements.SetRectangle(Keys.BleedBox, value); } } /// /// Gets or sets the art box. /// public PdfRectangle ArtBox { get { return Elements.GetRectangle(Keys.ArtBox, true); } set { Elements.SetRectangle(Keys.ArtBox, value); } } /// /// Gets or sets the trim box. /// public PdfRectangle TrimBox { get { return Elements.GetRectangle(Keys.TrimBox, true); } set { Elements.SetRectangle(Keys.TrimBox, value); } } /// /// Gets or sets the height of the page. If orientation is Landscape, this function applies to /// the width. /// public XUnit Height { get { PdfRectangle rect = MediaBox; return this.orientation == PageOrientation.Portrait ? rect.Height : rect.Width; } set { PdfRectangle rect = MediaBox; if (this.orientation == PageOrientation.Portrait) MediaBox = new PdfRectangle(rect.X1, 0, rect.X2, value); else MediaBox = new PdfRectangle(0, rect.Y1, value, rect.Y2); this.pageSize = PageSize.Undefined; } } /// /// Gets or sets the width of the page. If orientation is Landscape, this function applies to /// the height. /// public XUnit Width { get { PdfRectangle rect = MediaBox; return this.orientation == PageOrientation.Portrait ? rect.Width : rect.Height; } set { PdfRectangle rect = MediaBox; if (this.orientation == PageOrientation.Portrait) MediaBox = new PdfRectangle(0, rect.Y1, value, rect.Y2); else MediaBox = new PdfRectangle(rect.X1, 0, rect.X2, value); this.pageSize = PageSize.Undefined; } } /// /// Gets or sets the /Rotate entry of the PDF page. The value is the number of degrees by which the page /// should be rotated clockwise when displayed or printed. The value must be a multiple of 90. /// PDFsharp does not set this value, but for imported pages this value can be set and must be taken /// into account when adding graphic to such a page. /// public int Rotate { get { return this.elements.GetInteger(Keys.Rotate); } set { if (value / 90 * 90 != value) throw new ArgumentException("Value must be a multiple of 90."); this.elements.SetInteger(Keys.Rotate, value); } } // TODO: PdfAnnotations // TODO: PdfActions // TODO: PdfPageTransition /// /// The content stream currently used by an XGraphics object for rendering. /// internal PdfContent RenderContent; /// /// Gets the array of content streams of the page. /// public PdfContents Contents { get { if (this.contents == null) { if (true) // || this.Document.IsImported) { PdfItem item = Elements[Keys.Contents]; if (item == null) { this.contents = new PdfContents(Owner); //Owner.irefTable.Add(this.contents); } else { if (item is PdfReference) item = ((PdfReference)item).Value; PdfArray array = item as PdfArray; if (array != null) { // It is already an array of content streams. if (array.IsIndirect) { // Make it a direct array array = array.Clone(); array.Document = Owner; } //#warning THHO4STLA: verursacht Exception "Object type transformation must not be done with direct objects" in "protected PdfObject(PdfObject obj)" // TODO THHO4STLA: verursacht Exception "Object type transformation must not be done with direct objects" in "protected PdfObject(PdfObject obj)" this.contents = new PdfContents(array); } else { // Only one content stream -> create array this.contents = new PdfContents(Owner); //Owner.irefTable.Add(this.contents); PdfContent content = new PdfContent((PdfDictionary)item); this.contents.Elements.Add(content.Reference); } } } //else //{ // this.content = new PdfContent(this.Document); // this.Document.xrefTable.Add(this.content); //} Debug.Assert(this.contents.Reference == null); Elements[Keys.Contents] = this.contents; } return this.contents; } } PdfContents contents; #region Annotations /// /// Gets the annotations array of this page. /// public PdfAnnotations Annotations { get { if (this.annotations == null) { this.annotations = (PdfAnnotations)Elements.GetValue(Keys.Annots, VCF.Create); this.annotations.Page = this; } return this.annotations; } } PdfAnnotations annotations; /// /// Adds an intra document link. /// /// The rect. /// The destination page. public PdfLinkAnnotation AddDocumentLink(PdfRectangle rect, int destinationPage) { PdfLinkAnnotation annotation = PdfLinkAnnotation.CreateDocumentLink(rect, destinationPage); Annotations.Add(annotation); return annotation; } /// /// Adds a link to the Web. /// /// The rect. /// The URL. public PdfLinkAnnotation AddWebLink(PdfRectangle rect, string url) { PdfLinkAnnotation annotation = PdfLinkAnnotation.CreateWebLink(rect, url); Annotations.Add(annotation); return annotation; } /// /// Adds a link to a file. /// /// The rect. /// Name of the file. public PdfLinkAnnotation AddFileLink(PdfRectangle rect, string fileName) { PdfLinkAnnotation annotation = PdfLinkAnnotation.CreateFileLink(rect, fileName); Annotations.Add(annotation); return annotation; } #endregion /// /// Gets or sets the custom values. /// public PdfCustomValues CustomValues { get { if (this.customValues == null) this.customValues = PdfCustomValues.Get(Elements); return this.customValues; } set { if (value != null) throw new ArgumentException("Only null is allowed to clear all custom values."); PdfCustomValues.Remove(Elements); this.customValues = null; } } PdfCustomValues customValues; internal PdfResources Resources { get { if (this.resources == null) this.resources = (PdfResources)Elements.GetValue(Keys.Resources, VCF.Create); //VCF.CreateIndirect return this.resources; } } PdfResources resources; /// /// Implements the interface because the primary function is internal. /// PdfResources IContentStream.Resources { get { return Resources; } } /// /// Gets the resource name of the specified font within this page. /// internal string GetFontName(XFont font, out PdfFont pdfFont) { pdfFont = this.document.FontTable.GetFont(font); Debug.Assert(pdfFont != null); string name = Resources.AddFont(pdfFont); return name; } string IContentStream.GetFontName(XFont font, out PdfFont pdfFont) { return GetFontName(font, out pdfFont); } /// /// Tries to get the resource name of the specified font data within this page. /// Returns null if no such font exists. /// internal string TryGetFontName(string idName, out PdfFont pdfFont) { pdfFont = this.document.FontTable.TryGetFont(idName); string name = null; if (pdfFont != null) name = Resources.AddFont(pdfFont); return name; } /// /// Gets the resource name of the specified font data within this page. /// internal string GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) { pdfFont = this.document.FontTable.GetFont(idName, fontData); //pdfFont = new PdfType0Font(Owner, idName, fontData); //pdfFont.Document = this.document; Debug.Assert(pdfFont != null); string name = Resources.AddFont(pdfFont); return name; } string IContentStream.GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) { return GetFontName(idName, fontData, out pdfFont); } /// /// Gets the resource name of the specified image within this page. /// internal string GetImageName(XImage image) { PdfImage pdfImage = this.document.ImageTable.GetImage(image); Debug.Assert(pdfImage != null); string name = Resources.AddImage(pdfImage); return name; } /// /// Implements the interface because the primary function is internal. /// string IContentStream.GetImageName(XImage image) { return GetImageName(image); } /// /// Gets the resource name of the specified form within this page. /// internal string GetFormName(XForm form) { PdfFormXObject pdfForm = this.document.FormTable.GetForm(form); Debug.Assert(pdfForm != null); string name = Resources.AddForm(pdfForm); return name; } /// /// Implements the interface because the primary function is internal. /// string IContentStream.GetFormName(XForm form) { return GetFormName(form); } internal override void WriteObject(PdfWriter writer) { // TODO: Take /Rotate into account //#warning THHO4STLA: warum nicht new PdfRectangle(mediaBox.Y1, mediaBox.X1, mediaBox.Y2, mediaBox.X2)? - siehe auch Orientation //#warning THHO4STLA: CropBox, BleedBox etc. auch drehen? #if true // Add transparency group to prevent rendering problems of Adobe viewer this.transparencyUsed = true; // TODO: check XObjects if (this.transparencyUsed && !Elements.ContainsKey(Keys.Group)) { PdfDictionary group = new PdfDictionary(); this.elements["/Group"] = group; if (this.document.Options.ColorMode != PdfColorMode.Cmyk) group.Elements.SetName("/CS", "/DeviceRGB"); else group.Elements.SetName("/CS", "/DeviceCMYK"); group.Elements.SetName("/S", "/Transparency"); group.Elements["/I"] = new PdfBoolean(false); group.Elements["/K"] = new PdfBoolean(false); } #endif #if DEBUG_ PdfItem item = Elements["/MediaBox"]; if (item != null) item.GetType(); #endif base.WriteObject(writer); } /// /// Hack to indicate that a page-level transparency group must be created. /// internal bool transparencyUsed; /// /// Inherit values from parent node. /// internal static void InheritValues(PdfDictionary page, InheritedValues values) { // HACK: I'M ABSOLUTELY NOT SURE WHETHER THIS CODE COVERS ALL CASES. if (values.Resources != null) { PdfDictionary resources; PdfItem res = page.Elements[PdfPage.Keys.Resources]; if (res is PdfReference) { resources = (PdfDictionary)((PdfReference)res).Value.Clone(); resources.Document = page.Owner; } else resources = (PdfDictionary)res; if (resources == null) { resources = values.Resources.Clone(); resources.Document = page.Owner; page.Elements.Add(PdfPage.Keys.Resources, resources); } else { foreach (PdfName name in values.Resources.Elements.KeyNames) { if (!resources.Elements.ContainsKey(name.Value)) { PdfItem item = values.Resources.Elements[name]; if (item is PdfObject) item = item.Clone(); resources.Elements.Add(name.ToString(), item); } } } } if (values.MediaBox != null && page.Elements[PdfPage.Keys.MediaBox] == null) page.Elements[PdfPage.Keys.MediaBox] = values.MediaBox; if (values.CropBox != null && page.Elements[PdfPage.Keys.CropBox] == null) page.Elements[PdfPage.Keys.CropBox] = values.CropBox; if (values.Rotate != null && page.Elements[PdfPage.Keys.Rotate] == null) page.Elements[PdfPage.Keys.Rotate] = values.Rotate; } /// /// Add all inheritable values from the specified page to the specified values structure. /// internal static void InheritValues(PdfDictionary page, ref InheritedValues values) { PdfItem item; item = page.Elements[PdfPage.Keys.Resources]; if (item != null) if (item is PdfReference) values.Resources = (PdfDictionary)(((PdfReference)item).Value); else values.Resources = (PdfDictionary)item; item = page.Elements[PdfPage.Keys.MediaBox]; if (item != null) values.MediaBox = new PdfRectangle(item); item = page.Elements[PdfPage.Keys.CropBox]; if (item != null) values.CropBox = new PdfRectangle(item); item = page.Elements[PdfPage.Keys.Rotate]; if (item != null) { if (item is PdfReference) item = ((PdfReference)item).Value; values.Rotate = (PdfInteger)item; } } internal override void PrepareForSave() { ////// Save 2 bytes in PDF... ////if (this.contents.Elements.Count == 1) //// Elements[Keys.Contents] = this.contents.Elements[0]; if (this.trimMargins.AreSet) { // These are the values InDesign set for an A4 page with 3mm crop margin at each edge. // (recall that PDF rect are two points and NOT a point and a width) // /MediaBox[0.0 0.0 612.283 858.898] 216 302.7 // /CropBox[0.0 0.0 612.283 858.898] // /BleedBox[0.0 0.0 612.283 858.898] // /ArtBox[8.50394 8.50394 603.78 850.394] 3 3 213 300 // /TrimBox[8.50394 8.50394 603.78 850.394] double width = this.trimMargins.Left.Point + Width.Point + this.trimMargins.Right.Point; double height = this.trimMargins.Top.Point + Height.Point + this.trimMargins.Bottom.Point; MediaBox = new PdfRectangle(0, 0, width, height); CropBox = new PdfRectangle(0, 0, width, height); BleedBox = new PdfRectangle(0, 0, width, height); PdfRectangle rect = new PdfRectangle(this.trimMargins.Left.Point, this.trimMargins.Top.Point, width - this.trimMargins.Right.Point, height - this.trimMargins.Bottom.Point); TrimBox = rect; ArtBox = rect.Clone(); } } /// /// Predefined keys of this dictionary. /// public sealed class Keys : InheritablePageKeys { /// /// (Required) The type of PDF object that this dictionary describes; /// must be Page for a page object. /// [KeyInfo(KeyType.Name | KeyType.Required, FixedValue = "Page")] public const string Type = "/Type"; /// /// (Required; must be an indirect reference) /// The page tree node that is the immediate parent of this page object. /// [KeyInfo(KeyType.Dictionary | KeyType.Required | KeyType.MustBeIndirect)] public const string Parent = "/Parent"; /// /// (Required if PieceInfo is present; optional otherwise; PDF 1.3) The date and time /// when the pages contents were most recently modified. If a page-piece dictionary /// (PieceInfo) is present, the modification date is used to ascertain which of the /// application data dictionaries that it contains correspond to the current content /// of the page. /// [KeyInfo(KeyType.Date)] public const string LastModified = "/LastModified"; /// /// (Optional; PDF 1.3) A rectangle, expressed in default user space units, defining the /// region to which the contents of the page should be clipped when output in a production /// environment. Default value: the value of CropBox. /// [KeyInfo("1.3", KeyType.Rectangle | KeyType.Optional)] public const string BleedBox = "/BleedBox"; /// /// (Optional; PDF 1.3) A rectangle, expressed in default user space units, defining the /// intended dimensions of the finished page after trimming. Default value: the value of /// CropBox. /// [KeyInfo("1.3", KeyType.Rectangle | KeyType.Optional)] public const string TrimBox = "/TrimBox"; /// /// (Optional; PDF 1.3) A rectangle, expressed in default user space units, defining the /// extent of the pages meaningful content (including potential white space) as intended /// by the pages creator. Default value: the value of CropBox. /// [KeyInfo("1.3", KeyType.Rectangle | KeyType.Optional)] public const string ArtBox = "/ArtBox"; /// /// (Optional; PDF 1.4) A box color information dictionary specifying the colors and other /// visual characteristics to be used in displaying guidelines on the screen for the various /// page boundaries. If this entry is absent, the application should use its own current /// default settings. /// [KeyInfo("1.4", KeyType.Dictionary | KeyType.Optional)] public const string BoxColorInfo = "/BoxColorInfo"; /// /// (Optional) A content stream describing the contents of this page. If this entry is absent, /// the page is empty. The value may be either a single stream or an array of streams. If the /// value is an array, the effect is as if all of the streams in the array were concatenated, /// in order, to form a single stream. This allows PDF producers to create image objects and /// other resources as they occur, even though they interrupt the content stream. The division /// between streams may occur only at the boundaries between lexical tokens but is unrelated /// to the pages logical content or organization. Applications that consume or produce PDF /// files are not required to preserve the existing structure of the Contents array. /// [KeyInfo(KeyType.Array | KeyType.Stream | KeyType.Optional)] public const string Contents = "/Contents"; /// /// (Optional; PDF 1.4) A group attributes dictionary specifying the attributes of the pages /// page group for use in the transparent imaging model. /// [KeyInfo("1.4", KeyType.Dictionary | KeyType.Optional)] public const string Group = "/Group"; /// /// (Optional) A stream object defining the pages thumbnail image. /// [KeyInfo(KeyType.Stream | KeyType.Optional)] public const string Thumb = "/Thumb"; /// /// (Optional; PDF 1.1; recommended if the page contains article beads) An array of indirect /// references to article beads appearing on the page. The beads are listed in the array in /// natural reading order. /// [KeyInfo("1.1", KeyType.Array | KeyType.Optional)] public const string B = "/B"; /// /// (Optional; PDF 1.1) The pages display duration (also called its advance timing): the /// maximum length of time, in seconds, that the page is displayed during presentations before /// the viewer application automatically advances to the next page. By default, the viewer does /// not advance automatically. /// [KeyInfo("1.1", KeyType.Real | KeyType.Optional)] public const string Dur = "/Dur"; /// /// (Optional; PDF 1.1) A transition dictionary describing the transition effect to be used /// when displaying the page during presentations. /// [KeyInfo("1.1", KeyType.Dictionary | KeyType.Optional)] public const string Trans = "/Trans"; /// /// (Optional) An array of annotation dictionaries representing annotations associated with /// the page. /// [KeyInfo(KeyType.Array | KeyType.Optional, typeof(PdfAnnotations))] public const string Annots = "/Annots"; /// /// (Optional; PDF 1.2) An additional-actions dictionary defining actions to be performed /// when the page is opened or closed. /// [KeyInfo("1.2", KeyType.Dictionary | KeyType.Optional)] public const string AA = "/AA"; /// /// (Optional; PDF 1.4) A metadata stream containing metadata for the page. /// [KeyInfo("1.4", KeyType.Stream | KeyType.Optional)] public const string Metadata = "/Metadata"; /// /// (Optional; PDF 1.3) A page-piece dictionary associated with the page. /// [KeyInfo("1.3", KeyType.Dictionary | KeyType.Optional)] public const string PieceInfo = "/PieceInfo"; /// /// (Required if the page contains structural content items; PDF 1.3) /// The integer key of the pages entry in the structural parent tree. /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string StructParents = "/StructParents"; /// /// (Optional; PDF 1.3; indirect reference preferred) The digital identifier of /// the pages parent Web Capture content set. /// [KeyInfo("1.3", KeyType.String | KeyType.Optional)] public const string ID = "/ID"; /// /// (Optional; PDF 1.3) The pages preferred zoom (magnification) factor: the factor /// by which it should be scaled to achieve the natural display magnification. /// [KeyInfo("1.3", KeyType.Real | KeyType.Optional)] public const string PZ = "/PZ"; /// /// (Optional; PDF 1.3) A separation dictionary containing information needed /// to generate color separations for the page. /// [KeyInfo("1.3", KeyType.Dictionary | KeyType.Optional)] public const string SeparationInfo = "/SeparationInfo"; /// /// (Optional; PDF 1.5) A name specifying the tab order to be used for annotations /// on the page. The possible values are R (row order), C (column order), /// and S (structure order). /// [KeyInfo("1.5", KeyType.Name | KeyType.Optional)] public const string Tabs = "/Tabs"; /// /// (Required if this page was created from a named page object; PDF 1.5) /// The name of the originating page object. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string TemplateInstantiated = "/TemplateInstantiated"; /// /// (Optional; PDF 1.5) A navigation node dictionary representing the first node /// on the page. /// [KeyInfo("1.5", KeyType.Dictionary | KeyType.Optional)] public const string PresSteps = "/PresSteps"; /// /// (Optional; PDF 1.6) A positive number giving the size of default user space units, /// in multiples of 1/72 inch. The range of supported values is implementation-dependent. /// [KeyInfo("1.6", KeyType.Real | KeyType.Optional)] public const string UserUnit = "/UserUnit"; /// /// (Optional; PDF 1.6) An array of viewport dictionaries specifying rectangular regions /// of the page. /// [KeyInfo("1.6", KeyType.Dictionary | KeyType.Optional)] public const string VP = "/VP"; /// /// Gets the KeysMeta for these keys. /// internal static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } /// /// Predefined keys common to PdfPage and PdfPages. /// public class InheritablePageKeys : KeysBase { /// /// (Required; inheritable) A dictionary containing any resources required by the page. /// If the page requires no resources, the value of this entry should be an empty dictionary. /// Omitting the entry entirely indicates that the resources are to be inherited from an /// ancestor node in the page tree. /// [KeyInfo(KeyType.Dictionary | KeyType.Required | KeyType.Inheritable, typeof(PdfResources))] public const string Resources = "/Resources"; /// /// (Required; inheritable) A rectangle, expressed in default user space units, defining the /// boundaries of the physical medium on which the page is intended to be displayed or printed. /// [KeyInfo(KeyType.Rectangle | KeyType.Required | KeyType.Inheritable)] public const string MediaBox = "/MediaBox"; /// /// (Optional; inheritable) A rectangle, expressed in default user space units, defining the /// visible region of default user space. When the page is displayed or printed, its contents /// are to be clipped (cropped) to this rectangle and then imposed on the output medium in some /// implementation defined manner. Default value: the value of MediaBox. /// [KeyInfo(KeyType.Rectangle | KeyType.Optional | KeyType.Inheritable)] public const string CropBox = "/CropBox"; /// /// (Optional; inheritable) The number of degrees by which the page should be rotated clockwise /// when displayed or printed. The value must be a multiple of 90. Default value: 0. /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string Rotate = "/Rotate"; } /// /// Values inherited from a parent in the parent chain of a page tree. /// internal struct InheritedValues { public PdfDictionary Resources; public PdfRectangle MediaBox; public PdfRectangle CropBox; public PdfInteger Rotate; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfNull.cs0000644000175000001440000000455511435766646021531 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; namespace PdfSharp.Pdf { /// /// Represents a indirect reference that is not in the cross reference table. /// public sealed class PdfNull : PdfItem { PdfNull() { } /// /// Returns a that represents the current . /// /// /// A that represents the current . /// public override string ToString() { return "null"; } internal override void WriteObject(PdfSharp.Pdf.IO.PdfWriter writer) { // Implementet because it must be overridden. writer.WriteRaw(" null "); } /// /// The only instance of this class. /// public static readonly PdfNull Value = new PdfNull(); } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfBoolean.cs0000644000175000001440000000600511435766646022166 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Represents a direct boolean value. /// [DebuggerDisplay("({Value})")] public sealed class PdfBoolean : PdfItem { /// /// Initializes a new instance of the class. /// public PdfBoolean() { } /// /// Initializes a new instance of the class. /// public PdfBoolean(bool value) { this.value = value; } /// /// Gets the value of this instance as boolean value. /// public bool Value { // This class must behave like a value type. Therefore it cannot be changed (like System.String). get { return this.value; } } bool value; /// /// A pre-defined value that represents true. /// public static readonly PdfBoolean True = new PdfBoolean(true); /// /// A pre-defined value that represents false. /// public static readonly PdfBoolean False = new PdfBoolean(false); /// /// Returns 'false' or 'true'. /// public override string ToString() { return this.value ? bool.TrueString : bool.FalseString; } /// /// Writes 'true' or 'false'. /// internal override void WriteObject(PdfWriter writer) { writer.Write(this); } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/EntryInfoAttribute.cs0000644000175000001440000000740011435766646023756 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; namespace PdfSharp.Pdf { /// /// Specifies the type of a key's value in a dictionary. /// [Flags] internal enum KeyType { Name = 0x00000001, String = 0x00000002, Boolean = 0x00000003, Integer = 0x00000004, Real = 0x00000005, Date = 0x00000006, Rectangle = 0x00000007, Array = 0x00000008, Dictionary = 0x00000009, Stream = 0x0000000A, NumberTree = 0x0000000B, Function = 0x0000000C, TextString = 0x0000000D, NameOrArray = 0x00000010, NameOrDictionary = 0x00000020, ArrayOrDictionary = 0x00000030, StreamOrArray = 0x00000040, StreamOrName = 0x00000050, ArrayOrNameOrString = 0x00000060, FunctionOrName = 0x000000070, Various = 0x000000080, TypeMask = 0x000000FF, Optional = 0x00000100, Required = 0x00000200, Inheritable = 0x00000400, MustBeIndirect = 0x00001000, MustNotBeIndirect = 0x00002000, } /// /// Summary description for KeyInfo. /// internal class KeyInfoAttribute : Attribute { public KeyInfoAttribute() { } public KeyInfoAttribute(KeyType keyType) { //this.version = version; this.KeyType = keyType; } public KeyInfoAttribute(string version, KeyType keyType) { this.version = version; this.KeyType = keyType; } public KeyInfoAttribute(KeyType keyType, Type objectType) { //this.version = version; this.KeyType = keyType; this.objectType = objectType; } public KeyInfoAttribute(string version, KeyType keyType, Type objectType) { //this.version = version; this.KeyType = keyType; this.objectType = objectType; } public string Version { get { return this.version; } set { this.version = value; } } string version = "1.0"; public KeyType KeyType { get { return this.entryType; } set { this.entryType = value; } } KeyType entryType; public Type ObjectType { get { return this.objectType; } set { this.objectType = value; } } Type objectType; public string FixedValue { get { return this.fixedValue; } set { this.fixedValue = value; } } string fixedValue; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfIntegerObject.cs0000644000175000001440000000612111435766646023332 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Represents an indirect integer value. This type is not used by PDFsharp. If it is imported from /// an external PDF file, the value is converted into a direct object. /// [DebuggerDisplay("({Value})")] public sealed class PdfIntegerObject : PdfNumberObject { /// /// Initializes a new instance of the class. /// public PdfIntegerObject() { } /// /// Initializes a new instance of the class. /// public PdfIntegerObject(int value) { this.value = value; } /// /// Initializes a new instance of the class. /// public PdfIntegerObject(PdfDocument document, int value) : base(document) { this.value = value; } /// /// Gets the value as integer. /// public int Value { get { return this.value; } //set {this.value = value;} } int value; /// /// Returns the integer as string. /// public override string ToString() { return this.value.ToString(); } /// /// Writes the integer literal. /// internal override void WriteObject(PdfWriter writer) { writer.WriteBeginObject(this); writer.Write(this.value); writer.WriteEndObject(); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfUInteger.cs0000644000175000001440000001514311435766646022334 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Represents a direct unsigned integer value. /// [DebuggerDisplay("({Value})")] public sealed class PdfUInteger : PdfNumber, IConvertible { /// /// Initializes a new instance of the class. /// public PdfUInteger() { } /// /// Initializes a new instance of the class. /// public PdfUInteger(uint value) { this.value = value; } /// /// Gets the value as integer. /// public uint Value { // This class must behave like a value type. Therefore it cannot be changed (like System.String). get { return this.value; } } uint value; /// /// Returns the unsigned integer as string. /// public override string ToString() { return this.value.ToString(); } /// /// Writes the integer as string. /// internal override void WriteObject(PdfWriter writer) { writer.Write(this); } #region IConvertible Members /// /// Converts the value of this instance to an equivalent 64-bit unsigned integer. /// public ulong ToUInt64(IFormatProvider provider) { return Convert.ToUInt64(this.value); } /// /// Converts the value of this instance to an equivalent 8-bit signed integer. /// public sbyte ToSByte(IFormatProvider provider) { throw new InvalidCastException(); } /// /// Converts the value of this instance to an equivalent double-precision floating-point number. /// public double ToDouble(IFormatProvider provider) { return value; } /// /// Returns an undefined DateTime structure. /// public DateTime ToDateTime(IFormatProvider provider) { // TODO: Add PdfUInteger.ToDateTime implementation return new DateTime(); } /// /// Converts the value of this instance to an equivalent single-precision floating-point number. /// public float ToSingle(IFormatProvider provider) { return value; } /// /// Converts the value of this instance to an equivalent Boolean value. /// public bool ToBoolean(IFormatProvider provider) { return Convert.ToBoolean(this.value); } /// /// Converts the value of this instance to an equivalent 32-bit signed integer. /// public int ToInt32(IFormatProvider provider) { return Convert.ToInt32(this.value); } /// /// Converts the value of this instance to an equivalent 16-bit unsigned integer. /// public ushort ToUInt16(IFormatProvider provider) { return Convert.ToUInt16(this.value); } /// /// Converts the value of this instance to an equivalent 16-bit signed integer. /// public short ToInt16(IFormatProvider provider) { return Convert.ToInt16(this.value); } /// /// Converts the value of this instance to an equivalent . /// string System.IConvertible.ToString(IFormatProvider provider) { return value.ToString(provider); } /// /// Converts the value of this instance to an equivalent 8-bit unsigned integer. /// public byte ToByte(IFormatProvider provider) { return Convert.ToByte(this.value); } /// /// Converts the value of this instance to an equivalent Unicode character. /// public char ToChar(IFormatProvider provider) { return Convert.ToChar(this.value); } /// /// Converts the value of this instance to an equivalent 64-bit signed integer. /// public long ToInt64(IFormatProvider provider) { return value; } /// /// Returns type code for 32-bit integers. /// public System.TypeCode GetTypeCode() { return TypeCode.Int32; } /// /// Converts the value of this instance to an equivalent number. /// public decimal ToDecimal(IFormatProvider provider) { return value; } /// /// Returns null. /// public object ToType(Type conversionType, IFormatProvider provider) { // TODO: Add PdfUInteger.ToType implementation return null; } /// /// Converts the value of this instance to an equivalent 32-bit unsigned integer. /// public uint ToUInt32(IFormatProvider provider) { return Convert.ToUInt32(this.value); } #endregion } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfName.cs0000644000175000001440000001271111435766646021470 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Represents a PDF name value. /// [DebuggerDisplay("({Value})")] public sealed class PdfName : PdfItem { /// /// Initializes a new instance of the class. /// public PdfName() { this.value = "/"; // Empty name. } /// /// Initializes a new instance of the class. /// public PdfName(string value) { if (value == null) throw new ArgumentNullException("value"); if (value.Length == 0 || value[0] != '/') throw new ArgumentException(PSSR.NameMustStartWithSlash); this.value = value; } /// /// Determines whether the specified object is equal to this name. /// public override bool Equals(object obj) { return this.value.Equals(obj); } /// /// Returns the hash code for this instance. /// public override int GetHashCode() { return this.value.GetHashCode(); } /// /// Gets the name as a string. /// public string Value { // This class must behave like a value type. Therefore it cannot be changed (like System.String). get { return this.value; } } string value; /// /// Returns the name. The string always begins with a slash. /// public override string ToString() { return this.value; } /// /// Determines whether the specified name and string are equal. /// public static bool operator ==(PdfName name, string str) { return name.value == str; } /// /// Determines whether the specified name and string are not equal. /// public static bool operator !=(PdfName name, string str) { return name.value != str; } #if leads_to_ambiguity public static bool operator ==(string str, PdfName name) { return str == name.value; } public static bool operator !=(string str, PdfName name) { return str == name.value; } public static bool operator ==(PdfName name1, PdfName name2) { return name1.value == name2.value; } public static bool operator !=(PdfName name1, PdfName name2) { return name1.value != name2.value; } #endif /// /// Represents the empty name. /// public static readonly PdfName Empty = new PdfName("/"); /// /// Writes the name including the leading slash. /// internal override void WriteObject(PdfWriter writer) { // TODO: what if unicode character are part of the name? writer.Write(this); } /// /// Gets the comparer for this type. /// public static PdfXNameComparer Comparer { get { return new PdfXNameComparer(); } } /// /// Implements a comparer that compares PdfName objects. /// public class PdfXNameComparer : IComparer { /// /// Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. /// /// The first object to compare. /// The second object to compare. public int Compare(PdfName x, PdfName y) { PdfName l = x; // as PdfName; PdfName r = y; // as PdfName; if (l != null) { if (r != null) return l.value.CompareTo(r.value); else return -1; } else if (r != null) return 1; else return 0; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfDocumentInformation.cs0000644000175000001440000001606411435766646024601 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp; namespace PdfSharp.Pdf { /// /// Represents the PDF document information dictionary. /// public sealed class PdfDocumentInformation : PdfDictionary { /// /// Initializes a new instance of the class. /// public PdfDocumentInformation(PdfDocument document) : base(document) { } PdfDocumentInformation(PdfDictionary dict) : base(dict) { } /// /// Gets or sets the document's title. /// public string Title { get { return Elements.GetString(Keys.Title); } set { Elements.SetString(Keys.Title, value); } } /// /// Gets or sets the name of the person who created the document. /// public string Author { get { return Elements.GetString(Keys.Author); } set { Elements.SetString(Keys.Author, value); } } /// /// Gets or sets the name of the subject of the document. /// public string Subject { get { return Elements.GetString(Keys.Subject); } set { Elements.SetString(Keys.Subject, value); } } /// /// Gets or sets keywords associated with the document. /// public string Keywords { get { return Elements.GetString(Keys.Keywords); } set { Elements.SetString(Keys.Keywords, value); } } /// /// Gets or sets the name of the application (for example, MigraDoc) that created the document. /// public string Creator { get { return Elements.GetString(Keys.Creator); } set { Elements.SetString(Keys.Creator, value); } } /// /// Gets the producer application (for example, PDFsharp). /// public string Producer { get { return Elements.GetString(Keys.Producer); } } /// /// Gets or sets the creation date of the document. /// public DateTime CreationDate { get { return Elements.GetDateTime(Keys.CreationDate, DateTime.Now); } set { Elements.SetDateTime(Keys.CreationDate, value); } } /// /// Gets or sets the modification date of the document. /// public DateTime ModificationDate { get { return Elements.GetDateTime(Keys.ModDate, DateTime.Now); } set { Elements.SetDateTime(Keys.ModDate, value); } } // TODO CustomProperties and meta data /// /// Predefined keys of this dictionary. /// internal sealed class Keys : KeysBase { /// /// (Optional; PDF 1.1) The documents title. /// [KeyInfo(KeyType.String | KeyType.Optional)] public const string Title = "/Title"; /// /// (Optional) The name of the person who created the document. /// [KeyInfo(KeyType.String | KeyType.Optional)] public const string Author = "/Author"; /// /// (Optional; PDF 1.1) The subject of the document. /// [KeyInfo(KeyType.String | KeyType.Optional)] public const string Subject = "/Subject"; /// /// (Optional; PDF 1.1) Keywords associated with the document. /// [KeyInfo(KeyType.String | KeyType.Optional)] public const string Keywords = "/Keywords"; /// /// (Optional) If the document was converted to PDF from another format, /// the name of the application (for example, empira MigraDoc) that created the /// original document from which it was converted. /// [KeyInfo(KeyType.String | KeyType.Optional)] public const string Creator = "/Creator"; /// /// (Optional) If the document was converted to PDF from another format, /// the name of the application (for example, this library) that converted it to PDF. /// [KeyInfo(KeyType.String | KeyType.Optional)] public const string Producer = "/Producer"; /// /// (Optional) The date and time the document was created, in human-readable form. /// [KeyInfo(KeyType.Date | KeyType.Optional)] public const string CreationDate = "/CreationDate"; /// /// (Required if PieceInfo is present in the document catalog; otherwise optional; PDF 1.1) /// The date and time the document was most recently modified, in human-readable form. /// [KeyInfo(KeyType.String | KeyType.Optional)] public const string ModDate = "/ModDate"; /// /// (Optional; PDF 1.3) A name object indicating whether the document has been modified /// to include trapping information. /// [KeyInfo("1.3", KeyType.Name | KeyType.Optional)] public const string Trapped = "/Trapped"; /// /// Gets the KeysMeta for these keys. /// public static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfBooleanObject.cs0000644000175000001440000000615111435766646023317 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Represents an indirect boolean value. This type is not used by PDFsharp. If it is imported from /// an external PDF file, the value is converted into a direct object. /// [DebuggerDisplay("({Value})")] public sealed class PdfBooleanObject : PdfObject { /// /// Initializes a new instance of the class. /// public PdfBooleanObject() { } /// /// Initializes a new instance of the class. /// public PdfBooleanObject(bool value) { this.value = value; } /// /// Initializes a new instance of the class. /// public PdfBooleanObject(PdfDocument document, bool value) : base(document) { this.value = value; } /// /// Gets the value of this instance as boolean value. /// public bool Value { get { return this.value; } //set {this.value = value;} } bool value; /// /// Returns "false" or "true". /// public override string ToString() { return this.value ? bool.TrueString : bool.FalseString; } /// /// Writes the keyword false or true. /// internal override void WriteObject(PdfWriter writer) { writer.WriteBeginObject(this); writer.Write(this.value); writer.WriteEndObject(); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfNumber.cs0000644000175000001440000000334111435766646022037 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; namespace PdfSharp.Pdf { /// /// Base class for direct number values (not yet used, maybe superfluous). /// public abstract class PdfNumber : PdfItem { //public PdfNumber() //{ //} } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfArray.cs0000644000175000001440000004133711435766646021674 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Represents a PDF array object. /// [DebuggerDisplay("(elements={Elements.Count})")] public class PdfArray : PdfObject, IEnumerable { ArrayElements elements; /// /// Initializes a new instance of the class. /// public PdfArray() { } /// /// Initializes a new instance of the class. /// /// The document. public PdfArray(PdfDocument document) : base(document) { } /// /// Initializes a new instance of the class. /// /// The document. /// The items. public PdfArray(PdfDocument document, params PdfItem[] items) : base(document) { foreach (PdfItem item in items) Elements.Add(item); } /// /// Initializes a new instance from an existing dictionary. Used for object type transformation. /// /// The array. protected PdfArray(PdfArray array) : base(array) { if (array.elements != null) array.elements.SetOwner(this); } /// /// Creates a copy of this array. Direct elements are deep copied. Indirect references are not /// modified. /// public new PdfArray Clone() { return (PdfArray)Copy(); } /// /// Implements the copy mechanism. /// protected override object Copy() { PdfArray array = (PdfArray)base.Copy(); if (array.elements != null) { array.elements = array.elements.Clone(); int count = array.elements.Count; for (int idx = 0; idx < count; idx++) { PdfItem item = array.elements[idx]; if (item is PdfObject) array.elements[idx] = item.Clone(); } } return array; } /// /// Gets the collection containing the elements of this object. /// public ArrayElements Elements { get { if (this.elements == null) this.elements = new ArrayElements(this); return this.elements; } } /// /// Returns an enumerator that iterates through a collection. /// public virtual IEnumerator GetEnumerator() { return Elements.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } /// /// Returns a string with the content of this object in a readable form. Useful for debugging purposes only. /// public override string ToString() { StringBuilder pdf = new StringBuilder(); pdf.Append("[ "); int count = Elements.Count; for (int idx = 0; idx < count; idx++) pdf.Append(Elements[idx].ToString() + " "); pdf.Append("]"); return pdf.ToString(); } internal override void WriteObject(PdfWriter writer) { writer.WriteBeginObject(this); int count = Elements.Count; for (int idx = 0; idx < count; idx++) { PdfItem value = Elements[idx]; value.WriteObject(writer); } writer.WriteEndObject(); } /// /// Represents the elements of an PdfArray. /// public sealed class ArrayElements : IList, ICloneable { List elements; PdfArray owner; internal ArrayElements(PdfArray array) { this.elements = new List(); this.owner = array; } object ICloneable.Clone() { ArrayElements elements = (ArrayElements)MemberwiseClone(); elements.elements = new List(elements.elements); elements.owner = null; return elements; } /// /// Creates a shallow copy of this object. /// public ArrayElements Clone() { return (ArrayElements)((ICloneable)this).Clone(); } /// /// Moves this instance to another dictionary during object type transformation. /// internal void SetOwner(PdfArray array) { this.owner = array; array.elements = this; } /// /// Converts the specified value to boolean. /// If the value not exists, the function returns false. /// If the value is not convertible, the function throws an InvalidCastException. /// If the index is out of range, the function throws an ArgumentOutOfRangeException. /// public bool GetBoolean(int index) { if (index < 0 || index >= Count) throw new ArgumentOutOfRangeException("index", index, PSSR.IndexOutOfRange); object obj = this[index]; if (obj == null) return false; if (obj is PdfBoolean) return ((PdfBoolean)obj).Value; else if (obj is PdfBooleanObject) return ((PdfBooleanObject)obj).Value; throw new InvalidCastException("GetBoolean: Object is not a boolean."); } /// /// Converts the specified value to integer. /// If the value not exists, the function returns 0. /// If the value is not convertible, the function throws an InvalidCastException. /// If the index is out of range, the function throws an ArgumentOutOfRangeException. /// public int GetInteger(int index) { if (index < 0 || index >= Count) throw new ArgumentOutOfRangeException("index", index, PSSR.IndexOutOfRange); object obj = this[index]; if (obj == null) return 0; if (obj is PdfInteger) return ((PdfInteger)obj).Value; if (obj is PdfIntegerObject) return ((PdfIntegerObject)obj).Value; throw new InvalidCastException("GetInteger: Object is not an integer."); } /// /// Converts the specified value to double. /// If the value not exists, the function returns 0. /// If the value is not convertible, the function throws an InvalidCastException. /// If the index is out of range, the function throws an ArgumentOutOfRangeException. /// public double GetReal(int index) { if (index < 0 || index >= Count) throw new ArgumentOutOfRangeException("index", index, PSSR.IndexOutOfRange); object obj = this[index]; if (obj == null) return 0; if (obj is PdfReal) return ((PdfReal)obj).Value; else if (obj is PdfRealObject) return ((PdfRealObject)obj).Value; else if (obj is PdfInteger) return ((PdfInteger)obj).Value; else if (obj is PdfIntegerObject) return ((PdfIntegerObject)obj).Value; throw new InvalidCastException("GetReal: Object is not a number."); } /// /// Converts the specified value to string. /// If the value not exists, the function returns the empty string. /// If the value is not convertible, the function throws an InvalidCastException. /// If the index is out of range, the function throws an ArgumentOutOfRangeException. /// public string GetString(int index) { if (index < 0 || index >= Count) throw new ArgumentOutOfRangeException("index", index, PSSR.IndexOutOfRange); object obj = this[index]; if (obj == null) return ""; if (obj is PdfString) return ((PdfString)obj).Value; if (obj is PdfStringObject) return ((PdfStringObject)obj).Value; throw new InvalidCastException("GetString: Object is not an integer."); } /// /// Converts the specified value to a name. /// If the value not exists, the function returns the empty string. /// If the value is not convertible, the function throws an InvalidCastException. /// If the index is out of range, the function throws an ArgumentOutOfRangeException. /// public string GetName(int index) { if (index < 0 || index >= Count) throw new ArgumentOutOfRangeException("index", index, PSSR.IndexOutOfRange); object obj = this[index]; if (obj == null) return ""; if (obj is PdfName) return ((PdfName)obj).Value; if (obj is PdfNameObject) return ((PdfNameObject)obj).Value; throw new InvalidCastException("GetName: Object is not an integer."); } /// /// Returns the indirect object if the value at the specified index is a PdfReference. /// [Obsolete("Use GetObject, GetDictionary, GetArray, or GetReference")] public PdfObject GetIndirectObject(int index) { if (index < 0 || index >= Count) throw new ArgumentOutOfRangeException("index", index, PSSR.IndexOutOfRange); PdfItem item = this[index]; if (item is PdfReference) return ((PdfReference)item).Value; return null; } /// /// Gets the PdfObject with the specified index, or null, if no such object exists. If the index refers to /// a reference, the referenced PdfObject is returned. /// public PdfObject GetObject(int index) { if (index < 0 || index >= Count) throw new ArgumentOutOfRangeException("index", index, PSSR.IndexOutOfRange); PdfItem item = this[index]; if (item is PdfReference) return ((PdfReference)item).Value; return item as PdfObject; } /// /// Gets the PdfArray with the specified index, or null, if no such object exists. If the index refers to /// a reference, the referenced PdfArray is returned. /// public PdfDictionary GetDictionary(int index) { return GetObject(index) as PdfDictionary; } /// /// Gets the PdfArray with the specified index, or null, if no such object exists. If the index refers to /// a reference, the referenced PdfArray is returned. /// public PdfArray GetArray(int index) { return GetObject(index) as PdfArray; } /// /// Gets the PdfReference with the specified index, or null, if no such object exists. /// public PdfReference GetReference(int index) { PdfItem item = this[index]; return item as PdfReference; } /// /// Gets all items of this array. /// public PdfItem[] Items { get { return this.elements.ToArray(); } } ///// ///// INTERNAL USE ONLY. ///// //public List GetArrayList_() //{ // // I use this hack to order the pages by ZIP code (MigraDoc ControlCode-Generator) // // TODO: implement a clean solution // return this.elements; //} #region IList Members /// /// Returns false. /// public bool IsReadOnly { get { return false; } } //object IList.this[int index] //{ // get { return this.elements[index]; } // set { this.elements[index] = value as PdfItem; } //} /// /// Gets or sets an item at the specified index. /// /// public PdfItem this[int index] { get { return this.elements[index]; } set { if (value == null) throw new ArgumentNullException("value"); this.elements[index] = value; } } /// /// Removes the item at the specified index. /// public void RemoveAt(int index) { this.elements.RemoveAt(index); } /// /// Removes the first occurrence of a specific object from the array/>. /// public bool Remove(PdfItem item) { return this.elements.Remove(item); } /// /// Inserts the item the specified index. /// public void Insert(int index, PdfItem value) { this.elements.Insert(index, value); } /// /// Determines whether the specified value is in the array. /// public bool Contains(PdfItem value) { return this.elements.Contains(value); } /// /// Removes all items from the array. /// public void Clear() { this.elements.Clear(); } /// /// Gets the index of the specified item. /// public int IndexOf(PdfItem value) { return this.elements.IndexOf(value); } /// /// Appends the specified object to the array. /// public void Add(PdfItem value) { // TODO: ??? //Debug.Assert((value is PdfObject && ((PdfObject)value).Reference == null) | !(value is PdfObject), // "You try to set an indirect object directly into an array."); PdfObject obj = value as PdfObject; if (obj != null && obj.IsIndirect) this.elements.Add(obj.Reference); else this.elements.Add(value); } /// /// Returns false. /// public bool IsFixedSize { get { return false; } } #endregion #region ICollection Members /// /// Returns false. /// public bool IsSynchronized { get { return false; } } /// /// Gets the number of elements in the array. /// public int Count { get { return this.elements.Count; } } /// /// Copies the elements of the array to the specified array. /// public void CopyTo(PdfItem[] array, int index) { this.elements.CopyTo(array, index); } /// /// The current implementation return null. /// public object SyncRoot { get { return null; } } #endregion /// /// Returns an enumerator that iterates through the array. /// public IEnumerator GetEnumerator() { return this.elements.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return this.elements.GetEnumerator(); } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfDate.cs0000644000175000001440000000577611435766646021502 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Represents a direct date value. /// [DebuggerDisplay("({Value})")] public sealed class PdfDate : PdfItem { /// /// Initializes a new instance of the class. /// public PdfDate() { } /// /// Initializes a new instance of the class. /// public PdfDate(string value) { this.value = Parser.ParseDateTime(value, DateTime.MinValue); } /// /// Initializes a new instance of the class. /// public PdfDate(DateTime value) { this.value = value; } /// /// Gets the value as DateTime. /// public DateTime Value { // This class must behave like a value type. Therefore it cannot be changed (like System.String). get { return this.value; } } DateTime value; /// /// Returns the value in the PDF date format. /// public override string ToString() { string delta = this.value.ToString("zzz").Replace(':', '\''); return String.Format("D:{0:yyyyMMddHHmmss}{1}'", this.value, delta); } /// /// Writes the value in the PDF date format. /// internal override void WriteObject(PdfWriter writer) { writer.WriteDocString(ToString()); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/KeysMeta.cs0000644000175000001440000001421411437255665021674 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections.Generic; using System.Reflection; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Hold information about the value of a key in a dictionary. This information is used to create /// and interpret this value. /// internal sealed class KeyDescriptor { /// /// Initializes a new instance of KeyDescriptor from the specified attribute during a KeysMeta /// initializes itself using reflection. /// public KeyDescriptor(KeyInfoAttribute attribute) { this.version = attribute.Version; this.keyType = attribute.KeyType; this.fixedValue = attribute.FixedValue; this.objectType = attribute.ObjectType; if (this.version == "") version = "1.0"; } /// /// Gets or sets the PDF version starting with the availability of the described key. /// public string Version { get { return this.version; } set { this.version = value; } } string version; public KeyType KeyType { get { return this.keyType; } set { this.keyType = value; } } KeyType keyType; public string KeyValue { get { return this.keyValue; } set { this.keyValue = value; } } string keyValue; public string FixedValue { get { return this.fixedValue; } } string fixedValue; public Type ObjectType { get { return this.objectType; } set { this.objectType = value; } } Type objectType; public bool CanBeIndirect { get { return (this.keyType & KeyType.MustNotBeIndirect) == 0; } } /// /// Returns the type of the object to be created as value for the described key. /// public Type GetValueType() { Type type = this.objectType; if (type == null) { // If we have no ObjectType specified, use the KeyType enumeration. switch (this.keyType & KeyType.TypeMask) { case KeyType.Name: type = typeof(PdfName); break; case KeyType.String: type = typeof(PdfString); break; case KeyType.Boolean: type = typeof(PdfBoolean); break; case KeyType.Integer: type = typeof(PdfInteger); break; case KeyType.Real: type = typeof(PdfReal); break; case KeyType.Date: type = typeof(PdfDate); break; case KeyType.Rectangle: type = typeof(PdfRectangle); break; case KeyType.Array: type = typeof(PdfArray); break; case KeyType.Dictionary: type = typeof(PdfDictionary); break; case KeyType.Stream: type = typeof(PdfDictionary); break; // The following types are not yet used case KeyType.NumberTree: throw new NotImplementedException("KeyType.NumberTree"); case KeyType.NameOrArray: throw new NotImplementedException("KeyType.NameOrArray"); case KeyType.ArrayOrDictionary: throw new NotImplementedException("KeyType.ArrayOrDictionary"); case KeyType.StreamOrArray: throw new NotImplementedException("KeyType.StreamOrArray"); case KeyType.ArrayOrNameOrString: throw new NotImplementedException("KeyType.ArrayOrNameOrString"); default: Debug.Assert(false, "Invalid KeyType: " + this.keyType); break; } } return type; } } /// /// Contains meta information about all keys of a PDF dictionary. /// internal class DictionaryMeta { public DictionaryMeta(Type type) { FieldInfo[] fields = type.GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy); foreach (FieldInfo field in fields) { object[] attributes = field.GetCustomAttributes(typeof(KeyInfoAttribute), false); if (attributes.Length == 1) { KeyInfoAttribute attribute = (KeyInfoAttribute)attributes[0]; KeyDescriptor descriptor = new KeyDescriptor(attribute); descriptor.KeyValue = (string)field.GetValue(null); this.keyDescriptors[descriptor.KeyValue] = descriptor; } } } public KeyDescriptor this[string key] { get { return this.keyDescriptors[key]; } } readonly Dictionary keyDescriptors = new Dictionary(); } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfNullObject.cs0000644000175000001440000000512511435766646022652 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf { /// /// Represents an indirect null value. This type is not used by PDFsharp, but at least /// one tool from Adobe creates PDF files with a null object. /// public sealed class PdfNullObject : PdfObject { /// /// Initializes a new instance of the class. /// public PdfNullObject() { } /// /// Initializes a new instance of the class. /// /// The document. public PdfNullObject(PdfDocument document) : base(document) { } /// /// Returns the string "null". /// public override string ToString() { return "null"; } /// /// Writes the keyword null. /// internal override void WriteObject(PdfWriter writer) { writer.WriteBeginObject(this); writer.WriteRaw(" null "); writer.WriteEndObject(); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/KeysBase.cs0000644000175000001440000000332411435766646021664 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; namespace PdfSharp.Pdf { /// /// Base class for all dictionary Keys classes. /// public class KeysBase { // public KeysBase() { } internal static DictionaryMeta CreateMeta(Type type) { return new DictionaryMeta(type); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf/PdfString.cs0000644000175000001440000002312311435766646022055 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf { /// /// Determines the encoding of a PdfString or PdfStringObject. /// [Flags] public enum PdfStringEncoding { /// /// The characters of the string are actually bytes with an unknown or context specific meaning or encoding. /// With this encoding the 8 high bits of each character is zero. /// RawEncoding = 0x00, /// /// Not yet used by PDFsharp. /// StandardEncoding = 0x01, /// /// The characters of the string are actually bytes with PDF document encoding. /// With this encoding the 8 high bits of each character is zero. /// PDFDocEncoding = 0x02, /// /// The characters of the string are actually bytes with Windows ANSI encoding. /// With this encoding the 8 high bits of each character is zero. /// WinAnsiEncoding = 0x03, /// /// Not yet used by PDFsharp. /// MacRomanEncoding = 0x04, // not used by PDFsharp /// /// Not yet used by PDFsharp. /// MacExpertEncoding = 0x05, // not used by PDFsharp /// /// The characters of the string are Unicode characters. /// Unicode = 0x06, } /// /// Internal wrapper for PdfStringEncoding. /// [Flags] enum PdfStringFlags { RawEncoding = 0x00, StandardEncoding = 0x01, // not used by PDFsharp PDFDocEncoding = 0x02, WinAnsiEncoding = 0x03, MacRomanEncoding = 0x04, // not used by PDFsharp MacExpertEncoding = 0x05, // not used by PDFsharp Unicode = 0x06, EncodingMask = 0x0F, HexLiteral = 0x80, } /// /// Represents a direct text string value. /// [DebuggerDisplay("({Value})")] public sealed class PdfString : PdfItem { /// /// Initializes a new instance of the class. /// public PdfString() { this.flags = PdfStringFlags.RawEncoding; } /// /// Initializes a new instance of the class. /// /// The value. public PdfString(string value) { this.value = value; this.flags = PdfStringFlags.RawEncoding; } /// /// Initializes a new instance of the class. /// /// The value. /// The encoding. public PdfString(string value, PdfStringEncoding encoding) { this.value = value; //if ((flags & PdfStringFlags.EncodingMask) == 0) // flags |= PdfStringFlags.PDFDocEncoding; this.flags = (PdfStringFlags)encoding; } internal PdfString(string value, PdfStringFlags flags) { this.value = value; //if ((flags & PdfStringFlags.EncodingMask) == 0) // flags |= PdfStringFlags.PDFDocEncoding; this.flags = flags; } /// /// Gets the number of characters in this string. /// public int Length { get { return this.value == null ? 0 : this.value.Length; } } /// /// Gets the encoding. /// public PdfStringEncoding Encoding { get { return (PdfStringEncoding)(this.flags & PdfStringFlags.EncodingMask); } //set { this.flags = (this.flags & ~PdfStringFlags.EncodingMask) | ((PdfStringFlags)value & PdfStringFlags.EncodingMask);} } /// /// Gets a value indicating whether the string is a hexadecimal literal. /// public bool HexLiteral { get { return (this.flags & PdfStringFlags.HexLiteral) != 0; } //set { this.flags = value ? this.flags | PdfStringFlags.HexLiteral : this.flags & ~PdfStringFlags.HexLiteral;} } internal PdfStringFlags Flags { get { return this.flags; } //set { this.flags = value; } } PdfStringFlags flags; /// /// Gets the string value. /// public string Value { // This class must behave like a value type. Therefore it cannot be changed (like System.String). get { return this.value == null ? "" : this.value; } } string value; /// /// Gets or sets the string value for encryption purposes. /// internal byte[] EncryptionValue { // TODO: Unicode case is not handled! get { return this.value == null ? new byte[0] : PdfEncoders.RawEncoding.GetBytes(this.value); } // BUG: May lead to trouble with the value semantics of PdfString set { this.value = PdfEncoders.RawEncoding.GetString(value, 0, value.Length); } } /// /// Returns the string. /// public override string ToString() { return this.value; } /// /// Hack for document encoded bookmarks. /// public string ToStringFromPdfDocEncoded() { int length = this.value.Length; char[] bytes = new char[length]; for (int idx = 0; idx < length; idx++) { char ch = this.value[idx]; if (ch <= 255) { bytes[idx] = Encode[ch]; } else { Debugger.Break(); } } StringBuilder sb = new StringBuilder(length); for (int idx = 0; idx < length; idx++) sb.Append((char)bytes[idx]); return sb.ToString(); } static char[] Encode = new char[] { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0A', '\x0B', '\x0C', '\x0D', '\x0E', '\x0F', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1A', '\x1B', '\x1C', '\x1D', '\x1E', '\x1F', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2A', '\x2B', '\x2C', '\x2D', '\x2E', '\x2F', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3A', '\x3B', '\x3C', '\x3D', '\x3E', '\x3F', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4A', '\x4B', '\x4C', '\x4D', '\x4E', '\x4F', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5A', '\x5B', '\x5C', '\x5D', '\x5E', '\x5F', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6A', '\x6B', '\x6C', '\x6D', '\x6E', '\x6F', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7A', '\x7B', '\x7C', '\x7D', '\x7E', '\x7F', '\x2022', '\x2020', '\x2021', '\x2026', '\x2014', '\x2013', '\x0192', '\x2044', '\x2039', '\x203A', '\x2212', '\x2030', '\x201E', '\x201C', '\x201D', '\x2018', '\x2019', '\x201A', '\x2122', '\xFB01', '\xFB02', '\x0141', '\x0152', '\x0160', '\x0178', '\x017D', '\x0131', '\x0142', '\x0153', '\x0161', '\x017E', '\xFFFD', '\x20AC', '\xA1', '\xA2', '\xA3', '\xA4', '\xA5', '\xA6', '\xA7', '\xA8', '\xA9', '\xAA', '\xAB', '\xAC', '\xAD', '\xAE', '\xAF', '\xB0', '\xB1', '\xB2', '\xB3', '\xB4', '\xB5', '\xB6', '\xB7', '\xB8', '\xB9', '\xBA', '\xBB', '\xBC', '\xBD', '\xBE', '\xBF', '\xC0', '\xC1', '\xC2', '\xC3', '\xC4', '\xC5', '\xC6', '\xC7', '\xC8', '\xC9', '\xCA', '\xCB', '\xCC', '\xCD', '\xCE', '\xCF', '\xD0', '\xD1', '\xD2', '\xD3', '\xD4', '\xD5', '\xD6', '\xD7', '\xD8', '\xD9', '\xDA', '\xDB', '\xDC', '\xDD', '\xDE', '\xDF', '\xE0', '\xE1', '\xE2', '\xE3', '\xE4', '\xE5', '\xE6', '\xE7', '\xE8', '\xE9', '\xEA', '\xEB', '\xEC', '\xED', '\xEE', '\xEF', '\xF0', '\xF1', '\xF2', '\xF3', '\xF4', '\xF5', '\xF6', '\xF7', '\xF8', '\xF9', '\xFA', '\xFB', '\xFC', '\xFD', '\xFE', '\xFF', }; /// /// Writes the string DocEncoded. /// internal override void WriteObject(PdfWriter writer) { writer.Write(this); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.Pdf/0000777000175000001440000000000011533760020021176 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.Pdf/XGraphicsPdfRenderer.cs0000644000175000001440000017210511435766646025565 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.Collections.Generic; using System.Text; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Internal; using PdfSharp.Pdf; using PdfSharp.Fonts; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf.Internal; using PdfSharp.Pdf.Advanced; namespace PdfSharp.Drawing.Pdf { /// /// Represents a drawing surface for PdfPages. /// class XGraphicsPdfRenderer : IXGraphicsRenderer { public XGraphicsPdfRenderer(PdfPage page, XGraphics gfx, XGraphicsPdfPageOptions options) { this.page = page; this.colorMode = page.document.Options.ColorMode; this.options = options; #if MIGRADOC this.options = options & ~XGraphicsPdfPageOptions.PDFlibHack; pdflibHack = (options & XGraphicsPdfPageOptions.PDFlibHack) != 0; #endif this.gfx = gfx; this.content = new StringBuilder(); page.RenderContent.pdfRenderer = this; this.gfxState = new PdfGraphicsState(this); } #if MIGRADOC bool pdflibHack; #endif public XGraphicsPdfRenderer(XForm form, XGraphics gfx) { this.form = form; this.colorMode = form.Owner.Options.ColorMode; this.gfx = gfx; this.content = new StringBuilder(); form.pdfRenderer = this; this.gfxState = new PdfGraphicsState(this); } /// /// Gets the content created by this renderer. /// string GetContent() { EndPage(); return this.content.ToString(); } public XGraphicsPdfPageOptions PageOptions { get { return this.options; } } public void Close() { if (this.page != null) { PdfContent content = page.RenderContent; content.CreateStream(PdfEncoders.RawEncoding.GetBytes(GetContent())); this.gfx = null; this.page.RenderContent.pdfRenderer = null; this.page.RenderContent = null; this.page = null; } else if (this.form != null) { this.form.pdfForm.CreateStream(PdfEncoders.RawEncoding.GetBytes(GetContent())); this.gfx = null; this.form.pdfRenderer = null; this.form = null; } } // -------------------------------------------------------------------------------------------- #region Drawing //void SetPageLayout(down, point(0, 0), unit // ----- Clear -------------------------------------------------------------------------------- public void Clear(XColor color) { if (!this.gfx.transform.IsIdentity) throw new NotImplementedException("Transform must be identity to clear the canvas."); // TODO: this is implementation is bogus. Reset transformation to identity an then fill XBrush brush = new XSolidBrush(color); DrawRectangle(null, brush, 0, 0, Size.Width, Size.Height); } // ----- DrawLine ----------------------------------------------------------------------------- /// /// Strokes a single connection of two points. /// public void DrawLine(XPen pen, double x1, double y1, double x2, double y2) { DrawLines(pen, new XPoint[2] { new XPoint(x1, y1), new XPoint(x2, y2) }); } // ----- DrawLines ---------------------------------------------------------------------------- /// /// Strokes a series of connected points. /// public void DrawLines(XPen pen, XPoint[] points) { if (pen == null) throw new ArgumentNullException("pen"); if (points == null) throw new ArgumentNullException("points"); int count = points.Length; if (count == 0) return; Realize(pen); AppendFormat("{0:0.###} {1:0.###} m\n", points[0].X, points[0].Y); for (int idx = 1; idx < count; idx++) AppendFormat("{0:0.###} {1:0.###} l\n", points[idx].X, points[idx].Y); this.content.Append("S\n"); } // ----- DrawBezier --------------------------------------------------------------------------- public void DrawBezier(XPen pen, double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { DrawBeziers(pen, new XPoint[4] { new XPoint(x1, y1), new XPoint(x2, y2), new XPoint(x3, y3), new XPoint(x4, y4) }); } // ----- DrawBeziers -------------------------------------------------------------------------- public void DrawBeziers(XPen pen, XPoint[] points) { if (pen == null) throw new ArgumentNullException("pen"); if (points == null) throw new ArgumentNullException("points"); int count = points.Length; if (count == 0) return; if ((count - 1) % 3 != 0) throw new ArgumentException("Invalid number of points for bezier curves. Number must fulfil 4+3n.", "points"); Realize(pen); AppendFormat("{0:0.####} {1:0.####} m\n", points[0].X, points[0].Y); for (int idx = 1; idx < count; idx += 3) AppendFormat("{0:0.####} {1:0.####} {2:0.####} {3:0.####} {4:0.####} {5:0.####} c\n", points[idx].X, points[idx].Y, points[idx + 1].X, points[idx + 1].Y, points[idx + 2].X, points[idx + 2].Y); AppendStrokeFill(pen, null, XFillMode.Alternate, false); } // ----- DrawCurve ---------------------------------------------------------------------------- public void DrawCurve(XPen pen, XPoint[] points, double tension) { if (pen == null) throw new ArgumentNullException("pen"); if (points == null) throw new ArgumentNullException("points"); int count = points.Length; if (count == 0) return; if (count < 2) throw new ArgumentException("Not enough points", "points"); // See http://pubpages.unh.edu/~cs770/a5/cardinal.html tension /= 3; Realize(pen); AppendFormat("{0:0.###} {1:0.###} m\n", points[0].X, points[0].Y); if (count == 2) { // Just draws a line... AppendCurveSegment(points[0], points[0], points[1], points[1], tension); } else { AppendCurveSegment(points[0], points[0], points[1], points[2], tension); for (int idx = 1; idx < count - 2; idx++) AppendCurveSegment(points[idx - 1], points[idx], points[idx + 1], points[idx + 2], tension); AppendCurveSegment(points[count - 3], points[count - 2], points[count - 1], points[count - 1], tension); } AppendStrokeFill(pen, null, XFillMode.Alternate, false); } // ----- DrawArc ------------------------------------------------------------------------------ public void DrawArc(XPen pen, double x, double y, double width, double height, double startAngle, double sweepAngle) { if (pen == null) throw new ArgumentNullException("pen"); Realize(pen); AppendPartialArc(x, y, width, height, startAngle, sweepAngle, PathStart.MoveTo1st, new XMatrix()); AppendStrokeFill(pen, null, XFillMode.Alternate, false); } // ----- DrawRectangle ------------------------------------------------------------------------ public void DrawRectangle(XPen pen, XBrush brush, double x, double y, double width, double height) { if (pen == null && brush == null) throw new ArgumentNullException("pen and brush"); Realize(pen, brush); AppendFormat("{0:0.###} {1:0.###} {2:0.###} {3:0.###} re\n", x, y, width, height); if (pen != null && brush != null) this.content.Append("B\n"); else if (pen != null) this.content.Append("S\n"); else this.content.Append("f\n"); } // ----- DrawRectangles ----------------------------------------------------------------------- public void DrawRectangles(XPen pen, XBrush brush, XRect[] rects) { int count = rects.Length; for (int idx = 0; idx < count; idx++) { XRect rect = rects[idx]; DrawRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); } } // ----- DrawRoundedRectangle ----------------------------------------------------------------- public void DrawRoundedRectangle(XPen pen, XBrush brush, double x, double y, double width, double height, double ellipseWidth, double ellipseHeight) { XGraphicsPath path = new XGraphicsPath(); path.AddRoundedRectangle(x, y, width, height, ellipseWidth, ellipseHeight); DrawPath(pen, brush, path); } // ----- DrawEllipse -------------------------------------------------------------------------- public void DrawEllipse(XPen pen, XBrush brush, double x, double y, double width, double height) { Realize(pen, brush); // Useful information are here http://home.t-online.de/home/Robert.Rossmair/ellipse.htm // or here http://www.whizkidtech.redprince.net/bezier/circle/ // Deeper but more difficult: http://www.tinaja.com/cubic01.asp // Petzold: 4/3 * tan(α / 4) const double κ = 0.5522847498; // := 4/3 * (1 - cos(-π/4)) / sin(π/4)) <=> 4/3 * sqrt(2) - 1 XRect rect = new XRect(x, y, width, height); double δx = rect.Width / 2; double δy = rect.Height / 2; double fx = δx * κ; double fy = δy * κ; double x0 = rect.X + δx; double y0 = rect.Y + δy; AppendFormat("{0:0.####} {1:0.####} m\n", x0 + δx, y0); AppendFormat("{0:0.####} {1:0.####} {2:0.####} {3:0.####} {4:0.####} {5:0.####} c\n", x0 + δx, y0 + fy, x0 + fx, y0 + δy, x0, y0 + δy); AppendFormat("{0:0.####} {1:0.####} {2:0.####} {3:0.####} {4:0.####} {5:0.####} c\n", x0 - fx, y0 + δy, x0 - δx, y0 + fy, x0 - δx, y0); AppendFormat("{0:0.####} {1:0.####} {2:0.####} {3:0.####} {4:0.####} {5:0.####} c\n", x0 - δx, y0 - fy, x0 - fx, y0 - δy, x0, y0 - δy); AppendFormat("{0:0.####} {1:0.####} {2:0.####} {3:0.####} {4:0.####} {5:0.####} c\n", x0 + fx, y0 - δy, x0 + δx, y0 - fy, x0 + δx, y0); AppendStrokeFill(pen, brush, XFillMode.Winding, true); } // ----- DrawPolygon -------------------------------------------------------------------------- public void DrawPolygon(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode) { Realize(pen, brush); int count = points.Length; if (points.Length < 2) throw new ArgumentException("points", PSSR.PointArrayAtLeast(2)); AppendFormat("{0:0.####} {1:0.####} m\n", points[0].X, points[0].Y); for (int idx = 1; idx < count; idx++) AppendFormat("{0:0.####} {1:0.####} l\n", points[idx].X, points[idx].Y); AppendStrokeFill(pen, brush, fillmode, true); } // ----- DrawPie ------------------------------------------------------------------------------ public void DrawPie(XPen pen, XBrush brush, double x, double y, double width, double height, double startAngle, double sweepAngle) { Realize(pen, brush); AppendFormat("{0:0.####} {1:0.####} m\n", x + width / 2, y + height / 2); AppendPartialArc(x, y, width, height, startAngle, sweepAngle, PathStart.LineTo1st, new XMatrix()); AppendStrokeFill(pen, brush, XFillMode.Alternate, true); } // ----- DrawClosedCurve ---------------------------------------------------------------------- public void DrawClosedCurve(XPen pen, XBrush brush, XPoint[] points, double tension, XFillMode fillmode) { int count = points.Length; if (count == 0) return; if (count < 2) throw new ArgumentException("Not enough points", "points"); // Simply tried out. Not proofed why it is correct. tension /= 3; Realize(pen, brush); AppendFormat("{0:0.####} {1:0.####} m\n", points[0].X, points[0].Y); if (count == 2) { // Just draws a line... AppendCurveSegment(points[0], points[0], points[1], points[1], tension); } else { AppendCurveSegment(points[count - 1], points[0], points[1], points[2], tension); for (int idx = 1; idx < count - 2; idx++) AppendCurveSegment(points[idx - 1], points[idx], points[idx + 1], points[idx + 2], tension); AppendCurveSegment(points[count - 3], points[count - 2], points[count - 1], points[0], tension); AppendCurveSegment(points[count - 2], points[count - 1], points[0], points[1], tension); } AppendStrokeFill(pen, brush, fillmode, true); } // ----- DrawPath ----------------------------------------------------------------------------- public void DrawPath(XPen pen, XBrush brush, XGraphicsPath path) { if (pen == null && brush == null) throw new ArgumentNullException("pen"); #if GDI && !WPF Realize(pen, brush); AppendPath(path.gdipPath); AppendStrokeFill(pen, brush, path.FillMode, false); #endif #if WPF && !GDI Realize(pen, brush); AppendPath(path.pathGeometry); AppendStrokeFill(pen, brush, path.FillMode, false); #endif #if WPF && GDI Realize(pen, brush); if (this.gfx.targetContext == XGraphicTargetContext.GDI) AppendPath(path.gdipPath); else AppendPath(path.pathGeometry); AppendStrokeFill(pen, brush, path.FillMode, false); #endif } // ----- DrawString --------------------------------------------------------------------------- public void DrawString(string s, XFont font, XBrush brush, XRect rect, XStringFormat format) { Realize(font, brush, 0); double x = rect.X; double y = rect.Y; double lineSpace = font.GetHeight(this.gfx); //int cellSpace = font.cellSpace; // font.FontFamily.GetLineSpacing(font.Style); //int cellAscent = font.cellAscent; // font.FontFamily.GetCellAscent(font.Style); //int cellDescent = font.cellDescent; // font.FontFamily.GetCellDescent(font.Style); //double cyAscent = lineSpace * cellAscent / cellSpace; //double cyDescent = lineSpace * cellDescent / cellSpace; double cyAscent = lineSpace * font.cellAscent / font.cellSpace; double cyDescent = lineSpace * font.cellDescent / font.cellSpace; double width = this.gfx.MeasureString(s, font).Width; bool bold = (font.Style & XFontStyle.Bold) != 0; bool italic = (font.Style & XFontStyle.Italic) != 0; bool strikeout = (font.Style & XFontStyle.Strikeout) != 0; bool underline = (font.Style & XFontStyle.Underline) != 0; switch (format.Alignment) { case XStringAlignment.Near: // nothing to do break; case XStringAlignment.Center: x += (rect.Width - width) / 2; break; case XStringAlignment.Far: x += rect.Width - width; break; } if (Gfx.PageDirection == XPageDirection.Downwards) { switch (format.LineAlignment) { case XLineAlignment.Near: y += cyAscent; break; case XLineAlignment.Center: // TODO use CapHeight. PDFlib also uses 3/4 of ascent y += (cyAscent * 3 / 4) / 2 + rect.Height / 2; break; case XLineAlignment.Far: y += -cyDescent + rect.Height; break; case XLineAlignment.BaseLine: // nothing to do break; } } else { switch (format.LineAlignment) { case XLineAlignment.Near: y += cyDescent; break; case XLineAlignment.Center: // TODO use CapHeight. PDFlib also uses 3/4 of ascent y += -(cyAscent * 3 / 4) / 2 + rect.Height / 2; break; case XLineAlignment.Far: y += -cyAscent + rect.Height; break; case XLineAlignment.BaseLine: // nothing to do break; } } PdfFont realizedFont = this.gfxState.realizedFont; Debug.Assert(realizedFont != null); realizedFont.AddChars(s); OpenTypeDescriptor descriptor = realizedFont.FontDescriptor.descriptor; if (bold && !descriptor.IsBoldFace) { // TODO: emulate bold by thicker outline } if (italic && !descriptor.IsBoldFace) { // TODO: emulate italic by shearing transformation } if (font.Unicode) { string s2 = ""; for (int idx = 0; idx < s.Length; idx++) { char ch = s[idx]; int glyphID = 0; if (descriptor.fontData.cmap.symbol) { glyphID = (int)ch + (descriptor.fontData.os2.usFirstCharIndex & 0xFF00); glyphID = descriptor.CharCodeToGlyphIndex((char)glyphID); } else glyphID = descriptor.CharCodeToGlyphIndex(ch); s2 += (char)glyphID; } s = s2; byte[] bytes = PdfEncoders.RawUnicodeEncoding.GetBytes(s); bytes = PdfEncoders.FormatStringLiteral(bytes, true, false, true, null); string text = PdfEncoders.RawEncoding.GetString(bytes, 0, bytes.Length); XPoint pos = new XPoint(x, y); AdjustTextMatrix(ref pos); AppendFormat( "{0:0.####} {1:0.####} Td {2} Tj\n", pos.x, pos.y, text); //PdfEncoders.ToStringLiteral(s, PdfStringEncoding.RawEncoding, null)); } else { byte[] bytes = PdfEncoders.WinAnsiEncoding.GetBytes(s); XPoint pos = new XPoint(x, y); AdjustTextMatrix(ref pos); AppendFormat( "{0:0.####} {1:0.####} Td {2} Tj\n", pos.x, pos.y, PdfEncoders.ToStringLiteral(bytes, false, null)); } if (underline) { double underlinePosition = lineSpace * realizedFont.FontDescriptor.descriptor.UnderlinePosition / font.cellSpace; double underlineThickness = lineSpace * realizedFont.FontDescriptor.descriptor.UnderlineThickness / font.cellSpace; DrawRectangle(null, brush, x, y - underlinePosition, width, underlineThickness); } if (strikeout) { double strikeoutPosition = lineSpace * realizedFont.FontDescriptor.descriptor.StrikeoutPosition / font.cellSpace; double strikeoutSize = lineSpace * realizedFont.FontDescriptor.descriptor.StrikeoutSize / font.cellSpace; DrawRectangle(null, brush, x, y - strikeoutPosition - strikeoutSize, width, strikeoutSize); } } // ----- DrawImage ---------------------------------------------------------------------------- //public void DrawImage(Image image, Point point); //public void DrawImage(Image image, PointF point); //public void DrawImage(Image image, Point[] destPoints); //public void DrawImage(Image image, PointF[] destPoints); //public void DrawImage(Image image, Rectangle rect); //public void DrawImage(Image image, RectangleF rect); //public void DrawImage(Image image, int x, int y); //public void DrawImage(Image image, float x, float y); //public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit); //public void DrawImage(Image image, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit); //public void DrawImage(Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit); //public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit); //public void DrawImage(Image image, int x, int y, Rectangle srcRect, GraphicsUnit srcUnit); //public void DrawImage(Image image, float x, float y, RectangleF srcRect, GraphicsUnit srcUnit); //public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr); //public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr); //public void DrawImage(Image image, int x, int y, int width, int height); //public void DrawImage(Image image, float x, float y, float width, float height); //public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback); //public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback); //public void DrawImage(Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit); //public void DrawImage(Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit); //public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData); //public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData); //public void DrawImage(Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr); //public void DrawImage(Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs); //public void DrawImage(Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback); //public void DrawImage(Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback); //public void DrawImage(Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData); //public void DrawImage(Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes public void DrawImage(XImage image, double x, double y, double width, double height) { string name = Realize(image); if (!(image is XForm)) { if (this.gfx.PageDirection == XPageDirection.Downwards) { AppendFormat("q {2:0.####} 0 0 -{3:0.####} {0:0.####} {4:0.####} cm {5} Do Q\n", x, y, width, height, y + height, name); } else { AppendFormat("q {2:0.####} 0 0 {3:0.####} {0:0.####} {1:0.####} cm {4} Do Q\n", x, y, width, height, name); } } else { BeginPage(); XForm form = (XForm)image; form.Finish(); PdfFormXObject pdfForm = Owner.FormTable.GetForm(form); double cx = width / image.PointWidth; double cy = height / image.PointHeight; if (cx != 0 && cy != 0) { if (this.gfx.PageDirection == XPageDirection.Downwards) { AppendFormat("q {2:0.####} 0 0 -{3:0.####} {0:0.####} {4:0.####} cm 100 Tz {5} Do Q\n", x, y, cx, cy, y + height, name); } else { AppendFormat("q {2:0.####} 0 0 {3:0.####} {0:0.####} {1:0.####} cm {4} Do Q\n", x, y, cx, cy, name); } } } } // TODO: incomplete - srcRect not used public void DrawImage(XImage image, XRect destRect, XRect srcRect, XGraphicsUnit srcUnit) { double x = destRect.X; double y = destRect.Y; double width = destRect.Width; double height = destRect.Height; string name = Realize(image); if (!(image is XForm)) { if (this.gfx.PageDirection == XPageDirection.Downwards) { AppendFormat("q {2:0.####} 0 0 -{3:0.####} {0:0.####} {4:0.####} cm {5} Do\nQ\n", x, y, width, height, y + height, name); } else { AppendFormat("q {2:0.####} 0 0 {3:0.####} {0:0.####} {1:0.####} cm {4} Do Q\n", x, y, width, height, name); } } else { BeginPage(); XForm xForm = (XForm)image; xForm.Finish(); PdfFormXObject pdfForm = Owner.FormTable.GetForm(xForm); double cx = width / image.PointWidth; double cy = height / image.PointHeight; if (cx != 0 && cy != 0) { if (this.gfx.PageDirection == XPageDirection.Downwards) { AppendFormat("q {2:0.####} 0 0 -{3:0.####} {0:0.####} {4:0.####} cm 100 Tz {5} Do Q\n", x, y, cx, cy, y + height, name); } else { AppendFormat("q {2:0.####} 0 0 {3:0.####} {0:0.####} {1:0.####} cm {4} Do Q\n", x, y, cx, cy, name); } } } } #endregion // -------------------------------------------------------------------------------------------- #region Save and Restore /// /// Clones the current graphics state and push it on a stack. /// public void Save(XGraphicsState state) { // Before saving, the current transformation matrix must be completely realized. BeginGraphic(); RealizeTransform(); // Associate the XGraphicsState with the current PdgGraphicsState. this.gfxState.InternalState = state.InternalState; SaveState(); } public void Restore(XGraphicsState state) { BeginGraphic(); RestoreState(state.InternalState); } public void BeginContainer(XGraphicsContainer container, XRect dstrect, XRect srcrect, XGraphicsUnit unit) { // Before saving, the current transformation matrix must be completely realized. BeginGraphic(); RealizeTransform(); this.gfxState.InternalState = container.InternalState; SaveState(); //throw new NotImplementedException("BeginContainer"); // PdfGraphicsState pdfstate = (PdfGraphicsState)this.gfxState.Clone(); // this.gfxStateStack.Push(pdfstate); // container.Handle = pdfstate; // container.Handle = this.gfxState.Clone(); // Matrix matrix = new Matrix(); // matrix.Translate(srcrect.X, srcrect.Y); // matrix.Scale(dstrect.Width / srcrect.Width, dstrect.Height / srcrect.Height); // matrix.Translate(dstrect.X, dstrect.Y); // Transform = matrix; } public void EndContainer(XGraphicsContainer container) { BeginGraphic(); RestoreState(container.InternalState); // PdfGraphicsState pdfstate = (PdfGraphicsState)container.Handle; // this.dirty |= DirtyFlags.Ctm; // this.gfxState = pdfstate; } #endregion // -------------------------------------------------------------------------------------------- #region Transformation public void SetPageTransform(XPageDirection direction, XPoint origion, XGraphicsUnit unit) { if (this.gfxStateStack.Count > 0) throw new InvalidOperationException("PageTransformation can be modified only when the graphics stack is empty."); throw new NotImplementedException("SetPageTransform"); } //public void TranslateTransform(double dx, double dy, XMatrixOrder order) //{ //} // //public void ScaleTransform(double scaleX, double scaleY, XMatrixOrder order) //{ //} // //public void ScaleTransform(double scaleXY, XMatrixOrder order) //{ //} // //public void RotateTransform(double angle, XMatrixOrder order) //{ //} // //public void MultiplyTransform(XMatrix matrix, XMatrixOrder order) //{ //} public XMatrix Transform { //get {return this.gfxState.Ctm;} set { this.gfxState.Transform = value; } } #endregion // -------------------------------------------------------------------------------------------- #region Clipping public void SetClip(XGraphicsPath path, XCombineMode combineMode) { if (path == null) throw new NotImplementedException("SetClip with no path."); // Ensure that the graphics state stack level is at least 2, because otherwise an error // occurs when someone set the clip region before something was drawn. if (this.gfxState.Level < GraphicsStackLevelWorldSpace) RealizeTransform(); // TODO: refactor this function if (combineMode == XCombineMode.Replace) { if (this.clipLevel != 0) { if (this.clipLevel != this.gfxState.Level) throw new NotImplementedException("Cannot set new clip region in an inner graphic state level."); else ResetClip(); } this.clipLevel = this.gfxState.Level; } else if (combineMode == XCombineMode.Intersect) { if (this.clipLevel == 0) this.clipLevel = this.gfxState.Level; } else { Debug.Assert(false, "Invalid XCombineMode in internal function."); } this.gfxState.SetAndRealizeClipPath(path); } /// /// Sets the clip path empty. Only possible if graphic state level has the same value as it has when /// the first time SetClip was invoked. /// public void ResetClip() { // No clip level means no clipping occurs and nothing is to do. if (this.clipLevel == 0) return; // Only at the clipLevel the clipping can be reset. if (this.clipLevel != this.gfxState.Level) throw new NotImplementedException("Cannot reset clip region in an inner graphic state level."); // Must be in graphical mode before popping the graphics state. BeginGraphic(); // Save InternalGraphicsState and transformation of the current graphical state. InternalGraphicsState state = this.gfxState.InternalState; XMatrix ctm = this.gfxState.Transform; // Empty clip path by switching back to the previous state. RestoreState(); SaveState(); // Save internal state this.gfxState.InternalState = state; // Restore CTM this.gfxState.Transform = ctm; } /// /// The nesting level of the PDF graphics state stack when the clip region was set to non empty. /// Because of the way PDF is made the clip region can only be reset at this level. /// int clipLevel; #endregion // -------------------------------------------------------------------------------------------- #region Miscellaneous /// /// Writes a comment to the PDF content stream. May be useful for debugging purposes. /// public void WriteComment(string comment) { comment.Replace("\n", "\n% "); // TODO: Some more checks necessary? Append("% " + comment + "\n"); } #endregion // -------------------------------------------------------------------------------------------- #region Append to PDF stream /// /// Appends one or up to five Bézier curves that interpolate the arc. /// void AppendPartialArc(double x, double y, double width, double height, double startAngle, double sweepAngle, PathStart pathStart, XMatrix matrix) { // Normalize the angles double α = startAngle; if (α < 0) α = α + (1 + Math.Floor((Math.Abs(α) / 360))) * 360; else if (α > 360) α = α - Math.Floor(α / 360) * 360; Debug.Assert(α >= 0 && α <= 360); double β = sweepAngle; if (β < -360) β = -360; else if (β > 360) β = 360; if (α == 0 && β < 0) α = 360; else if (α == 360 && β > 0) α = 0; // Is it possible that the arc is small starts and ends in same quadrant? bool smallAngle = Math.Abs(β) <= 90; β = α + β; if (β < 0) β = β + (1 + Math.Floor((Math.Abs(β) / 360))) * 360; bool clockwise = sweepAngle > 0; int startQuadrant = Quatrant(α, true, clockwise); int endQuadrant = Quatrant(β, false, clockwise); if (startQuadrant == endQuadrant && smallAngle) AppendPartialArcQuadrant(x, y, width, height, α, β, pathStart, matrix); else { int currentQuadrant = startQuadrant; bool firstLoop = true; do { if (currentQuadrant == startQuadrant && firstLoop) { double ξ = currentQuadrant * 90 + (clockwise ? 90 : 0); AppendPartialArcQuadrant(x, y, width, height, α, ξ, pathStart, matrix); } else if (currentQuadrant == endQuadrant) { double ξ = currentQuadrant * 90 + (clockwise ? 0 : 90); AppendPartialArcQuadrant(x, y, width, height, ξ, β, PathStart.Ignore1st, matrix); } else { double ξ1 = currentQuadrant * 90 + (clockwise ? 0 : 90); double ξ2 = currentQuadrant * 90 + (clockwise ? 90 : 0); AppendPartialArcQuadrant(x, y, width, height, ξ1, ξ2, PathStart.Ignore1st, matrix); } // Don't stop immediately if arc is greater than 270 degrees if (currentQuadrant == endQuadrant && smallAngle) break; else smallAngle = true; if (clockwise) currentQuadrant = currentQuadrant == 3 ? 0 : currentQuadrant + 1; else currentQuadrant = currentQuadrant == 0 ? 3 : currentQuadrant - 1; firstLoop = false; } while (true); } } /// /// Gets the quadrant (0 through 3) of the specified angle. If the angle lies on an edge /// (0, 90, 180, etc.) the result depends on the details how the angle is used. /// int Quatrant(double φ, bool start, bool clockwise) { Debug.Assert(φ >= 0); if (φ > 360) φ = φ - Math.Floor(φ / 360) * 360; int quadrant = (int)(φ / 90); if (quadrant * 90 == φ) { if ((start && !clockwise) || (!start && clockwise)) quadrant = quadrant == 0 ? 3 : quadrant - 1; } else quadrant = clockwise ? ((int)Math.Floor(φ / 90)) % 4 : (int)Math.Floor(φ / 90); return quadrant; } /// /// Appends a Bézier curve for an arc within a quadrant. /// void AppendPartialArcQuadrant(double x, double y, double width, double height, double α, double β, PathStart pathStart, XMatrix matrix) { Debug.Assert(α >= 0 && α <= 360); Debug.Assert(β >= 0); if (β > 360) β = β - Math.Floor(β / 360) * 360; Debug.Assert(Math.Abs(α - β) <= 90); // Scanling factor double δx = width / 2; double δy = height / 2; // Center of ellipse double x0 = x + δx; double y0 = y + δy; // We have the following quarters: // | // 2 | 3 // ----+----- // 1 | 0 // | // If the angles lie in quarter 2 or 3, their values are subtracted by 180 and the // resulting curve is reflected at the center. This algorithm works as expected (simply tried out). // There may be a mathematically more elegant solution... bool reflect = false; if (α >= 180 && β >= 180) { α -= 180; β -= 180; reflect = true; } double cosα, cosβ, sinα, sinβ; if (width == height) { // Circular arc needs no correction. α = α * Calc.Deg2Rad; β = β * Calc.Deg2Rad; } else { // Elliptic arc needs the angles to be adjusted such that the scaling transformation is compensated. α = α * Calc.Deg2Rad; sinα = Math.Sin(α); if (Math.Abs(sinα) > 1E-10) α = Calc.πHalf - Math.Atan(δy * Math.Cos(α) / (δx * sinα)); β = β * Calc.Deg2Rad; sinβ = Math.Sin(β); if (Math.Abs(sinβ) > 1E-10) β = Calc.πHalf - Math.Atan(δy * Math.Cos(β) / (δx * sinβ)); } double κ = 4 * (1 - Math.Cos((α - β) / 2)) / (3 * Math.Sin((β - α) / 2)); sinα = Math.Sin(α); cosα = Math.Cos(α); sinβ = Math.Sin(β); cosβ = Math.Cos(β); XPoint pt1, pt2, pt3; if (!reflect) { // Calculation for quarter 0 and 1 switch (pathStart) { case PathStart.MoveTo1st: pt1 = matrix.Transform(new XPoint(x0 + δx * cosα, y0 + δy * sinα)); AppendFormat("{0:0.###} {1:0.###} m\n", pt1.x, pt1.y); break; case PathStart.LineTo1st: pt1 = matrix.Transform(new XPoint(x0 + δx * cosα, y0 + δy * sinα)); AppendFormat("{0:0.###} {1:0.###} l\n", pt1.x, pt1.y); break; case PathStart.Ignore1st: break; } pt1 = matrix.Transform(new XPoint(x0 + δx * (cosα - κ * sinα), y0 + δy * (sinα + κ * cosα))); pt2 = matrix.Transform(new XPoint(x0 + δx * (cosβ + κ * sinβ), y0 + δy * (sinβ - κ * cosβ))); pt3 = matrix.Transform(new XPoint(x0 + δx * cosβ, y0 + δy * sinβ)); AppendFormat("{0:0.###} {1:0.###} {2:0.###} {3:0.###} {4:0.###} {5:0.###} c\n", pt1.x, pt1.y, pt2.x, pt2.y, pt3.x, pt3.y); } else { // Calculation for quarter 2 and 3 switch (pathStart) { case PathStart.MoveTo1st: pt1 = matrix.Transform(new XPoint(x0 - δx * cosα, y0 - δy * sinα)); AppendFormat("{0:0.###} {1:0.###} m\n", pt1.x, pt1.y); break; case PathStart.LineTo1st: pt1 = matrix.Transform(new XPoint(x0 - δx * cosα, y0 - δy * sinα)); AppendFormat("{0:0.###} {1:0.###} l\n", pt1.x, pt1.y); break; case PathStart.Ignore1st: break; } pt1 = matrix.Transform(new XPoint(x0 - δx * (cosα - κ * sinα), y0 - δy * (sinα + κ * cosα))); pt2 = matrix.Transform(new XPoint(x0 - δx * (cosβ + κ * sinβ), y0 - δy * (sinβ - κ * cosβ))); pt3 = matrix.Transform(new XPoint(x0 - δx * cosβ, y0 - δy * sinβ)); AppendFormat("{0:0.###} {1:0.###} {2:0.###} {3:0.###} {4:0.###} {5:0.###} c\n", pt1.x, pt1.y, pt2.x, pt2.y, pt3.x, pt3.y); } } #if WPF void AppendPartialArc(System.Windows.Point point1, System.Windows.Point point2, double rotationAngle, System.Windows.Size size, bool isLargeArc, System.Windows.Media.SweepDirection sweepDirection, PathStart pathStart) { #if true //AppendPartialArc(currentPoint, seg.Point, seg.RotationAngle, seg.Size, seg.IsLargeArc, seg.SweepDirection, PathStart.Ignore1st); int pieces; PointCollection points = GeometryHelper.ArcToBezier(point1.X, point1.Y, size.Width, size.Height, rotationAngle, isLargeArc, sweepDirection == SweepDirection.Clockwise, point2.X, point2.Y, out pieces); int count = points.Count; int start = count % 3 == 1 ? 1 : 0; if (start == 1) AppendFormat("{0:0.####} {1:0.####} m\n", points[0].X, points[0].Y); for (int idx = start; idx < count; idx += 3) AppendFormat("{0:0.####} {1:0.####} {2:0.####} {3:0.####} {4:0.####} {5:0.####} c\n", points[idx].X, points[idx].Y, points[idx + 1].X, points[idx + 1].Y, points[idx + 2].X, points[idx + 2].Y); #else List points = GeometryHelper.BezierCurveFromArc((XPoint)point1, (XPoint)point2, rotationAngle, (XSize)size, isLargeArc, sweepDirection == SweepDirection.Clockwise, pathStart); int count = points.Count; int start = count % 3 == 1 ? 1 : 0; if (start == 1) AppendFormat("{0:0.####} {1:0.####} m\n", points[0].X, points[0].Y); for (int idx = start; idx < count; idx += 3) AppendFormat("{0:0.####} {1:0.####} {2:0.####} {3:0.####} {4:0.####} {5:0.####} c\n", points[idx].X, points[idx].Y, points[idx + 1].X, points[idx + 1].Y, points[idx + 2].X, points[idx + 2].Y); #endif } #endif /// /// Appends a Bézier curve for a cardinal spline through pt1 and pt2. /// void AppendCurveSegment(XPoint pt0, XPoint pt1, XPoint pt2, XPoint pt3, double tension3) { AppendFormat("{0:0.####} {1:0.####} {2:0.####} {3:0.####} {4:0.####} {5:0.####} c\n", pt1.X + tension3 * (pt2.X - pt0.X), pt1.Y + tension3 * (pt2.Y - pt0.Y), pt2.X - tension3 * (pt3.X - pt1.X), pt2.Y - tension3 * (pt3.Y - pt1.Y), pt2.X, pt2.Y); } #if GDI /// /// Appends the content of a GraphicsPath object. /// internal void AppendPath(GraphicsPath path) { int count = path.PointCount; if (count == 0) return; PointF[] points = path.PathPoints; Byte[] types = path.PathTypes; for (int idx = 0; idx < count; idx++) { // From GDI+ documentation: const byte PathPointTypeStart = 0; // move const byte PathPointTypeLine = 1; // line const byte PathPointTypeBezier = 3; // default Bezier (= cubic Bezier) const byte PathPointTypePathTypeMask = 0x07; // type mask (lowest 3 bits). //const byte PathPointTypeDashMode = 0x10; // currently in dash mode. //const byte PathPointTypePathMarker = 0x20; // a marker for the path. const byte PathPointTypeCloseSubpath = 0x80; // closed flag byte type = types[idx]; switch (type & PathPointTypePathTypeMask) { case PathPointTypeStart: //PDF_moveto(pdf, points[idx].X, points[idx].Y); AppendFormat("{0:0.####} {1:0.####} m\n", points[idx].X, points[idx].Y); break; case PathPointTypeLine: //PDF_lineto(pdf, points[idx].X, points[idx].Y); AppendFormat("{0:0.####} {1:0.####} l\n", points[idx].X, points[idx].Y); if ((type & PathPointTypeCloseSubpath) != 0) Append("h\n"); break; case PathPointTypeBezier: Debug.Assert(idx + 2 < count); //PDF_curveto(pdf, points[idx].X, points[idx].Y, // points[idx + 1].X, points[idx + 1].Y, // points[idx + 2].X, points[idx + 2].Y); AppendFormat("{0:0.####} {1:0.####} {2:0.####} {3:0.####} {4:0.####} {5:0.####} c\n", points[idx].X, points[idx].Y, points[++idx].X, points[idx].Y, points[++idx].X, points[idx].Y); if ((types[idx] & PathPointTypeCloseSubpath) != 0) Append("h\n"); break; } } } #endif #if WPF /// /// Appends the content of a PathGeometry object. /// internal void AppendPath(PathGeometry geometry) { #if true_ // sissy version geometry = geometry.GetFlattenedPathGeometry(); #endif foreach (PathFigure figure in geometry.Figures) { System.Windows.Point currentPoint = new System.Windows.Point(); // Move to start point currentPoint = figure.StartPoint; AppendFormat("{0:0.####} {1:0.####} m\n", currentPoint.X, currentPoint.Y); foreach (PathSegment segment in figure.Segments) { Type type = segment.GetType(); if (type == typeof(LineSegment)) { // Draw a single line System.Windows.Point point = ((LineSegment)segment).Point; currentPoint = point; AppendFormat("{0:0.####} {1:0.####} l\n", point.X, point.Y); } else if (type == typeof(PolyLineSegment)) { // Draw connected lines PointCollection points = ((PolyLineSegment)segment).Points; foreach (System.Windows.Point point in points) { currentPoint = point; // I forced myself not to optimize this assignment AppendFormat("{0:0.####} {1:0.####} l\n", point.X, point.Y); } } else if (type == typeof(BezierSegment)) { // Draw Bézier curve BezierSegment seg = (BezierSegment)segment; System.Windows.Point point1 = seg.Point1; System.Windows.Point point2 = seg.Point2; System.Windows.Point point3 = seg.Point3; AppendFormat("{0:0.####} {1:0.####} {2:0.####} {3:0.####} {4:0.####} {5:0.####} c\n", point1.X, point1.Y, point2.X, point2.Y, point3.X, point3.Y); currentPoint = point3; } else if (type == typeof(PolyBezierSegment)) { // Draw connected Bézier curves PointCollection points = ((PolyBezierSegment)segment).Points; int count = points.Count; if (count > 0) { Debug.Assert(count % 3 == 0, "Number of Points in PolyBezierSegment are not a multiple of 3."); for (int idx = 0; idx < count - 2; idx += 3) { System.Windows.Point point1 = points[idx]; System.Windows.Point point2 = points[idx + 1]; System.Windows.Point point3 = points[idx + 2]; AppendFormat("{0:0.####} {1:0.####} {2:0.####} {3:0.####} {4:0.####} {5:0.####} c\n", point1.X, point1.Y, point2.X, point2.Y, point3.X, point3.Y); } currentPoint = points[count - 1]; } } else if (type == typeof(ArcSegment)) { // Draw arc ArcSegment seg = (ArcSegment)segment; AppendPartialArc(currentPoint, seg.Point, seg.RotationAngle, seg.Size, seg.IsLargeArc, seg.SweepDirection, PathStart.Ignore1st); currentPoint = seg.Point; } else if (type == typeof(QuadraticBezierSegment)) { QuadraticBezierSegment seg = (QuadraticBezierSegment)segment; currentPoint = seg.Point2; // TODOWPF: Undone because XGraphics has no such curve type throw new NotImplementedException("AppendPath with QuadraticBezierSegment."); } else if (type == typeof(PolyQuadraticBezierSegment)) { PolyQuadraticBezierSegment seg = (PolyQuadraticBezierSegment)segment; currentPoint = seg.Points[seg.Points.Count - 1]; // TODOWPF: Undone because XGraphics has no such curve type throw new NotImplementedException("AppendPath with PolyQuadraticBezierSegment."); } } if (figure.IsClosed) Append("h\n"); } } #endif internal void Append(string value) { this.content.Append(value); } internal void AppendFormat(string format, params object[] args) { this.content.AppendFormat(CultureInfo.InvariantCulture, format, args); } void AppendStrokeFill(XPen pen, XBrush brush, XFillMode fillMode, bool closePath) { if (closePath) this.content.Append("h "); if (fillMode == XFillMode.Winding) { if (pen != null && brush != null) this.content.Append("B\n"); else if (pen != null) this.content.Append("S\n"); else this.content.Append("f\n"); } else { if (pen != null && brush != null) this.content.Append("B*\n"); else if (pen != null) this.content.Append("S\n"); else this.content.Append("f*\n"); } } #endregion // -------------------------------------------------------------------------------------------- #region Realizing graphical state /// /// Initializes the default view transformation, i.e. the transformation from the user page /// space to the PDF page space. /// void BeginPage() { if (this.gfxState.Level == GraphicsStackLevelInitial) { // Flip page horizontaly and mirror text. // TODO: Is PageOriging and PageScale (== Viewport) useful? Or just public DefaultViewMatrix (like Presentation Manager has had) this.defaultViewMatrix = new XMatrix(); //XMatrix.Identity; if (this.gfx.PageDirection == XPageDirection.Downwards) { #if MIGRADOC if (this.pdflibHack) { // MigraDoc 1.1 (written in C++) based on PDFlib and our RenderContext for GDI+. To keep it running // on PDFlib (and PGL) I need this hack here in the MigraDoc build of PDFsharp. // The new and more flexible MigraDoc Rendering (written in C#) doesn't need it anymore. SaveState(); defaultViewMatrix.Translate(0, this.page.Height); defaultViewMatrix.Scale(1, -1); } else #endif { // Take TrimBox into account double pageHeight = Size.Height; XPoint trimOffset = new XPoint(); if (this.page != null && this.page.TrimMargins.AreSet) { pageHeight += this.page.TrimMargins.Top.Point + this.page.TrimMargins.Bottom.Point; trimOffset = new XPoint(this.page.TrimMargins.Left.Point, this.page.TrimMargins.Top.Point); } if (this.page != null && this.page.Elements.GetInteger("/Rotate") == 90) // HACK for InDesign flyer { defaultViewMatrix.RotatePrepend(90); defaultViewMatrix.ScalePrepend(1, -1); } else { // Recall that the value of Height depends on Orientation. defaultViewMatrix.TranslatePrepend(0, pageHeight); defaultViewMatrix.Scale(1, -1, XMatrixOrder.Prepend); } // Scale with page units switch (this.gfx.PageUnit) { case XGraphicsUnit.Inch: defaultViewMatrix.ScalePrepend(XUnit.InchFactor); break; case XGraphicsUnit.Millimeter: defaultViewMatrix.ScalePrepend(XUnit.MillimeterFactor); break; case XGraphicsUnit.Centimeter: defaultViewMatrix.ScalePrepend(XUnit.CentimeterFactor); break; } if (trimOffset != new XPoint()) { Debug.Assert(this.gfx.PageUnit == XGraphicsUnit.Point, "With TrimMargins set the page units must be Point. Ohter cases nyi."); defaultViewMatrix.TranslatePrepend(trimOffset.x, trimOffset.y); } // Save initial graphic state SaveState(); // Set page transformation double[] cm = defaultViewMatrix.GetElements(); AppendFormat("{0:0.###} {1:0.###} {2:0.###} {3:0.###} {4:0.###} {5:0.###} cm ", cm[0], cm[1], cm[2], cm[3], cm[4], cm[5]); AppendFormat("-100 Tz\n"); } } else { // Scale with page units switch (this.gfx.PageUnit) { case XGraphicsUnit.Inch: defaultViewMatrix.ScalePrepend(XUnit.InchFactor); break; case XGraphicsUnit.Millimeter: defaultViewMatrix.ScalePrepend(XUnit.MillimeterFactor); break; case XGraphicsUnit.Centimeter: defaultViewMatrix.ScalePrepend(XUnit.CentimeterFactor); break; } // Save initial graphic state SaveState(); // Set page transformation double[] cm = defaultViewMatrix.GetElements(); AppendFormat("{0:0.###} {1:0.###} {2:0.###} {3:0.###} {4:0.###} {5:0.###} cm ", cm[0], cm[1], cm[2], cm[3], cm[4], cm[5]); } } } /// /// Ends the content stream, i.e. ends the text mode and balances the graphic state stack. /// void EndPage() { if (this.streamMode == StreamMode.Text) { this.content.Append("ET\n"); this.streamMode = StreamMode.Graphic; } while (this.gfxStateStack.Count != 0) RestoreState(); } /// /// Begins the graphic mode (i.e. ends the text mode). /// internal void BeginGraphic() { if (this.streamMode != StreamMode.Graphic) { if (this.streamMode == StreamMode.Text) this.content.Append("ET\n"); this.streamMode = StreamMode.Graphic; } } StreamMode streamMode; /// /// Makes the specified pen and brush to the current graphics objects. /// void Realize(XPen pen, XBrush brush) { BeginPage(); BeginGraphic(); RealizeTransform(); if (pen != null) this.gfxState.RealizePen(pen, this.colorMode); // this.page.document.Options.ColorMode); if (brush != null) this.gfxState.RealizeBrush(brush, this.colorMode); // this.page.document.Options.ColorMode); } /// /// Makes the specified pen to the current graphics object. /// void Realize(XPen pen) { Realize(pen, null); } /// /// Makes the specified brush to the current graphics object. /// void Realize(XBrush brush) { Realize(null, brush); } /// /// Makes the specified font and brush to the current graphics objects. /// void Realize(XFont font, XBrush brush, int renderMode) { BeginPage(); RealizeTransform(); if (this.streamMode != StreamMode.Text) { this.streamMode = StreamMode.Text; this.content.Append("BT\n"); // Text matrix is empty after BT this.gfxState.realizedTextPosition = new XPoint(); } this.gfxState.RealizeFont(font, brush, renderMode); } void AdjustTextMatrix(ref XPoint pos) { XPoint posSave = pos; pos = pos - new XVector(this.gfxState.realizedTextPosition.x, this.gfxState.realizedTextPosition.y); this.gfxState.realizedTextPosition = posSave; } /// /// Makes the specified image to the current graphics object. /// string Realize(XImage image) { BeginPage(); BeginGraphic(); RealizeTransform(); string imageName; if (image is XForm) imageName = GetFormName(image as XForm); else imageName = GetImageName(image); return imageName; } /// /// Realizes the current transformation matrix, if necessary. /// void RealizeTransform() { BeginPage(); if (this.gfxState.Level == GraphicsStackLevelPageSpace) { BeginGraphic(); SaveState(); } if (gfxState.MustRealizeCtm) { BeginGraphic(); this.gfxState.RealizeCtm(); } } #endregion #if GDI [Conditional("DEBUG")] void DumpPathData(PathData pathData) { int count = pathData.Points.Length; for (int idx = 0; idx < count; idx++) { string info = PdfEncoders.Format("{0:X} {1:####0.000} {2:####0.000}", pathData.Types[idx], pathData.Points[idx].X, pathData.Points[idx].Y); Debug.WriteLine(info, "PathData"); } } #endif /// /// Gets the owning PdfDocument of this page or form. /// internal PdfDocument Owner { get { if (this.page != null) return this.page.Owner; else return this.form.Owner; } } internal XGraphics Gfx { get { return this.gfx; } } /// /// Gets the PdfResources of this page or form. /// internal PdfResources Resources { get { if (this.page != null) return this.page.Resources; else return this.form.Resources; } } /// /// Gets the size of this page or form. /// internal XSize Size { get { if (this.page != null) return new XSize(this.page.Width, this.page.Height); else return this.form.Size; } } /// /// Gets the resource name of the specified font within this page or form. /// internal string GetFontName(XFont font, out PdfFont pdfFont) { if (this.page != null) return this.page.GetFontName(font, out pdfFont); else return this.form.GetFontName(font, out pdfFont); } /// /// Gets the resource name of the specified image within this page or form. /// internal string GetImageName(XImage image) { if (this.page != null) return this.page.GetImageName(image); else return this.form.GetImageName(image); } /// /// Gets the resource name of the specified form within this page or form. /// internal string GetFormName(XForm form) { if (this.page != null) return this.page.GetFormName(form); else return this.form.GetFormName(form); } internal PdfPage page; internal XForm form; internal PdfColorMode colorMode; XGraphicsPdfPageOptions options; XGraphics gfx; StringBuilder content; /// /// The q/Q nesting level is 0. /// const int GraphicsStackLevelInitial = 0; /// /// The q/Q nesting level is 1. /// const int GraphicsStackLevelPageSpace = 1; /// /// The q/Q nesting level is 2. /// const int GraphicsStackLevelWorldSpace = 2; #region PDF Graphics State /// /// Saves the current graphical state. /// void SaveState() { Debug.Assert(this.streamMode == StreamMode.Graphic, "Cannot save state in text mode."); this.gfxStateStack.Push(this.gfxState); this.gfxState = this.gfxState.Clone(); this.gfxState.Level = this.gfxStateStack.Count; Append("q\n"); } /// /// Restores the previous graphical state. /// void RestoreState() { Debug.Assert(this.streamMode == StreamMode.Graphic, "Cannot restore state in text mode."); this.gfxState = (PdfGraphicsState)this.gfxStateStack.Pop(); Append("Q\n"); } PdfGraphicsState RestoreState(InternalGraphicsState state) { int count = 1; PdfGraphicsState top = (PdfGraphicsState)this.gfxStateStack.Pop(); while (top.InternalState != state) { Append("Q\n"); count++; top = (PdfGraphicsState)this.gfxStateStack.Pop(); } Append("Q\n"); this.gfxState = top; return top; } /// /// The current graphical state. /// PdfGraphicsState gfxState; /// /// The graphical state stack. /// Stack gfxStateStack = new Stack(); #endregion /// /// The final transformation from the world space to the default page space. /// internal XMatrix defaultViewMatrix; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.Pdf/enums/0000777000175000001440000000000011533760020022325 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.Pdf/enums/DirtyFlags.cs0000644000175000001440000000316011435766646024745 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Drawing.Pdf { [Flags] enum DirtyFlags { Ctm = 0x00000001, ClipPath = 0x00000002, LineWidth = 0x00000010, LineJoin = 0x00000020, MiterLimit = 0x00000040, StrokeFill = 0x00000070, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.Pdf/enums/StreamMode.cs0000644000175000001440000000325211435766646024737 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing.Pdf { /// /// Indicates whether we are within a BT/ET block. /// enum StreamMode { /// /// Graphic mode. This is default. /// Graphic, /// /// Text mode. /// Text, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.Pdf/PdfGraphicsState.cs0000644000175000001440000003411711435766646024747 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.Text; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF #endif using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Internal; namespace PdfSharp.Drawing.Pdf { // TODO: update the following text // // In PDF the current transformation matrix (CTM) can only be modified, but not set. The XGraphics // object allows to set the transformation matrix, which leads to a problem. In PDF the only way // to reset the CTM to its original value is to save and restore the PDF graphics state. Don't try // to keep track of every modification and then reset the CTM by multiplying with the inverse matrix // of the product of all modifications. PDFlib uses this 'trick', but it does not work. Because of // rounding errors everything on the PDF page looks sloping after some resets. Saving and restoring // the graphics state is the only possible way to reset the CTM, but because the PDF restore operator // 'Q' resets not only the CTM but all other graphics state values, we have to implement our own // graphics state management. This is apparently the only safe way to give the XGrahics users the // illusion that they can arbitrarily set the transformation matrix. // // The current implementation is just a draft. Save/Restore works only once and clipping is not // correctly restored in some cases. /// /// Represents the current PDF graphics state. /// internal sealed class PdfGraphicsState : ICloneable { public PdfGraphicsState(XGraphicsPdfRenderer renderer) { this.renderer = renderer; } readonly XGraphicsPdfRenderer renderer; public PdfGraphicsState Clone() { PdfGraphicsState state = (PdfGraphicsState)MemberwiseClone(); return state; } object ICloneable.Clone() { return Clone(); } internal int Level; internal InternalGraphicsState InternalState; public void PushState() { //BeginGraphic this.renderer.Append("q/n"); } public void PopState() { //BeginGraphic this.renderer.Append("Q/n"); } #region Stroke double realizedLineWith = -1; int realizedLineCap = -1; int realizedLineJoin = -1; double realizedMiterLimit = -1; XDashStyle realizedDashStyle = (XDashStyle)(-1); string realizedDashPattern; XColor realizedStrokeColor = XColor.Empty; public void RealizePen(XPen pen, PdfColorMode colorMode) { XColor color = pen.Color; color = ColorSpaceHelper.EnsureColorMode(colorMode, color); if (this.realizedLineWith != pen.width) { this.renderer.AppendFormat("{0:0.###} w\n", pen.width); this.realizedLineWith = pen.width; } if (this.realizedLineCap != (int)pen.lineCap) { this.renderer.AppendFormat("{0} J\n", (int)pen.lineCap); this.realizedLineCap = (int)pen.lineCap; } if (this.realizedLineJoin != (int)pen.lineJoin) { this.renderer.AppendFormat("{0} j\n", (int)pen.lineJoin); this.realizedLineJoin = (int)pen.lineJoin; } if (this.realizedLineCap == (int)XLineJoin.Miter) { if (this.realizedMiterLimit != (int)pen.miterLimit && (int)pen.miterLimit != 0) { this.renderer.AppendFormat("{0} M\n", (int)pen.miterLimit); this.realizedMiterLimit = (int)pen.miterLimit; } } if (this.realizedDashStyle != pen.dashStyle || pen.dashStyle == XDashStyle.Custom) { double dot = pen.Width; double dash = 3 * dot; // Line width 0 is not recommended but valid XDashStyle dashStyle = pen.DashStyle; if (dot == 0) dashStyle = XDashStyle.Solid; switch (dashStyle) { case XDashStyle.Solid: this.renderer.Append("[]0 d\n"); break; case XDashStyle.Dash: this.renderer.AppendFormat("[{0:0.##} {1:0.##}]0 d\n", dash, dot); break; case XDashStyle.Dot: this.renderer.AppendFormat("[{0:0.##}]0 d\n", dot); break; case XDashStyle.DashDot: this.renderer.AppendFormat("[{0:0.##} {1:0.##} {1:0.##} {1:0.##}]0 d\n", dash, dot); break; case XDashStyle.DashDotDot: this.renderer.AppendFormat("[{0:0.##} {1:0.##} {1:0.##} {1:0.##} {1:0.##} {1:0.##}]0 d\n", dash, dot); break; case XDashStyle.Custom: { StringBuilder pdf = new StringBuilder("[", 256); int len = pen.dashPattern == null ? 0 : pen.dashPattern.Length; for (int idx = 0; idx < len; idx++) { if (idx > 0) pdf.Append(' '); pdf.Append(PdfEncoders.ToString(pen.dashPattern[idx] * pen.width)); } // Make an even number of values look like in GDI+ if (len > 0 && len % 2 == 1) { pdf.Append(' '); pdf.Append(PdfEncoders.ToString(0.2 * pen.width)); } pdf.AppendFormat(CultureInfo.InvariantCulture, "]{0:0.###} d\n", pen.dashOffset * pen.width); string pattern = pdf.ToString(); // BUG: drice2@ageone.de reported a realizing problem // HACK: I romove the if clause //if (this.realizedDashPattern != pattern) { this.realizedDashPattern = pattern; this.renderer.Append(pattern); } } break; } this.realizedDashStyle = dashStyle; } if (colorMode != PdfColorMode.Cmyk) { if (this.realizedStrokeColor.Rgb != color.Rgb) { this.renderer.Append(PdfEncoders.ToString(color, PdfColorMode.Rgb)); this.renderer.Append(" RG\n"); } } else { if (!ColorSpaceHelper.IsEqualCmyk(this.realizedStrokeColor, color)) { this.renderer.Append(PdfEncoders.ToString(color, PdfColorMode.Cmyk)); this.renderer.Append(" K\n"); } } if (this.renderer.Owner.Version >= 14 && this.realizedStrokeColor.A != color.A) { PdfExtGState extGState = this.renderer.Owner.ExtGStateTable.GetExtGStateStroke(color.A); string gs = this.renderer.Resources.AddExtGState(extGState); this.renderer.AppendFormat("{0} gs\n", gs); // Must create transparany group if (this.renderer.page != null && color.A < 1) this.renderer.page.transparencyUsed = true; } this.realizedStrokeColor = color; } #endregion #region Fill XColor realizedFillColor = XColor.Empty; public void RealizeBrush(XBrush brush, PdfColorMode colorMode) { if (brush is XSolidBrush) { XColor color = ((XSolidBrush)brush).Color; color = ColorSpaceHelper.EnsureColorMode(colorMode, color); if (colorMode != PdfColorMode.Cmyk) { if (this.realizedFillColor.Rgb != color.Rgb) { this.renderer.Append(PdfEncoders.ToString(color, PdfColorMode.Rgb)); this.renderer.Append(" rg\n"); } } else { if (!ColorSpaceHelper.IsEqualCmyk(this.realizedFillColor, color)) { this.renderer.Append(PdfEncoders.ToString(color, PdfColorMode.Cmyk)); this.renderer.Append(" k\n"); } } if (this.renderer.Owner.Version >= 14 && this.realizedFillColor.A != color.A) { PdfExtGState extGState = this.renderer.Owner.ExtGStateTable.GetExtGStateNonStroke(color.A); string gs = this.renderer.Resources.AddExtGState(extGState); this.renderer.AppendFormat("{0} gs\n", gs); // Must create transparany group if (this.renderer.page != null && color.A < 1) this.renderer.page.transparencyUsed = true; } this.realizedFillColor = color; } else if (brush is XLinearGradientBrush) { XMatrix matrix = this.renderer.defaultViewMatrix; matrix.Prepend(this.Transform); PdfShadingPattern pattern = new PdfShadingPattern(this.renderer.Owner); pattern.SetupFromBrush((XLinearGradientBrush)brush, matrix); string name = this.renderer.Resources.AddPattern(pattern); this.renderer.AppendFormat("/Pattern cs\n", name); this.renderer.AppendFormat("{0} scn\n", name); // Invalidate fill color this.realizedFillColor = XColor.Empty; } } #endregion #region Text internal PdfFont realizedFont; string realizedFontName = String.Empty; double realizedFontSize; public void RealizeFont(XFont font, XBrush brush, int renderMode) { // So far rendering mode 0 only RealizeBrush(brush, this.renderer.colorMode); // this.renderer.page.document.Options.ColorMode); this.realizedFont = null; string fontName = this.renderer.GetFontName(font, out this.realizedFont); if (fontName != this.realizedFontName || this.realizedFontSize != font.Size) { if (this.renderer.Gfx.PageDirection == XPageDirection.Downwards) this.renderer.AppendFormat("{0} {1:0.###} Tf\n", fontName, -font.Size); else this.renderer.AppendFormat("{0} {1:0.###} Tf\n", fontName, font.Size); this.realizedFontName = fontName; this.realizedFontSize = font.Size; } } public XPoint realizedTextPosition; #endregion #region Transformation /// /// The realized current transformation matrix. /// private XMatrix realizedCtm; /// /// The unrealized current transformation matrix. /// XMatrix unrealizedCtm; /// /// A flag indicating whether the CTM must be realized. /// public bool MustRealizeCtm; public XMatrix Transform { get { if (this.MustRealizeCtm) { XMatrix matrix = this.realizedCtm; matrix.Prepend(this.unrealizedCtm); return matrix; } return this.realizedCtm; } set { XMatrix matrix = this.realizedCtm; matrix.Invert(); matrix.Prepend(value); this.unrealizedCtm = matrix; this.MustRealizeCtm = !this.unrealizedCtm.IsIdentity; } } /// /// Modifies the current transformation matrix. /// public void MultiplyTransform(XMatrix matrix, XMatrixOrder order) { if (!matrix.IsIdentity) { this.MustRealizeCtm = true; this.unrealizedCtm.Multiply(matrix, order); } } /// /// Realizes the CTM. /// public void RealizeCtm() { if (this.MustRealizeCtm) { Debug.Assert(!this.unrealizedCtm.IsIdentity, "mrCtm is unnecessarily set."); double[] matrix = this.unrealizedCtm.GetElements(); // Up to six decimal digits to prevent round up problems this.renderer.AppendFormat("{0:0.######} {1:0.######} {2:0.######} {3:0.######} {4:0.######} {5:0.######} cm\n", matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); this.realizedCtm.Prepend(this.unrealizedCtm); this.unrealizedCtm = new XMatrix(); //XMatrix.Identity; this.MustRealizeCtm = false; } } #endregion #region Clip Path public void SetAndRealizeClipRect(XRect clipRect) { XGraphicsPath clipPath = new XGraphicsPath(); clipPath.AddRectangle(clipRect); RealizeClipPath(clipPath); } public void SetAndRealizeClipPath(XGraphicsPath clipPath) { RealizeClipPath(clipPath); } void RealizeClipPath(XGraphicsPath clipPath) { this.renderer.BeginGraphic(); RealizeCtm(); #if GDI && !WPF this.renderer.AppendPath(clipPath.gdipPath); #endif #if WPF &&!GDI this.renderer.AppendPath(clipPath.pathGeometry); #endif #if WPF && GDI if (this.renderer.Gfx.targetContext == XGraphicTargetContext.GDI) { this.renderer.AppendPath(clipPath.gdipPath); } else { this.renderer.AppendPath(clipPath.pathGeometry); } #endif if (clipPath.FillMode == XFillMode.Winding) this.renderer.Append("W n\n"); else this.renderer.Append("W* n\n"); } #endregion } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/0000777000175000001440000000000011533760020020466 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XFont.cs0000644000175000001440000005076211435766646022106 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Runtime.InteropServices; using System.ComponentModel; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Internal; using PdfSharp.Fonts; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; // WPFHACK #pragma warning disable 162 namespace PdfSharp.Drawing { /// /// Defines an object used to draw text. /// [DebuggerDisplay("'{Name}', {Size}")] public class XFont { /// /// Initializes a new instance of the class. /// /// Name of the font family. /// The em size. public XFont(string familyName, double emSize) { this.familyName = familyName; this.emSize = emSize; this.style = XFontStyle.Regular; this.pdfOptions = new XPdfFontOptions(); Initialize(); } /// /// Initializes a new instance of the class. /// /// Name of the font family. /// The em size. /// The font style. public XFont(string familyName, double emSize, XFontStyle style) { this.familyName = familyName; this.emSize = emSize; this.style = style; this.pdfOptions = new XPdfFontOptions(); Initialize(); } /// /// Initializes a new instance of the class. /// /// Name of the font family. /// The em size. /// The font style. /// Additional PDF options. public XFont(string familyName, double emSize, XFontStyle style, XPdfFontOptions pdfOptions) { this.familyName = familyName; this.emSize = emSize; this.style = style; this.pdfOptions = pdfOptions; Initialize(); } #if GDI // #PFC /// /// Initializes a new instance of the class. /// /// The font family. /// The em size. /// The font style. /// Additional PDF options. public XFont(System.Drawing.FontFamily family, double emSize, XFontStyle style, XPdfFontOptions pdfOptions /*, XPrivateFontCollection privateFontCollection*/ ) { this.familyName = null; this.gdifamily = family; this.emSize = emSize; this.style = style; this.pdfOptions = pdfOptions; Initialize(); } #endif #if GDI #if UseGdiObjects /// /// Initializes a new instance of the class from a System.Drawing.Font. /// /// A System.Drawing.Font. /// Additional PDF options. public XFont(Font font, XPdfFontOptions pdfOptions) { if (font.Unit != GraphicsUnit.World) throw new ArgumentException("Font must use GraphicsUnit.World."); this.font = font; this.familyName = font.Name; this.emSize = font.Size; this.style = FontStyleFrom(font); this.pdfOptions = pdfOptions; Initialize(); } #endif #endif /// /// Connects the specifications of a font from XFont to a real glyph type face. /// void Initialize() { XFontMetrics fm = null; #if DEBUG___ FontData[] fontDataArray = FontDataStock.Global.GetFontDataList(); if (fontDataArray.Length > 0) { //// GetType(); ////#if GDI //// var x = XPrivateFontCollection.global.GlobalPrivateFontCollection; //// families = x.Families; //// bool fff = families[0].IsStyleAvailable(System.Drawing.FontStyle.Regular); //// fff.GetType(); //// this.font = new Font(families[0].Name, 12, System.Drawing.FontStyle.Regular, GraphicsUnit.Pixel); //// this.font = new Font("Oblivious", 12, System.Drawing.FontStyle.Regular, GraphicsUnit.Pixel); //// this.font = new Font(families[0], 12, System.Drawing.FontStyle.Regular, GraphicsUnit.Pixel); //// System.Drawing.FontFamily f = new System.Drawing.FontFamily(families[0].Name); //// f.GetType(); ////#endif } #endif #if GDI if (this.font == null) { if (this.gdifamily != null) { this.font = new Font(this.gdifamily, (float)this.emSize, (System.Drawing.FontStyle)this.style, GraphicsUnit.World); this.familyName = this.gdifamily.Name; // Do we need this??? } else { // First check private fonts this.font = XPrivateFontCollection.TryFindPrivateFont(this.familyName, this.emSize, (System.Drawing.FontStyle)this.style) ?? new Font(this.familyName, (float)this.emSize, (System.Drawing.FontStyle)this.style, GraphicsUnit.World); } #if DEBUG // new Font returns MSSansSerif if the requested font was not found ... //Debug.Assert(this.familyName == this.font.FontFamily.Name); #endif } fm = Metrics; System.Drawing.FontFamily fontFamily = this.font.FontFamily; this.unitsPerEm = fm.UnitsPerEm; System.Drawing.FontFamily fontFamily2 = this.font.FontFamily; this.cellSpace = fontFamily2.GetLineSpacing(font.Style); //Debug.Assert(this.cellSpace == fm.Ascent + Math.Abs(fm.Descent) + fm.Leading, "Value differs from information retrieved from font image."); this.cellAscent = fontFamily.GetCellAscent(font.Style); #pragma warning disable 1030 #warning delTHHO //!!!delTHHO 14.08.2008 Debug.Assert(this.cellAscent == fm.Ascent, "Value differs from information retrieved from font image."); //Debug.Assert(this.cellAscent == fm.Ascent, "Value differs from information retrieved from font image."); this.cellDescent = fontFamily.GetCellDescent(font.Style); #if DEBUG int desc = Math.Abs(fm.Descent); if (this.cellDescent != desc) Debug.Assert(false, "Value differs from information retrieved from font image."); #endif #endif #if WPF #if !SILVERLIGHT if (this.family == null) { Debug.Assert(this.typeface == null); this.typeface = XPrivateFontCollection.TryFindTypeface(Name, this.style, out this.family); #if true if (this.typeface != null) { GlyphTypeface glyphTypeface; ICollection list = this.family.GetTypefaces(); foreach (Typeface tf in list) { if (!tf.TryGetGlyphTypeface(out glyphTypeface)) Debugger.Break(); } if (!this.typeface.TryGetGlyphTypeface(out glyphTypeface)) throw new InvalidOperationException(PSSR.CannotGetGlyphTypeface(Name)); } #endif } if (this.family == null) this.family = new System.Windows.Media.FontFamily(Name); if (typeface == null) this.typeface = FontHelper.CreateTypeface(this.family, style); fm = Metrics; Debug.Assert(this.unitsPerEm == 0 || this.unitsPerEm == fm.UnitsPerEm); this.unitsPerEm = fm.UnitsPerEm; //Debug.Assert(this.cellSpace == 0 || this.cellSpace == fm.Ascent + Math.Abs(fm.Descent) + fm.Leading); this.cellSpace = fm.Ascent + Math.Abs(fm.Descent) + fm.Leading; Debug.Assert(this.cellAscent == 0 || this.cellAscent == fm.Ascent); this.cellAscent = fm.Ascent; Debug.Assert(this.cellDescent == 0 || this.cellDescent == Math.Abs(fm.Descent)); this.cellDescent = Math.Abs(fm.Descent); #else if (fm != null) fm.GetType(); #endif #endif } #if GDI // Fonts can be created from familyName or from family! //string familyName; /// /// Gets the GDI family. /// /// The GDI family. public System.Drawing.FontFamily GdiFamily { get { return this.gdifamily; } //set { this.gdifamily = value; } } System.Drawing.FontFamily gdifamily; #endif #if GDI internal static XFontStyle FontStyleFrom(Font font) { return (font.Bold ? XFontStyle.Bold : 0) | (font.Italic ? XFontStyle.Italic : 0) | (font.Strikeout ? XFontStyle.Strikeout : 0) | (font.Underline ? XFontStyle.Underline : 0); } #endif //// Methods //public Font(Font prototype, FontStyle newStyle); //public Font(FontFamily family, float emSize); //public Font(string familyName, float emSize); //public Font(FontFamily family, float emSize, FontStyle style); //public Font(FontFamily family, float emSize, GraphicsUnit unit); //public Font(string familyName, float emSize, FontStyle style); //public Font(string familyName, float emSize, GraphicsUnit unit); //public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit); //public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit); ////public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet); ////public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet); ////public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont); ////public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont); //public object Clone(); //private static FontFamily CreateFontFamilyWithFallback(string familyName); //private void Dispose(bool disposing); //public override bool Equals(object obj); //protected override void Finalize(); //public static Font FromHdc(IntPtr hdc); //public static Font FromHfont(IntPtr hfont); //public static Font FromLogFont(object lf); //public static Font FromLogFont(object lf, IntPtr hdc); //public override int GetHashCode(); /// /// Returns the line spacing, in pixels, of this font. The line spacing is the vertical distance /// between the base lines of two consecutive lines of text. Thus, the line spacing includes the /// blank space between lines along with the height of the character itself. /// public double GetHeight() { #if GDI RealizeGdiFont(); double gdiValue = this.font.GetHeight(); #if DEBUG float myValue = (float)(this.cellSpace * this.emSize / this.unitsPerEm); //Debug.Assert(DoubleUtil.AreClose((float)value, myValue), "Check formula."); Debug.Assert(DoubleUtil.AreRoughlyEqual(gdiValue, myValue, 5), "Check formula."); //// 2355*(0.3/2048)*96 = 33.11719 //double myValue = this.cellSpace * (this.size / 72 / this.unitsPerEm) * 96; //double myValue2 = (float)(this.cellSpace * (this.size / /*72 /*/ this.unitsPerEm) /* 72*/); //Int64 i1 = (Int64)(value * 1000 + .5); //Int64 i2 = (Int64)(myValue2 * 1000 + .5); //Debug.Assert(i1 == i2, "??"); #endif return gdiValue; #endif #if WPF double value = this.cellSpace * this.emSize / this.unitsPerEm; return value; #endif } /// /// Returns the line spacing, in the current unit of a specified Graphics object, of this font. /// The line spacing is the vertical distance between the base lines of two consecutive lines of /// text. Thus, the line spacing includes the blank space between lines along with the height of /// public double GetHeight(XGraphics graphics) { #if GDI && !WPF RealizeGdiFont(); double value = this.font.GetHeight(graphics.gfx); Debug.Assert(value == this.font.GetHeight(graphics.gfx.DpiY)); double value2 = this.cellSpace * this.emSize / this.unitsPerEm; Debug.Assert(value - value2 < 1e-3, "??"); return this.font.GetHeight(graphics.gfx); #endif #if WPF && !GDI double value = this.cellSpace * this.emSize / this.unitsPerEm; return value; #endif #if GDI && WPF if (graphics.targetContext == XGraphicTargetContext.GDI) { RealizeGdiFont(); #if DEBUG double value = this.font.GetHeight(graphics.gfx); // 2355*(0.3/2048)*96 = 33.11719 double myValue = this.cellSpace * (this.emSize / (96 * this.unitsPerEm)) * 96; myValue = this.cellSpace * this.emSize / this.unitsPerEm; //Debug.Assert(value == myValue, "??"); //Debug.Assert(value - myValue < 1e-3, "??"); #endif return this.font.GetHeight(graphics.gfx); } else if (graphics.targetContext == XGraphicTargetContext.WPF) { double value = this.cellSpace * this.emSize / this.unitsPerEm; return value; } Debug.Assert(false); return 0; #endif } //public float GetHeight(float dpi); //public IntPtr ToHfont(); //public void ToLogFont(object logFont); //public void ToLogFont(object logFont, Graphics graphics); //public override string ToString(); // Properties /// /// Gets the XFontFamily object associated with this XFont object. /// [Browsable(false)] public XFontFamily FontFamily { get { if (this.fontFamily == null) { #if GDI RealizeGdiFont(); this.fontFamily = new XFontFamily(this.font.FontFamily); #endif #if WPF #if !SILVERLIGHT Debug.Assert(this.family != null); this.fontFamily = new XFontFamily(this.family); #else // AGHACK #endif #endif } return this.fontFamily; } } XFontFamily fontFamily; /// /// Gets the face name of this Font object. /// public string Name { get { #if GDI RealizeGdiFont(); return this.font.Name; #endif #if WPF || SILVERLIGHT //RealizeGdiFont(); return this.familyName; #endif } } /// /// Gets the em-size of this Font object measured in the unit of this Font object. /// public double Size { get { return this.emSize; } } double emSize; /// /// Gets the line spacing of this font. /// [Browsable(false)] public int Height { // Implementation from System.Drawing.Font.cs get { return (int)Math.Ceiling(GetHeight()); } // DELETE // { //#if GDI && !WPF // RealizeGdiFont(); // return this.font.Height; //#endif //#if WPF && !GDI // return (int)this.size; //#endif //#if GDI && WPF // // netmassdownloader -d "C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5" -output G:\dotnet-massdownload\SourceCode -v // RealizeGdiFont(); // int gdiHeight = this.font.Height; // double wpfHeight1 = this.cellSpace * this.size / this.unitsPerEm; // //int wpfHeight = (int)wpfHeight1+Math.Round(wpfHeight1, // int wpfHeight = Convert.ToInt32(wpfHeight1 + 0.5); // Debug.Assert(gdiHeight == wpfHeight); // return gdiHeight; //#endif // } } /// /// Gets style information for this Font object. /// [Browsable(false)] public XFontStyle Style { get { return this.style; } } XFontStyle style; /// /// Indicates whether this XFont object is bold. /// public bool Bold { get { return (this.style & XFontStyle.Bold) == XFontStyle.Bold; } } /// /// Indicates whether this XFont object is italic. /// public bool Italic { get { return (this.style & XFontStyle.Italic) == XFontStyle.Italic; } } /// /// Indicates whether this XFont object is stroke out. /// public bool Strikeout { get { return (this.style & XFontStyle.Strikeout) == XFontStyle.Strikeout; } } /// /// Indicates whether this XFont object is underlined. /// public bool Underline { get { return (this.style & XFontStyle.Underline) == XFontStyle.Underline; } } /// /// Temporary HACK for XPS to PDF converter. /// internal bool IsVertical { get { return this.isVertical; } set { this.isVertical = value; } } bool isVertical; /// /// Gets the PDF options of the font. /// public XPdfFontOptions PdfOptions { get { if (this.pdfOptions == null) this.pdfOptions = new XPdfFontOptions(); return this.pdfOptions; } } XPdfFontOptions pdfOptions; /// /// Indicates whether this XFont is encoded as Unicode. /// internal bool Unicode { get { return this.pdfOptions != null ? this.pdfOptions.FontEncoding == PdfFontEncoding.Unicode : false; } } /// /// Gets the metrics. /// /// The metrics. public XFontMetrics Metrics { get { if (this.fontMetrics == null) { FontDescriptor descriptor = FontDescriptorStock.Global.CreateDescriptor(this); this.fontMetrics = descriptor.FontMetrics; } return this.fontMetrics; } } XFontMetrics fontMetrics; #if GDI #if UseGdiObjects /// /// Implicit conversion form Font to XFont /// public static implicit operator XFont(Font font) { //XFont xfont = new XFont(font.Name, font.Size, FontStyleFrom(font)); XFont xfont = new XFont(font, null); return xfont; } #endif internal Font RealizeGdiFont() { //if (this.font == null) // this.font = new Font(this.familyName, this.size, (FontStyle)this.style); return this.font; } internal Font font; #endif #if WPF && !SILVERLIGHT internal Typeface RealizeWpfTypeface() { return this.typeface; } internal System.Windows.Media.FontFamily family; internal Typeface typeface; #endif internal string familyName; internal int unitsPerEm; internal int cellSpace; internal int cellAscent; internal int cellDescent; /// /// Cache PdfFontTable.FontSelector to speed up finding the right PdfFont /// if this font is used more than once. /// internal PdfFontTable.FontSelector selector; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XPoint.cs0000644000175000001440000003013611435766646022262 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.ComponentModel; using System.Runtime.InteropServices; #if GDI using System.Drawing; #endif #if WPF using System.Windows; #endif using PdfSharp.Internal; namespace PdfSharp.Drawing { /// /// Represents a pair of floating point x- and y-coordinates that defines a point /// in a two-dimensional plane. /// [DebuggerDisplay("X={X.ToString(\"0.####\",System.Globalization.CultureInfo.InvariantCulture)}, Y={Y.ToString(\"0.####\",System.Globalization.CultureInfo.InvariantCulture)}")] [Serializable] [StructLayout(LayoutKind.Sequential)] // TypeConverter(typeof(PointConverter)), ValueSerializer(typeof(PointValueSerializer))] public struct XPoint : IFormattable { /// /// Initializes a new instance of the XPoint class with the specified coordinates. /// public XPoint(double x, double y) { this.x = x; this.y = y; } #if GDI /// /// Initializes a new instance of the XPoint class with the specified point. /// public XPoint(System.Drawing.Point point) { this.x = point.X; this.y = point.Y; } #endif #if WPF /// /// Initializes a new instance of the XPoint class with the specified point. /// public XPoint(System.Windows.Point point) { this.x = point.X; this.y = point.Y; } #endif #if GDI /// /// Initializes a new instance of the XPoint class with the specified point. /// public XPoint(PointF point) { this.x = point.X; this.y = point.Y; } #endif /// /// Determines whether two points are equal. /// public static bool operator ==(XPoint point1, XPoint point2) { return point1.x == point2.x && point1.y == point2.y; } /// /// Determines whether two points are not equal. /// public static bool operator !=(XPoint point1, XPoint point2) { return !(point1 == point2); } /// /// Indicates whether the specified points are equal. /// public static bool Equals(XPoint point1, XPoint point2) { return point1.X.Equals(point2.X) && point1.Y.Equals(point2.Y); } /// /// Indicates whether this instance and a specified object are equal. /// public override bool Equals(object o) { if ((o == null) || !(o is XPoint)) return false; XPoint point = (XPoint)o; return Equals(this, point); } /// /// Indicates whether this instance and a specified point are equal. /// public bool Equals(XPoint value) { return Equals(this, value); } /// /// Returns the hash code for this instance. /// public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); } /// /// Parses the point from a string. /// public static XPoint Parse(string source) { CultureInfo cultureInfo = CultureInfo.InvariantCulture; TokenizerHelper helper = new TokenizerHelper(source, cultureInfo); string str = helper.NextTokenRequired(); XPoint point = new XPoint(Convert.ToDouble(str, cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo)); helper.LastTokenRequired(); return point; } /// /// Parses an array of points from a string. /// public static XPoint[] ParsePoints(string value) { if (value == null) throw new ArgumentNullException("value"); // TODO: Reflect reliabel implementation from Avalon // TODOWPF string[] values = value.Split(' '); int count = values.Length; XPoint[] points = new XPoint[count]; for (int idx = 0; idx < count; idx++) points[idx] = Parse(values[idx]); return points; } /// /// Gets the x-coordinate of this XPoint. /// public double X { get { return this.x; } set { this.x = value; } } /// /// Gets the x-coordinate of this XPoint. /// public double Y { get { return this.y; } set { this.y = value; } } #if GDI /// /// Converts this XPoint to a System.Drawing.Point. /// public PointF ToPointF() { return new PointF((float)this.x, (float)this.y); } #endif #if WPF /// /// Converts this XPoint to a System.Windows.Point. /// public System.Windows.Point ToPoint() { return new System.Windows.Point(this.x, this.y); } #endif /// /// Converts this XPoint to a human readable string. /// public override string ToString() { return this.ConvertToString(null, null); } /// /// Converts this XPoint to a human readable string. /// public string ToString(IFormatProvider provider) { return this.ConvertToString(null, provider); } /// /// Converts this XPoint to a human readable string. /// string IFormattable.ToString(string format, IFormatProvider provider) { return this.ConvertToString(format, provider); } /// /// Implements ToString. /// internal string ConvertToString(string format, IFormatProvider provider) { char numericListSeparator = TokenizerHelper.GetNumericListSeparator(provider); return string.Format(provider, "{1:" + format + "}{0}{2:" + format + "}", new object[] { numericListSeparator, this.x, this.y }); } /// /// Offsets the x and y value of this point. /// public void Offset(double offsetX, double offsetY) { this.x += offsetX; this.y += offsetY; } /// /// Indicates whether this XPoint is empty. /// [Browsable(false)] [Obsolete("Use '== new XPoint()'")] public bool IsEmpty // DELETE: 09-12-31 { get { return this.x == 0 && this.y == 0; } } /// /// Adds a point and a vector. /// public static XPoint operator +(XPoint point, XVector vector) { return new XPoint(point.x + vector.x, point.y + vector.y); } /// /// Adds a point and a size. /// public static XPoint operator +(XPoint point, XSize size) // TODO: make obsolete { return new XPoint(point.x + size.width, point.y + size.height); } /// /// Adds a point and a vector. /// public static XPoint Add(XPoint point, XVector vector) { return new XPoint(point.x + vector.x, point.y + vector.y); } /// /// Subtracts a vector from a point. /// public static XPoint operator -(XPoint point, XVector vector) { return new XPoint(point.x - vector.x, point.y - vector.y); } /// /// Subtracts a vector from a point. /// public static XPoint Subtract(XPoint point, XVector vector) { return new XPoint(point.x - vector.x, point.y - vector.y); } /// /// Subtracts a point from a point. /// public static XVector operator -(XPoint point1, XPoint point2) { return new XVector(point1.x - point2.x, point1.y - point2.y); } /// /// Subtracts a size from a point. /// [Obsolete("Use XVector instead of XSize as second parameter.")] public static XPoint operator -(XPoint point, XSize size) // TODO: make obsolete { return new XPoint(point.x - size.width, point.y - size.height); } /// /// Subtracts a point from a point. /// public static XVector Subtract(XPoint point1, XPoint point2) { return new XVector(point1.x - point2.x, point1.y - point2.y); } /// /// Multiplies a point with a matrix. /// public static XPoint operator *(XPoint point, XMatrix matrix) { return matrix.Transform(point); } /// /// Multiplies a point with a matrix. /// public static XPoint Multiply(XPoint point, XMatrix matrix) { return matrix.Transform(point); } /// /// Multiplies a point with a scalar value. /// public static XPoint operator *(XPoint point, double value) { return new XPoint(point.x * value, point.y * value); } /// /// Multiplies a point with a scalar value. /// public static XPoint operator *(double value, XPoint point) { return new XPoint(value * point.x, value * point.y); } /// /// Divides a point by a scalar value. /// [Obsolete("Avoid using this operator.")] public static XPoint operator /(XPoint point, double value) // DELETE: 09-12-31 { if (value == 0) throw new DivideByZeroException("Divisor is zero."); return new XPoint(point.x / value, point.y / value); } /// /// Performs an explicit conversion from XPoint to XSize. /// public static explicit operator XSize(XPoint point) { return new XSize(Math.Abs(point.x), Math.Abs(point.y)); } /// /// Performs an explicit conversion from XPoint to XVector. /// public static explicit operator XVector(XPoint point) { return new XVector(point.x, point.y); } #if WPF /// /// Performs an implicit conversion from XPoint to Point. /// public static implicit operator System.Windows.Point(XPoint point) { return new System.Windows.Point(point.x, point.y); } /// /// Performs an implicit conversion from Point to XPoint. /// public static implicit operator XPoint(System.Windows.Point point) { return new XPoint(point.X, point.Y); } #endif /// /// For convergence with WPF use new XPoint(), not XPoint.Empty /// [Obsolete("For convergence with WPF use new XPoint(), not XPoint.Empty")] public static readonly XPoint Empty = new XPoint(); // DELETE: 09-12-31 internal double x; internal double y; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XStringFormats.cs0000644000175000001440000000716211435766646023776 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Internal; namespace PdfSharp.Drawing { /// /// Represents predefined text layouts. /// public static class XStringFormats { /// /// Gets a new XStringFormat object that aligns the text left on the base line. /// public static XStringFormat Default { get { XStringFormat format = new XStringFormat(); format.LineAlignment = XLineAlignment.BaseLine; return format; } } /// /// Gets a new XStringFormat object that aligns the text top left of the layout rectangle. /// public static XStringFormat TopLeft { get { XStringFormat format = new XStringFormat(); format.Alignment = XStringAlignment.Near; format.LineAlignment = XLineAlignment.Near; return format; } } /// /// Gets a new XStringFormat object that centers the text in the middle of the layout rectangle. /// public static XStringFormat Center { get { XStringFormat format = new XStringFormat(); format.Alignment = XStringAlignment.Center; format.LineAlignment = XLineAlignment.Center; return format; } } /// /// Gets a new XStringFormat object that centers the text at the top of the layout rectangle. /// public static XStringFormat TopCenter { get { XStringFormat format = new XStringFormat(); format.Alignment = XStringAlignment.Center; format.LineAlignment = XLineAlignment.Near; return format; } } /// /// Gets a new XStringFormat object that centers the text at the bottom of the layout rectangle. /// public static XStringFormat BottomCenter { get { XStringFormat format = new XStringFormat(); format.Alignment = XStringAlignment.Center; format.LineAlignment = XLineAlignment.Far; return format; } } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XGraphicsState.cs0000644000175000001440000000364511435766646023737 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows.Media; #endif namespace PdfSharp.Drawing { /// /// Represents the internal state of an XGraphics object. /// public sealed class XGraphicsState { #if GDI internal XGraphicsState(GraphicsState state) { GdiState = state; } internal GraphicsState GdiState; #endif #if WPF internal XGraphicsState() { } #endif internal InternalGraphicsState InternalState; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XGraphics.cs0000644000175000001440000051163211435766646022736 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; #endif #if WPF using System.Windows; using System.Windows.Controls; using System.Windows.Media; #endif using PdfSharp.Internal; using PdfSharp.Pdf; using PdfSharp.Drawing.Pdf; using PdfSharp.Pdf.Advanced; // ReSharper disable RedundantNameQualifier namespace PdfSharp.Drawing { /// /// Represents a drawing surface (or canvas) for a fixed size page. /// public sealed class XGraphics : IDisposable { #if GDI /// /// Initializes a new instance of the XGraphics class. /// /// The gfx. /// The size. /// The page unit. /// The page direction. XGraphics(Graphics gfx, XSize size, XGraphicsUnit pageUnit, XPageDirection pageDirection) { if (gfx == null) { //throw new ArgumentNullException("gfx"); gfx = Graphics.FromHwnd(IntPtr.Zero); } this.gsStack = new GraphicsStateStack(this); this.targetContext = XGraphicTargetContext.GDI; this.gfx = gfx; this.drawGraphics = true; this.pageSize = new XSize(size.width, size.height); this.pageUnit = pageUnit; switch (pageUnit) { case XGraphicsUnit.Point: this.pageSizePoints = new XSize(size.width, size.height); break; case XGraphicsUnit.Inch: this.pageSizePoints = new XSize(XUnit.FromInch(size.width), XUnit.FromInch(size.height)); break; case XGraphicsUnit.Millimeter: this.pageSizePoints = new XSize(XUnit.FromMillimeter(size.width), XUnit.FromMillimeter(size.height)); break; case XGraphicsUnit.Centimeter: this.pageSizePoints = new XSize(XUnit.FromCentimeter(size.width), XUnit.FromCentimeter(size.height)); break; case XGraphicsUnit.Presentation: this.pageSizePoints = new XSize(XUnit.FromPresentation(size.width), XUnit.FromPresentation(size.height)); break; default: throw new NotImplementedException("unit"); } this.pageDirection = pageDirection; Initialize(); } #endif #if WPF && !SILVERLIGHT /// /// Initializes a new instance of the XGraphics class. /// /// The drawing context. /// The size. /// The page unit. /// The page direction. XGraphics(DrawingContext dc, XSize size, XGraphicsUnit pageUnit, XPageDirection pageDirection) { if (dc == null) { //throw new ArgumentNullException("dc"); this.dv = new DrawingVisual(); dc = this.dv.RenderOpen(); } this.gsStack = new GraphicsStateStack(this); this.targetContext = XGraphicTargetContext.WPF; this.dc = dc; this.drawGraphics = true; this.pageSize = new XSize(size.width, size.height); this.pageUnit = pageUnit; switch (pageUnit) { case XGraphicsUnit.Point: this.pageSizePoints = new XSize(size.width, size.height); break; case XGraphicsUnit.Inch: this.pageSizePoints = new XSize(XUnit.FromInch(size.width), XUnit.FromInch(size.height)); break; case XGraphicsUnit.Millimeter: this.pageSizePoints = new XSize(XUnit.FromMillimeter(size.width), XUnit.FromMillimeter(size.height)); break; case XGraphicsUnit.Centimeter: this.pageSizePoints = new XSize(XUnit.FromCentimeter(size.width), XUnit.FromCentimeter(size.height)); break; case XGraphicsUnit.Presentation: this.pageSizePoints = new XSize(XUnit.FromPresentation(size.width), XUnit.FromPresentation(size.height)); break; default: throw new NotImplementedException("unit"); } this.pageDirection = pageDirection; Initialize(); } #endif #if SILVERLIGHT /// /// Initializes a new instance of the XGraphics class. /// /// The canvas. /// The size. /// The page unit. /// The page direction. XGraphics(Canvas canvas, XSize size, XGraphicsUnit pageUnit, XPageDirection pageDirection) { //throw new ArgumentNullException("canvas"); if (canvas == null) canvas = new Canvas(); this.dc = new DrawingContext(canvas); this.gsStack = new GraphicsStateStack(this); this.targetContext = XGraphicTargetContext.WPF; this.drawGraphics = true; this.pageSize = new XSize(size.width, size.height); this.pageUnit = pageUnit; switch (pageUnit) { case XGraphicsUnit.Point: this.pageSizePoints = new XSize(size.width, size.height); break; case XGraphicsUnit.Inch: this.pageSizePoints = new XSize(XUnit.FromInch(size.width), XUnit.FromInch(size.height)); break; case XGraphicsUnit.Millimeter: this.pageSizePoints = new XSize(XUnit.FromMillimeter(size.width), XUnit.FromMillimeter(size.height)); break; case XGraphicsUnit.Centimeter: this.pageSizePoints = new XSize(XUnit.FromCentimeter(size.width), XUnit.FromCentimeter(size.height)); break; case XGraphicsUnit.Presentation: this.pageSizePoints = new XSize(XUnit.FromPresentation(size.width), XUnit.FromPresentation(size.height)); break; default: throw new NotImplementedException("unit"); } this.pageDirection = pageDirection; Initialize(); } #endif /// /// Initializes a new instance of the XGraphics class for drawing on a PDF page. /// XGraphics(PdfPage page, XGraphicsPdfPageOptions options, XGraphicsUnit pageUnit, XPageDirection pageDirection) { if (page == null) throw new ArgumentNullException("page"); if (page.Owner == null) throw new ArgumentException("You cannot draw on a page that is not owned by a PdfDocument object.", "page"); if (page.RenderContent != null) throw new InvalidOperationException("An XGraphics object already exists for this page and must be disposed before a new one can be created."); if (page.Owner.IsReadOnly) throw new InvalidOperationException("Cannot create XGraphics for a page of a document that cannot be modified. Use PdfDocumentOpenMode.Modify."); this.gsStack = new GraphicsStateStack(this); PdfContent content = null; switch (options) { case XGraphicsPdfPageOptions.Replace: page.Contents.Elements.Clear(); goto case XGraphicsPdfPageOptions.Append; case XGraphicsPdfPageOptions.Prepend: content = page.Contents.PrependContent(); break; case XGraphicsPdfPageOptions.Append: content = page.Contents.AppendContent(); break; } page.RenderContent = content; #if GDI // HACK: This does not work with MediumTrust this.gfx = Graphics.FromHwnd(IntPtr.Zero); this.targetContext = XGraphicTargetContext.GDI; //Bitmap bm = new Bitmap(10, 10); //this.gfx = Graphics.FromImage(bm); #endif #if WPF && !SILVERLIGHT this.dv = new DrawingVisual(); this.dc = this.dv.RenderOpen(); this.targetContext = XGraphicTargetContext.WPF; #endif #if SILVERLIGHT this.dc = new DrawingContext(new Canvas()); this.targetContext = XGraphicTargetContext.WPF; #endif #if GDI && WPF this.targetContext = PdfSharp.Internal.TargetContextHelper.TargetContext; #endif this.renderer = new PdfSharp.Drawing.Pdf.XGraphicsPdfRenderer(page, this, options); this.pageSizePoints = new XSize(page.Width, page.Height); switch (pageUnit) { case XGraphicsUnit.Point: this.pageSize = new XSize(page.Width, page.Height); break; case XGraphicsUnit.Inch: this.pageSize = new XSize(XUnit.FromPoint(page.Width).Inch, XUnit.FromPoint(page.Height).Inch); break; case XGraphicsUnit.Millimeter: this.pageSize = new XSize(XUnit.FromPoint(page.Width).Millimeter, XUnit.FromPoint(page.Height).Millimeter); break; case XGraphicsUnit.Centimeter: this.pageSize = new XSize(XUnit.FromPoint(page.Width).Centimeter, XUnit.FromPoint(page.Height).Centimeter); break; case XGraphicsUnit.Presentation: this.pageSize = new XSize(XUnit.FromPoint(page.Width).Presentation, XUnit.FromPoint(page.Height).Presentation); break; default: throw new NotImplementedException("unit"); } this.pageUnit = pageUnit; this.pageDirection = pageDirection; Initialize(); } /// /// Initializes a new instance of the XGraphics class used for drawing on a form. /// XGraphics(XForm form) { if (form == null) throw new ArgumentNullException("form"); this.form = form; form.AssociateGraphics(this); this.gsStack = new GraphicsStateStack(this); #if GDI && !WPF this.targetContext = XGraphicTargetContext.GDI; // If form.Owner is null create a meta file. if (form.Owner == null) { MemoryStream stream = new MemoryStream(); Graphics refgfx = Graphics.FromHwnd(IntPtr.Zero); IntPtr hdc = refgfx.GetHdc(); #if true_ // This code comes from my C++ RenderContext and checks some confusing details in connection // with metafiles. // Display | LaserJet // DPI 96 : 120 | 300 // physical device size in MM --------------------------------------------- int horzSizeMM = NativeMethods.GetDeviceCaps(hdc, NativeMethods.HORZSIZE); // = 360 : 360 | 198 (not 210) int vertSizeMM = NativeMethods.GetDeviceCaps(hdc, NativeMethods.VERTSIZE); // = 290 : 290 | 288 (hot 297) // Cool: // My monitor is a Sony SDM-N80 and it's size is EXACTLY 360mm x 290mm!! // It is an 18.1" Flat Panel LCD display from 2002 and these are the values // an older display drivers reports in about 2003: // Display // DPI 96 : 120 // -------------- // 330 : 254 // 254 : 203 // Obviously my ATI driver reports the exact size of the monitor. // device size in pixel int horzSizePixel = NativeMethods.GetDeviceCaps(hdc, NativeMethods.HORZRES); // = 1280 : 1280 | 4676 int vertSizePixel = NativeMethods.GetDeviceCaps(hdc, NativeMethods.VERTRES); // = 1024 : 1024 | 6814 // 'logical' device resolution in DPI int logResX = NativeMethods.GetDeviceCaps(hdc, NativeMethods.LOGPIXELSX); // = 96 : 120 | 600 int logResY = NativeMethods.GetDeviceCaps(hdc, NativeMethods.LOGPIXELSY); // = 96 : 120 | 600 // now we can get the 'physical' device resolution... float phyResX = horzSizePixel / (horzSizeMM / 25.4f); // = 98.521210 : 128.00000 | 599.85052 float phyResY = vertSizePixel / (vertSizeMM / 25.4f); // = 102.40000 : 128.12611 | 600.95691 // ...and rescale the size of the meta rectangle. float magicX = logResX / phyResX; // = 0.97440946 : 0.93750000 | 1.0002491 float magicY = logResY / phyResY; // = 0.93750000 : 0.93657720 | 0.99840766 // use A4 page in point // adjust size of A4 page so that meta file fits with DrawImage... //RectangleF rcMagic = new RectangleF(0, 0, magicX * form.Width, magicY * form.Height); //m_PreviewMetafile = new Metafile(hdc, rcMagic, MetafileFrameUnitPoint, // EmfTypeEmfPlusOnly, L"some description"); #endif RectangleF rect = new RectangleF(0, 0, form.PixelWidth, form.PixelHeight); this.metafile = new Metafile(stream, hdc, rect, MetafileFrameUnit.Pixel); //, EmfType.EmfPlusOnly); // Petzold disposes the refgfx object, although the hdc is in use of the metafile refgfx.ReleaseHdc(hdc); refgfx.Dispose(); this.gfx = Graphics.FromImage(this.metafile); this.gfx.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; this.drawGraphics = true; } else { this.metafile = null; this.gfx = Graphics.FromHwnd(IntPtr.Zero); } if (form.Owner != null) this.renderer = new PdfSharp.Drawing.Pdf.XGraphicsPdfRenderer(form, this); this.pageSize = form.Size; Initialize(); #endif #if WPF && !GDI this.targetContext = XGraphicTargetContext.WPF; #if !SILVERLIGHT // If form.Owner is null create a meta file. if (form.Owner == null) { this.dv = new DrawingVisual(); this.dc = this.dv.RenderOpen(); this.drawGraphics = true; } else { this.dv = new DrawingVisual(); this.dc = this.dv.RenderOpen(); } if (form.Owner != null) this.renderer = new PdfSharp.Drawing.Pdf.XGraphicsPdfRenderer(form, this); this.pageSize = form.Size; Initialize(); #else throw new NotImplementedException(); // AGHACK //Initialize(); #endif #endif } /// /// Creates the measure context. This is a graphics context created only for querying measures of text. /// Drawing on a measure context has no effect. /// public static XGraphics CreateMeasureContext(XSize size, XGraphicsUnit pageUnit, XPageDirection pageDirection) { XGraphics gfx = null; #if GDI gfx = new XGraphics((System.Drawing.Graphics)null, size, pageUnit, pageDirection); #endif #if WPF && !SILVERLIGHT gfx = new XGraphics((System.Windows.Media.DrawingContext)null, size, pageUnit, pageDirection); #endif #if SILVERLIGHT gfx = new XGraphics(new Canvas(), size, pageUnit, pageDirection); #endif return gfx; } #if GDI /// /// Creates a new instance of the XGraphics class from a System.Drawing.Graphics object. /// public static XGraphics FromGraphics(Graphics graphics, XSize size) { // TODO: Get object from cache... return new XGraphics(graphics, size, XGraphicsUnit.Point, XPageDirection.Downwards); } /// /// Creates a new instance of the XGraphics class from a System.Drawing.Graphics object. /// public static XGraphics FromGraphics(Graphics graphics, XSize size, XGraphicsUnit unit) { // TODO: Get object from cache... return new XGraphics(graphics, size, unit, XPageDirection.Downwards); } ///// ///// Creates a new instance of the XGraphics class from a System.Drawing.Graphics object. ///// //public static XGraphics FromGraphics(Graphics graphics, XSize size, XPageDirection pageDirection) //{ // // TODO: Get object from cache... // return new XGraphics(graphics, size, XGraphicsUnit.Point, pageDirection); //} ///// ///// Creates a new instance of the XGraphics class from a System.Drawing.Graphics object. ///// //public static XGraphics FromGraphics(Graphics graphics, XSize size, XGraphicsUnit unit, XPageDirection pageDirection) //{ // // TODO: Get object from cache... // return new XGraphics(graphics, size, XGraphicsUnit.Point, pageDirection); //} #endif #if WPF && !SILVERLIGHT /// /// Creates a new instance of the XGraphics class from a System.Windows.Media.DrawingContext object. /// public static XGraphics FromDrawingContext(DrawingContext drawingContext, XSize size, XGraphicsUnit unit) { return new XGraphics(drawingContext, size, unit, XPageDirection.Downwards); } #endif #if SILVERLIGHT /// /// Creates a new instance of the XGraphics class from a System.Windows.Media.DrawingContext object. /// public static XGraphics FromCanvas(Canvas canvas, XSize size, XGraphicsUnit unit) { return new XGraphics(canvas, size, unit, XPageDirection.Downwards); } #endif /// /// Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object. /// public static XGraphics FromPdfPage(PdfPage page) { return new XGraphics(page, XGraphicsPdfPageOptions.Append, XGraphicsUnit.Point, XPageDirection.Downwards); } /// /// Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object. /// public static XGraphics FromPdfPage(PdfPage page, XGraphicsUnit unit) { return new XGraphics(page, XGraphicsPdfPageOptions.Append, unit, XPageDirection.Downwards); } /// /// Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object. /// public static XGraphics FromPdfPage(PdfPage page, XPageDirection pageDirection) { return new XGraphics(page, XGraphicsPdfPageOptions.Append, XGraphicsUnit.Point, pageDirection); } /// /// Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object. /// public static XGraphics FromPdfPage(PdfPage page, XGraphicsPdfPageOptions options) { return new XGraphics(page, options, XGraphicsUnit.Point, XPageDirection.Downwards); } /// /// Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object. /// public static XGraphics FromPdfPage(PdfPage page, XGraphicsPdfPageOptions options, XPageDirection pageDirection) { return new XGraphics(page, options, XGraphicsUnit.Point, pageDirection); } /// /// Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object. /// public static XGraphics FromPdfPage(PdfPage page, XGraphicsPdfPageOptions options, XGraphicsUnit unit) { return new XGraphics(page, options, unit, XPageDirection.Downwards); } /// /// Creates a new instance of the XGraphics class from a PdfSharp.Pdf.PdfPage object. /// public static XGraphics FromPdfPage(PdfPage page, XGraphicsPdfPageOptions options, XGraphicsUnit unit, XPageDirection pageDirection) { return new XGraphics(page, options, unit, pageDirection); } /// /// Creates a new instance of the XGraphics class from a PdfSharp.Drawing.XPdfForm object. /// public static XGraphics FromPdfForm(XPdfForm form) { if (form.gfx != null) return form.gfx; return new XGraphics(form); } /// /// Creates a new instance of the XGraphics class from a PdfSharp.Drawing.XForm object. /// public static XGraphics FromForm(XForm form) { if (form.gfx != null) return form.gfx; return new XGraphics(form); } /// /// Internal setup. /// void Initialize() { this.pageOrigin = new XPoint(); XMatrix matrix = new XMatrix(); //XMatrix.Identity; double pageHeight = this.pageSize.height; PdfPage targetPage = PdfPage; XPoint trimOffset = new XPoint(); if (targetPage != null && targetPage.TrimMargins.AreSet) { pageHeight += targetPage.TrimMargins.Top.Point + targetPage.TrimMargins.Bottom.Point; trimOffset = new XPoint(targetPage.TrimMargins.Left.Point, targetPage.TrimMargins.Top.Point); } #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { if (this.gfx != null) matrix = (XMatrix)gfx.Transform; if (this.pageUnit != XGraphicsUnit.Point) { switch (this.pageUnit) { case XGraphicsUnit.Inch: matrix.ScalePrepend(XUnit.InchFactor); break; case XGraphicsUnit.Millimeter: matrix.ScalePrepend(XUnit.MillimeterFactor); break; case XGraphicsUnit.Centimeter: matrix.ScalePrepend(XUnit.CentimeterFactor); break; case XGraphicsUnit.Presentation: matrix.ScalePrepend(XUnit.PresentationFactor); break; } } } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { if (this.pageUnit != XGraphicsUnit.Presentation) { switch (this.pageUnit) { case XGraphicsUnit.Point: matrix.ScalePrepend(XUnit.PointFactorWpf); break; case XGraphicsUnit.Inch: matrix.ScalePrepend(XUnit.InchFactorWpf); break; case XGraphicsUnit.Millimeter: matrix.ScalePrepend(XUnit.MillimeterFactorWpf); break; case XGraphicsUnit.Centimeter: matrix.ScalePrepend(XUnit.CentimeterFactorWpf); break; } if (!matrix.IsIdentity) { #if !SILVERLIGHT MatrixTransform transform = new MatrixTransform((System.Windows.Media.Matrix)matrix); dc.PushTransform(transform); #else MatrixTransform transform2 = new MatrixTransform(); transform2.Matrix = (System.Windows.Media.Matrix)matrix; dc.PushTransform(transform2); #endif } } } #endif if (this.pageDirection == XPageDirection.Upwards) matrix.Prepend(new XMatrix(1, 0, 0, -1, 0, pageHeight)); if (trimOffset != new XPoint()) matrix.TranslatePrepend(trimOffset.x, trimOffset.y); this.defaultViewMatrix = matrix; this.transform = new XMatrix(); //XMatrix.Identity; } /// /// Releases all resources used by this object. /// public void Dispose() { Dispose(true); } void Dispose(bool disposing) { if (!this.disposed) { this.disposed = true; if (disposing) { // Dispose managed resources. } if (this.form != null) this.form.Finish(); #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { // GDI+ requires this to disassociate it from metafiles this.gfx.Dispose(); this.gfx = null; this.metafile = null; } #endif #if WPF if (this.dc != null) { this.dc.Close(); #if !SILVERLIGHT this.dv = null; #endif } #endif this.drawGraphics = false; if (this.renderer != null) { this.renderer.Close(); this.renderer = null; } } } bool disposed; /// /// Internal hack for MigraDoc. Will be removed in further releases. /// Unicode support requires a global refactoring of MigraDoc and will be done in further releases. /// public PdfFontEncoding MUH // MigraDoc Unicode Hack... { get { return this.muh; } set { this.muh = value; } } PdfFontEncoding muh; /// /// Internal hack for MigraDoc. Will be removed in further releases. /// Font embedding support requires a global refactoring of MigraDoc and will be done in further releases. /// public PdfFontEmbedding MFEH // MigraDoc Font Embedding Hack... { get { return this.mfeh; } set { this.mfeh = value; } } PdfFontEmbedding mfeh; /// /// A value indicating whether GDI+ or WPF is used as context. /// internal XGraphicTargetContext targetContext; /// /// Gets or sets the unit of measure used for page coordinates. /// CURRENTLY ONLY POINT IS IMPLEMENTED. /// public XGraphicsUnit PageUnit { get { return this.pageUnit; } //set //{ // // TODO: other page units // if (value != XGraphicsUnit.Point) // throw new NotImplementedException("PageUnit must be XGraphicsUnit.Point in current implementation."); //} } XGraphicsUnit pageUnit; /// /// Gets or sets the a value indicating in which direction y-value grow. /// public XPageDirection PageDirection { get { return this.pageDirection; } set { //TODO if (value != XPageDirection.Downwards) throw new NotImplementedException("PageDirection must be XPageDirection.Downwards in current implementation."); } } XPageDirection pageDirection; /// /// Gets the current page origin. Setting the origin is not yet implemented. /// public XPoint PageOrigin { get { return this.pageOrigin; } set { //TODO if (value != new XPoint()) throw new NotImplementedException("PageOrigin cannot be modified in current implementation."); } } XPoint pageOrigin; /// /// Gets the current size of the page. /// public XSize PageSize { get { return this.pageSize; } //set //{ // //TODO // throw new NotImplementedException("PageSize cannot be modified in current implementation."); //} } XSize pageSize; XSize pageSizePoints; //public void Flush(); //public void Flush(FlushIntention intention); #region Drawing // ----- Clear -------------------------------------------------------------------------------- /// /// Fills the entire drawing surface with the specified color. The functions works only if /// the current transformation is identity, i.e. the function should be called only immediately /// after the XGraphics object was created. /// public void Clear(XColor color) { if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.Clear(color.ToGdiColor()); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { Rect rc = new Rect(); rc.Width = rc.Height = 10000; this.dc.DrawRectangle(new SolidColorBrush(color.ToWpfColor()), null, rc); } #endif } if (this.renderer != null) this.renderer.Clear(color); } // ----- DrawLine ----------------------------------------------------------------------------- #if GDI /// /// Draws a line connecting two Point structures. /// public void DrawLine(XPen pen, System.Drawing.Point pt1, System.Drawing.Point pt2) { DrawLine(pen, (double)pt1.X, (double)pt1.Y, (double)pt2.X, (double)pt2.Y); } #endif #if WPF /// /// Draws a line connecting two Point structures. /// public void DrawLine(XPen pen, System.Windows.Point pt1, System.Windows.Point pt2) { DrawLine(pen, (double)pt1.X, (double)pt1.Y, (double)pt2.X, (double)pt2.Y); } #endif #if GDI /// /// Draws a line connecting two PointF structures. /// public void DrawLine(XPen pen, PointF pt1, PointF pt2) { DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y); } #endif /// /// Draws a line connecting two XPoint structures. /// public void DrawLine(XPen pen, XPoint pt1, XPoint pt2) { DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y); } /// /// Draws a line connecting the two points specified by coordinate pairs. /// public void DrawLine(XPen pen, int x1, int y1, int x2, int y2) { DrawLine(pen, (double)x1, (double)y1, (double)x2, (double)y2); } /// /// Draws a line connecting the two points specified by coordinate pairs. /// public void DrawLine(XPen pen, double x1, double y1, double x2, double y2) { if (pen == null) throw new ArgumentNullException("pen"); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.DrawLine(pen.RealizeGdiPen(), (float)x1, (float)y1, (float)x2, (float)y2); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) this.dc.DrawLine(pen.RealizeWpfPen(), new System.Windows.Point(x1, y1), new System.Windows.Point(x2, y2)); #endif } if (this.renderer != null) this.renderer.DrawLines(pen, new XPoint[2] { new XPoint(x1, y1), new XPoint(x2, y2) }); } // ----- DrawLines ---------------------------------------------------------------------------- #if GDI /// /// Draws a series of line segments that connect an array of points. /// public void DrawLines(XPen pen, System.Drawing.Point[] points) { DrawLines(pen, MakePointFArray(points)); } #endif #if WPF /// /// Draws a series of line segments that connect an array of points. /// public void DrawLines(XPen pen, System.Windows.Point[] points) { DrawLines(pen, XGraphics.MakeXPointArray(points)); } #endif #if GDI /// /// Draws a series of line segments that connect an array of points. /// public void DrawLines(XPen pen, PointF[] points) { if (pen == null) throw new ArgumentNullException("pen"); if (points == null) throw new ArgumentNullException("points"); if (points.Length < 2) throw new ArgumentException("points", PSSR.PointArrayAtLeast(2)); if (this.drawGraphics) this.gfx.DrawLines(pen.RealizeGdiPen(), points); if (this.renderer != null) this.renderer.DrawLines(pen, MakeXPointArray(points)); } #endif /// /// Draws a series of line segments that connect an array of points. /// public void DrawLines(XPen pen, XPoint[] points) { if (pen == null) throw new ArgumentNullException("pen"); if (points == null) throw new ArgumentNullException("points"); if (points.Length < 2) throw new ArgumentException("points", PSSR.PointArrayAtLeast(2)); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.DrawLines(pen.RealizeGdiPen(), XGraphics.MakePointFArray(points)); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { #if !SILVERLIGHT PolyLineSegment seg = new PolyLineSegment(XGraphics.MakePointArray(points), true); #else Point[] pts = XGraphics.MakePointArray(points); PointCollection collection = new PointCollection(); foreach (Point point in pts) collection.Add(point); PolyLineSegment seg = new PolyLineSegment(); seg.Points = collection; #endif PathFigure figure = new PathFigure(); figure.StartPoint = new System.Windows.Point(points[0].x, points[0].y); figure.Segments.Add(seg); PathGeometry geo = new PathGeometry(); geo.Figures.Add(figure); this.dc.DrawGeometry(null, pen.RealizeWpfPen(), geo); } #endif } if (this.renderer != null) this.renderer.DrawLines(pen, points); } /// /// Draws a series of line segments that connect an array of x and y pairs. /// public void DrawLines(XPen pen, double x, double y, params double[] value) { if (pen == null) throw new ArgumentNullException("pen"); if (value == null) throw new ArgumentNullException("value"); int length = value.Length; XPoint[] points = new XPoint[length / 2 + 1]; points[0].X = x; points[0].Y = y; for (int idx = 0; idx < length / 2; idx++) { points[idx + 1].X = value[2 * idx]; points[idx + 1].Y = value[2 * idx + 1]; } DrawLines(pen, points); } // ----- DrawBezier --------------------------------------------------------------------------- #if GDI /// /// Draws a Bzier spline defined by four points. /// public void DrawBezier(XPen pen, System.Drawing.Point pt1, System.Drawing.Point pt2, System.Drawing.Point pt3, System.Drawing.Point pt4) { DrawBezier(pen, (double)pt1.X, (double)pt1.Y, (double)pt2.X, (double)pt2.Y, (double)pt3.X, (double)pt3.Y, (double)pt4.X, (double)pt4.Y); } #endif #if WPF /// /// Draws a Bzier spline defined by four points. /// public void DrawBezier(XPen pen, System.Windows.Point pt1, System.Windows.Point pt2, System.Windows.Point pt3, System.Windows.Point pt4) { DrawBezier(pen, (double)pt1.X, (double)pt1.Y, (double)pt2.X, (double)pt2.Y, (double)pt3.X, (double)pt3.Y, (double)pt4.X, (double)pt4.Y); } #endif #if GDI /// /// Draws a Bzier spline defined by four points. /// public void DrawBezier(XPen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4) { DrawBezier(pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y); } #endif /// /// Draws a Bzier spline defined by four points. /// public void DrawBezier(XPen pen, XPoint pt1, XPoint pt2, XPoint pt3, XPoint pt4) { DrawBezier(pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y); } /// /// Draws a Bzier spline defined by four points. /// public void DrawBezier(XPen pen, double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { if (pen == null) throw new ArgumentNullException("pen"); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.DrawBezier(pen.RealizeGdiPen(), (float)x1, (float)y1, (float)x2, (float)y2, (float)x3, (float)y3, (float)x4, (float)y4); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { #if !SILVERLIGHT BezierSegment seg = new BezierSegment(new System.Windows.Point(x2, y2), new System.Windows.Point(x3, y3), new System.Windows.Point(x4, y4), true); PathFigure figure = new PathFigure(); figure.StartPoint = new System.Windows.Point(x1, y1); figure.Segments.Add(seg); PathGeometry geo = new PathGeometry(); geo.Figures.Add(figure); this.dc.DrawGeometry(null, pen.RealizeWpfPen(), geo); #else // AGHACK #endif } #endif } if (this.renderer != null) this.renderer.DrawBeziers(pen, new XPoint[4]{new XPoint(x1, y1), new XPoint(x2, y2), new XPoint(x3, y3), new XPoint(x4, y4)}); } // ----- DrawBeziers -------------------------------------------------------------------------- #if GDI /// /// Draws a series of Bzier splines from an array of points. /// public void DrawBeziers(XPen pen, System.Drawing.Point[] points) { DrawBeziers(pen, MakeXPointArray(points)); } #endif #if WPF /// /// Draws a series of Bzier splines from an array of points. /// public void DrawBeziers(XPen pen, System.Windows.Point[] points) { DrawBeziers(pen, MakeXPointArray(points)); } #endif #if GDI /// /// Draws a series of Bzier splines from an array of points. /// public void DrawBeziers(XPen pen, PointF[] points) { DrawBeziers(pen, MakeXPointArray(points)); } #endif /// /// Draws a series of Bzier splines from an array of points. /// public void DrawBeziers(XPen pen, XPoint[] points) { if (pen == null) throw new ArgumentNullException("pen"); int count = points.Length; if (count == 0) return; if ((count - 1) % 3 != 0) throw new ArgumentException("Invalid number of points for bezier curves. Number must fulfil 4+3n.", "points"); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.DrawBeziers(pen.RealizeGdiPen(), MakePointFArray(points)); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { #if !SILVERLIGHT PathFigure figure = new PathFigure(); figure.StartPoint = new System.Windows.Point(points[0].x, points[0].y); for (int idx = 1; idx < count; idx += 3) { BezierSegment seg = new BezierSegment( new System.Windows.Point(points[idx].x, points[idx].y), new System.Windows.Point(points[idx + 1].x, points[idx + 1].y), new System.Windows.Point(points[idx + 2].x, points[idx + 2].y), true); figure.Segments.Add(seg); } PathGeometry geo = new PathGeometry(); geo.Figures.Add(figure); this.dc.DrawGeometry(null, pen.RealizeWpfPen(), geo); #else // AGHACK #endif } #endif } if (this.renderer != null) this.renderer.DrawBeziers(pen, points); } // ----- DrawCurve ---------------------------------------------------------------------------- #if GDI /// /// Draws a cardinal spline through a specified array of points. /// public void DrawCurve(XPen pen, System.Drawing.Point[] points) { DrawCurve(pen, MakePointFArray(points), 0.5); } #endif #if WPF /// /// Draws a cardinal spline through a specified array of points. /// public void DrawCurve(XPen pen, System.Windows.Point[] points) { DrawCurve(pen, MakeXPointArray(points), 0.5); } #endif #if GDI /// /// Draws a cardinal spline through a specified array of points. /// public void DrawCurve(XPen pen, PointF[] points) { DrawCurve(pen, MakeXPointArray(points), 0.5); } #endif /// /// Draws a cardinal spline through a specified array of points. /// public void DrawCurve(XPen pen, XPoint[] points) { DrawCurve(pen, points, 0.5); } #if GDI /// /// Draws a cardinal spline through a specified array of points using a specified tension. /// public void DrawCurve(XPen pen, System.Drawing.Point[] points, double tension) { DrawCurve(pen, MakeXPointArray(points), tension); } #endif #if WPF /// /// Draws a cardinal spline through a specified array of points using a specified tension. /// public void DrawCurve(XPen pen, System.Windows.Point[] points, double tension) { DrawCurve(pen, MakeXPointArray(points), tension); } #endif #if GDI /// /// Draws a cardinal spline through a specified array of points using a specified tension. /// public void DrawCurve(XPen pen, PointF[] points, double tension) { DrawCurve(pen, MakeXPointArray(points), tension); } #endif /// /// Draws a cardinal spline through a specified array of points using a specified tension. /// public void DrawCurve(XPen pen, XPoint[] points, double tension) { if (pen == null) throw new ArgumentNullException("pen"); if (points == null) throw new ArgumentNullException("points"); int count = points.Length; if (count < 2) throw new ArgumentException("DrawCurve requires two or more points.", "points"); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.DrawCurve(pen.RealizeGdiPen(), MakePointFArray(points), (float)tension); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { tension /= 3; PathFigure figure = new PathFigure(); figure.StartPoint = new System.Windows.Point(points[0].x, points[0].y); if (count == 2) { figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[0], points[0], points[1], points[1], tension)); } else { figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[0], points[0], points[1], points[2], tension)); for (int idx = 1; idx < count - 2; idx++) figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[idx - 1], points[idx], points[idx + 1], points[idx + 2], tension)); figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 3], points[count - 2], points[count - 1], points[count - 1], tension)); } PathGeometry geo = new PathGeometry(); geo.Figures.Add(figure); this.dc.DrawGeometry(null, pen.RealizeWpfPen(), geo); } #endif } if (this.renderer != null) this.renderer.DrawCurve(pen, points, tension); } // TODO: //public void DrawCurve(XPen pen, PointF[] points, int offset, int numberOfSegments); //public void DrawCurve(XPen pen, Point[] points, int offset, int numberOfSegments, double tension); //public void DrawCurve(XPen pen, PointF[] points, int offset, int numberOfSegments, double tension); // ----- DrawArc ------------------------------------------------------------------------------ #if GDI /// /// Draws an arc representing a portion of an ellipse. /// public void DrawArc(XPen pen, Rectangle rect, double startAngle, double sweepAngle) { DrawArc(pen, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, startAngle, sweepAngle); } #endif #if GDI /// /// Draws an arc representing a portion of an ellipse. /// public void DrawArc(XPen pen, RectangleF rect, double startAngle, double sweepAngle) { DrawArc(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); } #endif /// /// Draws an arc representing a portion of an ellipse. /// public void DrawArc(XPen pen, XRect rect, double startAngle, double sweepAngle) { DrawArc(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); } /// /// Draws an arc representing a portion of an ellipse. /// public void DrawArc(XPen pen, int x, int y, int width, int height, int startAngle, int sweepAngle) { DrawArc(pen, (double)x, (double)y, (double)width, (double)height, startAngle, sweepAngle); } /// /// Draws an arc representing a portion of an ellipse. /// public void DrawArc(XPen pen, double x, double y, double width, double height, double startAngle, double sweepAngle) { if (pen == null) throw new ArgumentNullException("pen"); if (Math.Abs(sweepAngle) >= 360) { DrawEllipse(pen, x, y, width, height); } else { if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.DrawArc(pen.RealizeGdiPen(), (float)x, (float)y, (float)width, (float)height, (float)startAngle, (float)sweepAngle); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { System.Windows.Point startPoint; ArcSegment seg = GeometryHelper.CreateArcSegment(x, y, width, height, startAngle, sweepAngle, out startPoint); PathFigure figure = new PathFigure(); figure.StartPoint = startPoint; figure.Segments.Add(seg); PathGeometry geo = new PathGeometry(); geo.Figures.Add(figure); this.dc.DrawGeometry(null, pen.RealizeWpfPen(), geo); } #endif } if (this.renderer != null) this.renderer.DrawArc(pen, x, y, width, height, startAngle, sweepAngle); } } // ----- DrawRectangle ------------------------------------------------------------------------ // ----- stroke ----- #if GDI /// /// Draws a rectangle. /// public void DrawRectangle(XPen pen, Rectangle rect) { DrawRectangle(pen, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height); } #endif #if GDI /// /// Draws a rectangle. /// public void DrawRectangle(XPen pen, RectangleF rect) { DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height); } #endif /// /// Draws a rectangle. /// public void DrawRectangle(XPen pen, XRect rect) { DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height); } /// /// Draws a rectangle. /// public void DrawRectangle(XPen pen, int x, int y, int width, int height) { DrawRectangle(pen, (double)x, (double)y, (double)width, (double)height); } /// /// Draws a rectangle. /// public void DrawRectangle(XPen pen, double x, double y, double width, double height) { if (pen == null) throw new ArgumentNullException("pen"); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.DrawRectangle(pen.RealizeGdiPen(), (float)x, (float)y, (float)width, (float)height); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { this.dc.DrawRectangle(null, pen.RealizeWpfPen(), new Rect(x, y, width, height)); } #endif } if (this.renderer != null) this.renderer.DrawRectangle(pen, null, x, y, width, height); } // ----- fill ----- #if GDI /// /// Draws a rectangle. /// public void DrawRectangle(XBrush brush, Rectangle rect) { DrawRectangle(brush, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height); } #endif #if GDI /// /// Draws a rectangle. /// public void DrawRectangle(XBrush brush, RectangleF rect) { DrawRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height); } #endif /// /// Draws a rectangle. /// public void DrawRectangle(XBrush brush, XRect rect) { DrawRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height); } /// /// Draws a rectangle. /// public void DrawRectangle(XBrush brush, int x, int y, int width, int height) { DrawRectangle(brush, (double)x, (double)y, (double)width, (double)height); } /// /// Draws a rectangle. /// public void DrawRectangle(XBrush brush, double x, double y, double width, double height) { if (brush == null) throw new ArgumentNullException("brush"); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.FillRectangle(brush.RealizeGdiBrush(), (float)x, (float)y, (float)width, (float)height); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) this.dc.DrawRectangle(brush.RealizeWpfBrush(), null, new Rect(x, y, width, height)); #endif } if (this.renderer != null) this.renderer.DrawRectangle(null, brush, x, y, width, height); } // ----- stroke and fill ----- #if GDI /// /// Draws a rectangle. /// public void DrawRectangle(XPen pen, XBrush brush, Rectangle rect) { DrawRectangle(pen, brush, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height); } #endif #if GDI /// /// Draws a rectangle. /// public void DrawRectangle(XPen pen, XBrush brush, RectangleF rect) { DrawRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); } #endif /// /// Draws a rectangle. /// public void DrawRectangle(XPen pen, XBrush brush, XRect rect) { DrawRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); } /// /// Draws a rectangle. /// public void DrawRectangle(XPen pen, XBrush brush, int x, int y, int width, int height) { DrawRectangle(pen, brush, (double)x, (double)y, (double)width, (double)height); } /// /// Draws a rectangle. /// public void DrawRectangle(XPen pen, XBrush brush, double x, double y, double width, double height) { if (pen == null && brush == null) throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { this.gfx.FillRectangle(brush.RealizeGdiBrush(), (float)x, (float)y, (float)width, (float)height); this.gfx.DrawRectangle(pen.RealizeGdiPen(), (float)x, (float)y, (float)width, (float)height); } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) this.dc.DrawRectangle(brush.RealizeWpfBrush(), pen.RealizeWpfPen(), new Rect(x, y, width, height)); #endif } if (this.renderer != null) this.renderer.DrawRectangle(pen, brush, x, y, width, height); } // ----- DrawRectangles ----------------------------------------------------------------------- // ----- stroke ----- #if GDI /// /// Draws a series of rectangles. /// public void DrawRectangles(XPen pen, Rectangle[] rectangles) { if (pen == null) throw new ArgumentNullException("pen"); if (rectangles == null) throw new ArgumentNullException("rectangles"); DrawRectangles(pen, null, rectangles); } #endif #if GDI /// /// Draws a series of rectangles. /// public void DrawRectangles(XPen pen, RectangleF[] rectangles) { if (pen == null) throw new ArgumentNullException("pen"); if (rectangles == null) throw new ArgumentNullException("rectangles"); DrawRectangles(pen, null, rectangles); } #endif /// /// Draws a series of rectangles. /// public void DrawRectangles(XPen pen, XRect[] rectangles) { if (pen == null) throw new ArgumentNullException("pen"); if (rectangles == null) throw new ArgumentNullException("rectangles"); DrawRectangles(pen, null, rectangles); } // ----- fill ----- #if GDI /// /// Draws a series of rectangles. /// public void DrawRectangles(XBrush brush, Rectangle[] rectangles) { if (brush == null) throw new ArgumentNullException("brush"); if (rectangles == null) throw new ArgumentNullException("rectangles"); DrawRectangles(null, brush, rectangles); } #endif #if GDI /// /// Draws a series of rectangles. /// public void DrawRectangles(XBrush brush, RectangleF[] rectangles) { if (brush == null) throw new ArgumentNullException("brush"); if (rectangles == null) throw new ArgumentNullException("rectangles"); DrawRectangles(null, brush, rectangles); } #endif /// /// Draws a series of rectangles. /// public void DrawRectangles(XBrush brush, XRect[] rectangles) { if (brush == null) throw new ArgumentNullException("brush"); if (rectangles == null) throw new ArgumentNullException("rectangles"); DrawRectangles(null, brush, rectangles); } // ----- stroke and fill ----- #if GDI /// /// Draws a series of rectangles. /// public void DrawRectangles(XPen pen, XBrush brush, Rectangle[] rectangles) { if (pen == null && brush == null) throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); if (rectangles == null) throw new ArgumentNullException("rectangles"); if (this.drawGraphics) { this.gfx.FillRectangles(brush.RealizeGdiBrush(), rectangles); this.gfx.DrawRectangles(pen.RealizeGdiPen(), rectangles); } if (this.renderer != null) { int count = rectangles.Length; for (int idx = 0; idx < count; idx++) { Rectangle rect = rectangles[idx]; this.renderer.DrawRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); } } } #endif #if GDI /// /// Draws a series of rectangles. /// public void DrawRectangles(XPen pen, XBrush brush, RectangleF[] rectangles) { if (pen == null && brush == null) throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); if (rectangles == null) throw new ArgumentNullException("rectangles"); if (this.drawGraphics) { this.gfx.FillRectangles(brush.RealizeGdiBrush(), rectangles); this.gfx.DrawRectangles(pen.RealizeGdiPen(), rectangles); } if (this.renderer != null) { int count = rectangles.Length; for (int idx = 0; idx < count; idx++) { RectangleF rect = rectangles[idx]; this.renderer.DrawRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); } } } #endif /// /// Draws a series of rectangles. /// public void DrawRectangles(XPen pen, XBrush brush, XRect[] rectangles) { if (pen == null && brush == null) throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); if (rectangles == null) throw new ArgumentNullException("rectangles"); int count = rectangles.Length; if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { RectangleF[] rects = new RectangleF[count]; for (int idx = 0; idx < count; idx++) { XRect rect = rectangles[idx]; rects[idx] = new RectangleF((float)rect.X, (float)rect.Y, (float)rect.Width, (float)rect.Height); } if (brush != null) this.gfx.FillRectangles(brush.RealizeGdiBrush(), rects); if (pen != null) this.gfx.DrawRectangles(pen.RealizeGdiPen(), rects); } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { System.Windows.Media.Brush wpfBrush = brush != null ? brush.RealizeWpfBrush() : null; System.Windows.Media.Pen wpfPen = pen != null ? pen.RealizeWpfPen() : null; for (int idx = 0; idx < count; idx++) { XRect rect = rectangles[idx]; this.dc.DrawRectangle(wpfBrush, wpfPen, new System.Windows.Rect(new System.Windows.Point(rect.x, rect.y), new System.Windows.Size(rect.width, rect.height))); } } #endif } if (this.renderer != null) { for (int idx = 0; idx < count; idx++) { XRect rect = rectangles[idx]; this.renderer.DrawRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); } } } // ----- DrawRoundedRectangle ----------------------------------------------------------------- // ----- stroke ----- #if GDI /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XPen pen, Rectangle rect, System.Drawing.Size ellipseSize) { DrawRoundedRectangle(pen, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, (double)ellipseSize.Width, (double)ellipseSize.Height); } #endif #if WPF /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XPen pen, Rect rect, System.Windows.Size ellipseSize) { DrawRoundedRectangle(pen, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, (double)ellipseSize.Width, (double)ellipseSize.Height); } #endif #if GDI /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XPen pen, RectangleF rect, SizeF ellipseSize) { DrawRoundedRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); } #endif /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XPen pen, XRect rect, XSize ellipseSize) { DrawRoundedRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); } /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XPen pen, int x, int y, int width, int height, int ellipseWidth, int ellipseHeight) { DrawRoundedRectangle(pen, (double)x, (double)y, (double)width, (double)height, (double)ellipseWidth, (double)ellipseHeight); } /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XPen pen, double x, double y, double width, double height, double ellipseWidth, double ellipseHeight) { if (pen == null) throw new ArgumentNullException("pen"); DrawRoundedRectangle(pen, null, x, y, width, height, ellipseWidth, ellipseHeight); } // ----- fill ----- #if GDI /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XBrush brush, Rectangle rect, System.Drawing.Size ellipseSize) { DrawRoundedRectangle(brush, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, (double)ellipseSize.Width, (double)ellipseSize.Height); } #endif #if WPF /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XBrush brush, Rect rect, System.Windows.Size ellipseSize) { DrawRoundedRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); } #endif #if GDI /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XBrush brush, RectangleF rect, SizeF ellipseSize) { DrawRoundedRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); } #endif /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XBrush brush, XRect rect, XSize ellipseSize) { DrawRoundedRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); } /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XBrush brush, int x, int y, int width, int height, int ellipseWidth, int ellipseHeight) { DrawRoundedRectangle(brush, (double)x, (double)y, (double)width, (double)height, (double)ellipseWidth, (double)ellipseHeight); } /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XBrush brush, double x, double y, double width, double height, double ellipseWidth, double ellipseHeight) { if (brush == null) throw new ArgumentNullException("brush"); DrawRoundedRectangle(null, brush, x, y, width, height, ellipseWidth, ellipseHeight); } // ----- stroke and fill ----- #if GDI /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XPen pen, XBrush brush, Rectangle rect, System.Drawing.Size ellipseSize) { DrawRoundedRectangle(pen, brush, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, (double)ellipseSize.Width, (double)ellipseSize.Height); } #endif #if WPF /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XPen pen, XBrush brush, Rect rect, System.Windows.Size ellipseSize) { DrawRoundedRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); } #endif #if GDI /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XPen pen, XBrush brush, RectangleF rect, SizeF ellipseSize) { DrawRoundedRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); } #endif /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XPen pen, XBrush brush, XRect rect, XSize ellipseSize) { DrawRoundedRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height, ellipseSize.Width, ellipseSize.Height); } /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XPen pen, XBrush brush, int x, int y, int width, int height, int ellipseWidth, int ellipseHeight) { DrawRoundedRectangle(pen, brush, (double)x, (double)y, (double)width, (double)height, (double)ellipseWidth, (double)ellipseHeight); } /// /// Draws a rectangles with round corners. /// public void DrawRoundedRectangle(XPen pen, XBrush brush, double x, double y, double width, double height, double ellipseWidth, double ellipseHeight) { if (pen == null && brush == null) throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { XGraphicsPath path = new XGraphicsPath(); path.AddRoundedRectangle(x, y, width, height, ellipseWidth, ellipseHeight); DrawPath(pen, brush, path); } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { this.dc.DrawRoundedRectangle( brush != null ? brush.RealizeWpfBrush() : null, pen != null ? pen.RealizeWpfPen() : null, new Rect(x, y, width, height), ellipseWidth / 2, ellipseHeight / 2); } #endif } if (this.renderer != null) this.renderer.DrawRoundedRectangle(pen, brush, x, y, width, height, ellipseWidth, ellipseHeight); } // ----- DrawEllipse -------------------------------------------------------------------------- // ----- stroke ----- #if GDI /// /// Draws an ellipse defined by a bounding rectangle. /// public void DrawEllipse(XPen pen, Rectangle rect) { DrawEllipse(pen, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height); } #endif #if GDI /// /// Draws an ellipse defined by a bounding rectangle. /// public void DrawEllipse(XPen pen, RectangleF rect) { DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height); } #endif /// /// Draws an ellipse defined by a bounding rectangle. /// public void DrawEllipse(XPen pen, XRect rect) { DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height); } /// /// Draws an ellipse defined by a bounding rectangle. /// public void DrawEllipse(XPen pen, int x, int y, int width, int height) { DrawEllipse(pen, (double)x, (double)y, (double)width, (double)height); } /// /// Draws an ellipse defined by a bounding rectangle. /// public void DrawEllipse(XPen pen, double x, double y, double width, double height) { if (pen == null) throw new ArgumentNullException("pen"); // No DrawArc defined? if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.DrawArc(pen.RealizeGdiPen(), (float)x, (float)y, (float)width, (float)height, 0, 360); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { double radiusX = width / 2; double radiusY = height / 2; this.dc.DrawEllipse(null, pen.RealizeWpfPen(), new System.Windows.Point(x + radiusX, y + radiusY), radiusX, radiusY); } #endif } if (this.renderer != null) this.renderer.DrawEllipse(pen, null, x, y, width, height); } // ----- fill ----- #if GDI /// /// Draws an ellipse defined by a bounding rectangle. /// public void DrawEllipse(XBrush brush, Rectangle rect) { DrawEllipse(brush, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height); } #endif #if GDI /// /// Draws an ellipse defined by a bounding rectangle. /// public void DrawEllipse(XBrush brush, RectangleF rect) { DrawEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height); } #endif /// /// Draws an ellipse defined by a bounding rectangle. /// public void DrawEllipse(XBrush brush, XRect rect) { DrawEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height); } /// /// Draws an ellipse defined by a bounding rectangle. /// public void DrawEllipse(XBrush brush, int x, int y, int width, int height) { DrawEllipse(brush, (double)x, (double)y, (double)width, (double)height); } /// /// Draws an ellipse defined by a bounding rectangle. /// public void DrawEllipse(XBrush brush, double x, double y, double width, double height) { if (brush == null) throw new ArgumentNullException("brush"); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.FillEllipse(brush.RealizeGdiBrush(), (float)x, (float)y, (float)width, (float)height); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { double radiusX = width / 2; double radiusY = height / 2; this.dc.DrawEllipse(brush.RealizeWpfBrush(), null, new System.Windows.Point(x + radiusX, y + radiusY), radiusX, radiusY); } #endif } if (this.renderer != null) this.renderer.DrawEllipse(null, brush, x, y, width, height); } // ----- stroke and fill ----- #if GDI /// /// Draws an ellipse defined by a bounding rectangle. /// public void DrawEllipse(XPen pen, XBrush brush, Rectangle rect) { DrawEllipse(pen, brush, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height); } #endif #if GDI /// /// Draws an ellipse defined by a bounding rectangle. /// public void DrawEllipse(XPen pen, XBrush brush, RectangleF rect) { DrawEllipse(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); } #endif /// /// Draws an ellipse defined by a bounding rectangle. /// public void DrawEllipse(XPen pen, XBrush brush, XRect rect) { DrawEllipse(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); } /// /// Draws an ellipse defined by a bounding rectangle. /// public void DrawEllipse(XPen pen, XBrush brush, int x, int y, int width, int height) { DrawEllipse(pen, brush, (double)x, (double)y, (double)width, (double)height); } /// /// Draws an ellipse defined by a bounding rectangle. /// public void DrawEllipse(XPen pen, XBrush brush, double x, double y, double width, double height) { if (pen == null && brush == null) throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { this.gfx.FillEllipse(brush.RealizeGdiBrush(), (float)x, (float)y, (float)width, (float)height); this.gfx.DrawArc(pen.RealizeGdiPen(), (float)x, (float)y, (float)width, (float)height, 0, 360); } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { double radiusX = width / 2; double radiusY = height / 2; this.dc.DrawEllipse(brush.RealizeWpfBrush(), pen.RealizeWpfPen(), new System.Windows.Point(x + radiusX, y + radiusY), radiusX, radiusY); } #endif } if (this.renderer != null) this.renderer.DrawEllipse(pen, brush, x, y, width, height); } // ----- DrawPolygon -------------------------------------------------------------------------- // ----- stroke ----- #if GDI /// /// Draws a polygon defined by an array of points. /// public void DrawPolygon(XPen pen, System.Drawing.Point[] points) { DrawPolygon(pen, MakeXPointArray(points)); } #endif #if WPF /// /// Draws a polygon defined by an array of points. /// public void DrawPolygon(XPen pen, System.Windows.Point[] points) { DrawPolygon(pen, MakeXPointArray(points)); } #endif #if GDI /// /// Draws a polygon defined by an array of points. /// public void DrawPolygon(XPen pen, PointF[] points) { DrawPolygon(pen, MakeXPointArray(points)); } #endif /// /// Draws a polygon defined by an array of points. /// public void DrawPolygon(XPen pen, XPoint[] points) { if (pen == null) throw new ArgumentNullException("pen"); if (points == null) throw new ArgumentNullException("points"); if (points.Length < 2) throw new ArgumentException("points", PSSR.PointArrayAtLeast(2)); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.DrawPolygon(pen.RealizeGdiPen(), MakePointFArray(points)); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { this.dc.DrawGeometry(null, pen.RealizeWpfPen(), GeometryHelper.CreatePolygonGeometry(MakePointArray(points), XFillMode.Alternate, true)); } #endif } if (this.renderer != null) this.renderer.DrawPolygon(pen, null, points, XFillMode.Alternate); // XFillMode is ignored } // ----- fill ----- #if GDI /// /// Draws a polygon defined by an array of points. /// public void DrawPolygon(XBrush brush, System.Drawing.Point[] points, XFillMode fillmode) { DrawPolygon(brush, MakeXPointArray(points), fillmode); } #endif #if WPF /// /// Draws a polygon defined by an array of points. /// public void DrawPolygon(XBrush brush, System.Windows.Point[] points, XFillMode fillmode) { DrawPolygon(brush, MakeXPointArray(points), fillmode); } #endif #if GDI /// /// Draws a polygon defined by an array of points. /// public void DrawPolygon(XBrush brush, PointF[] points, XFillMode fillmode) { DrawPolygon(brush, MakeXPointArray(points), fillmode); } #endif /// /// Draws a polygon defined by an array of points. /// public void DrawPolygon(XBrush brush, XPoint[] points, XFillMode fillmode) { if (brush == null) throw new ArgumentNullException("brush"); if (points == null) throw new ArgumentNullException("points"); if (points.Length < 2) throw new ArgumentException("points", PSSR.PointArrayAtLeast(2)); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.FillPolygon(brush.RealizeGdiBrush(), MakePointFArray(points), (FillMode)fillmode); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { this.dc.DrawGeometry(brush.RealizeWpfBrush(), null, GeometryHelper.CreatePolygonGeometry(MakePointArray(points), fillmode, true)); } #endif } if (this.renderer != null) this.renderer.DrawPolygon(null, brush, points, fillmode); } // ----- stroke and fill ----- #if GDI /// /// Draws a polygon defined by an array of points. /// public void DrawPolygon(XPen pen, XBrush brush, System.Drawing.Point[] points, XFillMode fillmode) { DrawPolygon(pen, brush, MakeXPointArray(points), fillmode); } #endif #if WPF /// /// Draws a polygon defined by an array of points. /// public void DrawPolygon(XPen pen, XBrush brush, System.Windows.Point[] points, XFillMode fillmode) { DrawPolygon(pen, brush, MakeXPointArray(points), fillmode); } #endif #if GDI /// /// Draws a polygon defined by an array of points. /// public void DrawPolygon(XPen pen, XBrush brush, PointF[] points, XFillMode fillmode) { DrawPolygon(pen, brush, MakeXPointArray(points), fillmode); } #endif /// /// Draws a polygon defined by an array of points. /// public void DrawPolygon(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode) { if (pen == null && brush == null) throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); if (points == null) throw new ArgumentNullException("points"); if (points.Length < 2) throw new ArgumentException("points", PSSR.PointArrayAtLeast(2)); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { PointF[] pts = MakePointFArray(points); this.gfx.FillPolygon(brush.RealizeGdiBrush(), pts, (FillMode)fillmode); this.gfx.DrawPolygon(pen.RealizeGdiPen(), pts); } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { System.Windows.Media.Brush wpfBrush = brush != null ? brush.RealizeWpfBrush() : null; System.Windows.Media.Pen wpfPen = brush != null ? pen.RealizeWpfPen() : null; this.dc.DrawGeometry(wpfBrush, wpfPen, GeometryHelper.CreatePolygonGeometry(MakePointArray(points), fillmode, true)); } #endif } if (this.renderer != null) this.renderer.DrawPolygon(pen, brush, points, fillmode); } // ----- DrawPie ------------------------------------------------------------------------------ // ----- stroke ----- #if GDI /// /// Draws a pie defined by an ellipse. /// public void DrawPie(XPen pen, Rectangle rect, double startAngle, double sweepAngle) { DrawPie(pen, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, startAngle, sweepAngle); } #endif #if GDI /// /// Draws a pie defined by an ellipse. /// public void DrawPie(XPen pen, RectangleF rect, double startAngle, double sweepAngle) { DrawPie(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); } #endif /// /// Draws a pie defined by an ellipse. /// public void DrawPie(XPen pen, XRect rect, double startAngle, double sweepAngle) { DrawPie(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); } /// /// Draws a pie defined by an ellipse. /// public void DrawPie(XPen pen, int x, int y, int width, int height, int startAngle, int sweepAngle) { DrawPie(pen, (double)x, (double)y, (double)width, (double)height, (double)startAngle, (double)sweepAngle); } /// /// Draws a pie defined by an ellipse. /// public void DrawPie(XPen pen, double x, double y, double width, double height, double startAngle, double sweepAngle) { if (pen == null) throw new ArgumentNullException("pen", PSSR.NeedPenOrBrush); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.DrawPie(pen.RealizeGdiPen(), (float)x, (float)y, (float)width, (float)height, (float)startAngle, (float)sweepAngle); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) DrawPie(pen, null, x, y, width, height, startAngle, sweepAngle); #endif } if (this.renderer != null) this.renderer.DrawPie(pen, null, x, y, width, height, startAngle, sweepAngle); } // ----- fill ----- #if GDI /// /// Draws a pie defined by an ellipse. /// public void DrawPie(XBrush brush, Rectangle rect, double startAngle, double sweepAngle) { DrawPie(brush, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, startAngle, sweepAngle); } #endif #if GDI /// /// Draws a pie defined by an ellipse. /// public void DrawPie(XBrush brush, RectangleF rect, double startAngle, double sweepAngle) { DrawPie(brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); } #endif /// /// Draws a pie defined by an ellipse. /// public void DrawPie(XBrush brush, XRect rect, double startAngle, double sweepAngle) { DrawPie(brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); } /// /// Draws a pie defined by an ellipse. /// public void DrawPie(XBrush brush, int x, int y, int width, int height, int startAngle, int sweepAngle) { DrawPie(brush, (double)x, (double)y, (double)width, (double)height, (double)startAngle, (double)sweepAngle); } /// /// Draws a pie defined by an ellipse. /// public void DrawPie(XBrush brush, double x, double y, double width, double height, double startAngle, double sweepAngle) { if (brush == null) throw new ArgumentNullException("brush", PSSR.NeedPenOrBrush); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.FillPie(brush.RealizeGdiBrush(), (float)x, (float)y, (float)width, (float)height, (float)startAngle, (float)sweepAngle); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) DrawPie(null, brush, x, y, width, height, startAngle, sweepAngle); #endif } if (this.renderer != null) this.renderer.DrawPie(null, brush, x, y, width, height, startAngle, sweepAngle); } // ----- stroke and fill ----- #if GDI /// /// Draws a pie defined by an ellipse. /// public void DrawPie(XPen pen, XBrush brush, Rectangle rect, double startAngle, double sweepAngle) { DrawPie(pen, brush, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, startAngle, sweepAngle); } #endif #if GDI /// /// Draws a pie defined by an ellipse. /// public void DrawPie(XPen pen, XBrush brush, RectangleF rect, double startAngle, double sweepAngle) { DrawPie(pen, brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); } #endif /// /// Draws a pie defined by an ellipse. /// public void DrawPie(XPen pen, XBrush brush, XRect rect, double startAngle, double sweepAngle) { DrawPie(pen, brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); } /// /// Draws a pie defined by an ellipse. /// public void DrawPie(XPen pen, XBrush brush, int x, int y, int width, int height, int startAngle, int sweepAngle) { DrawPie(pen, brush, (double)x, (double)y, (double)width, (double)height, (double)startAngle, (double)sweepAngle); } /// /// Draws a pie defined by an ellipse. /// public void DrawPie(XPen pen, XBrush brush, double x, double y, double width, double height, double startAngle, double sweepAngle) { if (pen == null && brush == null) throw new ArgumentNullException("pen", PSSR.NeedPenOrBrush); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { this.gfx.FillPie(brush.RealizeGdiBrush(), (float)x, (float)y, (float)width, (float)height, (float)startAngle, (float)sweepAngle); this.gfx.DrawPie(pen.RealizeGdiPen(), (float)x, (float)y, (float)width, (float)height, (float)startAngle, (float)sweepAngle); } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { #if !SILVERLIGHT System.Windows.Media.Brush wpfBrush = brush != null ? brush.RealizeWpfBrush() : null; System.Windows.Media.Pen wpfPen = pen != null ? pen.RealizeWpfPen() : null; System.Windows.Point center = new System.Windows.Point(x + width / 2, y + height / 2); System.Windows.Point startArc; ArcSegment arc = GeometryHelper.CreateArcSegment(x, y, width, height, startAngle, sweepAngle, out startArc); PathFigure figure = new PathFigure(); figure.StartPoint = center; figure.Segments.Add(new LineSegment(startArc, true)); figure.Segments.Add(arc); figure.IsClosed = true; PathGeometry geo = new PathGeometry(); geo.Figures.Add(figure); this.dc.DrawGeometry(wpfBrush, wpfPen, geo); #else // AGHACK #endif } #endif } if (this.renderer != null) this.renderer.DrawPie(pen, brush, x, y, width, height, startAngle, sweepAngle); } // ----- DrawClosedCurve ---------------------------------------------------------------------- // ----- stroke ----- #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, System.Drawing.Point[] points) { DrawClosedCurve(pen, null, MakeXPointArray(points), XFillMode.Alternate, 0.5); } #endif #if WPF /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, System.Windows.Point[] points) { DrawClosedCurve(pen, null, MakeXPointArray(points), XFillMode.Alternate, 0.5); } #endif #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, PointF[] points) { DrawClosedCurve(pen, null, MakeXPointArray(points), XFillMode.Alternate, 0.5); } #endif /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, XPoint[] points) { DrawClosedCurve(pen, null, points, XFillMode.Alternate, 0.5); } #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, System.Drawing.Point[] points, double tension) { DrawClosedCurve(pen, null, MakeXPointArray(points), XFillMode.Alternate, tension); } #endif #if WPF /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, System.Windows.Point[] points, double tension) { DrawClosedCurve(pen, null, MakeXPointArray(points), XFillMode.Alternate, tension); } #endif #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, PointF[] points, double tension) { DrawClosedCurve(pen, null, MakeXPointArray(points), XFillMode.Alternate, tension); } #endif /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, XPoint[] points, double tension) { DrawClosedCurve(pen, null, points, XFillMode.Alternate, tension); } // ----- fill ----- #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XBrush brush, System.Drawing.Point[] points) { DrawClosedCurve(null, brush, MakeXPointArray(points), XFillMode.Alternate, 0.5); } #endif #if WPF /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XBrush brush, System.Windows.Point[] points) { DrawClosedCurve(null, brush, MakeXPointArray(points), XFillMode.Alternate, 0.5); } #endif #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XBrush brush, PointF[] points) { DrawClosedCurve(null, brush, MakeXPointArray(points), XFillMode.Alternate, 0.5); } #endif /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XBrush brush, XPoint[] points) { DrawClosedCurve(null, brush, points, XFillMode.Alternate, 0.5); } #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XBrush brush, System.Drawing.Point[] points, XFillMode fillmode) { DrawClosedCurve(null, brush, MakeXPointArray(points), fillmode, 0.5); } #endif #if WPF /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XBrush brush, System.Windows.Point[] points, XFillMode fillmode) { DrawClosedCurve(null, brush, MakeXPointArray(points), fillmode, 0.5); } #endif #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XBrush brush, PointF[] points, XFillMode fillmode) { DrawClosedCurve(null, brush, MakeXPointArray(points), fillmode, 0.5); } #endif /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XBrush brush, XPoint[] points, XFillMode fillmode) { DrawClosedCurve(null, brush, points, fillmode, 0.5); } #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XBrush brush, System.Drawing.Point[] points, XFillMode fillmode, double tension) { DrawClosedCurve(null, brush, MakeXPointArray(points), fillmode, tension); } #endif #if WPF /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XBrush brush, System.Windows.Point[] points, XFillMode fillmode, double tension) { DrawClosedCurve(null, brush, MakeXPointArray(points), fillmode, tension); } #endif #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XBrush brush, PointF[] points, XFillMode fillmode, double tension) { DrawClosedCurve(null, brush, MakeXPointArray(points), fillmode, tension); } #endif /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XBrush brush, XPoint[] points, XFillMode fillmode, double tension) { DrawClosedCurve(null, brush, points, fillmode, tension); // if (brush == null) // throw new ArgumentNullException("brush"); // if (this.drawGraphics) // { //#if GDI // if (this.targetContext == XGraphicTargetContext.GDI) // this.gfx.FillClosedCurve(brush.RealizeGdiBrush(), MakePointFArray(points), (FillMode)fillmode, (float)tension); //#endif //#if WPF // if (this.targetContext == XGraphicTargetContext.WPF) // { // // throw new NotImplementedException("TODO"); // } //#endif // } // if (this.renderer != null) // this.renderer.DrawClosedCurve(null, brush, points, tension, fillmode); } // ----- stroke and fill ----- #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, XBrush brush, System.Drawing.Point[] points) { DrawClosedCurve(pen, brush, MakeXPointArray(points), XFillMode.Alternate, 0.5); } #endif #if WPF /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, XBrush brush, System.Windows.Point[] points) { DrawClosedCurve(pen, brush, MakeXPointArray(points), XFillMode.Alternate, 0.5); } #endif #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, XBrush brush, PointF[] points) { DrawClosedCurve(pen, brush, MakeXPointArray(points), XFillMode.Alternate, 0.5); } #endif /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, XBrush brush, XPoint[] points) { DrawClosedCurve(pen, brush, points, XFillMode.Alternate, 0.5); } #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, XBrush brush, System.Drawing.Point[] points, XFillMode fillmode) { DrawClosedCurve(pen, brush, MakeXPointArray(points), fillmode, 0.5); } #endif #if WPF /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, XBrush brush, System.Windows.Point[] points, XFillMode fillmode) { DrawClosedCurve(pen, brush, MakeXPointArray(points), fillmode, 0.5); } #endif #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, XBrush brush, PointF[] points, XFillMode fillmode) { DrawClosedCurve(pen, brush, MakeXPointArray(points), fillmode, 0.5); } #endif /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode) { DrawClosedCurve(pen, brush, points, fillmode, 0.5); } #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, XBrush brush, System.Drawing.Point[] points, XFillMode fillmode, double tension) { DrawClosedCurve(pen, brush, MakeXPointArray(points), fillmode, tension); } #endif #if WPF /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, XBrush brush, System.Windows.Point[] points, XFillMode fillmode, double tension) { DrawClosedCurve(pen, brush, MakeXPointArray(points), fillmode, tension); } #endif #if GDI /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, XBrush brush, PointF[] points, XFillMode fillmode, double tension) { DrawClosedCurve(pen, brush, MakeXPointArray(points), fillmode, tension); } #endif /// /// Draws a closed cardinal spline defined by an array of points. /// public void DrawClosedCurve(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode, double tension) { if (pen == null && brush == null) throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); int count = points.Length; if (count == 0) return; if (count < 2) throw new ArgumentException("Not enough points.", "points"); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { if (brush != null) this.gfx.FillClosedCurve(brush.RealizeGdiBrush(), MakePointFArray(points), (FillMode)fillmode, (float)tension); if (pen != null) { // The fillmode is not used by DrawClosedCurve this.gfx.DrawClosedCurve(pen.RealizeGdiPen(), MakePointFArray(points), (float)tension, (FillMode)fillmode); } } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { #if !SILVERLIGHT tension /= 3; // Simply tried out. Not proofed why it is correct. PathFigure figure = new PathFigure(); figure.IsClosed = true; figure.StartPoint = new System.Windows.Point(points[0].x, points[0].y); if (count == 2) { figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[0], points[0], points[1], points[1], tension)); } else { figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 1], points[0], points[1], points[2], tension)); for (int idx = 1; idx < count - 2; idx++) figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[idx - 1], points[idx], points[idx + 1], points[idx + 2], tension)); figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 3], points[count - 2], points[count - 1], points[0], tension)); figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 2], points[count - 1], points[0], points[1], tension)); } PathGeometry geo = new PathGeometry(); geo.FillRule = fillmode == XFillMode.Alternate ? FillRule.EvenOdd : FillRule.Nonzero; geo.Figures.Add(figure); System.Windows.Media.Brush wpfBrush = brush != null ? brush.RealizeWpfBrush() : null; System.Windows.Media.Pen wpfPen = pen != null ? pen.RealizeWpfPen() : null; this.dc.DrawGeometry(wpfBrush, wpfPen, geo); #else // AGHACK #endif } #endif } if (this.renderer != null) this.renderer.DrawClosedCurve(pen, brush, points, tension, fillmode); } // ----- DrawPath ----------------------------------------------------------------------------- // ----- stroke ----- /// /// Draws a graphical path. /// public void DrawPath(XPen pen, XGraphicsPath path) { if (pen == null) throw new ArgumentNullException("pen"); if (path == null) throw new ArgumentNullException("path"); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.DrawPath(pen.RealizeGdiPen(), path.gdipPath); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) this.dc.DrawGeometry(null, pen.RealizeWpfPen(), path.pathGeometry); #endif } if (this.renderer != null) this.renderer.DrawPath(pen, null, path); } // ----- fill ----- /// /// Draws a graphical path. /// public void DrawPath(XBrush brush, XGraphicsPath path) { if (brush == null) throw new ArgumentNullException("brush"); if (path == null) throw new ArgumentNullException("path"); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.FillPath(brush.RealizeGdiBrush(), path.gdipPath); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) this.dc.DrawGeometry(brush.RealizeWpfBrush(), null, path.pathGeometry); #endif } if (this.renderer != null) this.renderer.DrawPath(null, brush, path); } // ----- stroke and fill ----- /// /// Draws a graphical path. /// public void DrawPath(XPen pen, XBrush brush, XGraphicsPath path) { if (pen == null && brush == null) throw new ArgumentNullException("pen and brush", PSSR.NeedPenOrBrush); if (path == null) throw new ArgumentNullException("path"); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { if (brush != null) this.gfx.FillPath(brush.RealizeGdiBrush(), path.gdipPath); if (pen != null) this.gfx.DrawPath(pen.RealizeGdiPen(), path.gdipPath); } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { System.Windows.Media.Brush wpfBrush = brush != null ? brush.RealizeWpfBrush() : null; System.Windows.Media.Pen wpfPen = pen != null ? pen.RealizeWpfPen() : null; this.dc.DrawGeometry(wpfBrush, wpfPen, path.pathGeometry); } #endif } if (this.renderer != null) this.renderer.DrawPath(pen, brush, path); } // ----- DrawString --------------------------------------------------------------------------- #if GDI /// /// Draws the specified text string. /// public void DrawString(string s, XFont font, XBrush brush, PointF point) { DrawString(s, font, brush, new XRect(point.X, point.Y, 0, 0), XStringFormats.Default); } #endif /// /// Draws the specified text string. /// public void DrawString(string s, XFont font, XBrush brush, XPoint point) { DrawString(s, font, brush, new XRect(point.X, point.Y, 0, 0), XStringFormats.Default); } #if GDI /// /// Draws the specified text string. /// public void DrawString(string s, XFont font, XBrush brush, PointF point, XStringFormat format) { DrawString(s, font, brush, new XRect(point.X, point.Y, 0, 0), format); } #endif /// /// Draws the specified text string. /// public void DrawString(string s, XFont font, XBrush brush, XPoint point, XStringFormat format) { DrawString(s, font, brush, new XRect(point.X, point.Y, 0, 0), format); } /// /// Draws the specified text string. /// public void DrawString(string s, XFont font, XBrush brush, double x, double y) { DrawString(s, font, brush, new XRect(x, y, 0, 0), XStringFormats.Default); } /// /// Draws the specified text string. /// public void DrawString(string s, XFont font, XBrush brush, double x, double y, XStringFormat format) { DrawString(s, font, brush, new XRect(x, y, 0, 0), format); } #if GDI /// /// Draws the specified text string. /// public void DrawString(string s, XFont font, XBrush brush, RectangleF layoutRectangle) { DrawString(s, font, brush, new XRect(layoutRectangle), XStringFormats.Default); } #endif /// /// Draws the specified text string. /// public void DrawString(string s, XFont font, XBrush brush, XRect layoutRectangle) { DrawString(s, font, brush, layoutRectangle, XStringFormats.Default); } #if GDI /// /// Draws the specified text string. /// public void DrawString(string s, XFont font, XBrush brush, RectangleF layoutRectangle, XStringFormat format) { DrawString(s, font, brush, new XRect(layoutRectangle), format); } #endif /// /// Draws the specified text string. /// public void DrawString(string text, XFont font, XBrush brush, XRect layoutRectangle, XStringFormat format) { if (text == null) throw new ArgumentNullException("text"); if (font == null) throw new ArgumentNullException("font"); if (brush == null) throw new ArgumentNullException("brush"); if (format != null && format.LineAlignment == XLineAlignment.BaseLine && layoutRectangle.Height != 0) throw new InvalidOperationException("DrawString: With XLineAlignment.BaseLine the height of the layout rectangle must be 0."); if (text.Length == 0) return; if (format == null) format = XStringFormats.Default; if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { RectangleF rect = layoutRectangle.ToRectangleF(); if (format.LineAlignment == XLineAlignment.BaseLine) { double lineSpace = font.GetHeight(this); int cellSpace = font.FontFamily.GetLineSpacing(font.Style); int cellAscent = font.FontFamily.GetCellAscent(font.Style); int cellDescent = font.FontFamily.GetCellDescent(font.Style); double cyAscent = lineSpace * cellAscent / cellSpace; cyAscent = lineSpace * font.cellAscent / font.cellSpace; rect.Offset(0, (float)-cyAscent); } this.gfx.DrawString(text, font.RealizeGdiFont(), brush.RealizeGdiBrush(), rect, format != null ? format.RealizeGdiStringFormat() : null); } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { #if !SILVERLIGHT double x = layoutRectangle.X; double y = layoutRectangle.Y; double lineSpace = font.GetHeight(this); double cyAscent = lineSpace * font.cellAscent / font.cellSpace; double cyDescent = lineSpace * font.cellDescent / font.cellSpace; bool bold = (font.Style & XFontStyle.Bold) != 0; bool italic = (font.Style & XFontStyle.Italic) != 0; bool strikeout = (font.Style & XFontStyle.Strikeout) != 0; bool underline = (font.Style & XFontStyle.Underline) != 0; //FormattedText formattedText = new FormattedText(text, new CultureInfo("en-us"), // WPFHACK // FlowDirection.LeftToRight, font.typeface, font.Size, brush.RealizeWpfBrush()); FormattedText formattedText = FontHelper.CreateFormattedText(text, font.typeface, font.Size, brush.RealizeWpfBrush()); //formattedText.SetTextDecorations(TextDecorations.OverLine); switch (format.Alignment) { case XStringAlignment.Near: // nothing to do, this is the default //formattedText.TextAlignment = TextAlignment.Left; break; case XStringAlignment.Center: x += layoutRectangle.Width / 2; formattedText.TextAlignment = TextAlignment.Center; break; case XStringAlignment.Far: x += layoutRectangle.Width; formattedText.TextAlignment = TextAlignment.Right; break; } if (PageDirection == XPageDirection.Downwards) { switch (format.LineAlignment) { case XLineAlignment.Near: //y += cyAscent; break; case XLineAlignment.Center: // TODO use CapHeight. PDFlib also uses 3/4 of ascent y += -formattedText.Baseline + (cyAscent * 1 / 3) + layoutRectangle.Height / 2; //y += -formattedText.Baseline + (font.Size * font.Metrics.CapHeight / font.unitsPerEm / 2) + layoutRectangle.Height / 2; break; case XLineAlignment.Far: y += -formattedText.Baseline - cyDescent + layoutRectangle.Height; break; case XLineAlignment.BaseLine: y -= formattedText.Baseline; break; } } else { // TODOWPF: make unit test switch (format.LineAlignment) { case XLineAlignment.Near: //y += cyDescent; break; case XLineAlignment.Center: // TODO use CapHeight. PDFlib also uses 3/4 of ascent //y += -(cyAscent * 3 / 4) / 2 + rect.Height / 2; break; case XLineAlignment.Far: //y += -cyAscent + rect.Height; break; case XLineAlignment.BaseLine: // nothing to do break; } } //if (bold && !descriptor.IsBoldFace) //{ // // TODO: emulate bold by thicker outline //} //if (italic && !descriptor.IsBoldFace) //{ // // TODO: emulate italic by shearing transformation //} if (underline) { formattedText.SetTextDecorations(TextDecorations.Underline); //double underlinePosition = lineSpace * realizedFont.FontDescriptor.descriptor.UnderlinePosition / font.cellSpace; //double underlineThickness = lineSpace * realizedFont.FontDescriptor.descriptor.UnderlineThickness / font.cellSpace; //DrawRectangle(null, brush, x, y - underlinePosition, width, underlineThickness); } if (strikeout) { formattedText.SetTextDecorations(TextDecorations.Strikethrough); //double strikeoutPosition = lineSpace * realizedFont.FontDescriptor.descriptor.StrikeoutPosition / font.cellSpace; //double strikeoutSize = lineSpace * realizedFont.FontDescriptor.descriptor.StrikeoutSize / font.cellSpace; //DrawRectangle(null, brush, x, y - strikeoutPosition - strikeoutSize, width, strikeoutSize); } //this.dc.DrawText(formattedText, layoutRectangle.Location.ToPoint()); this.dc.DrawText(formattedText, new System.Windows.Point(x, y)); #else dc.DrawString(this, text, font, brush, layoutRectangle, format); #endif } #endif } if (this.renderer != null) this.renderer.DrawString(text, font, brush, layoutRectangle, format); } // ----- MeasureString ------------------------------------------------------------------------ /// /// Measures the specified string when drawn with the specified font. /// public XSize MeasureString(string text, XFont font, XStringFormat stringFormat) { // TODO: Here comes a lot of code in the future: kerning etc... if (text == null) throw new ArgumentNullException("text"); if (font == null) throw new ArgumentNullException("font"); if (stringFormat == null) throw new ArgumentNullException("stringFormat"); #if GDI && !WPF return XSize.FromSizeF(this.gfx.MeasureString(text, font.RealizeGdiFont(), new PointF(0, 0), stringFormat.RealizeGdiStringFormat())); #endif #if WPF && !GDI #if !SILVERLIGHT //FormattedText formattedText = new FormattedText(text, new CultureInfo("en-us"), // FlowDirection.LeftToRight, font.typeface, font.Size, System.Windows.Media.Brushes.Black); FormattedText formattedText = FontHelper.CreateFormattedText(text, font.typeface, font.Size, System.Windows.Media.Brushes.Black); return new XSize(formattedText.WidthIncludingTrailingWhitespace, formattedText.Height); #else return dc.MeasureString(this, text, font, stringFormat); #endif #endif #if WPF && GDI if (this.targetContext == XGraphicTargetContext.GDI) { XSize gdiSize = XSize.FromSizeF(this.gfx.MeasureString(text, font.RealizeGdiFont(), new PointF(0, 0), stringFormat.RealizeGdiStringFormat())); #if DEBUG Debug.WriteLine(gdiSize); #endif return gdiSize; } if (this.targetContext == XGraphicTargetContext.WPF) { //double h = font.Height; //FormattedText formattedText = new FormattedText(text, new CultureInfo("en-us"), // FlowDirection.LeftToRight, font.typeface, font.Size, System.Windows.Media.Brushes.Black); FormattedText formattedText = FontHelper.CreateFormattedText(text, font.typeface, font.Size, System.Windows.Media.Brushes.Black); XSize wpfSize = new XSize(formattedText.WidthIncludingTrailingWhitespace, formattedText.Height); #if DEBUG Debug.WriteLine(wpfSize); #endif return wpfSize; } Debug.Assert(false); return XSize.Empty; #endif } /// /// Measures the specified string when drawn with the specified font. /// public XSize MeasureString(string text, XFont font) { return MeasureString(text, font, XStringFormats.Default); } //public SizeF MeasureString(string text, XFont font, SizeF layoutArea); //public SizeF MeasureString(string text, XFont font, int width); //public SizeF MeasureString(string text, XFont font, PointF origin, XStringFormat stringFormat); //public SizeF MeasureString(string text, XFont font, SizeF layoutArea, XStringFormat stringFormat); //public SizeF MeasureString(string text, XFont font, int width, XStringFormat format); //public SizeF MeasureString(string text, XFont font, SizeF layoutArea, XStringFormat stringFormat, out int charactersFitted, out int linesFilled); // ----- DrawImage ---------------------------------------------------------------------------- #if GDI /// /// Draws the specified image. /// public void DrawImage(XImage image, System.Drawing.Point point) { DrawImage(image, (double)point.X, (double)point.Y); } #endif #if WPF /// /// Draws the specified image. /// public void DrawImage(XImage image, System.Windows.Point point) { DrawImage(image, (double)point.X, (double)point.Y); } #endif #if GDI /// /// Draws the specified image. /// public void DrawImage(XImage image, PointF point) { DrawImage(image, point.X, point.Y); } #endif /// /// Draws the specified image. /// public void DrawImage(XImage image, XPoint point) { DrawImage(image, point.X, point.Y); } //TODO trapezoid transformation ////public void DrawImage(XImage image, Point[] destPoints); ////public void DrawImage(XImage image, PointF[] destPoints); ////public void DrawImage(XImage image, XPoint[] destPoints); /// /// Draws the specified image. /// public void DrawImage(XImage image, int x, int y) { DrawImage(image, (double)x, (double)y); } /// /// Draws the specified image. /// public void DrawImage(XImage image, double x, double y) { if (image == null) throw new ArgumentNullException("image"); CheckXPdfFormConsistence(image); double width = image.PointWidth; double height = image.PointHeight; if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { if (image.gdiImage != null) { InterpolationMode interpolationMode = InterpolationMode.Invalid; if (!image.Interpolate) { interpolationMode = gfx.InterpolationMode; gfx.InterpolationMode = InterpolationMode.NearestNeighbor; } this.gfx.DrawImage(image.gdiImage, (float)x, (float)y, (float)width, (float)height); if (!image.Interpolate) gfx.InterpolationMode = interpolationMode; } else { DrawMissingImageRect(new XRect(x, y, width, height)); //this.gfx.DrawRectangle(Pens.Red, (float)x, (float)y, (float)width, (float)height); //this.gfx.DrawLine(Pens.Red, (float)x, (float)y, (float)(x + width), (float)(y + height)); //this.gfx.DrawLine(Pens.Red, (float)(x + width), (float)y, (float)x, (float)(y + height)); } } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { if (image.wpfImage != null) { this.dc.DrawImage(image.wpfImage, new Rect(x, y, image.PointWidth, image.PointHeight)); } else { DrawMissingImageRect(new XRect(x, y, width, height)); } } #endif } if (this.renderer != null) this.renderer.DrawImage(image, x, y, image.PointWidth, image.PointHeight); //image.Width * 72 / image.HorizontalResolution, //image.Height * 72 / image.HorizontalResolution); } #if GDI /// /// Draws the specified image. /// public void DrawImage(XImage image, Rectangle rect) { DrawImage(image, (double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height); } #endif #if GDI /// /// Draws the specified image. /// public void DrawImage(XImage image, RectangleF rect) { DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height); } #endif /// /// Draws the specified image. /// public void DrawImage(XImage image, XRect rect) { DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height); } /// /// Draws the specified image. /// public void DrawImage(XImage image, int x, int y, int width, int height) { DrawImage(image, (double)x, (double)y, (double)width, (double)height); } /// /// Draws the specified image. /// public void DrawImage(XImage image, double x, double y, double width, double height) { if (image == null) throw new ArgumentNullException("image"); CheckXPdfFormConsistence(image); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { if (image.gdiImage != null) { InterpolationMode interpolationMode = InterpolationMode.Invalid; if (!image.Interpolate) { interpolationMode = gfx.InterpolationMode; gfx.InterpolationMode = InterpolationMode.NearestNeighbor; } this.gfx.DrawImage(image.gdiImage, (float)x, (float)y, (float)width, (float)height); if (!image.Interpolate) gfx.InterpolationMode = interpolationMode; } else { XImage placeholder = null; if (image is XPdfForm) { XPdfForm pf = image as XPdfForm; if (pf.PlaceHolder != null) placeholder = pf.PlaceHolder; } if (placeholder != null) this.gfx.DrawImage(placeholder.gdiImage, (float)x, (float)y, (float)width, (float)height); else { DrawMissingImageRect(new XRect(x, y, width, height)); //this.gfx.DrawRectangle(Pens.Red, (float)x, (float)y, (float)width, (float)height); //this.gfx.DrawLine(Pens.Red, (float)x, (float)y, (float)(x + width), (float)(y + height)); //this.gfx.DrawLine(Pens.Red, (float)(x + width), (float)y, (float)x, (float)(y + height)); } } } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { if (image.wpfImage != null) { //InterpolationMode interpolationMode = InterpolationMode.Invalid; //if (!image.Interpolate) //{ // interpolationMode = gfx.InterpolationMode; // gfx.InterpolationMode = InterpolationMode.NearestNeighbor; //} this.dc.DrawImage(image.wpfImage, new Rect(x, y, width, height)); //if (!image.Interpolate) // gfx.InterpolationMode = interpolationMode; } else { XImage placeholder = null; if (image is XPdfForm) { XPdfForm pf = image as XPdfForm; if (pf.PlaceHolder != null) placeholder = pf.PlaceHolder; } if (placeholder != null) this.dc.DrawImage(placeholder.wpfImage, new Rect(x, y, width, height)); else DrawMissingImageRect(new XRect(x, y, width, height)); } } #endif } if (this.renderer != null) this.renderer.DrawImage(image, x, y, width, height); } //TODO trapezoid transformation //public void DrawImage(XImage image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit); //public void DrawImage(XImage image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit); //public void DrawImage(XImage image, XPoint[] destPoints, XRect srcRect, GraphicsUnit srcUnit); // TODO: calculate destination size //public void DrawImage(XImage image, int x, int y, Rectangle srcRect, XGraphicsUnit srcUnit) //public void DrawImage(XImage image, double x, double y, RectangleF srcRect, XGraphicsUnit srcUnit) //public void DrawImage(XImage image, double x, double y, XRect srcRect, XGraphicsUnit srcUnit) #if GDI /// /// Draws the specified image. /// public void DrawImage(XImage image, Rectangle destRect, Rectangle srcRect, XGraphicsUnit srcUnit) { XRect destRectX = new XRect(destRect.X, destRect.Y, destRect.Width, destRect.Height); XRect srcRectX = new XRect(srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height); DrawImage(image, destRectX, srcRectX, srcUnit); } #endif #if GDI /// /// Draws the specified image. /// public void DrawImage(XImage image, RectangleF destRect, RectangleF srcRect, XGraphicsUnit srcUnit) { XRect destRectX = new XRect(destRect.X, destRect.Y, destRect.Width, destRect.Height); XRect srcRectX = new XRect(srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height); DrawImage(image, destRectX, srcRectX, srcUnit); } #endif /// /// Draws the specified image. /// public void DrawImage(XImage image, XRect destRect, XRect srcRect, XGraphicsUnit srcUnit) { if (image == null) throw new ArgumentNullException("image"); CheckXPdfFormConsistence(image); if (this.drawGraphics) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { if (image.gdiImage != null) { InterpolationMode interpolationMode = InterpolationMode.Invalid; if (!image.Interpolate) { interpolationMode = gfx.InterpolationMode; gfx.InterpolationMode = InterpolationMode.NearestNeighbor; } RectangleF destRectF = new RectangleF((float)destRect.X, (float)destRect.Y, (float)destRect.Width, (float)destRect.Height); RectangleF srcRectF = new RectangleF((float)srcRect.X, (float)srcRect.Y, (float)srcRect.Width, (float)srcRect.Height); this.gfx.DrawImage(image.gdiImage, destRectF, srcRectF, GraphicsUnit.Pixel); if (!image.Interpolate) gfx.InterpolationMode = interpolationMode; } else { DrawMissingImageRect(new XRect(destRect.x, destRect.y, destRect.width, destRect.height)); //this.gfx.DrawRectangle(Pens.Red, (float)destRect.X, (float)destRect.Y, // (float)destRect.Width, (float)destRect.Height); //this.gfx.DrawLine(Pens.Red, (float)destRect.X, (float)destRect.Y, (float)(destRect.X + destRect.Width), (float)(destRect.Y + destRect.Height)); //this.gfx.DrawLine(Pens.Red, (float)(destRect.X + destRect.Width), (float)destRect.Y, (float)destRect.X, (float)(destRect.Y + destRect.Height)); } } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { if (image.wpfImage != null) { //InterpolationMode interpolationMode = InterpolationMode.Invalid; //if (!image.Interpolate) //{ // interpolationMode = gfx.InterpolationMode; // //gfx.InterpolationMode = InterpolationMode.NearestNeighbor; //} // HACK: srcRect is ignored double x = destRect.x; double y = destRect.y; this.dc.DrawImage(image.wpfImage, new System.Windows.Rect(destRect.x, destRect.y, destRect.width, destRect.height)); //if (!image.Interpolate) // gfx.InterpolationMode = interpolationMode; } else { DrawMissingImageRect(destRect); } } #endif } if (this.renderer != null) this.renderer.DrawImage(image, destRect, srcRect, srcUnit); } //TODO? //public void DrawImage(XImage image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit); //public void DrawImage(XImage image, Rectangle destRect, double srcX, double srcY, double srcWidth, double srcHeight, GraphicsUnit srcUnit); //public void DrawImage(XImage image, Rectangle destRect, double srcX, double srcY, double srcWidth, double srcHeight, GraphicsUnit srcUnit); void DrawMissingImageRect(XRect rect) { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { float x = (float)rect.x; float y = (float)rect.y; float width = (float)rect.width; float height = (float)rect.height; this.gfx.DrawRectangle(Pens.Red, x, y, width, height); this.gfx.DrawLine(Pens.Red, x, y, x + width, y + height); this.gfx.DrawLine(Pens.Red, x + width, y, x, y + height); } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { double x = rect.x; double y = rect.y; double width = rect.width; double height = rect.height; #if !SILVERLIGHT System.Windows.Media.Pen pen = new System.Windows.Media.Pen(System.Windows.Media.Brushes.Red, 1); #else System.Windows.Media.Pen pen = new System.Windows.Media.Pen(new SolidColorBrush(Colors.Red), 1); #endif this.dc.DrawRectangle(null, pen, new Rect(x, y, width, height)); this.dc.DrawLine(pen, new System.Windows.Point(x, y), new System.Windows.Point(x + width, y + height)); this.dc.DrawLine(pen, new System.Windows.Point(x + width, y), new System.Windows.Point(x, y + height)); } #endif } /// /// Checks whether drawing is allowed and disposes the XGraphics object, if necessary. /// void CheckXPdfFormConsistence(XImage image) { XForm xForm = image as XForm; XGraphicsPdfRenderer renderer; if (xForm != null) { // Force disposing of XGraphics that draws the content xForm.Finish(); if (this.renderer != null && (renderer = this.renderer as XGraphicsPdfRenderer) != null) { if (xForm.Owner != null && xForm.Owner != ((XGraphicsPdfRenderer)this.renderer).Owner) throw new InvalidOperationException( "A XPdfForm object is always bound to the document it was created for and cannot be drawn in the context of another document."); if (xForm == ((XGraphicsPdfRenderer)this.renderer).form) throw new InvalidOperationException( "A XPdfForm cannot be drawn on itself."); } } } // ----- DrawBarCode -------------------------------------------------------------------------- /// /// Draws the specified bar code. /// public void DrawBarCode(BarCodes.BarCode barcode, XPoint position) { barcode.Render(this, XBrushes.Black, null, position); } /// /// Draws the specified bar code. /// public void DrawBarCode(BarCodes.BarCode barcode, XBrush brush, XPoint position) { barcode.Render(this, brush, null, position); } /// /// Draws the specified bar code. /// public void DrawBarCode(BarCodes.BarCode barcode, XBrush brush, XFont font, XPoint position) { barcode.Render(this, brush, font, position); } // ----- DrawMatrixCode ----------------------------------------------------------------------- /// /// Draws the specified data matrix code. /// public void DrawMatrixCode(BarCodes.MatrixCode matrixcode, XPoint position) { matrixcode.Render(this, XBrushes.Black, position); } /// /// Draws the specified data matrix code. /// public void DrawMatrixCode(BarCodes.MatrixCode matrixcode, XBrush brush, XPoint position) { matrixcode.Render(this, brush, position); } // ----- DrawGrit ----------------------------------------------------------------------------- //[Conditional("DEBUG")] //public void DrawGridlines(XPoint origin, XPen majorpen, double majordelta, XPen minorpen, double minordelta) //{ // RectangleF box = new RectangleF(0, 0, 600, 850); // DrawGridline(origin, minorpen, minordelta, box); // DrawGridline(origin, majorpen, majordelta, box); // /* // float xmin = -10000f, ymin = -10000f, xmax = 10000f, ymax = 10000f; // float x, y; // x = origin.X; // while (x < xmax) // { // DrawLine(majorpen, x, ymin, x, ymax); // x += majordelta; // } // x = origin.X - majordelta; // while (x > xmin) // { // DrawLine(majorpen, x, ymin, x, ymax); // x -= majordelta; // } // y = origin.Y; // while (y < ymax) // { // DrawLine(majorpen, xmin, y, xmax, y); // y += majordelta; // } // y = origin.Y - majordelta; // while (y > ymin) // { // DrawLine(majorpen, xmin, y, xmax, y); // y -= majordelta; // } // */ //} //[Conditional("DEBUG")] //void DrawGridline(XPoint origin, XPen pen, double delta, XRect box) //{ // double xmin = box.X, ymin = box.Y, xmax = box.X + box.Width, ymax = box.Y + box.Height; // double x, y; // y = origin.Y; // while (y < ymax) // { // DrawLine(pen, xmin, y, xmax, y); // y += delta; // } // y = origin.Y - delta; // while (y > ymin) // { // DrawLine(pen, xmin, y, xmax, y); // y -= delta; // } // x = origin.X; // while (x < xmax) // { // DrawLine(pen, x, ymin, x, ymax); // x += delta; // } // x = origin.X - delta; // while (x > xmin) // { // DrawLine(pen, x, ymin, x, ymax); // x -= delta; // } //} #endregion // -------------------------------------------------------------------------------------------- #region Save and Restore /// /// Saves the current state of this XGraphics object and identifies the saved state with the /// returned XGraphicsState object. /// public XGraphicsState Save() { XGraphicsState xState = null; #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { xState = new XGraphicsState(this.gfx.Save()); InternalGraphicsState iState = new InternalGraphicsState(this, xState); iState.Transform = this.transform; this.gsStack.Push(iState); } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { xState = new XGraphicsState(); InternalGraphicsState iState = new InternalGraphicsState(this, xState); iState.Transform = this.transform; this.gsStack.Push(iState); } #endif if (this.renderer != null) this.renderer.Save(xState); return xState; } /// /// Restores the state of this XGraphics object to the state represented by the specified /// XGraphicsState object. /// public void Restore(XGraphicsState state) { if (state == null) throw new ArgumentNullException("state"); #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { this.gsStack.Restore(state.InternalState); this.gfx.Restore(state.GdiState); this.transform = state.InternalState.Transform; } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { this.gsStack.Restore(state.InternalState); this.transform = state.InternalState.Transform; } #endif if (this.renderer != null) this.renderer.Restore(state); } /// /// Restores the state of this XGraphics object to the state before the most recently call of Save. /// public void Restore() { if (this.gsStack.Count == 0) throw new InvalidOperationException("Cannot restore without preceding save operation."); Restore(this.gsStack.Current.state); } /// /// Saves a graphics container with the current state of this XGraphics and /// opens and uses a new graphics container. /// public XGraphicsContainer BeginContainer() { return BeginContainer(new XRect(0, 0, 1, 1), new XRect(0, 0, 1, 1), XGraphicsUnit.Point); } #if GDI /// /// Saves a graphics container with the current state of this XGraphics and /// opens and uses a new graphics container. /// public XGraphicsContainer BeginContainer(Rectangle dstrect, Rectangle srcrect, XGraphicsUnit unit) { return BeginContainer(new XRect(dstrect), new XRect(dstrect), unit); } #endif #if GDI /// /// Saves a graphics container with the current state of this XGraphics and /// opens and uses a new graphics container. /// public XGraphicsContainer BeginContainer(RectangleF dstrect, RectangleF srcrect, XGraphicsUnit unit) { return BeginContainer(new XRect(dstrect), new XRect(dstrect), unit); } #endif #if WPF /// /// Saves a graphics container with the current state of this XGraphics and /// opens and uses a new graphics container. /// public XGraphicsContainer BeginContainer(Rect dstrect, Rect srcrect, XGraphicsUnit unit) { return BeginContainer(new XRect(dstrect), new XRect(dstrect), unit); } #endif /// /// Saves a graphics container with the current state of this XGraphics and /// opens and uses a new graphics container. /// public XGraphicsContainer BeginContainer(XRect dstrect, XRect srcrect, XGraphicsUnit unit) { // TODO: unit if (unit != XGraphicsUnit.Point) throw new ArgumentException("The current implementation supports XGraphicsUnit.Point only.", "unit"); XGraphicsContainer xContainer = null; #if GDI if (this.targetContext == XGraphicTargetContext.GDI) xContainer = new XGraphicsContainer(this.gfx.Save()); #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) xContainer = new XGraphicsContainer(); #endif InternalGraphicsState iState = new InternalGraphicsState(this, xContainer); iState.Transform = this.transform; this.gsStack.Push(iState); if (this.renderer != null) this.renderer.BeginContainer(xContainer, dstrect, srcrect, unit); XMatrix matrix = new XMatrix(); //XMatrix.Identity; #if true double scaleX = dstrect.Width / srcrect.Width; double scaleY = dstrect.Height / srcrect.Height; matrix.TranslatePrepend(-srcrect.X, -srcrect.Y); matrix.ScalePrepend(scaleX, scaleY); matrix.TranslatePrepend(dstrect.X / scaleX, dstrect.Y / scaleY); #else matrix.Translate(-dstrect.X, -dstrect.Y); matrix.Scale(dstrect.Width / srcrect.Width, dstrect.Height / srcrect.Height); matrix.Translate(srcrect.X, srcrect.Y); #endif AddTransform(matrix, XMatrixOrder.Prepend); return xContainer; } /// /// Closes the current graphics container and restores the state of this XGraphics /// to the state saved by a call to the BeginContainer method. /// public void EndContainer(XGraphicsContainer container) { if (container == null) throw new ArgumentNullException("container"); this.gsStack.Restore(container.InternalState); #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.Restore(container.GdiState); #endif #if WPF // nothing to do #endif this.transform = container.InternalState.Transform; if (this.renderer != null) this.renderer.EndContainer(container); } /// /// Gets the current graphics state level. The default value is 0. Each call of Save or BeginContainer /// increased and each call of Restore or EndContainer decreased the value by 1. /// public int GraphicsStateLevel { get { return this.gsStack.Count; } } #endregion // -------------------------------------------------------------------------------------------- #region Properties /// /// Gets or sets the smoothing mode. /// /// The smoothing mode. public XSmoothingMode SmoothingMode { get { #if GDI if (this.targetContext == XGraphicTargetContext.GDI) return (XSmoothingMode)this.gfx.SmoothingMode; #endif #if WPF // nothing to do #endif return this.smoothingMode; } set { this.smoothingMode = value; #if GDI if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.SmoothingMode = (SmoothingMode)value; #endif #if WPF // nothing to do #endif } } XSmoothingMode smoothingMode; //public Region Clip { get; set; } //public RectangleF ClipBounds { get; } //public CompositingMode CompositingMode { get; set; } //public CompositingQuality CompositingQuality { get; set; } //public float DpiX { get; } //public float DpiY { get; } //public InterpolationMode InterpolationMode { get; set; } //public bool IsClipEmpty { get; } //public bool IsVisibleClipEmpty { get; } //public float PageScale { get; set; } //public GraphicsUnit PageUnit { get; set; } //public PixelOffsetMode PixelOffsetMode { get; set; } //public Point RenderingOrigin { get; set; } //public SmoothingMode SmoothingMode { get; set; } //public int TextContrast { get; set; } //public TextRenderingHint TextRenderingHint { get; set; } //public Matrix Transform { get; set; } //public RectangleF VisibleClipBounds { get; } #endregion // -------------------------------------------------------------------------------------------- #region Transformation /// /// Applies the specified translation operation to the transformation matrix of this object by /// prepending it to the object's transformation matrix. /// public void TranslateTransform(double dx, double dy) { XMatrix matrix = new XMatrix(); //XMatrix.Identity; matrix.TranslatePrepend(dx, dy); AddTransform(matrix, XMatrixOrder.Prepend); } /// /// Applies the specified translation operation to the transformation matrix of this object /// in the specified order. /// public void TranslateTransform(double dx, double dy, XMatrixOrder order) { //XMatrix matrix = this.transform; //matrix.Translate(dx, dy, order); //Transform = matrix; XMatrix matrix = new XMatrix(); //XMatrix.Identity; matrix.TranslatePrepend(dx, dy); AddTransform(matrix, order); } /// /// Applies the specified scaling operation to the transformation matrix of this object by /// prepending it to the object's transformation matrix. /// public void ScaleTransform(double scaleX, double scaleY) { //ScaleTransform(scaleX, scaleY, XMatrixOrder.Prepend); XMatrix matrix = new XMatrix(); //XMatrix.Identity; matrix.ScalePrepend(scaleX, scaleY); AddTransform(matrix, XMatrixOrder.Prepend); } /// /// Applies the specified scaling operation to the transformation matrix of this object /// in the specified order. /// public void ScaleTransform(double scaleX, double scaleY, XMatrixOrder order) { //XMatrix matrix = this.transform; //matrix.Scale(scaleX, scaleY, order); //Transform = matrix; XMatrix matrix = new XMatrix(); //XMatrix.Identity; matrix.ScalePrepend(scaleX, scaleY); AddTransform(matrix, order); } /// /// Applies the specified scaling operation to the transformation matrix of this object by /// prepending it to the object's transformation matrix. /// public void ScaleTransform(double scaleXY) { //ScaleTransform(scaleXY, scaleXY, XMatrixOrder.Prepend); XMatrix matrix = new XMatrix(); //XMatrix.Identity; matrix.ScalePrepend(scaleXY, scaleXY); AddTransform(matrix, XMatrixOrder.Prepend); } /// /// Applies the specified scaling operation to the transformation matrix of this object /// in the specified order. /// public void ScaleTransform(double scaleXY, XMatrixOrder order) { //XMatrix matrix = this.transform; //matrix.Scale(scaleXY, scaleXY, order); //Transform = matrix; XMatrix matrix = new XMatrix(); //XMatrix.Identity; matrix.ScalePrepend(scaleXY, scaleXY); AddTransform(matrix, order); } /// /// Applies the specified rotation operation to the transformation matrix of this object by /// prepending it to the object's transformation matrix. /// public void RotateTransform(double angle) { //RotateTransform(angle, XMatrixOrder.Prepend); XMatrix matrix = new XMatrix(); //XMatrix.Identity; matrix.RotatePrepend(angle); AddTransform(matrix, XMatrixOrder.Prepend); } /// /// Applies the specified rotation operation to the transformation matrix of this object /// in the specified order. The angle unit of measure is degree. /// public void RotateTransform(double angle, XMatrixOrder order) { //XMatrix matrix = this.transform; //matrix.Rotate(angle, order); //Transform = matrix; XMatrix matrix = new XMatrix(); //XMatrix.Identity; matrix.RotatePrepend(angle); AddTransform(matrix, order); } /// /// Applies the specified rotation operation to the transformation matrix of this object by /// prepending it to the object's transformation matrix. /// public void RotateAtTransform(double angle, XPoint point) { //RotateAtTransform(angle, point, XMatrixOrder.Prepend); XMatrix matrix = new XMatrix(); //XMatrix.Identity; matrix.RotateAtPrepend(angle, point); AddTransform(matrix, XMatrixOrder.Prepend); } /// /// Applies the specified rotation operation to the transformation matrix of this object by /// prepending it to the object's transformation matrix. /// public void RotateAtTransform(double angle, XPoint point, XMatrixOrder order) { //XMatrix matrix = this.transform; //matrix.RotateAt(angle, point, order); //Transform = matrix; XMatrix matrix = new XMatrix(); //XMatrix.Identity; matrix.RotateAtPrepend(angle, point); AddTransform(matrix, order); } /// /// Applies the specified shearing operation to the transformation matrix of this object by /// prepending it to the object's transformation matrix. /// public void ShearTransform(double shearX, double shearY) { XMatrix matrix = new XMatrix(); //XMatrix.Identity; matrix.ShearPrepend(shearX, shearY); AddTransform(matrix, XMatrixOrder.Prepend); } /// /// Applies the specified shearing operation to the transformation matrix of this object /// in the specified order. /// public void ShearTransform(double shearX, double shearY, XMatrixOrder order) { XMatrix matrix = new XMatrix(); //XMatrix.Identity; matrix.ShearPrepend(shearX, shearY); AddTransform(matrix, order); } /// /// Multiplies the transformation matrix of this object and specified matrix. /// public void MultiplyTransform(XMatrix matrix) { //MultiplyTransform(matrix, XMatrixOrder.Prepend); XMatrix matrix2 = new XMatrix(); //XMatrix.Identity; matrix2.Prepend(matrix); AddTransform(matrix2, XMatrixOrder.Prepend); } /// /// Multiplies the transformation matrix of this object and specified matrix in the specified order. /// public void MultiplyTransform(XMatrix matrix, XMatrixOrder order) { //XMatrix matrix2 = this.transform; //matrix2.Multiply(matrix, order); //Transform = matrix2; XMatrix matrix2 = new XMatrix(); //XMatrix.Identity; matrix2.Prepend(matrix); AddTransform(matrix2, order); } /// /// Gets or sets the transformation matrix. /// [Obsolete] public XMatrix Transform { get { return this.transform; } set { throw new InvalidOperationException(PSSR.ObsoleteFunktionCalled); // if (!this.transform.Equals(value)) // { // this.transform = value; // XMatrix matrix = this.defaultViewMatrix; // matrix.Multiply(value); //#if GDI // if (this.targetContext == XGraphicTargetContext.GDI) // this.gfx.Transform = (System.Drawing.Drawing2D.Matrix)matrix; //#endif //#if WPF // if (this.targetContext == XGraphicTargetContext.WPF) // { // MatrixTransform transform = new MatrixTransform(value.ToWpfMatrix()); // this.gsStack.Current.SetTransform(transform); // } //#endif // if (this.renderer != null) // this.renderer.Transform = value; // } } } /// /// Gets or sets the transformation matrix. /// void AddTransform(XMatrix transform, XMatrixOrder order) { //if (!this.transform.Equals(value)) { XMatrix matrix = this.transform; matrix.Multiply(transform, order); this.transform = matrix; matrix = this.defaultViewMatrix; matrix.Multiply(this.transform, XMatrixOrder.Prepend); #if GDI if (this.targetContext == XGraphicTargetContext.GDI) { #if DEBUG System.Drawing.Drawing2D.Matrix m = (System.Drawing.Drawing2D.Matrix)matrix; this.gfx.Transform = m; #else this.gfx.Transform = (System.Drawing.Drawing2D.Matrix)matrix; #endif } #endif #if WPF if (this.targetContext == XGraphicTargetContext.WPF) { #if !SILVERLIGHT MatrixTransform mt = new MatrixTransform(transform.ToWpfMatrix()); #else MatrixTransform mt = new MatrixTransform(); mt.Matrix = transform.ToWpfMatrix(); #endif if (order == XMatrixOrder.Append) mt = (MatrixTransform)mt.Inverse; this.gsStack.Current.SetTransform(mt); } #endif if (this.renderer != null) this.renderer.Transform = this.transform; } } /// /// Resets the transformation matrix of this object to the identity matrix. /// [Obsolete("Use Save/Restore to reset transformation.")] public void ResetTransform() { // Definitely out of order throw new InvalidOperationException(PSSR.ObsoleteFunktionCalled); } //public void TransformPoints(CoordinateSpace destSpace, CoordinateSpace srcSpace, Point[] points) //{ //} // //public void TransformPoints(CoordinateSpace destSpace, CoordinateSpace srcSpace, PointF[] points) //{ //} #endregion // -------------------------------------------------------------------------------------------- #region Clipping #if GDI /// /// Sets the clipping region to the specified rectangle. /// [Obsolete("Use IntersectClip")] public void SetClip(Rectangle rect) { throw new InvalidOperationException("Function is obsolete. Use IntersectClip."); //XGraphicsPath path = new XGraphicsPath(); //path.AddRectangle(rect); //SetClip(path, XCombineMode.Replace); } #endif #if GDI /// /// Sets the clipping region to the specified rectangle. /// [Obsolete("Use IntersectClip")] public void SetClip(RectangleF rect) { throw new InvalidOperationException("Function is obsolete. Use IntersectClip."); //XGraphicsPath path = new XGraphicsPath(); //path.AddRectangle(rect); //SetClip(path, XCombineMode.Replace); } #endif /// /// Sets the clipping region to the specified rectangle. /// [Obsolete("Use IntersectClip", true)] public void SetClip(XRect rect) { throw new InvalidOperationException("Function is obsolete. Use IntersectClip."); //XGraphicsPath path = new XGraphicsPath(); //path.AddRectangle(rect); //SetClip(path, XCombineMode.Replace); } /// /// Sets the clipping region to the specified graphical path. /// [Obsolete("Use IntersectClip", true)] public void SetClip(XGraphicsPath path) { throw new InvalidOperationException("Function is obsolete. Use IntersectClip."); //SetClip(path, XCombineMode.Replace); } /// /// Sets the clipping region to the specified graphical path. /// [Obsolete("Use IntersectClip", true)] public void SetClip(XRect rect, XCombineMode combineMode) { throw new InvalidOperationException("Function is obsolete. Use IntersectClip."); //XGraphicsPath path = new XGraphicsPath(); //path.AddRectangle(rect); //SetClip(path, combineMode); } /// /// Sets the clipping region to the specified graphical path. /// [Obsolete("Use IntersectClip", true)] public void SetClip(XGraphicsPath path, XCombineMode combineMode) { throw new InvalidOperationException("Function is obsolete. Use IntersectClip."); // if (path == null) // throw new ArgumentNullException("path"); // if (combineMode != XCombineMode.Replace && combineMode != XCombineMode.Intersect) // throw new ArgumentException("Only XCombineMode.Replace and XCombineMode.Intersect are currently supported by PDFsharp.", "combineMode"); // if (this.drawGraphics) // { //#if GDI // if (this.targetContext == XGraphicTargetContext.GDI) // this.gfx.SetClip(path.gdipPath, (CombineMode)combineMode); //#endif //#if WPF // if (this.targetContext == XGraphicTargetContext.GDI) // GetType(); // //this.gfx.Transform = (Matrix)this.defaultViewMatrix; //#endif // } //if (this.renderer != null) // this.renderer.SetClip(path, combineMode); } #if nyi public void ExcludeClip(Rectangle rect) { throw new NotImplementedException("ExcludeClip"); } public void ExcludeClip(RectangleF rect) { throw new NotImplementedException("ExcludeClip"); } public void ExcludeClip(XRect rect) { throw new NotImplementedException("ExcludeClip"); } #endif #if GDI /// /// Updates the clip region of this XGraphics to the intersection of the /// current clip region and the specified rectangle. /// public void IntersectClip(Rectangle rect) { XGraphicsPath path = new XGraphicsPath(); path.AddRectangle(rect); IntersectClip(path); } #endif #if GDI /// /// Updates the clip region of this XGraphics to the intersection of the /// current clip region and the specified rectangle. /// public void IntersectClip(RectangleF rect) { XGraphicsPath path = new XGraphicsPath(); path.AddRectangle(rect); IntersectClip(path); } #endif /// /// Updates the clip region of this XGraphics to the intersection of the /// current clip region and the specified rectangle. /// public void IntersectClip(XRect rect) { XGraphicsPath path = new XGraphicsPath(); path.AddRectangle(rect); IntersectClip(path); } /// /// Updates the clip region of this XGraphics to the intersection of the /// current clip region and the specified graphical path. /// public void IntersectClip(XGraphicsPath path) { if (path == null) throw new ArgumentNullException("path"); if (this.drawGraphics) { #if GDI && WPF if (this.targetContext == XGraphicTargetContext.GDI) { //this.gfx.SetClip(path.gdipPath, CombineMode.Intersect); this.gfx.SetClip(path.gdipPath, CombineMode.Intersect); } else { //this.dc.p.renderer.SetClip(path, XCombineMode.Intersect); this.gsStack.Current.SetClip(path.pathGeometry); } #endif #if GDI && !WPF if (this.targetContext == XGraphicTargetContext.GDI) this.gfx.SetClip(path.gdipPath, CombineMode.Intersect); #endif #if WPF && !GDI if (this.targetContext == XGraphicTargetContext.WPF) this.gsStack.Current.SetClip(path.pathGeometry); #endif } if (this.renderer != null) this.renderer.SetClip(path, XCombineMode.Intersect); } /// /// Resets the clip region of this XGraphics to an infinite region, /// i.e. no clipping takes place. /// [Obsolete("Use Save/Restore pairs to reset clip area.", true)] public void ResetClip() { throw new InvalidOperationException("ResetClip is obsolete. Use Save/Restore instead."); // if (this.drawGraphics) // { //#if GDI // this.gfx.ResetClip(); //#endif //#if WPF // //this.gfx.Transform = (Matrix)this.defaultViewMatrix; //#endif // } // if (this.renderer != null) // this.renderer.ResetClip(); } //public void SetClip(Graphics g); //public void SetClip(Graphics g, CombineMode combineMode); //public void SetClip(GraphicsPath path, CombineMode combineMode); //public void SetClip(Rectangle rect, CombineMode combineMode); //public void SetClip(RectangleF rect, CombineMode combineMode); //public void SetClip(Region region, CombineMode combineMode); //public void IntersectClip(Region region); //public void ExcludeClip(Region region); #endregion // -------------------------------------------------------------------------------------------- #region Miscellaneous /// /// Writes a comment to the output stream. Comments have no effect on the rendering of the output. /// They may be useful to mark a position in a content stream of a PDF document. /// public void WriteComment(string comment) { if (comment == null) throw new ArgumentNullException("comment"); if (this.drawGraphics) { // TODO: Do something if metafile? } if (this.renderer != null) this.renderer.WriteComment(comment); } /// /// Permits access to internal data. /// public XGraphicsInternals Internals { get { if (this.internals == null) this.internals = new XGraphicsInternals(this); return this.internals; } } XGraphicsInternals internals; /// /// (Under construction. May change in future versions.) /// public SpaceTransformer Transformer { get { if (this.transformer == null) this.transformer = new SpaceTransformer(this); return this.transformer; } } SpaceTransformer transformer; #endregion // -------------------------------------------------------------------------------------------- #region Internal Helper Functions #if GDI /// /// Converts a Point[] into a PointF[]. /// internal static PointF[] MakePointFArray(System.Drawing.Point[] points) { if (points == null) return null; int count = points.Length; PointF[] result = new PointF[count]; for (int idx = 0; idx < count; idx++) { result[idx].X = points[idx].X; result[idx].Y = points[idx].Y; } return result; } #endif #if GDI /// /// Converts a XPoint[] into a PointF[]. /// internal static PointF[] MakePointFArray(XPoint[] points) { if (points == null) return null; int count = points.Length; PointF[] result = new PointF[count]; for (int idx = 0; idx < count; idx++) { result[idx].X = (float)points[idx].x; result[idx].Y = (float)points[idx].y; } return result; } #endif #if GDI /// /// Converts a Point[] into a XPoint[]. /// internal static XPoint[] MakeXPointArray(System.Drawing.Point[] points) { if (points == null) return null; int count = points.Length; XPoint[] result = new XPoint[count]; for (int idx = 0; idx < count; idx++) { result[idx].x = points[idx].X; result[idx].y = points[idx].Y; } return result; } #endif #if WPF /// /// Converts a Point[] into a XPoint[]. /// internal static XPoint[] MakeXPointArray(System.Windows.Point[] points) { if (points == null) return null; int count = points.Length; XPoint[] result = new XPoint[count]; for (int idx = 0; idx < count; idx++) { result[idx].x = points[idx].X; result[idx].y = points[idx].Y; } return result; } #endif #if GDI /// /// Converts a PointF[] into a XPoint[]. /// internal static XPoint[] MakeXPointArray(PointF[] points) { if (points == null) return null; int count = points.Length; XPoint[] result = new XPoint[count]; for (int idx = 0; idx < count; idx++) { result[idx].x = points[idx].X; result[idx].y = points[idx].Y; } return result; } #endif #if WPF /// /// Converts an XPoint[] into a Point[]. /// internal static System.Windows.Point[] MakePointArray(XPoint[] points) { if (points == null) return null; int count = points.Length; System.Windows.Point[] result = new System.Windows.Point[count]; for (int idx = 0; idx < count; idx++) { result[idx].X = points[idx].X; result[idx].Y = points[idx].Y; } return result; } #endif #endregion //// /// //// /// Testcode //// /// //// public void TestXObject(PdfDocument thisDoc, PdfPage thisPage, int page, //// PdfDocument externalDoc, ImportedObjectTable impDoc) //// { //// PdfPage impPage = externalDoc.Pages[page]; //// // impDoc.ImportPage(impPage); //// PdfFormXObject form = new PdfFormXObject(thisDoc, impDoc, impPage); //// thisDoc.xrefTable.Add(form); //// //// PdfDictionary xobjects = new PdfDictionary(); //// xobjects.Elements["/X42"] = form.XRef; //// thisPage.Resources.Elements[PdfResources.Keys.XObject] = xobjects; //// ((XGraphicsPdfRenderer)this.renderer).DrawXObject("/X42"); //// } #if GDI /// /// Always defined System.Drawing.Graphics object. Used as 'query context' for PDF pages. /// internal Graphics gfx; #endif #if WPF /// /// Always defined System.Drawing.Graphics object. Used as 'query context' for PDF pages. /// #if !SILVERLIGHT DrawingVisual dv; #endif internal DrawingContext dc; #endif /// /// The transformation matrix from the XGraphics page space to the Graphics world space. /// (The name 'default view matrix' comes from Microsoft OS/2 Presentation Manager. I choose /// this name because I have no better one.) /// internal XMatrix defaultViewMatrix; /// /// Indicates whether to send drawing operations to this.gfx or this.dc. /// bool drawGraphics; XForm form; #if GDI internal Metafile metafile; #endif /// /// Interface to an (optional) renderer. Currently it is the XGraphicsPdfRenderer, if defined. /// IXGraphicsRenderer renderer; /// /// The transformation matrix from XGraphics world space to page unit space. /// internal XMatrix transform; /// /// The graphics state stack. /// GraphicsStateStack gsStack; /// /// Gets the PDF page that serves as drawing surface if PDF is rendered, otherwise null. /// public PdfPage PdfPage { get { XGraphicsPdfRenderer renderer = this.renderer as PdfSharp.Drawing.Pdf.XGraphicsPdfRenderer; return renderer != null ? renderer.page : null; } } #if GDI /// /// Gets the System.Drawing.Graphics objects that serves as drawing surface if no PDF is rendered, /// or null, if no such object exists. /// public Graphics Graphics { get { return this.gfx; } } #endif /// /// Provides access to internal data structures of the XGraphics class. /// public class XGraphicsInternals { internal XGraphicsInternals(XGraphics gfx) { this.gfx = gfx; } XGraphics gfx; #if GDI /// /// Gets the underlying Graphics object. /// public Graphics Graphics { get { return this.gfx.gfx; } } #endif /// /// If PDF is rendered, sets the tz value. /// public void SetPdfTz(double value) { XGraphicsPdfRenderer renderer = this.gfx.renderer as XGraphicsPdfRenderer; if (renderer != null) renderer.AppendFormat(String.Format(CultureInfo.InvariantCulture, "{0:0.###} Tz\n", value)); } } /// /// (This class is under construction.) /// public class SpaceTransformer { internal SpaceTransformer(XGraphics gfx) { this.gfx = gfx; } XGraphics gfx; /// /// Gets the smallest rectangle in default page space units that completely encloses the specified rect /// in world space units. /// public XRect WorldToDefaultPage(XRect rect) { XPoint[] points = new XPoint[4]; points[0] = new XPoint(rect.x, rect.y); points[1] = new XPoint(rect.x + rect.width, rect.y); points[2] = new XPoint(rect.x, rect.y + rect.height); points[3] = new XPoint(rect.x + rect.width, rect.y + rect.height); XMatrix matrix = this.gfx.transform; matrix.TransformPoints(points); double height = this.gfx.PageSize.height; points[0].y = height - points[0].y; points[1].y = height - points[1].y; points[2].y = height - points[2].y; points[3].y = height - points[3].y; double xmin = Math.Min(Math.Min(points[0].x, points[1].x), Math.Min(points[2].x, points[3].x)); double xmax = Math.Max(Math.Max(points[0].x, points[1].x), Math.Max(points[2].x, points[3].x)); double ymin = Math.Min(Math.Min(points[0].y, points[1].y), Math.Min(points[2].y, points[3].y)); double ymax = Math.Max(Math.Max(points[0].y, points[1].y), Math.Max(points[2].y, points[3].y)); return new XRect(xmin, ymin, xmax - xmin, ymax - ymin); } } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/FontHelper.cs0000644000175000001440000002070211435766646023105 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; //#if GDI //using System.Drawing; //using System.Drawing.Drawing2D; //using System.Drawing.Imaging; //#endif #if WPF using System.Windows; using System.Windows.Controls; using System.Windows.Media; #endif using PdfSharp.Internal; using PdfSharp.Pdf; using PdfSharp.Drawing.Pdf; using PdfSharp.Fonts; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf.Advanced; namespace PdfSharp.Drawing { #if WPF /// /// The Get WPF Value flags. /// enum GWV { GetCellAscent, GetCellDescent, GetEmHeight, GetLineSpacing, //IsStyleAvailable } /// /// Helper class for fonts. /// static class FontHelper { //private const string testFontName = "Times New Roman"; //const string testFontName = "Segoe Condensed"; //const string testFontName = "Frutiger LT 45 Light"; //static FontHelper() //{ // FontFamily fontFamily = new FontFamily(testFontName); // s_typefaces = new List(fontFamily.GetTypefaces()); //} //private static List s_typefaces; /// /// Creates a typeface. /// public static Typeface CreateTypeface(FontFamily family, XFontStyle style) { // BUG: does not work with fonts that have others than the four default styles FontStyle fontStyle = FontStyleFromStyle(style); FontWeight fontWeight = FontWeightFromStyle(style); Typeface typeface = new Typeface(family, fontStyle, fontWeight, FontStretches.Normal); //List typefaces = new List(fontFamily.GetTypefaces()); //typefaces.GetType(); //Typeface typeface = typefaces[3]; return typeface; } #if !SILVERLIGHT /// /// Creates the formatted text. /// public static FormattedText CreateFormattedText(string text, Typeface typeface, double emSize, Brush brush) { //FontFamily fontFamily = new FontFamily(testFontName); //typeface = new Typeface(fontFamily, FontStyles.Normal, FontWeights.Bold, FontStretches.Condensed); //List typefaces = new List(fontFamily.GetTypefaces()); //typefaces.GetType(); //typeface = s_typefaces[0]; // BUG: does not work with fonts that have others than the four default styles FormattedText formattedText = new FormattedText(text, new CultureInfo("en-us"), FlowDirection.LeftToRight, typeface, emSize, brush); //formattedText.SetFontWeight(FontWeights.Bold); //formattedText.SetFontStyle(FontStyles.Oblique); //formattedText.SetFontStretch(FontStretches.Condensed); return formattedText; } #endif #if SILVERLIGHT /// /// Creates the TextBlock. /// public static TextBlock CreateTextBlock(string text, Typeface typeface, double emSize, Brush brush) { TextBlock textBlock = new TextBlock(); textBlock.FontFamily = new FontFamily("Verdana"); textBlock.FontSize = emSize; textBlock.Foreground = brush; textBlock.Text = text; return textBlock; } #endif /// /// Simple hack to make it work... /// public static FontStyle FontStyleFromStyle(XFontStyle style) { switch (style & XFontStyle.BoldItalic) // mask out Underline and Strikeout { case XFontStyle.Regular: return FontStyles.Normal; case XFontStyle.Bold: return FontStyles.Normal; case XFontStyle.Italic: return FontStyles.Italic; case XFontStyle.BoldItalic: return FontStyles.Italic; } return FontStyles.Normal; } /// /// Simple hack to make it work... /// public static FontWeight FontWeightFromStyle(XFontStyle style) { switch (style) { case XFontStyle.Regular: return FontWeights.Normal; case XFontStyle.Bold: return FontWeights.Bold; case XFontStyle.Italic: return FontWeights.Normal; case XFontStyle.BoldItalic: return FontWeights.Bold; } return FontWeights.Normal; } public static int GetWpfValue(XFontFamily family, XFontStyle style, GWV value) { FontDescriptor descriptor = FontDescriptorStock.Global.CreateDescriptor(family, style); XFontMetrics metrics = descriptor.FontMetrics; switch (value) { case GWV.GetCellAscent: return metrics.Ascent; case GWV.GetCellDescent: return Math.Abs(metrics.Descent); case GWV.GetEmHeight: //return (int)metrics.CapHeight; return metrics.UnitsPerEm; case GWV.GetLineSpacing: return metrics.Ascent + Math.Abs(metrics.Descent) + metrics.Leading; default: throw new InvalidOperationException("Unknown GWV value."); // DELETE //case GWV.IsStyleAvailable: // style &= XFontStyle.Regular | XFontStyle.Bold | XFontStyle.Italic | XFontStyle.BoldItalic; // same as XFontStyle.BoldItalic // List s_typefaces = new List(family.wpfFamily.GetTypefaces()); // foreach (Typeface typeface in s_typefaces) // { // } // Debugger.Break(); ////typeface.Style = FontStyles. } } /// /// Determines whether the style is available as a glyph type face in the specified font family, i.e. the specified style is not simulated. /// public static bool IsStyleAvailable(XFontFamily family, XFontStyle style) { #if !SILVERLIGHT // TODOWPF: check for correctness FontDescriptor descriptor = FontDescriptorStock.Global.CreateDescriptor(family, style); XFontMetrics metrics = descriptor.FontMetrics; style &= XFontStyle.Regular | XFontStyle.Bold | XFontStyle.Italic | XFontStyle.BoldItalic; // same as XFontStyle.BoldItalic List typefaces = new List(family.wpfFamily.GetTypefaces()); foreach (Typeface typeface in typefaces) { bool available = false; GlyphTypeface glyphTypeface; if (typeface.TryGetGlyphTypeface(out glyphTypeface)) { #if DEBUG glyphTypeface.GetType(); #endif available = true; } #if DEBUG_ // int weightClass = typeface.Weight.ToOpenTypeWeight(); switch (style) { case XFontStyle.Regular: //if (typeface.TryGetGlyphTypeface(.Style == FontStyles.Normal && typeface.Weight== FontWeights.Normal.) break; case XFontStyle.Bold: break; case XFontStyle.Italic: break; case XFontStyle.BoldItalic: break; } #endif if (available) return true; } return false; #else return true; // AGHACK #endif } } #endif }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XFontWeights.cs0000644000175000001440000001620511435766646023433 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; namespace PdfSharp.Drawing { /// /// Defines a set of static predefined XFontWeight values. /// public static class XFontWeights { internal static bool FontWeightStringToKnownWeight(string s, IFormatProvider provider, ref XFontWeight fontWeight) { int num; switch (s.ToLower()) { case "thin": fontWeight = Thin; return true; case "extralight": fontWeight = ExtraLight; return true; case "ultralight": fontWeight = UltraLight; return true; case "light": fontWeight = Light; return true; case "normal": fontWeight = Normal; return true; case "regular": fontWeight = Regular; return true; case "medium": fontWeight = Medium; return true; case "semibold": fontWeight = SemiBold; return true; case "demibold": fontWeight = DemiBold; return true; case "bold": fontWeight = Bold; return true; case "extrabold": fontWeight = ExtraBold; return true; case "ultrabold": fontWeight = UltraBold; return true; case "heavy": fontWeight = Heavy; return true; case "black": fontWeight = Black; return true; case "extrablack": fontWeight = ExtraBlack; return true; case "ultrablack": fontWeight = UltraBlack; return true; } if (Int32.TryParse(s, NumberStyles.Integer, provider, out num)) { fontWeight = new XFontWeight(num); return true; } return false; } internal static bool FontWeightToString(int weight, out string convertedValue) { switch (weight) { case 100: convertedValue = "Thin"; return true; case 200: convertedValue = "ExtraLight"; return true; case 300: convertedValue = "Light"; return true; case 400: convertedValue = "Normal"; return true; case 500: convertedValue = "Medium"; return true; case 600: convertedValue = "SemiBold"; return true; case 700: convertedValue = "Bold"; return true; case 800: convertedValue = "ExtraBold"; return true; case 900: convertedValue = "Black"; return true; case 950: convertedValue = "ExtraBlack"; return true; } convertedValue = null; return false; } /// /// Specifies a "Thin" font weight. /// public static XFontWeight Thin { get { return new XFontWeight(100); } } /// /// Specifies a "ExtraLight" font weight. /// public static XFontWeight ExtraLight { get { return new XFontWeight(200); } } /// /// Specifies a "UltraLight" font weight. /// public static XFontWeight UltraLight { get { return new XFontWeight(200); } } /// /// Specifies a "Light" font weight. /// public static XFontWeight Light { get { return new XFontWeight(300); } } /// /// Specifies a "Normal" font weight. /// public static XFontWeight Normal { get { return new XFontWeight(400); } } /// /// Specifies a "Regular" font weight. /// public static XFontWeight Regular { get { return new XFontWeight(400); } } /// /// Specifies a "Medium" font weight. /// public static XFontWeight Medium { get { return new XFontWeight(500); } } /// /// Specifies a "SemiBold" font weight. /// public static XFontWeight SemiBold { get { return new XFontWeight(600); } } /// /// Specifies a "DemiBold" font weight. /// public static XFontWeight DemiBold { get { return new XFontWeight(600); } } /// /// Specifies a "Bold" font weight. /// public static XFontWeight Bold { get { return new XFontWeight(700); } } /// /// Specifies a "ExtraBold" font weight. /// public static XFontWeight ExtraBold { get { return new XFontWeight(800); } } /// /// Specifies a "UltraBold" font weight. /// public static XFontWeight UltraBold { get { return new XFontWeight(800); } } /// /// Specifies a "Heavy" font weight. /// public static XFontWeight Heavy { get { return new XFontWeight(900); } } /// /// Specifies a "Black" font weight. /// public static XFontWeight Black { get { return new XFontWeight(900); } } /// /// Specifies a "ExtraBlack" font weight. /// public static XFontWeight ExtraBlack { get { return new XFontWeight(950); } } /// /// Specifies a "UltraBlack" font weight. /// public static XFontWeight UltraBlack { get { return new XFontWeight(950); } } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/IXGraphicsRenderer.cs0000644000175000001440000001575111435766646024537 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Text; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Internal; namespace PdfSharp.Drawing { /// /// Represents an abstract drawing surface for PdfPages. /// internal interface IXGraphicsRenderer { void Close(); #region Drawing /// /// Fills the entire drawing surface with the specified color. /// void Clear(XColor color); /// /// Draws a straight line. /// void DrawLine(XPen pen, double x1, double y1, double x2, double y2); /// /// Draws a series of straight lines. /// void DrawLines(XPen pen, XPoint[] points); /// /// Draws a Bzier spline. /// void DrawBezier(XPen pen, double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4); /// /// Draws a series of Bzier splines. /// void DrawBeziers(XPen pen, XPoint[] points); /// /// Draws a cardinal spline. /// void DrawCurve(XPen pen, XPoint[] points, double tension); /// /// Draws an arc. /// void DrawArc(XPen pen, double x, double y, double width, double height, double startAngle, double sweepAngle); /// /// Draws a rectangle. /// void DrawRectangle(XPen pen, XBrush brush, double x, double y, double width, double height); /// /// Draws a series of rectangles. /// void DrawRectangles(XPen pen, XBrush brush, XRect[] rects); /// /// Draws a rectangle with rounded corners. /// void DrawRoundedRectangle(XPen pen, XBrush brush, double x, double y, double width, double height, double ellipseWidth, double ellipseHeight); /// /// Draws an ellipse. /// void DrawEllipse(XPen pen, XBrush brush, double x, double y, double width, double height); /// /// Draws a polygon. /// void DrawPolygon(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode); /// /// Draws a pie. /// void DrawPie(XPen pen, XBrush brush, double x, double y, double width, double height, double startAngle, double sweepAngle); /// /// Draws a cardinal spline. /// void DrawClosedCurve(XPen pen, XBrush brush, XPoint[] points, double tension, XFillMode fillmode); /// /// Draws a graphical path. /// void DrawPath(XPen pen, XBrush brush, XGraphicsPath path); /// /// Draws a series of glyphs identified by the specified text and font. /// void DrawString(string s, XFont font, XBrush brush, XRect layoutRectangle, XStringFormat format); /// /// Draws an image. /// void DrawImage(XImage image, double x, double y, double width, double height); void DrawImage(XImage image, XRect destRect, XRect srcRect, XGraphicsUnit srcUnit); #endregion #region Save and Restore /// /// Saves the current graphics state without changing it. /// void Save(XGraphicsState state); /// /// Restores the specified graphics state. /// void Restore(XGraphicsState state); /// /// /// void BeginContainer(XGraphicsContainer container, XRect dstrect, XRect srcrect, XGraphicsUnit unit); /// /// /// void EndContainer(XGraphicsContainer container); #endregion #region Transformation //void TranslateTransform(double dx, double dy, XMatrixOrder order); //void ScaleTransform(double scaleX, double scaleY, XMatrixOrder order); //void ScaleTransform(double scaleXY, XMatrixOrder order); //void RotateTransform(double angle, XMatrixOrder order); //void MultiplyTransform(XMatrix matrix, XMatrixOrder order); /// /// Sets all values that influence the page transformation. /// void SetPageTransform(XPageDirection direction, XPoint origion, XGraphicsUnit unit); /// /// Gets or sets the transformation matrix. /// XMatrix Transform {/*get;*/ set;} #endregion #region Clipping void SetClip(XGraphicsPath path, XCombineMode combineMode); void ResetClip(); //public void SetClip(GraphicsPath path); //public void SetClip(Graphics g); //public void SetClip(Rectangle rect); //public void SetClip(XRect rect); //public void SetClip(GraphicsPath path, CombineMode combineMode); //public void SetClip(Graphics g, CombineMode combineMode); //public void SetClip(Rectangle rect, CombineMode combineMode); //public void SetClip(XRect rect, CombineMode combineMode); //public void SetClip(Region region, CombineMode combineMode); //public void ExcludeClip(Rectangle rect); //public void ExcludeClip(Region region); //public void IntersectClip(Rectangle rect); //public void IntersectClip(XRect rect); //public void IntersectClip(Region region); #endregion #region Miscellaneous /// /// Writes a comment to the output stream. Comments have no effect on the rendering of the output. /// void WriteComment(string comment); #endregion } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XSolidBrush.cs0000644000175000001440000001062211435766646023245 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.IO; #if GDI using System.Drawing; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Internal; namespace PdfSharp.Drawing { /// /// Defines a single color object used to fill shapes and draw text. /// public class XSolidBrush : XBrush { /// /// Initializes a new instance of the class. /// public XSolidBrush() { } /// /// Initializes a new instance of the class. /// public XSolidBrush(XColor color) : this(color, false) { } internal XSolidBrush(XColor color, bool immutable) { this.color = color; this.immutable = immutable; } /// /// Initializes a new instance of the class. /// public XSolidBrush(XSolidBrush brush) { this.color = brush.Color; } /// /// Gets or sets the color of this brush. /// public XColor Color { get { return this.color; } set { if (this.immutable) throw new ArgumentException(PSSR.CannotChangeImmutableObject("XSolidBrush")); this.color = value; #if GDI this.gdiDirty = this.gdiDirty || this.color != value; #endif #if WPF this.wpfDirty = this.wpfDirty || this.color != value; #endif #if GDI && WPF this.gdiDirty = this.wpfDirty = true; #endif } } internal XColor color; #if GDI internal override System.Drawing.Brush RealizeGdiBrush() { if (this.gdiDirty) { if (this.gdiBrush == null) this.gdiBrush = new SolidBrush(this.color.ToGdiColor()); else this.gdiBrush.Color = this.color.ToGdiColor(); this.gdiDirty = false; } #if DEBUG System.Drawing.Color clr = this.color.ToGdiColor(); SolidBrush brush1 = new SolidBrush(clr); Debug.Assert(this.gdiBrush.Color == brush1.Color); #endif return this.gdiBrush; } #endif #if WPF internal override System.Windows.Media.Brush RealizeWpfBrush() { if (this.wpfDirty) { if (this.wpfBrush == null) this.wpfBrush = new SolidColorBrush(this.color.ToWpfColor()); else this.wpfBrush.Color = this.color.ToWpfColor(); this.wpfDirty = false; } #if DEBUG_ System.Windows.Media.Color clr = this.color.ToWpfColor(); System.Windows.Media.SolidColorBrush brush1 = new System.Windows.Media.SolidColorBrush(clr); //System.Drawing.Color.FromArgb(128, 128, 0, 0)); Debug.Assert(this.wpfBrush.Color == brush1.Color); // Crashes during unit testing #endif return this.wpfBrush; } #endif #if GDI bool gdiDirty = true; SolidBrush gdiBrush; #endif #if WPF bool wpfDirty = true; SolidColorBrush wpfBrush; #endif bool immutable; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XStringFormat.cs0000644000175000001440000001756211435766646023620 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Internal; namespace PdfSharp.Drawing { /// /// Not used in this implementation. /// [Flags] public enum XStringFormatFlags { //DirectionRightToLeft = 0x0001, //DirectionVertical = 0x0002, //FitBlackBox = 0x0004, //DisplayFormatControl = 0x0020, //NoFontFallback = 0x0400, /// /// The default value. /// MeasureTrailingSpaces = 0x0800, //NoWrap = 0x1000, //LineLimit = 0x2000, //NoClip = 0x4000, } ////public enum StringTrimming ////{ //// None = 0, //// Character = 1, //// Word = 2, //// EllipsisCharacter = 3, //// EllipsisWord = 4, //// EllipsisPath = 5, ////} /// /// Represents the text layout information. /// public class XStringFormat { /// /// Initializes a new instance of the class. /// public XStringFormat() { #if GDI // We must clone GenericTypographic, otherwise we change the original! this.stringFormat = (StringFormat)StringFormat.GenericTypographic.Clone(); #endif } //TODO public StringFormat(StringFormat format); //public StringFormat(StringFormatFlags options); //public StringFormat(StringFormatFlags options, int language); //public object Clone(); //public void Dispose(); //private void Dispose(bool disposing); //protected override void Finalize(); //public float[] GetTabStops(out float firstTabOffset); //public void SetDigitSubstitution(int language, StringDigitSubstitute substitute); //public void SetMeasurableCharacterRanges(CharacterRange[] ranges); //public void SetTabStops(float firstTabOffset, float[] tabStops); //public override string ToString(); /// /// Gets or sets horizontal text alignment information. /// public XStringAlignment Alignment { get {return this.alignment;} set { this.alignment = value; #if GDI this.stringFormat.Alignment = (StringAlignment)value; #endif } } XStringAlignment alignment; //public int DigitSubstitutionLanguage { get; } //public StringDigitSubstitute DigitSubstitutionMethod { get; } //public StringFormatFlags FormatFlags { get; set; } //public static StringFormat GenericDefault { get; } //public static StringFormat GenericTypographic { get; } //public HotkeyPrefix HotkeyPrefix { get; set; } /// /// Gets or sets the line alignment. /// public XLineAlignment LineAlignment { get {return this.lineAlignment;} set { this.lineAlignment = value; #if GDI if (value == XLineAlignment.BaseLine) this.stringFormat.LineAlignment = StringAlignment.Near; else this.stringFormat.LineAlignment = (StringAlignment)value; #endif } } XLineAlignment lineAlignment; //public StringTrimming Trimming { get; set; } /// /// Gets a new XStringFormat object that aligns the text left on the base line. /// [Obsolete("Use XStringFormats.Default. (Note plural in class name.)")] public static XStringFormat Default { get { XStringFormat format = new XStringFormat(); format.LineAlignment = XLineAlignment.BaseLine; return format; } } /// /// Gets a new XStringFormat object that aligns the text top left of the layout rectangle. /// [Obsolete("Use XStringFormats.Default. (Note plural in class name.)")] public static XStringFormat TopLeft { get { XStringFormat format = new XStringFormat(); format.Alignment = XStringAlignment.Near; format.LineAlignment = XLineAlignment.Near; return format; } } /// /// Gets a new XStringFormat object that centers the text in the middle of the layout rectangle. /// [Obsolete("Use XStringFormats.Center. (Note plural in class name.)")] public static XStringFormat Center { get { XStringFormat format = new XStringFormat(); format.Alignment = XStringAlignment.Center; format.LineAlignment = XLineAlignment.Center; return format; } } /// /// Gets a new XStringFormat object that centers the text at the top of the layout rectangle. /// [Obsolete("Use XStringFormats.TopCenter. (Note plural in class name.)")] public static XStringFormat TopCenter { get { XStringFormat format = new XStringFormat(); format.Alignment = XStringAlignment.Center; format.LineAlignment = XLineAlignment.Near; return format; } } /// /// Gets a new XStringFormat object that centers the text at the bottom of the layout rectangle. /// [Obsolete("Use XStringFormats.BottomCenter. (Note plural in class name.)")] public static XStringFormat BottomCenter { get { XStringFormat format = new XStringFormat(); format.Alignment = XStringAlignment.Center; format.LineAlignment = XLineAlignment.Far; return format; } } /// /// Gets or sets flags with format information. /// public XStringFormatFlags FormatFlags { get {return this.formatFlags;} set { this.formatFlags = value; #if GDI this.stringFormat.FormatFlags = (StringFormatFlags)value; #endif } } private XStringFormatFlags formatFlags; #if GDI internal StringFormat RealizeGdiStringFormat() { if (this.stringFormat == null) { this.stringFormat = StringFormat.GenericTypographic; //.GenericDefault; this.stringFormat.Alignment = (StringAlignment)this.alignment; this.stringFormat.LineAlignment = (StringAlignment)this.lineAlignment; this.stringFormat.FormatFlags = (StringFormatFlags)this.formatFlags; } return this.stringFormat; } StringFormat stringFormat; #endif } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XForm.cs0000644000175000001440000004643311435766646022103 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.ComponentModel; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Internal; using PdfSharp.Drawing.Pdf; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Filters; using PdfSharp.Pdf.Internal; namespace PdfSharp.Drawing { /// /// Represents a graphical object that can be used to render retained graphics on it. /// In GDI+ it is represented by a Metafile, in WPF by a DrawingVisual, and in PDF by a Form XObjects. /// public class XForm : XImage, IContentStream { internal enum FormState { /// /// The form is an imported PDF page. /// NotATemplate, /// /// The template is just created. /// Created, /// /// XGraphics.FromForm() was called. /// UnderConstruction, /// /// The form was drawn at least once and is 'frozen' now. /// Finished, } /// /// Initializes a new instance of the class. /// protected XForm() { } #if GDI /// /// Initializes a new instance of the XForm class such that it can be drawn on the specified graphics /// object. /// /// The graphics object that later is used to draw this form. /// The size in points of the form. public XForm(XGraphics gfx, XSize size) { if (gfx == null) throw new ArgumentNullException("gfx"); if (size.width < 1 || size.height < 1) throw new ArgumentNullException("size", "The size of the XPdfForm is to small."); this.formState = FormState.Created; //this.templateSize = size; this.viewBox.width = size.width; this.viewBox.height = size.height; // If gfx belongs to a PdfPage also create the PdfFormXObject if (gfx.PdfPage != null) { this.document = gfx.PdfPage.Owner; this.pdfForm = new PdfFormXObject(this.document, this); PdfRectangle rect = new PdfRectangle(new XPoint(), size); this.pdfForm.Elements.SetRectangle(PdfFormXObject.Keys.BBox, rect); } } #endif #if GDI /// /// Initializes a new instance of the XForm class such that it can be drawn on the specified graphics /// object. /// /// The graphics object that later is used to draw this form. /// The width of the form. /// The height of the form. public XForm(XGraphics gfx, XUnit width, XUnit height) : this(gfx, new XSize(width, height)) { } #endif /// /// Initializes a new instance of the class that represents a page of a PDF document. /// /// The PDF document. /// The view box of the page. public XForm(PdfDocument document, XRect viewBox) { if (viewBox.width < 1 || viewBox.height < 1) throw new ArgumentNullException("viewBox", "The size of the XPdfForm is to small."); // I must tie the XPdfForm to a document immediately, because otherwise I would have no place where // to store the resources. if (document == null) throw new ArgumentNullException("document", "An XPdfForm template must be associated with a document at creation time."); this.formState = FormState.Created; this.document = document; this.pdfForm = new PdfFormXObject(document, this); //this.templateSize = size; this.viewBox = viewBox; PdfRectangle rect = new PdfRectangle(viewBox); this.pdfForm.Elements.SetRectangle(PdfFormXObject.Keys.BBox, rect); } /// /// Initializes a new instance of the class that represents a page of a PDF document. /// /// The PDF document. /// The size of the page. public XForm(PdfDocument document, XSize size) : this(document, new XRect(0, 0, size.width, size.height)) { ////if (size.width < 1 || size.height < 1) //// throw new ArgumentNullException("size", "The size of the XPdfForm is to small."); ////// I must tie the XPdfForm to a document immediately, because otherwise I would have no place where ////// to store the resources. ////if (document == null) //// throw new ArgumentNullException("document", "An XPdfForm template must be associated with a document."); ////this.formState = FormState.Created; ////this.document = document; ////this.pdfForm = new PdfFormXObject(document, this); ////this.templateSize = size; ////PdfRectangle rect = new PdfRectangle(new XPoint(), size); ////this.pdfForm.Elements.SetRectangle(PdfFormXObject.Keys.BBox, rect); } /// /// Initializes a new instance of the class that represents a page of a PDF document. /// /// The PDF document. /// The width of the page. /// The height of the page public XForm(PdfDocument document, XUnit width, XUnit height) : this(document, new XRect(0, 0, width, height)) { } /// /// This function should be called when drawing the content of this form is finished. /// The XGraphics object used for drawing the content is disposed by this function and /// cannot be used for any further drawing operations. /// PDFsharp automatically calls this function when this form was used the first time /// in a DrawImage function. /// public void DrawingFinished() { if (this.formState == FormState.Finished) return; if (this.formState == FormState.NotATemplate) throw new InvalidOperationException("This object is an imported PDF page and you cannot finish drawing on it because you must not draw on it at all."); Finish(); } /// /// Called from XGraphics constructor that creates an instance that work on this form. /// internal void AssociateGraphics(XGraphics gfx) { if (this.formState == FormState.NotATemplate) throw new NotImplementedException("The current version of PDFsharp cannot draw on an imported page."); if (this.formState == FormState.UnderConstruction) throw new InvalidOperationException("An XGraphics object already exists for this form."); if (this.formState == FormState.Finished) throw new InvalidOperationException("After drawing a form it cannot be modified anymore."); Debug.Assert(this.formState == FormState.Created); this.formState = FormState.UnderConstruction; this.gfx = gfx; } internal XGraphics gfx; /// /// Disposes this instance. /// protected override void Dispose(bool disposing) { base.Dispose(disposing); } /// /// Sets the form in the state FormState.Finished. /// internal virtual void Finish() { #if GDI if (this.formState == FormState.NotATemplate || this.formState == FormState.Finished) return; if (this.gfx.metafile != null) this.gdiImage = this.gfx.metafile; Debug.Assert(this.formState == FormState.Created || this.formState == FormState.UnderConstruction); this.formState = FormState.Finished; this.gfx.Dispose(); this.gfx = null; if (this.pdfRenderer != null) { //this.pdfForm.CreateStream(PdfEncoders.RawEncoding.GetBytes(this.pdfRenderer.GetContent())); this.pdfRenderer.Close(); Debug.Assert(this.pdfRenderer == null); if (this.document.Options.CompressContentStreams) { this.pdfForm.Stream.Value = Filtering.FlateDecode.Encode(this.pdfForm.Stream.Value); this.pdfForm.Elements["/Filter"] = new PdfName("/FlateDecode"); } int length = this.pdfForm.Stream.Length; this.pdfForm.Elements.SetInteger("/Length", length); } #endif #if WPF #endif } /// /// Gets the owning document. /// internal PdfDocument Owner { get { return this.document; } } PdfDocument document; /// /// Gets the color model used in the underlying PDF document. /// internal PdfColorMode ColorMode { get { if (this.document == null) return PdfColorMode.Undefined; return this.document.Options.ColorMode; } } /// /// Gets a value indicating whether this instance is a template. /// internal bool IsTemplate { get { return this.formState != FormState.NotATemplate; } } internal FormState formState; /// /// Get the width of the page identified by the property PageNumber. /// [Obsolete("Use either PixelWidth or PointWidth. Temporarily obsolete because of rearrangements for WPF. Currently same as PixelWidth, but will become PointWidth in future releases of PDFsharp.")] public override double Width { //get { return this.templateSize.width; } get { return this.viewBox.Width; } } /// /// Get the width of the page identified by the property PageNumber. /// [Obsolete("Use either PixelHeight or PointHeight. Temporarily obsolete because of rearrangements for WPF. Currently same as PixelHeight, but will become PointHeight in future releases of PDFsharp.")] public override double Height { //get { return this.templateSize.height; } get { return this.viewBox.height; } } /// /// Get the width in point of this image. /// public override double PointWidth { //get { return this.templateSize.width; } get { return this.viewBox.width; } } /// /// Get the height in point of this image. /// public override double PointHeight { //get { return this.templateSize.height; } get { return this.viewBox.height; } } /// /// Get the width of the page identified by the property PageNumber. /// public override int PixelWidth { //get { return (int)this.templateSize.width; } get { return (int)this.viewBox.width; } } /// /// Get the height of the page identified by the property PageNumber. /// public override int PixelHeight { //get { return (int)this.templateSize.height; } get { return (int)this.viewBox.height; } } /// /// Get the size of the page identified by the property PageNumber. /// public override XSize Size { //get { return this.templateSize; } get { return this.viewBox.Size; } } //XSize templateSize; /// /// Gets the view box of the form. /// public XRect ViewBox { get { return this.viewBox; } } XRect viewBox; /// /// Gets 72, the horizontal resolution by design of a form object. /// public override double HorizontalResolution { get { return 72; } } /// /// Gets 72 always, the vertical resolution by design of a form object. /// public override double VerticalResolution { get { return 72; } } /// /// Gets or sets the bounding box. /// public XRect BoundingBox { get { return this.boundingBox; } set { this.boundingBox = value; } // TODO: pdfForm = null } XRect boundingBox; /// /// Gets or sets the transformation matrix. /// public virtual XMatrix Transform { get { return this.transform; } set { if (this.formState == FormState.Finished) throw new InvalidOperationException("After a XPdfForm was once drawn it must not be modified."); this.transform = value; } } internal XMatrix transform = new XMatrix(); //XMatrix.Identity; internal PdfResources Resources { get { Debug.Assert(IsTemplate, "This function is for form templates only."); return PdfForm.Resources; //if (this.resources == null) // this.resources = (PdfResources)this.pdfForm.Elements.GetValue(PdfFormXObject.Keys.Resources, VCF.Create); // VCF.CreateIndirect //return this.resources; } } //PdfResources resources; /// /// Implements the interface because the primary function is internal. /// PdfResources IContentStream.Resources { get { return Resources; } } /// /// Gets the resource name of the specified font within this form. /// internal string GetFontName(XFont font, out PdfFont pdfFont) { Debug.Assert(IsTemplate, "This function is for form templates only."); pdfFont = this.document.FontTable.GetFont(font); Debug.Assert(pdfFont != null); string name = Resources.AddFont(pdfFont); return name; } string IContentStream.GetFontName(XFont font, out PdfFont pdfFont) { return GetFontName(font, out pdfFont); } /// /// Tries to get the resource name of the specified font data within this form. /// Returns null if no such font exists. /// internal string TryGetFontName(string idName, out PdfFont pdfFont) { Debug.Assert(IsTemplate, "This function is for form templates only."); pdfFont = this.document.FontTable.TryGetFont(idName); string name = null; if (pdfFont != null) name = Resources.AddFont(pdfFont); return name; } /// /// Gets the resource name of the specified font data within this form. /// internal string GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) { Debug.Assert(IsTemplate, "This function is for form templates only."); pdfFont = this.document.FontTable.GetFont(idName, fontData); //pdfFont = new PdfType0Font(Owner, idName, fontData); //pdfFont.Document = this.document; Debug.Assert(pdfFont != null); string name = Resources.AddFont(pdfFont); return name; } string IContentStream.GetFontName(string idName, byte[] fontData, out PdfFont pdfFont) { return GetFontName(idName, fontData, out pdfFont); } /// /// Gets the resource name of the specified image within this form. /// internal string GetImageName(XImage image) { Debug.Assert(IsTemplate, "This function is for form templates only."); PdfImage pdfImage = this.document.ImageTable.GetImage(image); Debug.Assert(pdfImage != null); string name = Resources.AddImage(pdfImage); return name; } /// /// Implements the interface because the primary function is internal. /// string IContentStream.GetImageName(XImage image) { return GetImageName(image); } internal PdfFormXObject PdfForm { get { Debug.Assert(IsTemplate, "This function is for form templates only."); if (this.pdfForm.Reference == null) this.document.irefTable.Add(this.pdfForm); return this.pdfForm; } } /// /// Gets the resource name of the specified form within this form. /// internal string GetFormName(XForm form) { Debug.Assert(IsTemplate, "This function is for form templates only."); PdfFormXObject pdfForm = this.document.FormTable.GetForm(form); Debug.Assert(pdfForm != null); string name = Resources.AddForm(pdfForm); return name; } /// /// Implements the interface because the primary function is internal. /// string IContentStream.GetFormName(XForm form) { return GetFormName(form); } /// /// The PdfFormXObject gets invalid when PageNumber or transform changed. This is because a modification /// of an XPdfForm must not change objects that are already been drawn. /// internal PdfFormXObject pdfForm; internal XGraphicsPdfRenderer pdfRenderer; #if WPF && !SILVERLIGHT /// /// Gets a value indicating whether this image is cmyk. /// /// true if this image is cmyk; otherwise, false. public override bool IsCmyk { get { return false; } // not supported and not relevant } /// /// Gets a value indicating whether this image is JPEG. /// /// true if this image is JPEG; otherwise, false. public override bool IsJpeg { get { return base.IsJpeg; }// not supported and not relevant } /// /// Gets the JPEG memory stream (if IsJpeg returns true). /// /// The memory. public override MemoryStream Memory { get { throw new NotImplementedException(); } } #endif } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XUnit.cs0000644000175000001440000004123411435766646022111 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; namespace PdfSharp.Drawing { /// /// Represents a value and its unit of measure. The structure converts implicitly from and to /// double with a value measured in point. /// public struct XUnit : IFormattable { internal const double PointFactor = 1; internal const double InchFactor = 72; internal const double MillimeterFactor = 72 / 25.4; internal const double CentimeterFactor = 72 / 2.54; internal const double PresentationFactor = 72 / 96.0; internal const double PointFactorWpf = 96 / 72.0; internal const double InchFactorWpf = 96; internal const double MillimeterFactorWpf = 96 / 25.4; internal const double CentimeterFactorWpf = 96 / 2.54; internal const double PresentationFactorWpf = 1; /// /// Initializes a new instance of the XUnit class with type set to point. /// public XUnit(double point) { this.value = point; this.type = XGraphicsUnit.Point; } /// /// Initializes a new instance of the XUnit class. /// public XUnit(double value, XGraphicsUnit type) { if (!Enum.IsDefined(typeof(XGraphicsUnit), type)) #if !SILVERLIGHT throw new System.ComponentModel.InvalidEnumArgumentException("type"); #else throw new ArgumentException("type"); #endif this.value = value; this.type = type; } /// /// Gets the raw value of the object without any conversion. /// To determine the XGraphicsUnit use property Type. /// To get the value in point use the implicit conversion to double. /// public double Value { get { return this.value; } } /// /// Gets the unit of measure. /// public XGraphicsUnit Type { get { return this.type; } } /// /// Gets or sets the value in point. /// public double Point { get { switch (type) { case XGraphicsUnit.Point: return this.value; case XGraphicsUnit.Inch: return this.value * 72; case XGraphicsUnit.Millimeter: return this.value * 72 / 25.4; case XGraphicsUnit.Centimeter: return this.value * 72 / 2.54; case XGraphicsUnit.Presentation: return this.value * 72 / 96; default: throw new InvalidCastException(); } } set { this.value = value; this.type = XGraphicsUnit.Point; } } /// /// Gets or sets the value in inch. /// public double Inch { get { switch (type) { case XGraphicsUnit.Point: return this.value / 72; case XGraphicsUnit.Inch: return this.value; case XGraphicsUnit.Millimeter: return this.value / 25.4; case XGraphicsUnit.Centimeter: return this.value / 2.54; case XGraphicsUnit.Presentation: return this.value / 96; default: throw new InvalidCastException(); } } set { this.value = value; this.type = XGraphicsUnit.Inch; } } /// /// Gets or sets the value in millimeter. /// public double Millimeter { get { switch (this.type) { case XGraphicsUnit.Point: return this.value * 25.4 / 72; case XGraphicsUnit.Inch: return this.value * 25.4; case XGraphicsUnit.Millimeter: return this.value; case XGraphicsUnit.Centimeter: return this.value * 10; case XGraphicsUnit.Presentation: return this.value * 25.4 / 96; default: throw new InvalidCastException(); } } set { this.value = value; this.type = XGraphicsUnit.Millimeter; } } /// /// Gets or sets the value in centimeter. /// public double Centimeter { get { switch (type) { case XGraphicsUnit.Point: return this.value * 2.54 / 72; case XGraphicsUnit.Inch: return this.value * 2.54; case XGraphicsUnit.Millimeter: return this.value / 10; case XGraphicsUnit.Centimeter: return this.value; case XGraphicsUnit.Presentation: return this.value * 2.54 / 96; default: throw new InvalidCastException(); } } set { this.value = value; this.type = XGraphicsUnit.Centimeter; } } /// /// Gets or sets the value in presentation units (1/96 inch). /// public double Presentation { get { switch (type) { case XGraphicsUnit.Point: return this.value * 96 / 72; case XGraphicsUnit.Inch: return this.value * 96; case XGraphicsUnit.Millimeter: return this.value * 96 / 25.4; case XGraphicsUnit.Centimeter: return this.value * 96 / 2.54; case XGraphicsUnit.Presentation: return this.value; default: throw new InvalidCastException(); } } set { this.value = value; this.type = XGraphicsUnit.Point; } } /// /// Returns the object as string using the format information. /// The unit of measure is appended to the end of the string. /// public string ToString(IFormatProvider formatProvider) { string valuestring; valuestring = this.value.ToString(formatProvider) + GetSuffix(); return valuestring; } /// /// Returns the object as string using the specified format and format information. /// The unit of measure is appended to the end of the string. /// string IFormattable.ToString(string format, IFormatProvider formatProvider) { string valuestring; valuestring = this.value.ToString(format, formatProvider) + GetSuffix(); return valuestring; } /// /// Returns the object as string. The unit of measure is appended to the end of the string. /// public override string ToString() { string valuestring; valuestring = this.value.ToString(CultureInfo.InvariantCulture) + GetSuffix(); return valuestring; } /// /// Returns the unit of measure of the object as a string like 'pt', 'cm', or 'in'. /// string GetSuffix() { switch (type) { case XGraphicsUnit.Point: return "pt"; case XGraphicsUnit.Inch: return "in"; case XGraphicsUnit.Millimeter: return "mm"; case XGraphicsUnit.Centimeter: return "cm"; case XGraphicsUnit.Presentation: return "pu"; //case XGraphicsUnit.Pica: // return "pc"; //case XGraphicsUnit.Line: // return "li"; default: throw new InvalidCastException(); } } /// /// Returns an XUnit object. Sets type to point. /// public static XUnit FromPoint(double value) { XUnit unit; unit.value = value; unit.type = XGraphicsUnit.Point; return unit; } /// /// Returns an XUnit object. Sets type to inch. /// public static XUnit FromInch(double value) { XUnit unit; unit.value = value; unit.type = XGraphicsUnit.Inch; return unit; } /// /// Returns an XUnit object. Sets type to millimeters. /// public static XUnit FromMillimeter(double value) { XUnit unit; unit.value = value; unit.type = XGraphicsUnit.Millimeter; return unit; } /// /// Returns an XUnit object. Sets type to centimeters. /// public static XUnit FromCentimeter(double value) { XUnit unit; unit.value = value; unit.type = XGraphicsUnit.Centimeter; return unit; } /// /// Returns an XUnit object. Sets type to Presentation. /// public static XUnit FromPresentation(double value) { XUnit unit; unit.value = value; unit.type = XGraphicsUnit.Presentation; return unit; } #if deferred ///// ///// Returns an XUnit object. Sets type to pica. ///// //public static XUnit FromPica(double val) //{ // XUnit unit; // unit.val = val; // unit.type = XGraphicsUnit.Pica; // return unit; //} // ///// ///// Returns an XUnit object. Sets type to line. ///// //public static XUnit FromLine(double val) //{ // XUnit unit; // unit.val = val; // unit.type = XGraphicsUnit.Line; // return unit; //} #endif /// /// Converts a string to an XUnit object. /// If the string contains a suffix like 'cm' or 'in' the object will be converted /// to the appropriate type, otherwise point is assumed. /// public static implicit operator XUnit(string value) { XUnit unit; value = value.Trim(); // HACK for Germans... value = value.Replace(',', '.'); int count = value.Length; int valLen = 0; for (; valLen < count; ) { char ch = value[valLen]; if (ch == '.' || ch == '-' || ch == '+' || Char.IsNumber(ch)) valLen++; else break; } try { unit.value = Double.Parse(value.Substring(0, valLen).Trim(), CultureInfo.InvariantCulture); } catch (Exception ex) { unit.value = 1; string message = String.Format("String '{0}' is not a valid value for structure 'XUnit'.", value); throw new ArgumentException(message, ex); } string typeStr = value.Substring(valLen).Trim().ToLower(); unit.type = XGraphicsUnit.Point; switch (typeStr) { case "cm": unit.type = XGraphicsUnit.Centimeter; break; case "in": unit.type = XGraphicsUnit.Inch; break; case "mm": unit.type = XGraphicsUnit.Millimeter; break; //case "pc": // unit.type = XGraphicsUnit.Pica; // break; // //case "li": // unit.type = XGraphicsUnit.Line; // break; case "": case "pt": unit.type = XGraphicsUnit.Point; break; case "pu": // presentation units unit.type = XGraphicsUnit.Presentation; break; default: throw new ArgumentException("Unknown unit type: '" + typeStr + "'"); } return unit; } /// /// Converts an int to an XUnit object with type set to point. /// public static implicit operator XUnit(int value) { XUnit unit; unit.value = value; unit.type = XGraphicsUnit.Point; return unit; } /// /// Converts a double to an XUnit object with type set to point. /// public static implicit operator XUnit(double value) { XUnit unit; unit.value = value; unit.type = XGraphicsUnit.Point; return unit; } /// /// Returns a double value as point. /// public static implicit operator double(XUnit value) { return value.Point; } /// /// Memberwise comparison. To compare by value, /// use code like Math.Abs(a.Pt - b.Pt) < 1e5. /// public static bool operator ==(XUnit value1, XUnit value2) { return value1.type == value2.type && value1.value == value2.value; } /// /// Memberwise comparison. To compare by value, /// use code like Math.Abs(a.Pt - b.Pt) < 1e5. /// public static bool operator !=(XUnit value1, XUnit value2) { return !(value1 == value2); } /// /// Calls base class Equals. /// public override bool Equals(Object obj) { if (obj is XUnit) return this == (XUnit)obj; return false; } /// /// Returns the hash code for this instance. /// public override int GetHashCode() { return this.value.GetHashCode() ^ this.type.GetHashCode(); } /// /// This member is intended to be used by XmlDomainObjectReader only. /// public static XUnit Parse(string value) { XUnit unit = value; return unit; } /// /// Converts an existing object from one unit into another unit type. /// public void ConvertType(XGraphicsUnit type) { if (this.type == type) return; switch (type) { case XGraphicsUnit.Point: this.value = Point; this.type = XGraphicsUnit.Point; break; case XGraphicsUnit.Inch: this.value = Inch; this.type = XGraphicsUnit.Inch; break; case XGraphicsUnit.Centimeter: this.value = Centimeter; this.type = XGraphicsUnit.Centimeter; break; case XGraphicsUnit.Millimeter: this.value = Millimeter; this.type = XGraphicsUnit.Millimeter; break; case XGraphicsUnit.Presentation: this.value = Presentation; this.type = XGraphicsUnit.Presentation; break; // case XGraphicsUnit.Pica: // this.value = this.Pc; // this.type = XGraphicsUnit.Pica; // break; // // case XGraphicsUnit.Line: // this.value = this.Li; // this.type = XGraphicsUnit.Line; // break; default: throw new ArgumentException("Unknown unit type: '" + type + "'"); } } /// /// Represents a unit with all values zero. /// public static readonly XUnit Zero; double value; XGraphicsUnit type; #if true_ /// /// Some test code. /// [Conditional("DEBUG")] public static void TestIt() { double v; XUnit u1 = 1000; v = u1; v = u1.Point; v = u1.Inch; v = u1.Millimeter; v = u1.Centimeter; v = u1.Presentation; u1 = "10cm"; v = u1.Point; v.GetType(); } #endif } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/0000777000175000001440000000000011533760020021615 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XGraphicsPdfPageOptions.cs0000644000175000001440000000430711435766646026664 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Specifies how the content of an existing PDF page and new content is combined. /// public enum XGraphicsPdfPageOptions { /// /// The new content is inserted behind the old content and any subsequent drawing in done above the existing graphic. /// Append, /// /// The new content is inserted before the old content and any subsequent drawing in done beneath the existing graphic. /// Prepend, /// /// The new content entirely replaces the old content and any subsequent drawing in done on a blank page. /// Replace, #if MIGRADOC /// /// Just a flag to aktivate an internal hack. /// PDFlibHack = 0xF000, #endif } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XFontStyle.cs0000644000175000001440000000412611435766646024247 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Drawing { /// /// Specifies style information applied to text. /// [Flags] public enum XFontStyle // same values as System.Drawing.FontStyle { /// /// Normal text. /// Regular = 0, /// /// Bold text. /// Bold = 1, /// /// Italic text. /// Italic = 2, /// /// Bold and italic text. /// BoldItalic = 3, /// /// Underlined text. /// Underline = 4, /// /// Text with a line through the middle. /// Strikeout = 8, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XCombineMode.cs0000644000175000001440000000431711435766646024503 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Specifies how different clipping regions can be combined. /// public enum XCombineMode // same values as System.Drawing.Drawing2D.CombineMode { /// /// One clipping region is replaced by another. /// Replace = 0, /// /// Two clipping regions are combined by taking their intersection. /// Intersect = 1, /// /// Not yet implemented in PDFsharp. /// Union = 2, /// /// Not yet implemented in PDFsharp. /// Xor = 3, /// /// Not yet implemented in PDFsharp. /// Exclude = 4, /// /// Not yet implemented in PDFsharp. /// Complement = 5, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XLineAlignment.cs0000644000175000001440000000467011435766646025052 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Specifies the alignment of a text string relative to its layout rectangle /// public enum XLineAlignment // same values as System.Drawing.StringAlignment (except BaseLine) { /// /// Specifies the text be aligned near the layout. /// In a left-to-right layout, the near position is left. In a right-to-left layout, the near /// position is right. /// Near = 0, /// /// Specifies that text is aligned in the center of the layout rectangle. /// Center = 1, /// /// Specifies that text is aligned far from the origin position of the layout rectangle. /// In a left-to-right layout, the far position is right. In a right-to-left layout, the far /// position is left. /// Far = 2, /// /// Specifies that text is aligned relative to its base line. /// With this option the layout rectangle must have a height of 0. /// BaseLine = 3, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XSmoothingMode.cs0000644000175000001440000000450711435766646025077 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Drawing { /// /// Specifies whether smoothing (or antialiasing) is applied to lines and curves /// and the edges of filled areas. /// [Flags] public enum XSmoothingMode // same values as System.Drawing.Drawing2D.SmoothingMode { // TODO: how can this value effect PDF antializing? /// /// Specifies an invalid mode. /// Invalid = -1, /// /// Specifies the default mode. /// Default = 0, /// /// Specifies high speed, low quality rendering. /// HighSpeed = 1, /// /// Specifies high quality, low speed rendering. /// HighQuality = 2, /// /// Specifies no antialiasing. /// None = 3, /// /// Specifies antialiased rendering. /// AntiAlias = 4, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XColorSpace.cs0000644000175000001440000000350511435766646024352 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Currently not used. Only DeviceRGB is rendered in PDF. /// public enum XColorSpace { /// /// Identifies the RGB color space. /// Rgb, /// /// Identifies the CMYK color space. /// Cmyk, /// /// Identifies the gray scale color space. /// GrayScale, // Lab? } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XMatrixOrder.cs0000644000175000001440000000337711435766646024567 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Specifies the order for matrix transform operations. /// public enum XMatrixOrder { /// /// The new operation is applied before the old operation. /// Prepend = 0, /// /// The new operation is applied after the old operation. /// Append = 1, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XStringAlignment.cs0000644000175000001440000000434211435766646025425 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Specifies the alignment of a text string relative to its layout rectangle. /// public enum XStringAlignment // same values as System.Drawing.StringAlignment { /// /// Specifies the text be aligned near the layout. /// In a left-to-right layout, the near position is left. In a right-to-left layout, the near /// position is right. /// Near = 0, /// /// Specifies that text is aligned in the center of the layout rectangle. /// Center = 1, /// /// Specifies that text is aligned far from the origin position of the layout rectangle. /// In a left-to-right layout, the far position is right. In a right-to-left layout, the far /// position is left. /// Far = 2, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XFillMode.cs0000644000175000001440000000355711435766646024022 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Specifies how the interior of a closed path is filled. /// public enum XFillMode // same values as System.Drawing.FillMode { /// /// Specifies the alternate fill mode. Called the 'odd-even rule' in PDF terminology. /// Alternate = 0, /// /// Specifies the winding fill mode. Called the 'nonzero winding number rule' in PDF terminology. /// Winding = 1, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/PathStart.cs0000644000175000001440000000345411435766646024105 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Indicates how to handle the first point of a path. /// enum PathStart { /// /// Set the current position to the first point. /// MoveTo1st, /// /// Draws a line to the first point. /// LineTo1st, /// /// Ignores the first point. /// Ignore1st, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XGraphicRenderTarget.cs0000644000175000001440000000337311435766646026207 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System.Diagnostics; namespace PdfSharp.Drawing { /// /// Determines whether rendering based on GDI+ or WPF. For internal use only. /// enum XGraphicTargetContext { /// /// Renders using GDI+. /// GDI = 1, /// /// Renders using WPF (including Silverlight). /// WPF = 2, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XLinearGradientMode.cs0000644000175000001440000000404111435766646026011 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Specifies the direction of a linear gradient. /// public enum XLinearGradientMode // same values as System.Drawing.LinearGradientMode { /// /// Specifies a gradient from left to right. /// Horizontal = 0, /// /// Specifies a gradient from top to bottom. /// Vertical = 1, /// /// Specifies a gradient from upper left to lower right. /// ForwardDiagonal = 2, /// /// Specifies a gradient from upper right to lower left. /// BackwardDiagonal = 3, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XKnownColor.cs0000644000175000001440000002677511435766646024431 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Specifies all pre-defined colors. Used to identify the pre-defined colors and to /// localize their names. /// public enum XKnownColor { /// A pre-defined color. AliceBlue = 0, /// A pre-defined color. AntiqueWhite = 1, /// A pre-defined color. Aqua = 2, /// A pre-defined color. Aquamarine = 3, /// A pre-defined color. Azure = 4, /// A pre-defined color. Beige = 5, /// A pre-defined color. Bisque = 6, /// A pre-defined color. Black = 7, /// A pre-defined color. BlanchedAlmond = 8, /// A pre-defined color. Blue = 9, /// A pre-defined color. BlueViolet = 10, /// A pre-defined color. Brown = 11, /// A pre-defined color. BurlyWood = 12, /// A pre-defined color. CadetBlue = 13, /// A pre-defined color. Chartreuse = 14, /// A pre-defined color. Chocolate = 15, /// A pre-defined color. Coral = 16, /// A pre-defined color. CornflowerBlue = 17, /// A pre-defined color. Cornsilk = 18, /// A pre-defined color. Crimson = 19, /// A pre-defined color. Cyan = 20, /// A pre-defined color. DarkBlue = 21, /// A pre-defined color. DarkCyan = 22, /// A pre-defined color. DarkGoldenrod = 23, /// A pre-defined color. DarkGray = 24, /// A pre-defined color. DarkGreen = 25, /// A pre-defined color. DarkKhaki = 26, /// A pre-defined color. DarkMagenta = 27, /// A pre-defined color. DarkOliveGreen = 28, /// A pre-defined color. DarkOrange = 29, /// A pre-defined color. DarkOrchid = 30, /// A pre-defined color. DarkRed = 31, /// A pre-defined color. DarkSalmon = 32, /// A pre-defined color. DarkSeaGreen = 33, /// A pre-defined color. DarkSlateBlue = 34, /// A pre-defined color. DarkSlateGray = 35, /// A pre-defined color. DarkTurquoise = 36, /// A pre-defined color. DarkViolet = 37, /// A pre-defined color. DeepPink = 38, /// A pre-defined color. DeepSkyBlue = 39, /// A pre-defined color. DimGray = 40, /// A pre-defined color. DodgerBlue = 41, /// A pre-defined color. Firebrick = 42, /// A pre-defined color. FloralWhite = 43, /// A pre-defined color. ForestGreen = 44, /// A pre-defined color. Fuchsia = 45, /// A pre-defined color. Gainsboro = 46, /// A pre-defined color. GhostWhite = 47, /// A pre-defined color. Gold = 48, /// A pre-defined color. Goldenrod = 49, /// A pre-defined color. Gray = 50, /// A pre-defined color. Green = 51, /// A pre-defined color. GreenYellow = 52, /// A pre-defined color. Honeydew = 53, /// A pre-defined color. HotPink = 54, /// A pre-defined color. IndianRed = 55, /// A pre-defined color. Indigo = 56, /// A pre-defined color. Ivory = 57, /// A pre-defined color. Khaki = 58, /// A pre-defined color. Lavender = 59, /// A pre-defined color. LavenderBlush = 60, /// A pre-defined color. LawnGreen = 61, /// A pre-defined color. LemonChiffon = 62, /// A pre-defined color. LightBlue = 63, /// A pre-defined color. LightCoral = 64, /// A pre-defined color. LightCyan = 65, /// A pre-defined color. LightGoldenrodYellow = 66, /// A pre-defined color. LightGray = 67, /// A pre-defined color. LightGreen = 68, /// A pre-defined color. LightPink = 69, /// A pre-defined color. LightSalmon = 70, /// A pre-defined color. LightSeaGreen = 71, /// A pre-defined color. LightSkyBlue = 72, /// A pre-defined color. LightSlateGray = 73, /// A pre-defined color. LightSteelBlue = 74, /// A pre-defined color. LightYellow = 75, /// A pre-defined color. Lime = 76, /// A pre-defined color. LimeGreen = 77, /// A pre-defined color. Linen = 78, /// A pre-defined color. Magenta = 79, /// A pre-defined color. Maroon = 80, /// A pre-defined color. MediumAquamarine = 81, /// A pre-defined color. MediumBlue = 82, /// A pre-defined color. MediumOrchid = 83, /// A pre-defined color. MediumPurple = 84, /// A pre-defined color. MediumSeaGreen = 85, /// A pre-defined color. MediumSlateBlue = 86, /// A pre-defined color. MediumSpringGreen = 87, /// A pre-defined color. MediumTurquoise = 88, /// A pre-defined color. MediumVioletRed = 89, /// A pre-defined color. MidnightBlue = 90, /// A pre-defined color. MintCream = 91, /// A pre-defined color. MistyRose = 92, /// A pre-defined color. Moccasin = 93, /// A pre-defined color. NavajoWhite = 94, /// A pre-defined color. Navy = 95, /// A pre-defined color. OldLace = 96, /// A pre-defined color. Olive = 97, /// A pre-defined color. OliveDrab = 98, /// A pre-defined color. Orange = 99, /// A pre-defined color. OrangeRed = 100, /// A pre-defined color. Orchid = 101, /// A pre-defined color. PaleGoldenrod = 102, /// A pre-defined color. PaleGreen = 103, /// A pre-defined color. PaleTurquoise = 104, /// A pre-defined color. PaleVioletRed = 105, /// A pre-defined color. PapayaWhip = 106, /// A pre-defined color. PeachPuff = 107, /// A pre-defined color. Peru = 108, /// A pre-defined color. Pink = 109, /// A pre-defined color. Plum = 110, /// A pre-defined color. PowderBlue = 111, /// A pre-defined color. Purple = 112, /// A pre-defined color. Red = 113, /// A pre-defined color. RosyBrown = 114, /// A pre-defined color. RoyalBlue = 115, /// A pre-defined color. SaddleBrown = 116, /// A pre-defined color. Salmon = 117, /// A pre-defined color. SandyBrown = 118, /// A pre-defined color. SeaGreen = 119, /// A pre-defined color. SeaShell = 120, /// A pre-defined color. Sienna = 121, /// A pre-defined color. Silver = 122, /// A pre-defined color. SkyBlue = 123, /// A pre-defined color. SlateBlue = 124, /// A pre-defined color. SlateGray = 125, /// A pre-defined color. Snow = 126, /// A pre-defined color. SpringGreen = 127, /// A pre-defined color. SteelBlue = 128, /// A pre-defined color. Tan = 129, /// A pre-defined color. Teal = 130, /// A pre-defined color. Thistle = 131, /// A pre-defined color. Tomato = 132, /// A pre-defined color. Transparent = 133, /// A pre-defined color. Turquoise = 134, /// A pre-defined color. Violet = 135, /// A pre-defined color. Wheat = 136, /// A pre-defined color. White = 137, /// A pre-defined color. WhiteSmoke = 138, /// A pre-defined color. Yellow = 139, /// A pre-defined color. YellowGreen = 140, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XLineJoin.cs0000644000175000001440000000402211435766646024022 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Specifies how to join consecutive line or curve segments in a figure or subpath. /// public enum XLineJoin { /// /// Specifies a mitered join. This produces a sharp corner or a clipped corner, /// depending on whether the length of the miter exceeds the miter limit /// Miter = 0, /// /// Specifies a circular join. This produces a smooth, circular arc between the lines. /// Round = 1, /// /// Specifies a beveled join. This produces a diagonal corner. /// Bevel = 2, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XGraphicsUnit.cs0000644000175000001440000000431511435766646024720 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Specifies the unit of measure. /// public enum XGraphicsUnit // NOT the same values as System.Drawing.GraphicsUnit { /// /// Specifies a printer's point (1/72 inch) as the unit of measure. /// Point = 0, // must be 0 to let a new XUnit be 0 point /// /// Specifies the inch (2.54 cm) as the unit of measure. /// Inch = 1, /// /// Specifies the millimeter as the unit of measure. /// Millimeter = 2, /// /// Specifies the centimeter as the unit of measure. /// Centimeter = 3, /// /// Specifies a presentation point (1/96 inch) as the unit of measure. /// Presentation = 4, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XGraphicsPathItemType.cs0000644000175000001440000000322111435766646026351 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Type of the path data. /// internal enum XGraphicsPathItemType { Lines, Beziers, Curve, Arc, Rectangle, RoundedRectangle, Ellipse, Polygon, CloseFigure, StartFigure, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XDashStyle.cs0000644000175000001440000000437311435766646024224 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Specifies the style of dashed lines drawn with an XPen object. /// public enum XDashStyle // same values as System.Drawing.Drawing2D.DashStyle { /// /// Specifies a solid line. /// Solid = 0, /// /// Specifies a line consisting of dashes. /// Dash = 1, /// /// Specifies a line consisting of dots. /// Dot = 2, /// /// Specifies a line consisting of a repeating pattern of dash-dot. /// DashDot = 3, /// /// Specifies a line consisting of a repeating pattern of dash-dot-dot. /// DashDotDot = 4, /// /// Specifies a user-defined custom dash style. /// Custom = 5, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XLineCap.cs0000644000175000001440000000351111435766646023630 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Specifies the available cap styles with which an XPen object can start and end a line. /// public enum XLineCap { /// /// Specifies a flat line cap. /// Flat = 0, /// /// Specifies a round line cap. /// Round = 1, /// /// Specifies a square line cap. /// Square = 2 } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/enums/XPageDirection.cs0000644000175000001440000000354311435766646025037 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing { /// /// Specifies the direction of the y-axis. /// public enum XPageDirection { /// /// Increasing Y values go downwards. This is the default. /// Downwards = 0, /// /// Increasing Y values go upwards. This is only possible when drawing on a PDF page. /// It is not implemented when drawing on a System.Drawing.Graphics object. /// Upwards = 1, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XColor.cs0000644000175000001440000005252611435766646022256 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.ComponentModel; #if GDI using System.Drawing; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Internal; namespace PdfSharp.Drawing { /// /// Represents a RGB, CMYK, or gray scale color. /// [DebuggerDisplay("(A={A}, R={R}, G={G}, B={B} C={C}, M={M}, Y={Y}, K={K})")] public struct XColor { XColor(uint argb) { this.cs = XColorSpace.Rgb; this.a = (byte)((argb >> 24) & 0xff) / 255f; this.r = (byte)((argb >> 16) & 0xff); this.g = (byte)((argb >> 8) & 0xff); this.b = (byte)(argb & 0xff); this.c = 0; this.m = 0; this.y = 0; this.k = 0; this.gs = 0; RgbChanged(); cs.GetType(); // Suppress warning } XColor(byte alpha, byte red, byte green, byte blue) { this.cs = XColorSpace.Rgb; this.a = alpha / 255f; this.r = red; this.g = green; this.b = blue; this.c = 0; this.m = 0; this.y = 0; this.k = 0; this.gs = 0; RgbChanged(); cs.GetType(); // Suppress warning } XColor(double alpha, double cyan, double magenta, double yellow, double black) { this.cs = XColorSpace.Cmyk; this.a = (float)(alpha > 1 ? 1 : (alpha < 0 ? 0 : alpha)); this.c = (float)(cyan > 1 ? 1 : (cyan < 0 ? 0 : cyan)); this.m = (float)(magenta > 1 ? 1 : (magenta < 0 ? 0 : magenta)); this.y = (float)(yellow > 1 ? 1 : (yellow < 0 ? 0 : yellow)); this.k = (float)(black > 1 ? 1 : (black < 0 ? 0 : black)); this.r = 0; this.g = 0; this.b = 0; this.gs = 0f; CmykChanged(); } XColor(double cyan, double magenta, double yellow, double black) : this(1.0, cyan, magenta, yellow, black) { } XColor(double gray) { this.cs = XColorSpace.GrayScale; if (gray < 0) this.gs = 0; else if (gray > 1) this.gs = 1; this.gs = (float)gray; this.a = 1; this.r = 0; this.g = 0; this.b = 0; this.c = 0; this.m = 0; this.y = 0; this.k = 0; GrayChanged(); } #if GDI XColor(System.Drawing.Color color) : this(color.A, color.R, color.G, color.B) { } #endif #if WPF XColor(System.Windows.Media.Color color) : this(color.A, color.R, color.G, color.B) { } #endif #if GDI XColor(KnownColor knownColor) : this(System.Drawing.Color.FromKnownColor((System.Drawing.KnownColor)knownColor)) { } #endif internal XColor(XKnownColor knownColor) : this(XKnownColorTable.KnownColorToArgb(knownColor)) { } /// /// Creates an XColor structure from a 32-bit ARGB value. /// public static XColor FromArgb(int argb) { return new XColor((byte)(argb >> 24), (byte)(argb >> 16), (byte)(argb >> 8), (byte)(argb)); } /// /// Creates an XColor structure from a 32-bit ARGB value. /// public static XColor FromArgb(uint argb) { return new XColor((byte)(argb >> 24), (byte)(argb >> 16), (byte)(argb >> 8), (byte)(argb)); } // from System.Drawing.Color //public static XColor FromArgb(int alpha, Color baseColor); //public static XColor FromArgb(int red, int green, int blue); //public static XColor FromArgb(int alpha, int red, int green, int blue); //public static XColor FromKnownColor(KnownColor color); //public static XColor FromName(string name); /// /// Creates an XColor structure from the specified 8-bit color values (red, green, and blue). /// The alpha value is implicitly 255 (fully opaque). /// public static XColor FromArgb(int red, int green, int blue) { CheckByte(red, "red"); CheckByte(green, "green"); CheckByte(blue, "blue"); return new XColor(255, (byte)red, (byte)green, (byte)blue); } /// /// Creates an XColor structure from the four ARGB component (alpha, red, green, and blue) values. /// public static XColor FromArgb(int alpha, int red, int green, int blue) { CheckByte(alpha, "alpha"); CheckByte(red, "red"); CheckByte(green, "green"); CheckByte(blue, "blue"); return new XColor((byte)alpha, (byte)red, (byte)green, (byte)blue); } #if GDI /// /// Creates an XColor structure from the specified System.Drawing.Color. /// public static XColor FromArgb(System.Drawing.Color color) { return new XColor(color); } #endif #if WPF /// /// Creates an XColor structure from the specified System.Drawing.Color. /// public static XColor FromArgb(System.Windows.Media.Color color) { return new XColor(color); } #endif /// /// Creates an XColor structure from the specified alpha value and color. /// public static XColor FromArgb(int alpha, XColor color) { color.A = ((byte)alpha) / 255.0; return color; } #if GDI /// /// Creates an XColor structure from the specified alpha value and color. /// public static XColor FromArgb(int alpha, System.Drawing.Color color) { return new XColor(alpha, color.R, color.G, color.B); } #endif #if WPF /// /// Creates an XColor structure from the specified alpha value and color. /// public static XColor FromArgb(int alpha, System.Windows.Media.Color color) { return new XColor(alpha, color.R, color.G, color.B); } #endif /// /// Creates an XColor structure from the specified CMYK values. /// public static XColor FromCmyk(double cyan, double magenta, double yellow, double black) { return new XColor(cyan, magenta, yellow, black); } /// /// Creates an XColor structure from the specified CMYK values. /// public static XColor FromCmyk(double alpha, double cyan, double magenta, double yellow, double black) { return new XColor(alpha, cyan, magenta, yellow, black); } /// /// Creates an XColor structure from the specified gray value. /// public static XColor FromGrayScale(double grayScale) { return new XColor(grayScale); } /// /// Creates an XColor from the specified pre-defined color. /// public static XColor FromKnownColor(XKnownColor color) { return new XColor(color); } #if GDI /// /// Creates an XColor from the specified pre-defined color. /// public static XColor FromKnownColor(KnownColor color) { return new XColor(color); } #endif /// /// Creates an XColor from the specified name of a pre-defined color. /// public static XColor FromName(string name) { #if GDI // The implementation in System.Drawing.dll is interesting. It uses a ColorConverter // with hash tables, locking mechanisms etc. I'm not sure what problems that solves. // So I don't use the source, but the reflection. try { return new XColor((KnownColor)Enum.Parse(typeof(KnownColor), name, true)); } catch { } #endif return XColor.Empty; } /// /// Gets or sets the color space to be used for PDF generation. /// public XColorSpace ColorSpace { get { return this.cs; } set { if (!Enum.IsDefined(typeof(XColorSpace), value)) throw new InvalidEnumArgumentException("value", (int)value, typeof(XColorSpace)); this.cs = value; } } /// /// Indicates whether this XColor structure is uninitialized. /// public bool IsEmpty { get { return this == XColor.Empty; } } #if GDI #if UseGdiObjects /// /// Implicit conversion from Color to XColor /// public static implicit operator XColor(Color color) { return new XColor(color); } #endif /// /// Creates a System.Drawing.Color object from this color. /// public System.Drawing.Color ToGdiColor() { return System.Drawing.Color.FromArgb((int)(this.a * 255), this.r, this.g, this.b); } #endif #if WPF /// /// Creates a System.Windows.Media.Color object from this color. /// public System.Windows.Media.Color ToWpfColor() { return System.Windows.Media.Color.FromArgb((byte)(this.a * 255), this.r, this.g, this.b); } #endif /// /// Determines whether the specified object is a Color structure and is equivalent to this /// Color structure. /// public override bool Equals(object obj) { if (obj is XColor) { XColor color = (XColor)obj; if (this.r == color.r && this.g == color.g && this.b == color.b && this.c == color.c && this.m == color.m && this.y == color.y && this.k == color.k && this.gs == color.gs) { return this.a == color.a; } } return false; } /// /// Returns the hash code for this instance. /// public override int GetHashCode() { return ((byte)(this.a * 255)) ^ this.r ^ this.g ^ this.b; // ^ *(int*)&this.c ^ *(int*)&this.m ^ *(int*)&this.y ^ *(int*)&this.k; } /// /// Determines whether two colors are equal. /// public static bool operator ==(XColor left, XColor right) { if (left.r == right.r && left.g == right.g && left.b == right.b && left.c == right.c && left.m == right.m && left.y == right.y && left.k == right.k && left.gs == right.gs) { return left.a == right.a; } return false; } /// /// Determines whether two colors are not equal. /// public static bool operator !=(XColor left, XColor right) { return !(left == right); } /// /// Gets a value indicating whether this color is a known color. /// public bool IsKnownColor { get { return XKnownColorTable.IsKnownColor(Argb); } } //public bool IsNamedColor { get; } //public bool IsSystemColor { get; } /// /// Gets the hue-saturation-brightness (HSB) hue value, in degrees, for this color. /// /// The hue, in degrees, of this color. The hue is measured in degrees, ranging from 0 through 360, in HSB color space. public double GetHue() { if ((this.r == this.g) && (this.g == this.b)) return 0; double value1 = this.r / 255.0; double value2 = this.g / 255.0; double value3 = this.b / 255.0; double value7 = 0; double value4 = value1; double value5 = value1; if (value2 > value4) value4 = value2; if (value3 > value4) value4 = value3; if (value2 < value5) value5 = value2; if (value3 < value5) value5 = value3; double value6 = value4 - value5; if (value1 == value4) value7 = (value2 - value3) / value6; else if (value2 == value4) value7 = 2f + ((value3 - value1) / value6); else if (value3 == value4) value7 = 4f + ((value1 - value2) / value6); value7 *= 60; if (value7 < 0) value7 += 360; return value7; } /// /// Gets the hue-saturation-brightness (HSB) saturation value for this color. /// /// The saturation of this color. The saturation ranges from 0 through 1, where 0 is grayscale and 1 is the most saturated. public double GetSaturation() { double value1 = this.r / 255.0; double value2 = this.g / 255.0; double value3 = this.b / 255.0; double value7 = 0; double value4 = value1; double value5 = value1; if (value2 > value4) value4 = value2; if (value3 > value4) value4 = value3; if (value2 < value5) value5 = value2; if (value3 < value5) value5 = value3; if (value4 == value5) return value7; double value6 = (value4 + value5) / 2; if (value6 <= 0.5) return (value4 - value5) / (value4 + value5); return (value4 - value5) / ((2f - value4) - value5); } /// /// Gets the hue-saturation-brightness (HSB) brightness value for this color. /// /// The brightness of this color. The brightness ranges from 0 through 1, where 0 represents black and 1 represents white. public double GetBrightness() { double value1 = this.r / 255.0; double value2 = this.g / 255.0; double value3 = this.b / 255.0; double value4 = value1; double value5 = value1; if (value2 > value4) value4 = value2; if (value3 > value4) value4 = value3; if (value2 < value5) value5 = value2; if (value3 < value5) value5 = value3; return (value4 + value5) / 2; } /// /// One of the RGB values changed; recalculate other color representations. /// void RgbChanged() { // ReSharper disable LocalVariableHidesMember this.cs = XColorSpace.Rgb; int c = 255 - this.r; int m = 255 - this.g; int y = 255 - this.b; int k = Math.Min(c, Math.Min(m, y)); if (k == 255) this.c = this.m = this.y = 0; else { float black = 255f - k; this.c = (c - k) / black; this.m = (m - k) / black; this.y = (y - k) / black; } this.k = this.gs = k / 255f; // ReSharper restore LocalVariableHidesMember } /// /// One of the CMYK values changed; recalculate other color representations. /// void CmykChanged() { this.cs = XColorSpace.Cmyk; float black = this.k * 255; float factor = 255f - black; this.r = (byte)(255 - Math.Min(255f, this.c * factor + black)); this.g = (byte)(255 - Math.Min(255f, this.m * factor + black)); this.b = (byte)(255 - Math.Min(255f, this.y * factor + black)); this.gs = (float)(1 - Math.Min(1.0, 0.3f * this.c + 0.59f * this.m + 0.11 * this.y + this.k)); } /// /// The gray scale value changed; recalculate other color representations. /// void GrayChanged() { this.cs = XColorSpace.GrayScale; this.r = (byte)(this.gs * 255); this.g = (byte)(this.gs * 255); this.b = (byte)(this.gs * 255); this.c = 0; this.m = 0; this.y = 0; this.k = 1 - this.gs; } // Properties /// /// Gets or sets the alpha value the specifies the transparency. /// The value is in the range from 1 (opaque) to 0 (completely transparent). /// public double A { get { return this.a; } set { if (value < 0) this.a = 0; else if (value > 1) this.a = 1; else this.a = (float)value; } } /// /// Gets or sets the red value. /// public byte R { get { return this.r; } set { this.r = value; RgbChanged(); } } /// /// Gets or sets the green value. /// public byte G { get { return this.g; } set { this.g = value; RgbChanged(); } } /// /// Gets or sets the blue value. /// public byte B { get { return this.b; } set { this.b = value; RgbChanged(); } } /// /// Gets the RGB part value of the color. Internal helper function. /// internal uint Rgb { get { return ((uint)this.r << 16) | ((uint)this.g << 8) | this.b; } } /// /// Gets the ARGB part value of the color. Internal helper function. /// internal uint Argb { get { return ((uint)(this.a * 255) << 24) | ((uint)this.r << 16) | ((uint)this.g << 8) | this.b; } } /// /// Gets or sets the cyan value. /// public double C { get { return this.c; } set { if (value < 0) this.c = 0; else if (value > 1) this.c = 1; else this.c = (float)value; CmykChanged(); } } /// /// Gets or sets the magenta value. /// public double M { get { return this.m; } set { if (value < 0) this.m = 0; else if (value > 1) this.m = 1; else this.m = (float)value; CmykChanged(); } } /// /// Gets or sets the yellow value. /// public double Y { get { return this.y; } set { if (value < 0) this.y = 0; else if (value > 1) this.y = 1; else this.y = (float)value; CmykChanged(); } } /// /// Gets or sets the black (or key) value. /// public double K { get { return this.k; } set { if (value < 0) this.k = 0; else if (value > 1) this.k = 1; else this.k = (float)value; CmykChanged(); } } /// /// Gets or sets the gray scale value. /// public double GS { get { return this.gs; } set { if (value < 0) this.gs = 0; else if (value > 1) this.gs = 1; else this.gs = (float)value; GrayChanged(); } } /// /// Represents the null color. /// public static XColor Empty; /// /// Special property for XmlSerializer only. /// public string RgbCmykG { get { return String.Format(CultureInfo.InvariantCulture, "{0};{1};{2};{3};{4};{5};{6};{7};{8}", this.r, this.g, this.b, this.c, this.m, this.y, this.k, this.gs, this.a); } set { string[] values = value.Split(';'); this.r = byte.Parse(values[0], CultureInfo.InvariantCulture); this.g = byte.Parse(values[1], CultureInfo.InvariantCulture); this.b = byte.Parse(values[2], CultureInfo.InvariantCulture); this.c = float.Parse(values[3], CultureInfo.InvariantCulture); this.m = float.Parse(values[4], CultureInfo.InvariantCulture); this.y = float.Parse(values[5], CultureInfo.InvariantCulture); this.k = float.Parse(values[6], CultureInfo.InvariantCulture); this.gs = float.Parse(values[7], CultureInfo.InvariantCulture); this.a = float.Parse(values[8], CultureInfo.InvariantCulture); } } static void CheckByte(int val, string name) { if (val < 0 || val > 0xFF) throw new ArgumentException(PSSR.InvalidValue(val, name, 0, 255)); } private XColorSpace cs; private float a; // alpha private byte r; // \ private byte g; // |--- RGB private byte b; // / private float c; // \ private float m; // |--- CMYK private float y; // | private float k; // / private float gs; // >--- gray scale } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XGraphicsContainer.cs0000644000175000001440000000365711435766646024604 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows.Media; #endif namespace PdfSharp.Drawing { /// /// Represents the internal state of an XGraphics object. /// public sealed class XGraphicsContainer { #if GDI internal XGraphicsContainer(GraphicsState state) { GdiState = state; } internal GraphicsState GdiState; #endif #if WPF internal XGraphicsContainer() { } #endif internal InternalGraphicsState InternalState; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/ImageHelper.cs0000644000175000001440000001262711435766646023230 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.Collections.Generic; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; #endif #if WPF using System.Windows; using System.Windows.Media; using System.Windows.Media.Imaging; #endif using PdfSharp.Internal; using PdfSharp.Pdf; using PdfSharp.Drawing.Pdf; using PdfSharp.Pdf.Advanced; namespace PdfSharp.Drawing { /// /// Helper class for processing image files. /// static class ImageHelper { #if WPF && GDI /// /// Creates a WPF bitmap source from an GDI image. /// public static BitmapSource CreateBitmapSource(Image image) { MemoryStream stream = new MemoryStream(); //int width = image.Width; //int height = image.Height; //double dpiX = image.HorizontalResolution; //double dpiY = image.VerticalResolution; //System.Windows.Media.PixelFormat pixelformat = PixelFormats.Default; BitmapSource bitmapSource = null; try { string guid = image.RawFormat.Guid.ToString("B").ToUpper(); switch (guid) { case "{B96B3CAA-0728-11D3-9D7B-0000F81EF32E}": // memoryBMP case "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}": // bmp image.Save(stream, ImageFormat.Bmp); stream.Position = 0; BmpBitmapDecoder bmpDecoder = new BmpBitmapDecoder(stream, BitmapCreateOptions.None, BitmapCacheOption.Default); bitmapSource = bmpDecoder.Frames[0]; break; case "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}": // png image.Save(stream, ImageFormat.Png); stream.Position = 0; PngBitmapDecoder pngDecoder = new PngBitmapDecoder(stream, BitmapCreateOptions.None, BitmapCacheOption.Default); bitmapSource = pngDecoder.Frames[0]; break; case "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}": // jpeg image.Save(stream, ImageFormat.Jpeg); JpegBitmapDecoder jpegDecoder = new JpegBitmapDecoder(stream, BitmapCreateOptions.None, BitmapCacheOption.Default); stream.Position = 0; bitmapSource = jpegDecoder.Frames[0]; break; case "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}": // gif image.Save(stream, ImageFormat.Gif); GifBitmapDecoder gifDecoder = new GifBitmapDecoder(stream, BitmapCreateOptions.None, BitmapCacheOption.Default); stream.Position = 0; bitmapSource = gifDecoder.Frames[0]; break; case "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}": // tiff image.Save(stream, ImageFormat.Tiff); TiffBitmapDecoder tiffDecoder = new TiffBitmapDecoder(stream, BitmapCreateOptions.None, BitmapCacheOption.Default); stream.Position = 0; bitmapSource = tiffDecoder.Frames[0]; break; case "{B96B3CB5-0728-11D3-9D7B-0000F81EF32E}": // icon image.Save(stream, ImageFormat.Icon); IconBitmapDecoder iconDecoder = new IconBitmapDecoder(stream, BitmapCreateOptions.None, BitmapCacheOption.Default); stream.Position = 0; bitmapSource = iconDecoder.Frames[0]; break; case "{B96B3CAC-0728-11D3-9D7B-0000F81EF32E}": // emf case "{B96B3CAD-0728-11D3-9D7B-0000F81EF32E}": // wmf case "{B96B3CB2-0728-11D3-9D7B-0000F81EF32E}": // exif case "{B96B3CB3-0728-11D3-9D7B-0000F81EF32E}": // photoCD case "{B96B3CB4-0728-11D3-9D7B-0000F81EF32E}": // flashPIX default: throw new InvalidOperationException("Unsupported image format."); } } catch (Exception ex) { Debug.WriteLine("ImageHelper.CreateBitmapSource failed:" + ex.Message); } finally { //if (stream != null) // stream.Close(); } return bitmapSource; } #endif } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/GeometryHelper.cs0000644000175000001440000007544611435766646024011 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.Collections.Generic; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Internal; using PdfSharp.Pdf; using PdfSharp.Drawing.Pdf; using PdfSharp.Pdf.Advanced; namespace PdfSharp.Drawing { /// /// Helper class for Geometry paths. /// static class GeometryHelper { #if WPF /// /// Appends a Bézier segment from a curve. /// public static BezierSegment CreateCurveSegment(XPoint pt0, XPoint pt1, XPoint pt2, XPoint pt3, double tension3) { #if !SILVERLIGHT return new BezierSegment( new System.Windows.Point(pt1.X + tension3 * (pt2.X - pt0.X), pt1.Y + tension3 * (pt2.Y - pt0.Y)), new System.Windows.Point(pt2.X - tension3 * (pt3.X - pt1.X), pt2.Y - tension3 * (pt3.Y - pt1.Y)), new System.Windows.Point(pt2.X, pt2.Y), true); #else return new BezierSegment(); // AGHACK #endif } #endif #if WPF /// /// Creates a path geometry from a polygon. /// public static PathGeometry CreatePolygonGeometry(System.Windows.Point[] points, XFillMode fillMode, bool closed) { PolyLineSegment seg = new PolyLineSegment(); int count = points.Length; // For correct drawing the start point of the segment must not be the same as the first point for (int idx = 1; idx < count; idx++) seg.Points.Add(new System.Windows.Point(points[idx].X, points[idx].Y)); #if !SILVERLIGHT seg.IsStroked = true; #endif PathFigure fig = new PathFigure(); fig.StartPoint = new System.Windows.Point(points[0].X, points[0].Y); fig.Segments.Add(seg); fig.IsClosed = closed; PathGeometry geo = new PathGeometry(); geo.FillRule = fillMode == XFillMode.Winding ? FillRule.Nonzero : FillRule.EvenOdd; geo.Figures.Add(fig); return geo; } #endif #if WPF /// /// Creates the arc segment from parameters of the GDI+ DrawArc function. /// public static ArcSegment CreateArcSegment(double x, double y, double width, double height, double startAngle, double sweepAngle, out System.Windows.Point startPoint) { // Normalize the angles double α = startAngle; if (α < 0) α = α + (1 + Math.Floor((Math.Abs(α) / 360))) * 360; else if (α > 360) α = α - Math.Floor(α / 360) * 360; Debug.Assert(α >= 0 && α <= 360); if (Math.Abs(sweepAngle) >= 360) sweepAngle = Math.Sign(sweepAngle) * 360; double β = startAngle + sweepAngle; if (β < 0) β = β + (1 + Math.Floor((Math.Abs(β) / 360))) * 360; else if (β > 360) β = β - Math.Floor(β / 360) * 360; if (α == 0 && β < 0) α = 360; else if (α == 360 && β > 0) α = 0; // Scanling factor double δx = width / 2; double δy = height / 2; // Center of ellipse double x0 = x + δx; double y0 = y + δy; double cosα, cosβ, sinα, sinβ; if (width == height) { // Circular arc needs no correction. α = α * Calc.Deg2Rad; β = β * Calc.Deg2Rad; } else { // Elliptic arc needs the angles to be adjusted such that the scaling transformation is compensated. α = α * Calc.Deg2Rad; sinα = Math.Sin(α); if (Math.Abs(sinα) > 1E-10) { if (α < Math.PI) α = Math.PI / 2 - Math.Atan(δy * Math.Cos(α) / (δx * sinα)); else α = 3 * Math.PI / 2 - Math.Atan(δy * Math.Cos(α) / (δx * sinα)); } //α = Calc.πHalf - Math.Atan(δy * Math.Cos(α) / (δx * sinα)); β = β * Calc.Deg2Rad; sinβ = Math.Sin(β); if (Math.Abs(sinβ) > 1E-10) { if (β < Math.PI) β = Math.PI / 2 - Math.Atan(δy * Math.Cos(β) / (δx * sinβ)); else β = 3 * Math.PI / 2 - Math.Atan(δy * Math.Cos(β) / (δx * sinβ)); } //β = Calc.πHalf - Math.Atan(δy * Math.Cos(β) / (δx * sinβ)); } sinα = Math.Sin(α); cosα = Math.Cos(α); sinβ = Math.Sin(β); cosβ = Math.Cos(β); startPoint = new System.Windows.Point(x0 + δx * cosα, y0 + δy * sinα); System.Windows.Point destPoint = new System.Windows.Point(x0 + δx * cosβ, y0 + δy * sinβ); System.Windows.Size size = new System.Windows.Size(δx, δy); bool isLargeArc = Math.Abs(sweepAngle) >= 180; SweepDirection sweepDirection = sweepAngle > 0 ? SweepDirection.Clockwise : SweepDirection.Counterclockwise; #if !SILVERLIGHT bool isStroked = true; ArcSegment seg = new ArcSegment(destPoint, size, 0, isLargeArc, sweepDirection, isStroked); #else ArcSegment seg = new ArcSegment(); seg.Point = destPoint; seg.Size = size; seg.RotationAngle = 0; seg.IsLargeArc = isLargeArc; seg.SweepDirection = sweepDirection; // isStroked does not exist in Silverlight 3 #endif return seg; } #endif /// /// Creates between 1 and 5 Béziers curves from parameters specified like in GDI+. /// public static List BezierCurveFromArc(double x, double y, double width, double height, double startAngle, double sweepAngle, PathStart pathStart, ref XMatrix matrix) { List points = new List(); // Normalize the angles double α = startAngle; if (α < 0) α = α + (1 + Math.Floor((Math.Abs(α) / 360))) * 360; else if (α > 360) α = α - Math.Floor(α / 360) * 360; Debug.Assert(α >= 0 && α <= 360); double β = sweepAngle; if (β < -360) β = -360; else if (β > 360) β = 360; if (α == 0 && β < 0) α = 360; else if (α == 360 && β > 0) α = 0; // Is it possible that the arc is small starts and ends in same quadrant? bool smallAngle = Math.Abs(β) <= 90; β = α + β; if (β < 0) β = β + (1 + Math.Floor((Math.Abs(β) / 360))) * 360; bool clockwise = sweepAngle > 0; int startQuadrant = Quatrant(α, true, clockwise); int endQuadrant = Quatrant(β, false, clockwise); if (startQuadrant == endQuadrant && smallAngle) AppendPartialArcQuadrant(points, x, y, width, height, α, β, pathStart, matrix); else { int currentQuadrant = startQuadrant; bool firstLoop = true; do { if (currentQuadrant == startQuadrant && firstLoop) { double ξ = currentQuadrant * 90 + (clockwise ? 90 : 0); AppendPartialArcQuadrant(points, x, y, width, height, α, ξ, pathStart, matrix); } else if (currentQuadrant == endQuadrant) { double ξ = currentQuadrant * 90 + (clockwise ? 0 : 90); AppendPartialArcQuadrant(points, x, y, width, height, ξ, β, PathStart.Ignore1st, matrix); } else { double ξ1 = currentQuadrant * 90 + (clockwise ? 0 : 90); double ξ2 = currentQuadrant * 90 + (clockwise ? 90 : 0); AppendPartialArcQuadrant(points, x, y, width, height, ξ1, ξ2, PathStart.Ignore1st, matrix); } // Don't stop immediately if arc is greater than 270 degrees if (currentQuadrant == endQuadrant && smallAngle) break; smallAngle = true; if (clockwise) currentQuadrant = currentQuadrant == 3 ? 0 : currentQuadrant + 1; else currentQuadrant = currentQuadrant == 0 ? 3 : currentQuadrant - 1; firstLoop = false; } while (true); } return points; } /// /// Calculates the quadrant (0 through 3) of the specified angle. If the angle lies on an edge /// (0, 90, 180, etc.) the result depends on the details how the angle is used. /// static int Quatrant(double φ, bool start, bool clockwise) { Debug.Assert(φ >= 0); if (φ > 360) φ = φ - Math.Floor(φ / 360) * 360; int quadrant = (int)(φ / 90); if (quadrant * 90 == φ) { if ((start && !clockwise) || (!start && clockwise)) quadrant = quadrant == 0 ? 3 : quadrant - 1; } else quadrant = clockwise ? ((int)Math.Floor(φ / 90)) % 4 : (int)Math.Floor(φ / 90); return quadrant; } /// /// Appends a Bézier curve for an arc within a full quadrant. /// static void AppendPartialArcQuadrant(List points, double x, double y, double width, double height, double α, double β, PathStart pathStart, XMatrix matrix) { Debug.Assert(α >= 0 && α <= 360); Debug.Assert(β >= 0); if (β > 360) β = β - Math.Floor(β / 360) * 360; Debug.Assert(Math.Abs(α - β) <= 90); // Scanling factor double δx = width / 2; double δy = height / 2; // Center of ellipse double x0 = x + δx; double y0 = y + δy; // We have the following quarters: // | // 2 | 3 // ----+----- // 1 | 0 // | // If the angles lie in quarter 2 or 3, their values are subtracted by 180 and the // resulting curve is reflected at the center. This algorithm works as expected (simply tried out). // There may be a mathematically more elegant solution... bool reflect = false; if (α >= 180 && β >= 180) { α -= 180; β -= 180; reflect = true; } double cosα, cosβ, sinα, sinβ; if (width == height) { // Circular arc needs no correction. α = α * Calc.Deg2Rad; β = β * Calc.Deg2Rad; } else { // Elliptic arc needs the angles to be adjusted such that the scaling transformation is compensated. α = α * Calc.Deg2Rad; sinα = Math.Sin(α); if (Math.Abs(sinα) > 1E-10) α = Calc.πHalf - Math.Atan(δy * Math.Cos(α) / (δx * sinα)); β = β * Calc.Deg2Rad; sinβ = Math.Sin(β); if (Math.Abs(sinβ) > 1E-10) β = Calc.πHalf - Math.Atan(δy * Math.Cos(β) / (δx * sinβ)); } double κ = 4 * (1 - Math.Cos((α - β) / 2)) / (3 * Math.Sin((β - α) / 2)); sinα = Math.Sin(α); cosα = Math.Cos(α); sinβ = Math.Sin(β); cosβ = Math.Cos(β); //XPoint pt1, pt2, pt3; if (!reflect) { // Calculation for quarter 0 and 1 switch (pathStart) { case PathStart.MoveTo1st: points.Add(matrix.Transform(new XPoint(x0 + δx * cosα, y0 + δy * sinα))); break; case PathStart.LineTo1st: points.Add(matrix.Transform(new XPoint(x0 + δx * cosα, y0 + δy * sinα))); break; case PathStart.Ignore1st: break; } points.Add(matrix.Transform(new XPoint(x0 + δx * (cosα - κ * sinα), y0 + δy * (sinα + κ * cosα)))); points.Add(matrix.Transform(new XPoint(x0 + δx * (cosβ + κ * sinβ), y0 + δy * (sinβ - κ * cosβ)))); points.Add(matrix.Transform(new XPoint(x0 + δx * cosβ, y0 + δy * sinβ))); } else { // Calculation for quarter 2 and 3 switch (pathStart) { case PathStart.MoveTo1st: points.Add(matrix.Transform(new XPoint(x0 - δx * cosα, y0 - δy * sinα))); break; case PathStart.LineTo1st: points.Add(matrix.Transform(new XPoint(x0 - δx * cosα, y0 - δy * sinα))); break; case PathStart.Ignore1st: break; } points.Add(matrix.Transform(new XPoint(x0 - δx * (cosα - κ * sinα), y0 - δy * (sinα + κ * cosα)))); points.Add(matrix.Transform(new XPoint(x0 - δx * (cosβ + κ * sinβ), y0 - δy * (sinβ - κ * cosβ)))); points.Add(matrix.Transform(new XPoint(x0 - δx * cosβ, y0 - δy * sinβ))); } } /// /// Creates between 1 and 5 Béziers curves from parameters specified like in WPF. /// public static List BezierCurveFromArc(XPoint point1, XPoint point2, double rotationAngle, XSize size, bool isLargeArc, bool clockwise, PathStart pathStart) { #if DEBUG_ if (size == new XSize(115, 115)) Debugger.Break(); #endif // See also http://www.charlespetzold.com/blog/blog.xml from January 2, 2008 double δx = size.Width; double δy = size.Height; Debug.Assert(δx * δy > 0); double factor = δy / δx; bool isCounterclockwise = !clockwise; // Adjust for different radii and rotation angle XMatrix matrix = new XMatrix(); matrix.RotateAppend(-rotationAngle); matrix.ScaleAppend(δy / δx, 1); XPoint pt1 = matrix.Transform(point1); XPoint pt2 = matrix.Transform(point2); // Get info about chord that connects both points XPoint midPoint = new XPoint((pt1.X + pt2.X) / 2, (pt1.Y + pt2.Y) / 2); XVector vect = pt2 - pt1; double halfChord = vect.Length / 2; // Get vector from chord to center XVector vectRotated; // (comparing two Booleans here!) if (isLargeArc == isCounterclockwise) vectRotated = new XVector(-vect.Y, vect.X); else vectRotated = new XVector(vect.Y, -vect.X); vectRotated.Normalize(); // Distance from chord to center double centerDistance = Math.Sqrt(δy * δy - halfChord * halfChord); if (double.IsNaN(centerDistance)) centerDistance = 0; // Calculate center point XPoint center = midPoint + centerDistance * vectRotated; // Get angles from center to the two points double α = Math.Atan2(pt1.Y - center.Y, pt1.X - center.X); double β = Math.Atan2(pt2.Y - center.Y, pt2.X - center.X); // (another comparison of two Booleans!) if (isLargeArc == (Math.Abs(β - α) < Math.PI)) { if (α < β) α += 2 * Math.PI; else β += 2 * Math.PI; } // Invert matrix for final point calculation matrix.Invert(); double sweepAngle = β - α; // Let the algorithm of GDI+ DrawArc to Bézier curves do the rest of the job return BezierCurveFromArc(center.X - δx * factor, center.Y - δy, 2 * δx * factor, 2 * δy, α / Calc.Deg2Rad, sweepAngle / Calc.Deg2Rad, pathStart, ref matrix); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #if WPF const double FUZZ = 1e-6; // Relative 0 //+------------------------------------------------------------------------------------------------- // // Function: GetArcAngle // // Synopsis: Get the number of Bezier arcs, and sine & cosine of each // // Notes: This is a private utility used by ArcToBezier // We break the arc into pieces so that no piece will span more than 90 degrees. // The input points are on the unit circle // //------------------------------------------------------------------------------------------------- public static void GetArcAngle( XPoint startPoint, // Start point XPoint endPoint, // End point bool isLargeArc, // Choose the larger of the 2 possible arcs if TRUE //SweepDirection sweepDirection, // Direction n which to sweep the arc. bool isClockwise, out double cosArcAngle, // Cosine of a the sweep angle of one arc piece out double sinArcAngle, // Sine of a the sweep angle of one arc piece out int pieces) // Out: The number of pieces { double angle; // The points are on the unit circle, so: cosArcAngle = startPoint.X * endPoint.X + startPoint.Y * endPoint.Y; sinArcAngle = startPoint.X * endPoint.Y - startPoint.Y * endPoint.X; if (cosArcAngle >= 0) { if (isLargeArc) { // The angle is between 270 and 360 degrees, so pieces = 4; } else { // The angle is between 0 and 90 degrees, so pieces = 1; return; // We already have the cosine and sine of the angle } } else { if (isLargeArc) { // The angle is between 180 and 270 degrees, so pieces = 3; } else { // The angle is between 90 and 180 degrees, so pieces = 2; } } // We have to chop the arc into the computed number of pieces. For cPieces=2 and 4 we could // have uses the half-angle trig formulas, but for pieces=3 it requires solving a cubic // equation; the performance difference is not worth the extra code, so we'll get the angle, // divide it, and get its sine and cosine. Debug.Assert(pieces > 0); angle = Math.Atan2(sinArcAngle, cosArcAngle); if (isClockwise) { if (angle < 0) angle += Math.PI * 2; } else { if (angle > 0) angle -= Math.PI * 2; } angle /= pieces; cosArcAngle = Math.Cos(angle); sinArcAngle = Math.Sin(angle); } /******************************************************************************\ * * Function Description: * * Get the distance from a circular arc's endpoints to the control points of the * Bezier arc that approximates it, as a fraction of the arc's radius. * * Since the result is relative to the arc's radius, it depends strictly on the * arc's angle. The arc is assumed to be of 90 degrees of less, so the angle is * determined by the cosine of that angle, which is derived from rDot = the dot * product of two radius vectors. We need the Bezier curve that agrees with * the arc's points and tangents at the ends and midpoint. Here we compute the * distance from the curve's endpoints to its control points. * * Since we are looking for the relative distance, we can work on the unit * circle. Place the center of the circle at the origin, and put the X axis as * the bisector between the 2 vectors. Let a be the angle between the vectors. * Then the X coordinates of the 1st & last points are cos(a/2). Let x be the X * coordinate of the 2nd & 3rd points. At t=1/2 we have a point at (1,0). * But the terms of the polynomial there are all equal: * * (1-t)^3 = t*(1-t)^2 = 2^2*(1-t) = t^3 = 1/8, * * so from the Bezier formula there we have: * * 1 = (1/8) * (cos(a/2) + 3x + 3x + cos(a/2)), * hence * x = (1 - cos(a/2)) / 3 * * The X difference between that and the 1st point is: * * DX = x - cos(a/2) = 4(1 - cos(a/2)) / 3. * * But DX = distance / sin(a/2), hence the distance is * * dist = (4/3)*(1 - cos(a/2)) / sin(a/2). * * Created: 5/29/2001 [....] * /*****************************************************************************/ public static double GetBezierDistance( // Return the distance as a fraction of the radius double dot, // In: The dot product of the two radius vectors double radius) // In: The radius of the arc's circle (optional=1) { double radSquared = radius * radius; // Squared radius Debug.Assert(dot >= -radSquared * .1); // angle < 90 degrees Debug.Assert(dot <= radSquared * 1.1); // as dot product of 2 radius vectors double dist = 0; // Acceptable fallback value /* Rather than the angle a, we are given rDot = R^2 * cos(a), so we multiply top and bottom by R: dist = (4/3)*(R - Rcos(a/2)) / Rsin(a/2) and use some trig: __________ cos(a/2) = \/1 + cos(a) / 2 ________________ __________ R*cos(a/2) = \/R^2 + R^2 cos(a) / 2 = \/R^2 + rDot / 2 */ double cos = (radSquared + dot) / 2; // =(R*cos(a))^2 if (cos < 0) return dist; // __________________ // R*sin(a/2) = \/R^2 - R^2 cos(a/2) double sin = radSquared - cos; // =(R*sin(a))^2 if (sin <= 0) return dist; sin = Math.Sqrt(sin); // = R*cos(a) cos = Math.Sqrt(cos); // = R*sin(a) dist = 4 * (radius - cos) / 3; if (dist <= sin * FUZZ) dist = 0; else dist = 4 * (radius - cos) / sin / 3; return dist; } //+------------------------------------------------------------------------------------------------- // // Function: ArcToBezier // // Synopsis: Compute the Bezier approximation of an arc // // Notes: This utilitycomputes the Bezier approximation for an elliptical arc as it is defined // in the SVG arc spec. The ellipse from which the arc is carved is axis-aligned in its // own coordinates, and defined there by its x and y radii. The rotation angle defines // how the ellipse's axes are rotated relative to our x axis. The start and end points // define one of 4 possible arcs; the sweep and large-arc flags determine which one of // these arcs will be chosen. See SVG spec for details. // // Returning pieces = 0 indicates a line instead of an arc // pieces = -1 indicates that the arc degenerates to a point // //-------------------------------------------------------------------------------------------------- public static PointCollection ArcToBezier(double xStart, double yStart, double xRadius, double yRadius, double rotationAngle, bool isLargeArc, bool isClockwise, double xEnd, double yEnd, out int pieces) { double cosArcAngle, sinArcAngle, xCenter, yCenter, r, bezDist; XVector vecToBez1, vecToBez2; XMatrix matToEllipse; double fuzz2 = FUZZ * FUZZ; bool isZeroCenter = false; pieces = -1; // In the following, the line segment between between the arc's start and // end points is referred to as "the chord". // Transform 1: Shift the origin to the chord's midpoint double x = (xEnd - xStart) / 2; double y = (yEnd - yStart) / 2; double halfChord2 = x * x + y * y; // (half chord length)^2 // Degenerate case: single point if (halfChord2 < fuzz2) { // The chord degeneartes to a point, the arc will be ignored return null; } // Degenerate case: straight line if (!AcceptRadius(halfChord2, fuzz2, ref xRadius) || !AcceptRadius(halfChord2, fuzz2, ref yRadius)) { // We have a zero radius, add a straight line segment instead of an arc pieces = 0; return null; } if (xRadius == 0 || yRadius == 0) { // We have a zero radius, add a straight line segment instead of an arc pieces = 0; return null; } // Transform 2: Rotate to the ellipse's coordinate system rotationAngle = -rotationAngle * Calc.Deg2Rad; double cos = Math.Cos(rotationAngle); double sin = Math.Sin(rotationAngle); r = x * cos - y * sin; y = x * sin + y * cos; x = r; // Transform 3: Scale so that the ellipse will become a unit circle x /= xRadius; y /= yRadius; // We get to the center of that circle along a verctor perpendicular to the chord // from the origin, which is the chord's midpoint. By Pythagoras, the length of that // vector is sqrt(1 - (half chord)^2). halfChord2 = x * x + y * y; // now in the circle coordinates if (halfChord2 > 1) { // The chord is longer than the circle's diameter; we scale the radii uniformly so // that the chord will be a diameter. The center will then be the chord's midpoint, // which is now the origin. r = Math.Sqrt(halfChord2); xRadius *= r; yRadius *= r; xCenter = yCenter = 0; isZeroCenter = true; // Adjust the unit-circle coordinates x and y x /= r; y /= r; } else { // The length of (-y,x) or (x,-y) is sqrt(rHalfChord2), and we want a vector // of length sqrt(1 - rHalfChord2), so we'll multiply it by: r = Math.Sqrt((1 - halfChord2) / halfChord2); //if (isLargeArc != (eSweepDirection == SweepDirection.Clockwise)) if (isLargeArc != isClockwise) // Going to the center from the origin=chord-midpoint { // in the direction of (-y, x) xCenter = -r * y; yCenter = r * x; } else { // in the direction of (y, -x) xCenter = r * y; yCenter = -r * x; } } // Transformation 4: shift the origin to the center of the circle, which then becomes // the unit circle. Since the chord's midpoint is the origin, the start point is (-x, -y) // and the endpoint is (x, y). XPoint ptStart = new XPoint(-x - xCenter, -y - yCenter); XPoint ptEnd = new XPoint(x - xCenter, y - yCenter); // Set up the matrix that will take us back to our coordinate system. This matrix is // the inverse of the combination of transformation 1 thru 4. matToEllipse = new XMatrix(cos * xRadius, -sin * xRadius, sin * yRadius, cos * yRadius, (xEnd + xStart) / 2, (yEnd + yStart) / 2); if (!isZeroCenter) { // Prepend the translation that will take the origin to the circle's center matToEllipse.OffsetX += (matToEllipse.M11 * xCenter + matToEllipse.M21 * yCenter); matToEllipse.OffsetY += (matToEllipse.M12 * xCenter + matToEllipse.M22 * yCenter); } // Get the sine & cosine of the angle that will generate the arc pieces GetArcAngle(ptStart, ptEnd, isLargeArc, isClockwise, out cosArcAngle, out sinArcAngle, out pieces); // Get the vector to the first Bezier control point bezDist = GetBezierDistance(cosArcAngle, 1); //if (eSweepDirection == SweepDirection.Counterclockwise) if (!isClockwise) bezDist = -bezDist; vecToBez1 = new XVector(-bezDist * ptStart.Y, bezDist * ptStart.X); PointCollection result = new PointCollection(); // Add the arc pieces, except for the last for (int idx = 1; idx < pieces; idx++) { // Get the arc piece's endpoint XPoint ptPieceEnd = new XPoint(ptStart.X * cosArcAngle - ptStart.Y * sinArcAngle, ptStart.X * sinArcAngle + ptStart.Y * cosArcAngle); vecToBez2 = new XVector(-bezDist * ptPieceEnd.Y, bezDist * ptPieceEnd.X); result.Add(matToEllipse.Transform(ptStart + vecToBez1)); result.Add(matToEllipse.Transform(ptPieceEnd - vecToBez2)); result.Add(matToEllipse.Transform(ptPieceEnd)); // Move on to the next arc ptStart = ptPieceEnd; vecToBez1 = vecToBez2; } // Last arc - we know the endpoint vecToBez2 = new XVector(-bezDist * ptEnd.Y, bezDist * ptEnd.X); result.Add(matToEllipse.Transform(ptStart + vecToBez1)); result.Add(matToEllipse.Transform(ptEnd - vecToBez2)); result.Add(new XPoint(xEnd, yEnd)); return result; } /// /// Gets a value indicating whether radius large enough compared to the chord length. /// /// (1/2 chord length)squared /// Squared fuzz. /// The radius to accept (or not). public static bool AcceptRadius(double halfChord2, double fuzz2, ref double radius) { Debug.Assert(halfChord2 >= fuzz2); // Otherewise we have no guarantee that the radius is not 0, and we need to divide by the radius bool accept = radius * radius > halfChord2 * fuzz2; if (accept) { if (radius < 0) radius = 0; } return accept; } #endif } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XFontWeight.cs0000644000175000001440000001236211435766646023250 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.ComponentModel; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Internal; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; namespace PdfSharp.Drawing { /// /// Defines the density of a typeface, in terms of the lightness or heaviness of the strokes. /// [DebuggerDisplay("'{Weight}'")] public class XFontWeight : IFormattable { internal XFontWeight(int weight) { this.weight = weight; } /// /// Gets the weight of the font, a value between 1 and 999. /// public int Weight { get { return (this.weight); } } private int weight; //public static XFontWeight FromOpenTypeWeight(int weightValue) //{ // if (weightValue < 1 || weightValue > 999) // throw new ArgumentOutOfRangeException("weightValue", "Parameter must be between 1 and 999."); // return new XFontWeight(weightValue); //} /// /// Compares the specified font weights. /// public static int Compare(XFontWeight left, XFontWeight right) { return left.weight - right.weight; } /// /// Implements the operator <. /// public static bool operator <(XFontWeight left, XFontWeight right) { return Compare(left, right) < 0; } /// /// Implements the operator <=. /// public static bool operator <=(XFontWeight left, XFontWeight right) { return Compare(left, right) <= 0; } /// /// Implements the operator >. /// public static bool operator >(XFontWeight left, XFontWeight right) { return Compare(left, right) > 0; } /// /// Implements the operator >=. /// public static bool operator >=(XFontWeight left, XFontWeight right) { return Compare(left, right) >= 0; } /// /// Implements the operator ==. /// public static bool operator ==(XFontWeight left, XFontWeight right) { return Compare(left, right) == 0; } /// /// Implements the operator !=. /// public static bool operator !=(XFontWeight left, XFontWeight right) { return !(left == right); } /// /// Determines whether the specified is equal to the current . /// public bool Equals(XFontWeight obj) { return this == obj; } /// /// Determines whether the specified is equal to the current . /// public override bool Equals(object obj) { return (obj is XFontWeight) && this == ((XFontWeight) obj); } /// /// Serves as a hash function for this type. /// public override int GetHashCode() { return Weight; } /// /// Returns a that represents the current . /// public override string ToString() { return ConvertToString(null, null); } string IFormattable.ToString(string format, IFormatProvider provider) { return ConvertToString(format, provider); } private string ConvertToString(string format, IFormatProvider provider) { string str; if (!XFontWeights.FontWeightToString(Weight, out str)) return Weight.ToString(provider); return str; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XGlyphTypeface.cs0000644000175000001440000025232511435766646023743 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.ComponentModel; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Internal; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; namespace PdfSharp.Drawing { /// /// Specifies a physical font face that corresponds to a font file on the disk. /// //[DebuggerDisplay("'{Name}', {Size}")] public class XGlyphTypeface { /// /// Initializes a new instance of the class from the specified font file. /// public XGlyphTypeface(string filename) { if (String.IsNullOrEmpty(filename)) throw new ArgumentNullException("filename"); FileStream stream = null; try { stream = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); int length = (int)stream.Length; byte[] data = new byte[length]; stream.Read(data, 0, length); Initialize(data); } finally { if (stream != null) stream.Close(); } } /// /// Initializes a new instance of the class from the specified font bytes. /// public XGlyphTypeface(byte[] data) { if (data == null) throw new ArgumentNullException("data"); Initialize(data); } void Initialize(byte[] data) { // Cache data and return a FontData this.fontData = FontDataStock.Global.RegisterFontData(data); } internal FontData FontData { get { return this.fontData; } } private FontData fontData; /// /// Gets the English family name of the font. /// public string FamilyName { get { return "Times"; } } /// /// Gets a value indicating whether the font weight is bold. /// public bool IsBold { get { return false; } } /// /// Gets a value indicating whether the font style is italic. /// public bool IsItalic { get { return false; } } //internal byte[] GetData() //{ // return this.data; //} //private byte[] data; //public XPrivateFont(string fontName, // bool bold, // bool italic, // byte[] data, // int length) //{ // this.FontName = fontName; // this.Bold = bold; // this.Italic = italic; // this.Data = data; // this.Length = length; //} //internal string FontName; //internal bool Bold; //internal bool Italic; //internal byte[] Data; //internal int Length; //public int GetFontData(ref byte[] data, // int length) //{ // if (length == this.Length) // { // // Copy the data: // //Data.CopyTo(data, 0); // Array.Copy(Data, data, length); // } // return this.Length; //} #if true_ #region Constructors /// /// Creates an uninitialized GlyphTypeface object. Caller should call ISupportInitialize.BeginInit() /// to begin initializing the object and call ISupportInitialize.EndInit() to finish the initialization. /// public GlyphTypeface() { } /// /// Creates a new GlyphTypeface object from a .otf, .ttf or .ttc font face specified by typefaceSource. /// The constructed GlyphTypeface does not use style simulations. /// /// Specifies the URI of a font file used by the newly created GlyphTypeface. public GlyphTypeface(Uri typefaceSource) : this(typefaceSource, StyleSimulations.None) {} /// /// Creates a new GlyphTypeface object from a .otf, .ttf or .ttc font face specified by typefaceSource. /// The constructed GlyphTypeface uses style simulations specified by styleSimulations parameter. /// /// Specifies the URI of a font file used by the newly created GlyphTypeface. /// Specifies style simulations to be applied to the newly created GlyphTypeface. /// /// Critical - as this calls the internal constructor that's critical. /// Safe - as the internal constructor does a Demand for FileIO for file /// Uris for the case where fromPublic is true. We block constructing /// GlyphTypeface directly in SEE since this'd allow guessing fonts on /// a machine by trying to create a GlyphTypeface object. /// /// [SecurityCritical] public GlyphTypeface(Uri typefaceSource, StyleSimulations styleSimulations) : this (typefaceSource, styleSimulations, /* fromPublic = */ true) {} /// /// Creates a new GlyphTypeface object from a .otf, .ttf or .ttc font face specified by typefaceSource. /// The constructed GlyphTypeface uses style simulations specified by styleSimulations parameter. /// /// Specifies the URI of a font file used by the newly created GlyphTypeface. /// Specifies style simulations to be applied to the newly created GlyphTypeface. /// Specifies if the call to the constructor is from a public constructor /// or if its from an internal method. For public constructor we demand FileIO for all files whereas /// for internal calls we don't demand in the constructor. /// /// Critical - as the instance of GlyphTypeface created with this constructor can /// expose font information for the case where fromPublic is false. /// [SecurityCritical] internal GlyphTypeface(Uri typefaceSource, StyleSimulations styleSimulations, bool fromPublic) { Initialize(typefaceSource, styleSimulations, fromPublic); } /// /// Critical - this method calls into other critical method. /// [SecurityCritical] private void Initialize(Uri typefaceSource, StyleSimulations styleSimulations, bool fromPublic) { if (typefaceSource == null) throw new ArgumentNullException("typefaceSource"); if (!typefaceSource.IsAbsoluteUri) throw new ArgumentException(SR.Get(SRID.UriNotAbsolute), "typefaceSource"); // remember the original Uri that contains face index _originalUri = new SecurityCriticalDataClass(typefaceSource); // split the Uri into the font source Uri and face index Uri fontSourceUri; int faceIndex; Util.SplitFontFaceIndex(typefaceSource, out fontSourceUri, out faceIndex); _fileIOPermObj = new SecurityCriticalDataForSet( SecurityHelper.CreateUriReadPermission(fontSourceUri) ); // This permission demand is here so that untrusted callers are unable to check for file existence using GlyphTypeface ctor. // Sensitive font data is protected by demands as the user tries to access it. // The demand below is skipped for non-public calls, because in such cases // fonts are exposed as logical fonts to the end user. if (fromPublic) DemandPermissionsForFontInformation(); // We skip permission demands for FontSource because the above line already demands them for the right callers. _fontFace = new FontFaceLayoutInfo(new FontSource(fontSourceUri, true), faceIndex); CacheManager.Lookup(_fontFace); if ((styleSimulations & ~StyleSimulations.BoldItalicSimulation) != 0) throw new InvalidEnumArgumentException("styleSimulations", (int)styleSimulations, typeof(StyleSimulations)); _styleSimulations = styleSimulations; _initializationState = InitializationState.IsInitialized; // fully initialized } #endregion Constructors //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- #region Public Methods /// /// Return hash code for this GlyphTypeface. /// /// Hash code. /// /// Critical - as this accesses _originalUri. /// Safe - as this only does this to compute the hash code. /// [SecurityCritical] public override int GetHashCode() { CheckInitialized(); return _originalUri.Value.GetHashCode() ^ (int)StyleSimulations; } /// /// Compares this GlyphTypeface with another object. /// /// Object to compare with. /// Whether this object is equal to the input object. /// /// Critical - as this accesses _originalUri. /// Safe - as this only does this to perform a comparison with another object. /// [SecurityCritical] public override bool Equals(object o) { CheckInitialized(); GlyphTypeface t = o as GlyphTypeface; if (t == null) return false; return StyleSimulations == t.StyleSimulations && _originalUri.Value == t._originalUri.Value; } /// /// Returns a geometry describing the path for a single glyph in the font. /// The path represents the glyph /// without grid fitting applied for rendering at a specific resolution. /// /// Index of the glyph to get outline for. /// Font size in drawing surface units. /// Size to hint for in points. [CLSCompliant(false)] public Geometry GetGlyphOutline(ushort glyphIndex, double renderingEmSize, double hintingEmSize) { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return ComputeGlyphOutline(glyphIndex, false, renderingEmSize, hintingEmSize); } /// /// Returns the binary image of font subset. /// /// Collection of glyph indices to be included into the subset. /// Binary image of font subset. /// /// Callers must have UnmanagedCode permission to call this API. /// Callers must have FileIOPermission or WebPermission to font location to call this API. /// /// /// Critical - returns raw font data. /// Safe - (1) unmanaged code demand. This ensures PT callers can't directly access the TrueType subsetter in V1. /// (2) fileIO or web permission demand for location of font. This ensures that even brokered access /// via print dialog (which asserts unmanaged code) only succeeds if user has access to font source location. /// [SecurityCritical] [CLSCompliant(false)] public byte[] ComputeSubset(ICollection glyphs) { SecurityHelper.DemandUnmanagedCode(); DemandPermissionsForFontInformation(); CheckInitialized(); // This can only be called on fully initialized GlyphTypeface if (glyphs == null) throw new ArgumentNullException("glyphs"); if (glyphs.Count <= 0) throw new ArgumentException(SR.Get(SRID.CollectionNumberOfElementsMustBeGreaterThanZero), "glyphs"); if (glyphs.Count > ushort.MaxValue) throw new ArgumentException(SR.Get(SRID.CollectionNumberOfElementsMustBeLessOrEqualTo, ushort.MaxValue), "glyphs"); UnmanagedMemoryStream pinnedFontSource = FontSource.GetUnmanagedStream(); try { TrueTypeFontDriver trueTypeDriver = new TrueTypeFontDriver(pinnedFontSource, _originalUri.Value); trueTypeDriver.SetFace(FaceIndex); return trueTypeDriver.ComputeFontSubset(glyphs); } catch (SEHException e) { throw Util.ConvertInPageException(FontSource, e); } finally { pinnedFontSource.Close(); } } /// /// Returns a font file stream represented by this GlyphTypeface. /// /// A font file stream represented by this GlyphTypeface. /// /// Critical - returns raw font data. /// Safe - does a demand before it gives out the information asked. /// [SecurityCritical] public Stream GetFontStream() { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface DemandPermissionsForFontInformation(); return FontSource.GetStream(); } /// /// Exposed to allow printing code to access GetFontStream() in partial trust /// /// /// Critical - returns a permission allowing access to GetFontStream in partial trust. /// Caller must make sure there is no font data leak /// [FriendAccessAllowed] internal CodeAccessPermission CriticalFileReadPermission { [SecurityCritical] get { CheckInitialized(); return _fileIOPermObj.Value; } } /// /// Exposed to allow printing code to access FontUri in partial trust /// /// /// Critical - returns a permission allowing access to FontUri /// Caller must make sure there is no data leak /// [FriendAccessAllowed] internal CodeAccessPermission CriticalUriDiscoveryPermission { [SecurityCritical] get { CheckInitialized(); return SecurityHelper.CreateUriDiscoveryPermission(_originalUri.Value); } } #endregion Public Methods //------------------------------------------------------ // // Public Properties // //------------------------------------------------------ #region Public Properties /// /// Returns the original Uri of this glyph typeface object. /// /// The Uri glyph typeface was constructed with. /// /// Callers must have FileIOPermission(FileIOPermissionAccess.PathDiscovery) for the given Uri to call this API. /// /// /// Critical - as this obtains Uri that can reveal local file system information. /// Safe - as this does a discovery demand before it gives out the information asked. /// public Uri FontUri { [SecurityCritical] get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface SecurityHelper.DemandUriDiscoveryPermission(_originalUri.Value); return _originalUri.Value; } [SecurityCritical] set { CheckInitializing(); // This can only be called in initialization if (value == null) throw new ArgumentNullException("value"); if (!value.IsAbsoluteUri) throw new ArgumentException(SR.Get(SRID.UriNotAbsolute), "value"); _originalUri = new SecurityCriticalDataClass(value); } } /// /// This property is indexed by a Culture Identifier. /// It returns the family name in the specified language, or, /// if the font does not provide a name for the specified language, /// it returns the family name in English. /// The family name excludes weight, style and stretch. /// public IDictionary FamilyNames { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.GetFamilyNameDictionary(); } } /// /// This property is indexed by a Culture Identifier. /// It returns the face name in the specified language, or, /// if the font does not provide a name for the specified language, /// it returns the face name in English. /// The face name may identify weight, style and/or stretch. /// public IDictionary FaceNames { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.GetFaceNameDictionary(); } } /// /// This property is indexed by a Culture Identifier. /// It returns the family name in the specified language, or, /// if the font does not provide a name for the specified language, /// it returns the family name in English. /// The Win32FamilyName name excludes regular or bold weights and style, /// but includes other weights and stretch. /// public IDictionary Win32FamilyNames { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.GetWin32FamilyNameDictionary(); } } /// /// This property is indexed by a Culture Identifier. /// It returns the face name in the specified language, or, /// if the font does not provide a name for the specified language, /// it returns the face name in English. /// The face name may identify weight, style and/or stretch. /// IDictionary ITypefaceMetrics.AdjustedFaceNames { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface IDictionary adjustedFaceNames = _fontFace.GetAdjustedFaceNameDictionary(); IDictionary adjustedLanguageFaceNames = new Dictionary(adjustedFaceNames.Count); foreach (KeyValuePair pair in adjustedFaceNames) { adjustedLanguageFaceNames[XmlLanguage.GetLanguage(pair.Key.IetfLanguageTag)] = pair.Value; } if (_styleSimulations != StyleSimulations.None) { adjustedLanguageFaceNames = FontDifferentiator.AppendSimulationsToFaceNames(adjustedLanguageFaceNames, _styleSimulations); } return adjustedLanguageFaceNames; } } /// /// This property is indexed by a Culture Identifier. /// It returns the face name in the specified language, or, /// if the font does not provide a name for the specified language, /// it returns the face name in English. /// The Win32Face name may identify weights other than regular or bold and/or style, /// but may not identify stretch or other weights. /// public IDictionary Win32FaceNames { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.GetWin32FaceNameDictionary(); } } /// /// This property is indexed by a Culture Identifier. /// Version string in the fonts NAME table. /// Version strings vary significantly in format - to obtain the version /// as a numeric value use the 'Version' property, /// do not attempt to parse the VersionString. /// /// /// Critical - as this accesses _fontFace which can reveal Windows font information. /// Safe - as this does a demand before it gives out the information asked. /// public IDictionary VersionStrings { [SecurityCritical] get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface DemandPermissionsForFontInformation(); return _fontFace.GetVersionStringDictionary(); } } /// /// This property is indexed by a Culture Identifier. /// Copyright notice. /// /// /// Critical - as this accesses _fontFace which can reveal Windows font information. /// Safe - as this does a demand before it gives out the information asked. /// public IDictionary Copyrights { [SecurityCritical] get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface DemandPermissionsForFontInformation(); return _fontFace.GetCopyrightDictionary(); } } /// /// This property is indexed by a Culture Identifier. /// Manufacturer Name. /// /// /// Critical - as this accesses _fontFace which can reveal Windows font information. /// Safe - as this does a demand before it gives out the information asked. /// public IDictionary ManufacturerNames { [SecurityCritical] get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface DemandPermissionsForFontInformation(); return _fontFace.GetManufacturerNameDictionary(); } } /// /// This property is indexed by a Culture Identifier. /// This is used to save any trademark notice/information for this font. /// Such information should be based on legal advice. /// This is distinctly separate from the copyright. /// /// /// Critical - as this accesses _fontFace which can reveal Windows font information. /// Safe - as this does a demand before it gives out the information asked. /// public IDictionary Trademarks { [SecurityCritical] get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface DemandPermissionsForFontInformation(); return _fontFace.GetTrademarkDictionary(); } } /// /// This property is indexed by a Culture Identifier. /// Name of the designer of the typeface. /// /// /// Critical - as this accesses _fontFace which can reveal Windows font information. /// Safe - as this does a demand before it gives out the information asked. /// public IDictionary DesignerNames { [SecurityCritical] get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface DemandPermissionsForFontInformation(); return _fontFace.GetDesignerNameDictionary(); } } /// /// This property is indexed by a Culture Identifier. /// Description of the typeface. Can contain revision information, /// usage recommendations, history, features, etc. /// /// /// Critical - as this accesses _fontFace which can reveal Windows font information. /// Safe - as this does a demand before it gives out the information asked. /// public IDictionary Descriptions { [SecurityCritical] get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface DemandPermissionsForFontInformation(); return _fontFace.GetDescriptionDictionary(); } } /// /// This property is indexed by a Culture Identifier. /// URL of font vendor (with protocol, e.g., `http://, `ftp://). /// If a unique serial number is embedded in the URL, /// it can be used to register the font. /// /// /// Critical - as this accesses _fontFace which can reveal Windows font information. /// Safe - as this does a demand before it gives out the information asked. /// public IDictionary VendorUrls { [SecurityCritical] get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface DemandPermissionsForFontInformation(); return _fontFace.GetVendorUrlDictionary(); } } /// /// This property is indexed by a Culture Identifier. /// URL of typeface designer (with protocol, e.g., `http://, `ftp://). /// /// /// Critical - as this accesses _fontFace which can reveal Windows font information. /// Safe - as this does a demand before it gives out the information asked. /// public IDictionary DesignerUrls { [SecurityCritical] get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface DemandPermissionsForFontInformation(); return _fontFace.GetDesignerUrlDictionary(); } } /// /// This property is indexed by a Culture Identifier. /// Description of how the font may be legally used, /// or different example scenarios for licensed use. /// This field should be written in plain language, not legalese. /// /// /// Critical - as this accesses _fontFace which can reveal Windows font information. /// Safe - as this does a demand before it gives out the information asked. /// public IDictionary LicenseDescriptions { [SecurityCritical] get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface DemandPermissionsForFontInformation(); return _fontFace.GetLicenseDescriptionDictionary(); } } /// /// This property is indexed by a Culture Identifier. /// This can be the font name, or any other text that the designer /// thinks is the best sample to display the font in. /// /// /// Critical - as this accesses _fontFace which can reveal Windows font information. /// Safe - as this does a demand before it gives out the information asked. /// public IDictionary SampleTexts { [SecurityCritical] get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface DemandPermissionsForFontInformation(); return _fontFace.GetSampleTextDictionary(); } } /// /// Returns designed style (regular/italic/oblique) of this font face /// /// Designed style of this font face. public FontStyle Style { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.Style; } } /// /// Returns designed weight of this font face. /// /// Designed weight of this font face. public FontWeight Weight { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.Weight; } } /// /// Returns designed stretch of this font face. /// /// Designed stretch of this font face. public FontStretch Stretch { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.Stretch; } } /// /// Font face version interpreted from the font's 'NAME' table. /// /// /// Critical - as this accesses _fontFace which can reveal Windows font information. /// Safe - as this does a demand before it gives out the information asked. /// public double Version { [SecurityCritical] get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface DemandPermissionsForFontInformation(); return _fontFace.Version; } } /// /// Height of character cell relative to em size. /// public double Height { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return (double)(_fontFace.DesignCellAscent + _fontFace.DesignCellDescent) / DesignEmHeight; } } /// /// Distance from cell top to English baseline relative to em size. /// public double Baseline { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return (double)_fontFace.DesignCellAscent / DesignEmHeight; } } /// /// Distance from baseline to top of English capital, relative to em size. /// public double CapsHeight { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return (double)_fontFace.CapsHeight / DesignEmHeight; } } /// /// Western x-height relative to em size. /// public double XHeight { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return (double)_fontFace.xHeight / DesignEmHeight; } } /// /// Returns true if this font does not conform to Unicode encoding: /// it may be considered as a simple collection of symbols indexed by a codepoint. /// public bool Symbol { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.Symbol; } } /// /// Position of underline relative to baseline relative to em size. /// The value is usually negative, to place the underline below the baseline. /// public double UnderlinePosition { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return (double)_fontFace.UnderlinePosition / DesignEmHeight; } } /// /// Thickness of underline relative to em size. /// public double UnderlineThickness { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return (double)_fontFace.UnderlineThickness / DesignEmHeight; } } /// /// Position of strikeThrough relative to baseline relative to em size. /// The value is usually positive, to place the Strikethrough above the baseline. /// public double StrikethroughPosition { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return (double)_fontFace.StrikethroughPosition / DesignEmHeight; } } /// /// Thickness of Strikethrough relative to em size. /// public double StrikethroughThickness { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return (double)_fontFace.StrikethroughThickness / DesignEmHeight; } } /// /// EmbeddingRights property describes font embedding permissions /// specified in this glyph typeface. /// /// /// Critical - as this accesses _fontFace which can reveal Windows font information. /// Safe - as this does a demand before it gives out the information asked. /// public FontEmbeddingRight EmbeddingRights { [SecurityCritical] get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface DemandPermissionsForFontInformation(); return _fontFace.EmbeddingRights; } } #region ITypefaceMetrics implementation /// /// Distance from baseline to top of English capital, relative to em size. /// double ITypefaceMetrics.CapsHeight { get { return CapsHeight; } } /// /// Western x-height relative to em size. /// double ITypefaceMetrics.XHeight { get { return XHeight; } } /// /// Returns true if this font does not conform to Unicode encoding: /// it may be considered as a simple collection of symbols indexed by a codepoint. /// bool ITypefaceMetrics.Symbol { get { return Symbol; } } /// /// Position of underline relative to baseline relative to em size. /// The value is usually negative, to place the underline below the baseline. /// double ITypefaceMetrics.UnderlinePosition { get { return UnderlinePosition; } } /// /// Thickness of underline relative to em size. /// double ITypefaceMetrics.UnderlineThickness { get { return UnderlineThickness; } } /// /// Position of strikeThrough relative to baseline relative to em size. /// The value is usually positive, to place the Strikethrough above the baseline. /// double ITypefaceMetrics.StrikethroughPosition { get { return StrikethroughPosition; } } /// /// Thickness of Strikethrough relative to em size. /// double ITypefaceMetrics.StrikethroughThickness { get { return StrikethroughThickness; } } #endregion // The next several properties return non CLS-compliant types. This is // tracked by bug 1792236. For now, suppress the compiler warning. // #pragma warning disable 3003 /// /// Returns advance width for a given glyph. /// public IDictionary AdvanceWidths { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return new GlyphIndexer(this.GetAdvanceWidth, _fontFace.GlyphCount); } } /// /// Returns Advance height for a given glyph (Used for example in vertical layout). /// public IDictionary AdvanceHeights { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return new GlyphIndexer(this.GetAdvanceHeight, _fontFace.GlyphCount); } } /// /// Distance from leading end of advance vector to left edge of black box. /// Positive when left edge of black box is within the alignment rectangle /// defined by the advance width and font cell height. /// Negative when left edge of black box overhangs the alignment rectangle. /// public IDictionary LeftSideBearings { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return new GlyphIndexer(this.GetLeftSidebearing, _fontFace.GlyphCount); } } /// /// Distance from right edge of black box to right end of advance vector. /// Positive when trailing edge of black box is within the alignment rectangle /// defined by the advance width and font cell height. /// Negative when right edge of black box overhangs the alignment rectangle. /// public IDictionary RightSideBearings { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return new GlyphIndexer(this.GetRightSidebearing, _fontFace.GlyphCount); } } /// /// Distance from top end of (vertical) advance vector to top edge of black box. /// Positive when top edge of black box is within the alignment rectangle /// defined by the advance height and font cell height. /// (The font cell height is a horizontal dimension in vertical layout). /// Negative when top edge of black box overhangs the alignment rectangle. /// public IDictionary TopSideBearings { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return new GlyphIndexer(this.GetTopSidebearing, _fontFace.GlyphCount); } } /// /// Distance from bottom edge of black box to bottom end of advance vector. /// Positive when bottom edge of black box is within the alignment rectangle /// defined by the advance width and font cell height. /// (The font cell height is a horizontal dimension in vertical layout). /// Negative when bottom edge of black box overhangs the alignment rectangle. /// public IDictionary BottomSideBearings { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return new GlyphIndexer(this.GetBottomSidebearing, _fontFace.GlyphCount); } } /// /// Offset down from horizontal Western baseline to bottom of glyph black box. /// public IDictionary DistancesFromHorizontalBaselineToBlackBoxBottom { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return new GlyphIndexer(this.GetBaseline, _fontFace.GlyphCount); } } /// /// Returns nominal mapping of Unicode codepoint to glyph index as defined by the font 'CMAP' table. /// /// /// Critical: May potentially leak a writeable cmap. /// Safe: The cmap IDictionary exposure is read only. /// public IDictionary CharacterToGlyphMap { [SecurityCritical] get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.CharacterMap; } } #pragma warning restore 3003 /// /// Returns algorithmic font style simulations to be applied to the GlyphTypeface. /// public StyleSimulations StyleSimulations { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _styleSimulations; } set { CheckInitializing(); _styleSimulations = value; } } /// /// Obtains the number of glyphs in the glyph typeface. /// /// The number of glyphs in the glyph typeface. public int GlyphCount { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.GlyphCount; } } #endregion Public Properties //----------------------------------------------------- // // Internal Methods // //------------------------------------------------------ #region Internal Methods /// /// Returns the nominal advance width for a glyph. /// /// Glyph index in the font. /// The nominal advance width for the glyph relative to the em size of the font. /// /// Critical - as this has unsafe block. /// Safe - as this only gives width information which is safe to give out. /// [SecurityCritical, SecurityTreatAsSafe] internal double GetAdvanceWidth(ushort glyph) { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface // We manually expand GetGlyphMetrics call because GetAdvanceWidth is a very frequently used function. // When we get to using GetAdvanceHeight for vertical writing, we need to consider doing the same optimization there. unsafe { FontFaceLayoutInfo.GlyphMetrics * cachedGlyphMetrics = _fontFace.Metrics(glyph); double aw = (double)cachedGlyphMetrics->advanceWidth / DesignEmHeight; if ((_styleSimulations & StyleSimulations.BoldSimulation) != 0) { // Bold simulation increases advance width and advance height by 2% of em size, // except for glyphs that are empty or have zero advance widths. // So, we compensate for the simulation when aw != 0 && left < right && ah != 0 && bottom > top if (cachedGlyphMetrics->advanceWidth != 0 && cachedGlyphMetrics->lsb < cachedGlyphMetrics->advanceWidth - cachedGlyphMetrics->rsb && cachedGlyphMetrics->advanceHeight != 0 && cachedGlyphMetrics->advanceHeight - cachedGlyphMetrics->tsb - cachedGlyphMetrics->bsb > 0) { aw += 0.02; } } return aw; } } /// /// Returns the nominal advance width for a glyph in font design units. /// /// Glyph index in the font. /// The nominal advance width for the glyph in font design units. internal double GetAdvanceWidthInDesignUnits(ushort glyph) { return GetAdvanceWidth(glyph) * DesignEmHeight; } /// /// This function will demand appropriate permissions depending on what /// the source of the font information is. The value of _fileIOPermObj /// is set correctly whenever _originalUri gets set. /// internal void DemandPermissionsForFontInformation() { if (_fileIOPermObj.Value != null) { _fileIOPermObj.Value.Demand(); } } private double GetAdvanceHeight(ushort glyph) { double aw, ah, lsb, rsb, tsb, bsb, baseline; GetGlyphMetrics( glyph, 1.0, out aw, out ah, out lsb, out rsb, out tsb, out bsb, out baseline ); return ah; } private double GetLeftSidebearing(ushort glyph) { return (double)_fontFace.GetLeftSidebearing(glyph) / DesignEmHeight; } private double GetRightSidebearing(ushort glyph) { return (double)_fontFace.GetRightSidebearing(glyph) / DesignEmHeight; } private double GetTopSidebearing(ushort glyph) { return (double)_fontFace.GetTopSidebearing(glyph) / DesignEmHeight; } private double GetBottomSidebearing(ushort glyph) { return (double)_fontFace.GetBottomSidebearing(glyph) / DesignEmHeight; } private double GetBaseline(ushort glyph) { return (double)_fontFace.GetBaseline(glyph) / DesignEmHeight; } /// /// Optimized version of obtaining all of glyph metrics from font cache at once /// without repeated checks and divisions. /// /// /// Critical - as this uses unsafe code. /// Safe - as this only gives information which is safe to give out. /// [SecurityCritical, SecurityTreatAsSafe] internal void GetGlyphMetrics( ushort glyph, double renderingEmSize, out double aw, out double ah, out double lsb, out double rsb, out double tsb, out double bsb, out double baseline ) { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface unsafe { FontFaceLayoutInfo.GlyphMetrics * cachedGlyphMetrics = _fontFace.Metrics(glyph); double designToEm = renderingEmSize / DesignEmHeight; aw = designToEm * cachedGlyphMetrics->advanceWidth; ah = designToEm * cachedGlyphMetrics->advanceHeight; lsb = designToEm * cachedGlyphMetrics->lsb; rsb = designToEm * cachedGlyphMetrics->rsb; tsb = designToEm * cachedGlyphMetrics->tsb; bsb = designToEm * cachedGlyphMetrics->bsb; baseline = designToEm * cachedGlyphMetrics->baseline; if ((_styleSimulations & StyleSimulations.BoldSimulation) != 0) { // Bold simulation increases advance width and advance height by 2% of em size, // except for glyphs that are empty or have zero advance widths. // So, we compensate for the simulation when aw != 0 && left < right && ah != 0 && bottom > top if (cachedGlyphMetrics->advanceWidth != 0 && cachedGlyphMetrics->lsb < cachedGlyphMetrics->advanceWidth - cachedGlyphMetrics->rsb && cachedGlyphMetrics->advanceHeight != 0 && cachedGlyphMetrics->advanceHeight - cachedGlyphMetrics->tsb - cachedGlyphMetrics->bsb > 0) { aw += 0.02 * renderingEmSize; ah += 0.02 * renderingEmSize; } } } } /// /// Returns a geometry describing the path for a single glyph in the font. /// The path represents the glyph /// without grid fitting applied for rendering at a specific resolution. /// /// Index of the glyph to get outline for. /// Specifies whether the glyph should be rotated sideways. /// Font size in drawing surface units. /// Size to hint for in points. /// Geometry containing glyph outline. /// /// Critical - as this calls GetGlyphs() which is critical. /// Safe - as this doesn't expose font information but just gives out a Geometry. /// [SecurityCritical, SecurityTreatAsSafe] internal Geometry ComputeGlyphOutline(ushort glyphIndex, bool sideways, double renderingEmSize, double hintingEmSize) { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface using (GlyphPathElement pathElement = new GlyphPathElement( _fontFace.FaceIndex, _fontFace.FontSource, GetRenderingFlags(sideways), DesignEmHeight )) { PathGeometry pathGeometry; unsafe { void*[] glyphOutlines = new void*[1]; FontCacheAccessor fontCacheAccessor = new FontCacheAccessor(); ushort[] glyphIndices = new ushort[1] { glyphIndex }; fontCacheAccessor.GetGlyphs( pathElement, glyphIndices, glyphOutlines ); void * outline = glyphOutlines[0]; Debug.Assert(outline != null); if (FontTechnology == FontTechnology.PostscriptOpenType) ConvertPostscriptOutline(outline, renderingEmSize, sideways, out pathGeometry); else ConvertTrueTypeOutline(outline, renderingEmSize, sideways, out pathGeometry); // Make sure fontCacheAccessor doesn't go out of scope before the outlines get converted. GC.KeepAlive(fontCacheAccessor); } // Make sure to always return Geometry.Empty from public methods for empty geometries. if (pathGeometry == null || pathGeometry.IsEmpty()) return Geometry.Empty; return pathGeometry; } } /// /// Critical - unsafe code, accepts pointer parameters, etc. /// [SecurityCritical] private unsafe void ConvertTrueTypeOutline(void* trueTypeOutline, double renderingEmSize, bool sideways, out PathGeometry pathGeometry) { GlyphPathData * outline = (GlyphPathData *)trueTypeOutline; // scale factor from design units to user coordinate system double designToUserScale = renderingEmSize / DesignEmHeight; Matrix designToUser = new Matrix(designToUserScale, 0, 0, -designToUserScale, 0, 0); if (sideways) { designToUser.Rotate(-90.0); designToUser.Translate(outline->verOriginY * designToUserScale, outline->verOriginX * designToUserScale); } ushort* endp = GlyphPathData.EndPointNumbers(outline); short* x = GlyphPathData.X(outline); short* y = GlyphPathData.Y(outline); byte* flags = GlyphPathData.Flags(outline); // k is the index of the first point of the current contour int k = 0; pathGeometry = null; // j is the index of the current contour for (int j = 0; j < outline->numberOfContours; ++j) { int lastPointIndex = endp[j]; if (lastPointIndex <= k) { k = lastPointIndex + 1; continue; // empty contour } Point startPoint; PathFigure figure = new PathFigure(); // The first point on the curve if (OnCurve(flags[k])) { // Easy case startPoint = designToUser.Transform(new Point(x[k], y[k])); ++k; } else { // Is last contour point on the curve if (OnCurve(flags[lastPointIndex])) { // Make the last point the first point and decrement the last point startPoint = designToUser.Transform(new Point(x[lastPointIndex], y[lastPointIndex])); --lastPointIndex; } else { // First and last point are off the countour, fake a mid point Point firstPoint = designToUser.Transform(new Point(x[k], y[k])); Point lastPoint = designToUser.Transform(new Point(x[lastPointIndex], y[lastPointIndex])); startPoint = new Point( (firstPoint.X + lastPoint.X) / 2, (firstPoint.Y + lastPoint.Y) / 2 ); } } figure.StartPoint = startPoint; bool inBezier = false; Point bezierB = new Point(); while (k <= lastPointIndex) { Point currentPoint = designToUser.Transform(new Point(x[k], y[k])); if (OnCurve(flags[k])) { if (!inBezier) { figure.Segments.Add(new LineSegment(currentPoint, true)); } else { figure.Segments.Add(new QuadraticBezierSegment(bezierB, currentPoint, true)); inBezier = false; } } else { if (inBezier) { figure.Segments.Add(new QuadraticBezierSegment( bezierB, new Point( (bezierB.X + currentPoint.X) / 2, (bezierB.Y + currentPoint.Y) / 2 ), true) ); } inBezier = true; bezierB = currentPoint; } ++k; } // explicitly set k to the start point of the next contour // since in some cases lastPointIndex is not equal to endp[j] k = endp[j] + 1; // close the figure, assume start point is always on curve if (inBezier) { figure.Segments.Add(new QuadraticBezierSegment(bezierB, startPoint, true)); } figure.IsClosed = true; if (pathGeometry == null) { pathGeometry = new PathGeometry(); pathGeometry.FillRule = FillRule.Nonzero; } pathGeometry.Figures.Add(figure); } } /// /// Critical - unsafe code, accepts pointer parameters, etc. /// [SecurityCritical] private unsafe void ConvertPostscriptOutline(void * outline, double renderingEmSize, bool sideways, out PathGeometry pathGeometry) { int * postscriptOutline = (int *)outline; // scale factor from design units to user coordinate system double designToUserScale = renderingEmSize / DesignEmHeight; Matrix designToUser = new Matrix(designToUserScale, 0, 0, -designToUserScale, 0, 0); if (sideways) { int verOriginX = postscriptOutline[0]; int verOriginY = postscriptOutline[1]; designToUser.Rotate(-90.0); designToUser.Translate(verOriginY * designToUserScale, verOriginX * designToUserScale); } // Skip vertical origin and length to get to the actual contour data. int * p = postscriptOutline + 3; Debug.Assert(postscriptOutline[2] % sizeof(int) == 0); int * end = p + (postscriptOutline[2] / sizeof(int)); pathGeometry = null; // Current figure. PathFigure figure = null; for (;;) { if (p >= end) break; int tokenValue = *p; switch ((OutlineTokenType)tokenValue) { case OutlineTokenType.MoveTo: { ++p; if (p + 1 >= end) throw new FileFormatException(_originalUri.Value); Point point = designToUser.Transform( new Point(p[0] * CFFConversionFactor, p[1] * CFFConversionFactor) ); if (figure == null) figure = new PathFigure(); figure.StartPoint = point; p += 2; break; } case OutlineTokenType.LineTo: { ++p; if (p + 1 >= end) throw new FileFormatException(_originalUri.Value); Point point = designToUser.Transform( new Point(p[0] * CFFConversionFactor, p[1] * CFFConversionFactor) ); if (figure == null) throw new FileFormatException(_originalUri.Value); figure.Segments.Add(new LineSegment(point, true)); p += 2; break; } case OutlineTokenType.CurveTo: { ++p; if (p + 5 >= end) throw new FileFormatException(_originalUri.Value); Point point0 = designToUser.Transform( new Point(p[0] * CFFConversionFactor, p[1] * CFFConversionFactor) ); Point point1 = designToUser.Transform( new Point(p[2] * CFFConversionFactor, p[3] * CFFConversionFactor) ); Point point2 = designToUser.Transform( new Point(p[4] * CFFConversionFactor, p[5] * CFFConversionFactor) ); if (figure == null) throw new FileFormatException(_originalUri.Value); figure.Segments.Add(new BezierSegment(point0, point1, point2, true)); p += 6; break; } case OutlineTokenType.ClosePath: if (figure == null) throw new FileFormatException(_originalUri.Value); figure.IsClosed = true; if (pathGeometry == null) { pathGeometry = new PathGeometry(); pathGeometry.FillRule = FillRule.Nonzero; } pathGeometry.Figures.Add(figure); figure = null; ++p; break; default: throw new FileFormatException(_originalUri.Value); } } } /// /// Get advance widths of unshaped characters /// /// character string /// character length /// character em size /// unshaped advance widths /// true if all characters map to missing glyph /// array of character advance widths /// /// Critical - takes unsafe char string and returns information in an unsafe int array /// [SecurityCritical] internal unsafe void GetAdvanceWidthsUnshaped( char* unsafeCharString, int stringLength, double emSize, int* advanceWidthsUnshaped, bool nullFont ) { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface Invariant.Assert(stringLength > 0); if (!nullFont) { IDictionary cmap = CharacterToGlyphMap; for (int i = 0; i < stringLength; i++) { ushort glyphIndex; cmap.TryGetValue(unsafeCharString[i], out glyphIndex); advanceWidthsUnshaped[i] = (int)Math.Round(emSize * GetAdvanceWidth(glyphIndex)); } } else { int missingGlyphWidth = (int)Math.Round(emSize * GetAdvanceWidth(0)); for (int i = 0; i < stringLength; i++) { advanceWidthsUnshaped[i] = missingGlyphWidth; } } } /// /// Compute an unshaped glyphrun object from specified character-based info /// internal GlyphRun ComputeUnshapedGlyphRun( Point origin, CharacterBufferRange charBufferRange, IList charWidths, double emSize, double emHintingSize, bool nullGlyph, CultureInfo cultureInfo, string deviceFontName ) { Debug.Assert(charBufferRange.Length > 0); CheckInitialized(); // This can only be called on fully initialized GlyphTypeface ushort[] nominalGlyphs = new ushort[charBufferRange.Length]; // compute glyph positions if (nullGlyph) { for (int i = 0; i < charBufferRange.Length; i++) { nominalGlyphs[i] = 0; } } else { IDictionary cmap = CharacterToGlyphMap; for (int i = 0; i < charBufferRange.Length; i++) { ushort glyphIndex; cmap.TryGetValue(charBufferRange[i], out glyphIndex); nominalGlyphs[i] = glyphIndex; } } return GlyphRun.TryCreate( this, 0, // bidiLevel false, // sideway emSize, nominalGlyphs, origin, charWidths, null, // glyphOffsets new PartialList(charBufferRange.CharacterBuffer, charBufferRange.OffsetToFirstChar, charBufferRange.Length), deviceFontName, // device font null, // 1:1 mapping null, // caret stops at every codepoint XmlLanguage.GetLanguage(cultureInfo.IetfLanguageTag) ); } #endregion Internal Methods //----------------------------------------------------- // // Internal Properties // //----------------------------------------------------- #region Internal Properties internal FontSource FontSource { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.FontSource; } } /// /// 0 for TTF files /// Face index within TrueType font collection for TTC files /// internal int FaceIndex { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.FaceIndex; } } internal FontFaceLayoutInfo FontFaceLayoutInfo { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace; } } internal ushort BlankGlyphIndex { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.BlankGlyph; } } internal FontFaceLayoutInfo.RenderingHints RenderingHints { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.FontRenderingHints; } } internal FontTechnology FontTechnology { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.FontTechnology; } } internal short FontContrastAdjustment { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface Debug.Assert(-3 <= _fontFace.FontContrastAdjustment && _fontFace.FontContrastAdjustment <= 4); return _fontFace.FontContrastAdjustment; } } internal ushort DesignEmHeight { get { CheckInitialized(); // This can only be called on fully initialized GlyphTypeface return _fontFace.DesignEmHeight; } } #endregion Internal Properties //----------------------------------------------------- // // Private Methods // //------------------------------------------------------ #region Private Methods private static bool OnCurve(byte flag) { return (flag & 0x01) != 0; } private ushort GetRenderingFlags(bool sideways) { ushort renderingFlags = 0; if ((_styleSimulations & StyleSimulations.BoldSimulation) != 0) renderingFlags |= (ushort)RenderingFlags.BoldSimulation; if ((_styleSimulations & StyleSimulations.ItalicSimulation) != 0) { renderingFlags |= (ushort)RenderingFlags.ItalicSimulation; if (sideways) renderingFlags |= (ushort)RenderingFlags.SidewaysItalicSimulation; } if (FontTechnology != FontTechnology.PostscriptOpenType) renderingFlags |= (ushort)MIL_GLYPHRUN_FLAGS.MilGlyphRunIsTrueType; return renderingFlags; } #endregion Private Methods #region ISupportInitialize interface void ISupportInitialize.BeginInit() { if (_initializationState == InitializationState.IsInitialized) { // Cannont initialize a GlyphRun this is completely initialized. throw new InvalidOperationException(SR.Get(SRID.OnlyOneInitialization)); } if (_initializationState == InitializationState.IsInitializing) { // Cannot initialize a GlyphRun this already being initialized. throw new InvalidOperationException(SR.Get(SRID.InInitialization)); } _initializationState = InitializationState.IsInitializing; } /// /// Critical - this method calls into critical method. /// [SecurityCritical] void ISupportInitialize.EndInit() { if (_initializationState != InitializationState.IsInitializing) { // Cannot EndInit a GlyphRun that is not being initialized. throw new InvalidOperationException(SR.Get(SRID.NotInInitialization)); } Initialize( (_originalUri == null ? null : _originalUri.Value), _styleSimulations, true ); } private void CheckInitialized() { if (_initializationState != InitializationState.IsInitialized) { throw new InvalidOperationException(SR.Get(SRID.InitializationIncomplete)); } } private void CheckInitializing() { if (_initializationState != InitializationState.IsInitializing) { throw new InvalidOperationException(SR.Get(SRID.NotInInitialization)); } } #endregion //----------------------------------------------------- // // Private Nested Classes // //------------------------------------------------------ #region Private Nested Classes private delegate double GlyphAccessor(ushort glyphIndex); /// /// This class is a helper to implement named indexers /// for glyph metrics. /// private class GlyphIndexer : IDictionary { internal GlyphIndexer(GlyphAccessor accessor, ushort numberOfGlyphs) { _accessor = accessor; _numberOfGlyphs = numberOfGlyphs; } #region IDictionary Members public void Add(ushort key, double value) { throw new NotSupportedException(); } public bool ContainsKey(ushort key) { return (key < _numberOfGlyphs); } public ICollection Keys { get { return new SequentialUshortCollection(_numberOfGlyphs); } } public bool Remove(ushort key) { throw new NotSupportedException(); } public bool TryGetValue(ushort key, out double value) { if (ContainsKey(key)) { value = this[key]; return true; } else { value = new double(); return false; } } public ICollection Values { get { return new ValueCollection(this); } } public double this[ushort key] { get { return _accessor(key); } set { throw new NotSupportedException(); } } #endregion #region ICollection> Members public void Add(KeyValuePair item) { throw new NotSupportedException(); } public void Clear() { throw new NotSupportedException(); } public bool Contains(KeyValuePair item) { return ContainsKey(item.Key); } public void CopyTo(KeyValuePair[] array, int arrayIndex) { if (array == null) { throw new ArgumentNullException("array"); } if (array.Rank != 1) { throw new ArgumentException(SR.Get(SRID.Collection_BadRank)); } // The extra "arrayIndex >= array.Length" check in because even if _collection.Count // is 0 the index is not allowed to be equal or greater than the length // (from the MSDN ICollection docs) if (arrayIndex < 0 || arrayIndex >= array.Length || (arrayIndex + Count) > array.Length) { throw new ArgumentOutOfRangeException("arrayIndex"); } for (ushort i = 0; i < Count; ++i) array[arrayIndex + i] = new KeyValuePair(i, this[i]); } public int Count { get { return _numberOfGlyphs; } } public bool IsReadOnly { get { return true; } } public bool Remove(KeyValuePair item) { throw new NotSupportedException(); } #endregion #region IEnumerable> Members public IEnumerator> GetEnumerator() { for (ushort i = 0; i < Count; ++i) yield return new KeyValuePair(i, this[i]); } #endregion #region IEnumerable Members IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable>)this).GetEnumerator(); } #endregion private class ValueCollection : ICollection { public ValueCollection(GlyphIndexer glyphIndexer) { _glyphIndexer = glyphIndexer; } #region ICollection Members public void Add(double item) { throw new NotSupportedException(); } public void Clear() { throw new NotSupportedException(); } public bool Contains(double item) { foreach (double d in this) { if (d == item) return true; } return false; } public void CopyTo(double[] array, int arrayIndex) { if (array == null) { throw new ArgumentNullException("array"); } if (array.Rank != 1) { throw new ArgumentException(SR.Get(SRID.Collection_BadRank)); } // The extra "arrayIndex >= array.Length" check in because even if _collection.Count // is 0 the index is not allowed to be equal or greater than the length // (from the MSDN ICollection docs) if (arrayIndex < 0 || arrayIndex >= array.Length || (arrayIndex + Count) > array.Length) { throw new ArgumentOutOfRangeException("arrayIndex"); } for (ushort i = 0; i < Count; ++i) array[arrayIndex + i] = _glyphIndexer[i]; } public int Count { get { return _glyphIndexer._numberOfGlyphs; } } public bool IsReadOnly { get { return true; } } public bool Remove(double item) { throw new NotSupportedException(); } #endregion #region IEnumerable Members public IEnumerator GetEnumerator() { for (ushort i = 0; i < Count; ++i) yield return _glyphIndexer[i]; } #endregion #region IEnumerable Members IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } #endregion private GlyphIndexer _glyphIndexer; } private GlyphAccessor _accessor; private ushort _numberOfGlyphs; } #endregion Private Nested Classes //------------------------------------------------------ // // Private Fields // //----------------------------------------------------- #region Private Fields private FontFaceLayoutInfo _fontFace; private StyleSimulations _styleSimulations; /// /// The Uri that was passed in to constructor. /// /// /// This is critical as we do a demand based on this value public functions. /// Only setting this Uri is critical, getting is fine. Hence using the /// SecurityCriticalDataForSet object. Note that the object itself does not /// need to be Critical, it's just setting it that makes it Critical. /// private SecurityCriticalDataClass _originalUri; /// /// Critical - as this object controls the Demand that'll be made before accessssing the /// security sensitive contents of the font file. This also only Critical /// for set. This should be correctly whenever _originalUri is set. /// /// Caching object for perf reasons. /// private SecurityCriticalDataForSet _fileIOPermObj; private const double CFFConversionFactor = 1.0 / 65536.0; private InitializationState _initializationState; /// /// Initialization states of GlyphTypeface object. /// private enum InitializationState { /// /// The state in which the GlyphTypeface has not been initialized. /// At this state, all operations on the object would cause InvalidOperationException. /// The object can only transit to 'IsInitializing' state with BeginInit() call. /// Uninitialized, /// /// The state in which the GlyphTypeface is being initialized. At this state, user can /// set values into the required properties. The object can only transit to 'IsInitialized' state /// with EndInit() call. /// IsInitializing, /// /// The state in which the GlyphTypeface object is fully initialized. At this state the object /// is fully functional. There is no valid transition out of the state. /// IsInitialized, } #endregion Private Fields #endif } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XImageFormat.cs0000644000175000001440000001223611435766646023365 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Drawing { /// /// Specifies the format of the image. /// public sealed class XImageFormat { Guid guid; XImageFormat(Guid guid) { this.guid = guid; } internal Guid Guid { get { return this.guid; } } /// /// Determines whether the specified object is equal to the current object. /// public override bool Equals(object obj) { XImageFormat format = obj as XImageFormat; if (format == null) return false; return this.guid == format.guid; } /// /// Returns the hash code for this instance. /// public override int GetHashCode() { return this.guid.GetHashCode(); } /// /// Gets the Portable Network Graphics (PNG) image format. /// public static XImageFormat Png { get { return XImageFormat.png; } } /// /// Gets the Graphics Interchange Format (GIF) image format. /// public static XImageFormat Gif { get { return XImageFormat.gif; } } /// /// Gets the Joint Photographic Experts Group (JPEG) image format. /// public static XImageFormat Jpeg { get { return XImageFormat.jpeg; } } /// /// Gets the Tag Image File Format (TIFF) image format. /// public static XImageFormat Tiff { get { return XImageFormat.tiff; } } /// /// Gets the Portable Document Format (PDF) image format /// public static XImageFormat Pdf { get { return XImageFormat.pdf; } } /// /// Gets the Windows icon image format. /// public static XImageFormat Icon { get { return XImageFormat.icon; } } static XImageFormat() { //ImageFormat.memoryBMP = new ImageFormat(new Guid("{b96b3caa-0728-11d3-9d7b-0000f81ef32e}")); //ImageFormat.bmp = new ImageFormat(new Guid("{b96b3cab-0728-11d3-9d7b-0000f81ef32e}")); //ImageFormat.emf = new ImageFormat(new Guid("{b96b3cac-0728-11d3-9d7b-0000f81ef32e}")); //ImageFormat.wmf = new ImageFormat(new Guid("{b96b3cad-0728-11d3-9d7b-0000f81ef32e}")); //ImageFormat.jpeg = new ImageFormat(new Guid("{b96b3cae-0728-11d3-9d7b-0000f81ef32e}")); //ImageFormat.png = new ImageFormat(new Guid("{b96b3caf-0728-11d3-9d7b-0000f81ef32e}")); //ImageFormat.gif = new ImageFormat(new Guid("{b96b3cb0-0728-11d3-9d7b-0000f81ef32e}")); //ImageFormat.tiff = new ImageFormat(new Guid("{b96b3cb1-0728-11d3-9d7b-0000f81ef32e}")); //ImageFormat.exif = new ImageFormat(new Guid("{b96b3cb2-0728-11d3-9d7b-0000f81ef32e}")); //ImageFormat.photoCD = new ImageFormat(new Guid("{b96b3cb3-0728-11d3-9d7b-0000f81ef32e}")); //ImageFormat.flashPIX = new ImageFormat(new Guid("{b96b3cb4-0728-11d3-9d7b-0000f81ef32e}")); //ImageFormat.icon = new ImageFormat(new Guid("{b96b3cb5-0728-11d3-9d7b-0000f81ef32e}")); } private static XImageFormat png = new XImageFormat(new Guid("{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}")); private static XImageFormat gif = new XImageFormat(new Guid("{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}")); private static XImageFormat jpeg = new XImageFormat(new Guid("{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}")); private static XImageFormat tiff = new XImageFormat(new Guid("{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}")); private static XImageFormat icon = new XImageFormat(new Guid("{B96B3CB5-0728-11D3-9D7B-0000F81EF32E}")); // not GDI+ conform private static XImageFormat pdf = new XImageFormat(new Guid("{84570158-DBF0-4C6B-8368-62D6A3CA76E0}")); } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XBrush.cs0000644000175000001440000000531411435766646022254 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Internal; namespace PdfSharp.Drawing { /// /// Classes derived from this abstract base class define objects used to fill the /// interiors of paths. /// public abstract class XBrush { #if GDI internal abstract System.Drawing. Brush RealizeGdiBrush(); #if UseGdiObjects /// /// Converts from a System.Drawing.Brush. /// public static implicit operator XBrush(Brush brush) { XBrush xbrush; SolidBrush solidBrush; LinearGradientBrush lgBrush; if ((solidBrush = brush as SolidBrush) != null) { xbrush = new XSolidBrush(solidBrush.Color); } else if ((lgBrush = brush as LinearGradientBrush) != null) { // TODO: xbrush = new LinearGradientBrush(lgBrush.Rectangle, lgBrush.co(solidBrush.Color); throw new NotImplementedException("Brush type not yet supported by PDFsharp."); } else { throw new NotImplementedException("Brush type not supported by PDFsharp."); } return xbrush; } #endif #endif #if WPF internal abstract System.Windows.Media. Brush RealizeWpfBrush(); #endif } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XTypeFace.cs0000644000175000001440000006213311435766646022673 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.ComponentModel; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Internal; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; namespace PdfSharp.Drawing { /// /// Temporary hack to implement PrivateFontCollection. /// class XTypefaceHack { public XTypefaceHack(string typefaceName) : this(typefaceName, XFontStyle.Regular, XFontWeights.Normal, new XFontStretch()) { } public XTypefaceHack(string typefaceName, XFontStyle style, XFontWeight weight) : this(typefaceName, style, weight, new XFontStretch()) { } public XTypefaceHack(string fontFamilyName, XFontStyle style, XFontWeight weight, XFontStretch stretch) { if (String.IsNullOrEmpty(fontFamilyName)) throw new ArgumentNullException("fontFamilyName"); this.fontFamilyName = fontFamilyName; this.style = style; this.weight = weight; this.stretch = stretch; } public string FontFamilyName { get { return this.fontFamilyName; } } string fontFamilyName; public XFontWeight Weight { get { return this.weight; } } private XFontWeight weight; public XFontStyle Style { get { return this.style; } } private XFontStyle style; public XFontStretch Stretch { get { return this.stretch; } } private XFontStretch stretch; } /// /// NYI /// internal class XTypeface { // /// // /// Construct a typeface // /// // /// font typeface name // public Typeface( // string typefaceName // ) // // assume face name is family name until we get face name resolved properly. // : this( // new FontFamily(typefaceName), // FontStyles.Normal, // FontWeights.Normal, // FontStretches.Normal // ) // { } // /// // /// Construct a typeface // /// // /// Font family // /// Font style // /// Boldness of font // /// Width of characters // public Typeface( // FontFamily fontFamily, // FontStyle style, // FontWeight weight, // FontStretch stretch // ) // : this( // fontFamily, // style, // weight, // stretch, // FontFamily.FontFamilyGlobalUI // ) // { } // /// // /// Construct a typeface // /// // /// Font family // /// Font style // /// Boldness of font // /// Width of characters // /// fallback font family // public Typeface( // FontFamily fontFamily, // FontStyle style, // FontWeight weight, // FontStretch stretch, // FontFamily fallbackFontFamily // ) // { // if (fontFamily == null) // { // throw new ArgumentNullException("fontFamily"); // } // _fontFamily = fontFamily; // _style = style; // _weight = weight; // _stretch = stretch; // _fallbackFontFamily = fallbackFontFamily; // } // private FontFamily _fontFamily; // // these _style, _weight and _stretch are only used for storing what was passed into the constructor. // // Since FontFamily may change these values when it includes a style name implicitly, // private FontStyle _style; // private FontWeight _weight; // private FontStretch _stretch; // /// // /// Font family // /// // public FontFamily FontFamily // { // get { return _fontFamily; } // } // /// // /// Font weight (light, bold, etc.) // /// // public FontWeight Weight // { // get { return _weight; } // } // /// // /// Font style (italic, oblique) // /// // public FontStyle Style // { // get { return _style; } // } // /// // /// Font Stretch (narrow, wide, etc.) // /// // public FontStretch Stretch // { // get { return _stretch; } // } // private FontFamily _fallbackFontFamily; // // Cached canonical values of the typeface. // private CachedTypeface _cachedTypeface; // /// // /// Returns true if FontStyle.Oblique is algorithmically simulated by // /// slanting glyphs. Returns false otherwise. // /// // public bool IsObliqueSimulated // { // get // { // return (CachedTypeface.TypefaceMetrics.StyleSimulations & StyleSimulations.ItalicSimulation) != 0; // } // } // /// // /// Returns true if FontStyle.Bold is algorithmically simulated by // /// thickening glyphs. Returns false otherwise. // /// // public bool IsBoldSimulated // { // get // { // return (CachedTypeface.TypefaceMetrics.StyleSimulations & StyleSimulations.BoldSimulation) != 0; // } // } // /// // /// Obtain a glyph typeface that corresponds to the Typeface object constructed from an OpenType font family. // /// If the Typeface was constructed from a composite font family, returns null. // /// // /// GlyphTypeface object that corresponds to this Typeface, or null if the Typeface // /// was constructed from a composite font. // /// Whether glyphTypeface is not null. // public bool TryGetGlyphTypeface(out GlyphTypeface glyphTypeface) // { // glyphTypeface = CachedTypeface.TypefaceMetrics as GlyphTypeface; // return glyphTypeface != null; // } // /// // /// Fallback font family // /// // internal FontFamily FallbackFontFamily // { // get { return _fallbackFontFamily; } // } // /// // /// (Western) x-height relative to em size. // /// // public double XHeight // { // get // { // return CachedTypeface.TypefaceMetrics.XHeight; // } // } // /// // /// Distance from baseline to top of English capital, relative to em size. // /// // public double CapsHeight // { // get // { // return CachedTypeface.TypefaceMetrics.CapsHeight; // } // } // /// // /// Distance from baseline to underline position // /// // public double UnderlinePosition // { // get // { // return CachedTypeface.TypefaceMetrics.UnderlinePosition; // } // } // /// // /// Underline thickness // /// // public double UnderlineThickness // { // get // { // return CachedTypeface.TypefaceMetrics.UnderlineThickness; // } // } // /// // /// Distance from baseline to strike-through position // /// // public double StrikethroughPosition // { // get // { // return CachedTypeface.TypefaceMetrics.StrikethroughPosition; // } // } // /// // /// strike-through thickness // /// // public double StrikethroughThickness // { // get // { // return CachedTypeface.TypefaceMetrics.StrikethroughThickness; // } // } // /// // /// Collection of culture-dependant face names. // /// // public LanguageSpecificStringDictionary FaceNames // { // get // { // return new LanguageSpecificStringDictionary(CachedTypeface.TypefaceMetrics.AdjustedFaceNames); // } // } // /// // /// Distance from character cell top to English baseline relative to em size. // /// // internal double Baseline // { // get // { // return CachedTypeface.FirstFontFamily.Baseline; // } // } // /// // /// Baseline to baseline distance relative to em size // /// // internal double LineSpacing // { // get // { // return CachedTypeface.FirstFontFamily.LineSpacing; // } // } // /// // /// Flag indicating if the typeface is of symbol type // /// // internal bool Symbol // { // get // { // return CachedTypeface.TypefaceMetrics.Symbol; // } // } // internal bool NullFont // { // get // { // return CachedTypeface.NullFont; // } // } // // Tries to get a GlyphTypeface based on the Typeface properties. The // // return value can be null. However, if CheckFastPathNominalGlyphs // // returns true, then one can expect this function to return a valid // // GlyphTypeface that maps all the specified text. // internal GlyphTypeface TryGetGlyphTypeface() // { // return CachedTypeface.TypefaceMetrics as GlyphTypeface; // } // internal FontStyle CanonicalStyle // { // get // { // return CachedTypeface.CanonicalStyle; // } // } // internal FontWeight CanonicalWeight // { // get // { // return CachedTypeface.CanonicalWeight; // } // } // internal FontStretch CanonicalStretch // { // get // { // return CachedTypeface.CanonicalStretch; // } // } // /// // /// Scan through specified character string checking for valid character // /// nominal glyph. // /// // /// character buffer range // /// height of Em // /// maximum width allowed // /// do not stop arbitrarily in the middle of a word // /// digits require complex shaping // /// CultureInfo of the text // /// number of character fit in given width // /// whether the specified string can be optimized by nominal glyph lookup // internal bool CheckFastPathNominalGlyphs( // CharacterBufferRange charBufferRange, // double emSize, // double widthMax, // bool keepAWord, // bool numberSubstitution, // CultureInfo cultureInfo, // out int stringLengthFit // ) // { // stringLengthFit = 0; // if (CachedTypeface.NullFont) return false; // GlyphTypeface glyphTypeface = TryGetGlyphTypeface(); // if (glyphTypeface == null) return false; // stringLengthFit = 0; // IDictionary cmap = glyphTypeface.CharacterToGlyphMap; // double totalWidth = 0; // int i = 0; // ushort blankGlyph = glyphTypeface.BlankGlyphIndex; // ushort glyph = blankGlyph; // ushort charFlagsMask = numberSubstitution ? // (ushort)(CharacterAttributeFlags.CharacterComplex | CharacterAttributeFlags.CharacterDigit) : // (ushort)CharacterAttributeFlags.CharacterComplex; // ushort charFlags = 0; // ushort charFastTextCheck = (ushort)(CharacterAttributeFlags.CharacterFastText | CharacterAttributeFlags.CharacterIdeo); // bool symbolTypeface = glyphTypeface.Symbol; // if (symbolTypeface) // { // // we don't care what code points are present if it's a non-Unicode font such as Symbol or Wingdings; // // the code points don't have any standardized meanings, and we always want to bypass shaping // charFlagsMask = 0; // } // if (keepAWord) // { // do // { // char ch = charBufferRange[i++]; // int charClass = (int)Classification.GetUnicodeClassUTF16(ch); // charFlags = Classification.CharAttributeOf(charClass).Flags; // charFastTextCheck &= charFlags; // cmap.TryGetValue(ch, out glyph); // totalWidth += emSize * glyphTypeface.GetAdvanceWidth(glyph); // } while ( // i < charBufferRange.Length // && ((charFlags & charFlagsMask) == 0) // && (glyph != 0 || symbolTypeface) // && glyph != blankGlyph // ); // // i is now at a character immediately following a leading blank // } // while ( // i < charBufferRange.Length // && totalWidth <= widthMax // && ((charFlags & charFlagsMask) == 0) // && (glyph != 0 || symbolTypeface) // ) // { // char ch = charBufferRange[i++]; // int charClass = (int)Classification.GetUnicodeClassUTF16(ch); // charFlags = Classification.CharAttributeOf(charClass).Flags; // charFastTextCheck &= charFlags; // cmap.TryGetValue(ch, out glyph); // totalWidth += emSize * glyphTypeface.GetAdvanceWidth(glyph); // } // if (symbolTypeface) // { // // always optimize for non-Unicode font as we don't support shaping or typographic features; // // we also don't fall back from non-Unicode fonts so we don't care if there are missing glyphs // stringLengthFit = i; // return true; // } // if (glyph == 0) // { // // character is not supported by the font // return false; // } // if ((charFlags & charFlagsMask) != 0) // { // // complex character encountered, exclude it // Debug.Assert(i > 0); // if (--i <= 0) // { // // first char is complex, fail the call // return false; // } // } // stringLengthFit = i; // TypographyAvailabilities typography = glyphTypeface.FontFaceLayoutInfo.TypographyAvailabilities; // if ((charFastTextCheck & (byte)CharacterAttributeFlags.CharacterFastText) != 0) // { // // all input code points are Fast Text // if ((typography & // (TypographyAvailabilities.FastTextTypographyAvailable // | TypographyAvailabilities.FastTextMajorLanguageLocalizedFormAvailable // ) // ) != 0 // ) // { // // Considered too risky to optimize. It is either because the font // // has required features or the font has 'locl' lookup for major languages. // return false; // } // else if ((typography & TypographyAvailabilities.FastTextExtraLanguageLocalizedFormAvailable) != 0) // { // // The font has 'locl' lookup for FastText code points for non major languages. // // Check whether the input is major langauge. If it is, we are still good to optimize. // return MajorLanguages.Contains(cultureInfo); // } // else // { // // No FastText flags are present, safe to optimize // return true; // } // } // else if ((charFastTextCheck & (byte)CharacterAttributeFlags.CharacterIdeo) != 0) // { // // The input are all ideographs, check the IdeoTypographyAvailable bit. It is safe if // // the bit is not set. // return ((typography & TypographyAvailabilities.IdeoTypographyAvailable) == 0); // } // else // { // // for all the rest of the cases, just check whether there is any required typography // // present at all. If none exists, it is optimizable. We might under-optimize here but // // it will be non-major languages. // return ((typography & TypographyAvailabilities.Available) == 0); // } // } // /// // /// Lookup characters nominal glyphs and width // /// // /// character buffer range // /// height of Em // /// scaling factor from real to ideal unit // /// glyph nominal advances in ideal units // /// total width in ideal units // /// true for success // /// This function is only used in fast path, and can only be called // /// if CheckFastPathNominalGlyphs has previously returned true. // internal void GetCharacterNominalWidthsAndIdealWidth( // CharacterBufferRange charBufferRange, // double emSize, // double toIdeal, // out int[] nominalWidths, // out int idealWidth // ) // { // // This function should only be called if CheckFastPathNominalGlyphs has // // returned true so we can assume the ITypefaceMetrics is a GlyphTypeface. // GlyphTypeface glyphTypeface = TryGetGlyphTypeface(); // Invariant.Assert(glyphTypeface != null); // IDictionary cmap = glyphTypeface.CharacterToGlyphMap; // nominalWidths = new int[charBufferRange.Length]; // idealWidth = 0; // for (int i = 0; i < charBufferRange.Length; i++) // { // ushort glyphIndex; // cmap.TryGetValue(charBufferRange[i], out glyphIndex); // double advance = emSize * glyphTypeface.GetAdvanceWidth(glyphIndex); // nominalWidths[i] = (int)Math.Round(advance * toIdeal); // idealWidth += nominalWidths[i]; // } // } // /// // /// Create correspondent hash code for the object // /// // /// object hash code // public override int GetHashCode() // { // int hash = _fontFamily.GetHashCode(); // if (_fallbackFontFamily != null) // hash = HashFn.HashMultiply(hash) + _fallbackFontFamily.GetHashCode(); // hash = HashFn.HashMultiply(hash) + _style.GetHashCode(); // hash = HashFn.HashMultiply(hash) + _weight.GetHashCode(); // hash = HashFn.HashMultiply(hash) + _stretch.GetHashCode(); // return HashFn.HashScramble(hash); // } // /// // /// Equality check // /// // public override bool Equals(object o) // { // Typeface t = o as Typeface; // if (t == null) // return false; // return _style == t._style // && _weight == t._weight // && _stretch == t._stretch // && _fontFamily.Equals(t._fontFamily) // && CompareFallbackFontFamily(t._fallbackFontFamily); // } // internal bool CompareFallbackFontFamily(FontFamily fallbackFontFamily) // { // if (fallbackFontFamily == null || _fallbackFontFamily == null) // return fallbackFontFamily == _fallbackFontFamily; // return _fallbackFontFamily.Equals(fallbackFontFamily); // } // //---------------------------------------- // // Private method // //---------------------------------------- // private CachedTypeface CachedTypeface // { // get // { // if (_cachedTypeface == null) // { // CachedTypeface cachedTypeface = TypefaceMetricsCache.ReadonlyLookup(this) as CachedTypeface; // if (cachedTypeface == null) // { // cachedTypeface = ConstructCachedTypeface(); // TypefaceMetricsCache.Add(this, cachedTypeface); // } // // For thread-safety, set the _cachedTypeface field only after we have a fully // // initialized CachedTypeface object. // _cachedTypeface = cachedTypeface; // } // return _cachedTypeface; // } // } // private CachedTypeface ConstructCachedTypeface() // { // FontStyle canonicalStyle = _style; // FontWeight canonicalWeight = _weight; // FontStretch canonicalStretch = _stretch; // // // // We always call FontFamily.FindFirstFontFamilyAndFace() method to resolve the // // canonical styles since the implied styles in FontFamily name will override // // the given styles in the Typeface. But we don't always use the IFontFamily // // instance returned from this method because an equal instance might already be // // cached. // // // FontFamily sourceFontFamily = FontFamily; // IFontFamily firstFontFamily = sourceFontFamily.FindFirstFontFamilyAndFace( // ref canonicalStyle, // ref canonicalWeight, // ref canonicalStretch // ); // if (firstFontFamily == null) // { // if (FallbackFontFamily != null) // { // sourceFontFamily = FallbackFontFamily; // firstFontFamily = sourceFontFamily.FindFirstFontFamilyAndFace( // ref canonicalStyle, // ref canonicalWeight, // ref canonicalStretch // ); // } // if (firstFontFamily == null) // { // sourceFontFamily = null; // firstFontFamily = FontFamily.LookupFontFamily(FontFamily.NullFontFamilyCanonicalName); // } // } // // If it's a named font, map all occurrences of the same name to one cached IFontFamily. // if (sourceFontFamily != null && sourceFontFamily.Source != null) // { // // We lookup in the cache to see if there is cached IFontFamily instance of the source FontFamily. Otherwise, // // this IFontFamily value is added to the TypefaceMetrics cache. // IFontFamily cachedValue = TypefaceMetricsCache.ReadonlyLookup(sourceFontFamily.FamilyIdentifier) as IFontFamily; // if (cachedValue != null) // { // firstFontFamily = cachedValue; // } // else // { // TypefaceMetricsCache.Add(sourceFontFamily.FamilyIdentifier, firstFontFamily); // } // } // ITypefaceMetrics typefaceMetrics = firstFontFamily.GetTypefaceMetrics(canonicalStyle, canonicalWeight, canonicalStretch); // return new CachedTypeface( // canonicalStyle, // canonicalWeight, // canonicalStretch, // firstFontFamily, // typefaceMetrics, // sourceFontFamily == null // ); // } //} } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XPdfForm.cs0000644000175000001440000003260311435766646022527 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.ComponentModel; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Internal; using PdfSharp.Drawing.Pdf; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Filters; using PdfSharp.Pdf.Internal; namespace PdfSharp.Drawing { /// /// Represents a so called 'PDF form external object', which is typically an imported page of an external /// PDF document. XPdfForm objects are used like images to draw an existing PDF page of an external /// document in the current document. XPdfForm objects can only be placed in PDF documents. If you try /// to draw them using a XGraphics based on an GDI+ context no action is taken if no placeholder image /// is specified. Otherwise the place holder is drawn. /// public class XPdfForm : XForm { /// /// Initializes a new instance of the XPdfForm class from the specified path to an external PDF document. /// Although PDFsharp internally caches XPdfForm objects it is recommended to reuse XPdfForm objects /// in your code and change the PageNumber property if more than one page is needed form the external /// document. Furthermore, because XPdfForm can occupy very much memory, it is recommended to /// dispose XPdfForm objects if not needed anymore. /// internal XPdfForm(string path) { int pageNumber; path = ExtractPageNumber(path, out pageNumber); path = Path.GetFullPath(path); if (!File.Exists(path)) throw new FileNotFoundException(PSSR.FileNotFound(path)); if (PdfReader.TestPdfFile(path) == 0) throw new ArgumentException("The specified file has no valid PDF file header.", "path"); this.path = path; if (pageNumber != 0) PageNumber = pageNumber; } /// /// Initializes a new instance of the class from a stream. /// /// The stream. internal XPdfForm(Stream stream) { // Create a dummy unique path this.path = "*" + Guid.NewGuid().ToString("B"); if (PdfReader.TestPdfFile(stream) == 0) throw new ArgumentException("The specified stream has no valid PDF file header.", "stream"); this.externalDocument = PdfReader.Open(stream); } /// /// Creates an XPdfForm from a file. /// public static new XPdfForm FromFile(string path) { // TODO: Same file should return same object (that's why the function is static). return new XPdfForm(path); } /// /// Creates an XPdfForm from a stream. /// public static XPdfForm FromStream(Stream stream) { return new XPdfForm(stream); } /* void Initialize() { // ImageFormat has no overridden Equals... } */ /// /// Sets the form in the state FormState.Finished. /// internal override void Finish() { if (this.formState == FormState.NotATemplate || this.formState == FormState.Finished) return; base.Finish(); //if (this.gfx.metafile != null) // this.image = this.gfx.metafile; //Debug.Assert(this.fromState == FormState.Created || this.fromState == FormState.UnderConstruction); //this.fromState = FormState.Finished; //this.gfx.Dispose(); //this.gfx = null; //if (this.pdfRenderer != null) //{ // this.pdfForm.Stream = new PdfDictionary.PdfStream(PdfEncoders.RawEncoding.GetBytes(this.pdfRenderer.GetContent()), this.pdfForm); // if (this.document.Options.CompressContentStreams) // { // this.pdfForm.Stream.Value = Filtering.FlateDecode.Encode(this.pdfForm.Stream.Value); // this.pdfForm.Elements["/Filter"] = new PdfName("/FlateDecode"); // } // int length = this.pdfForm.Stream.Length; // this.pdfForm.Elements.SetInteger("/Length", length); //} } /// /// Frees the memory occupied by the underlying imported PDF document, even if other XPdfForm objects /// refer to this document. A reuse of this object doesn't fail, because the underlying PDF document /// is re-imported if necessary. /// // TODO: NYI: Dispose protected override void Dispose(bool disposing) { if (!this.disposed) { this.disposed = true; try { if (disposing) { //... } if (this.externalDocument != null) PdfDocument.Tls.DetachDocument(this.externalDocument.Handle); //... } finally { base.Dispose(disposing); } } } bool disposed; /// /// Gets or sets an image that is used for drawing if the current XGraphics object cannot handle /// PDF forms. A place holder is useful for showing a preview of a page on the display, because /// PDFsharp cannot render native PDF objects. /// public XImage PlaceHolder { get { return this.placeHolder; } set { this.placeHolder = value; } } XImage placeHolder; /// /// Gets the underlying PdfPage (if one exists). /// public PdfPage Page { get { if (IsTemplate) return null; PdfPage page = ExternalDocument.Pages[this.pageNumber - 1]; return page; } } /// /// Gets the number of pages in the PDF form. /// public int PageCount { get { if (IsTemplate) return 1; if (this.pageCount == -1) this.pageCount = ExternalDocument.Pages.Count; return this.pageCount; } } int pageCount = -1; /// /// Gets the width in point of the page identified by the property PageNumber. /// [Obsolete("Use either PixelWidth or PointWidth. Temporarily obsolete because of rearrangements for WPF.")] public override double Width { get { PdfPage page = ExternalDocument.Pages[this.pageNumber - 1]; return page.Width; } } /// /// Gets the height in point of the page identified by the property PageNumber. /// [Obsolete("Use either PixelHeight or PointHeight. Temporarily obsolete because of rearrangements for WPF.")] public override double Height { get { PdfPage page = ExternalDocument.Pages[this.pageNumber - 1]; return page.Height; } } /// /// Gets the width in point of the page identified by the property PageNumber. /// public override double PointWidth { get { PdfPage page = ExternalDocument.Pages[this.pageNumber - 1]; return page.Width; } } /// /// Gets the height in point of the page identified by the property PageNumber. /// public override double PointHeight { get { PdfPage page = ExternalDocument.Pages[this.pageNumber - 1]; return page.Height; } } /// /// Gets the width in point of the page identified by the property PageNumber. /// public override int PixelWidth { get { //PdfPage page = ExternalDocument.Pages[this.pageNumber - 1]; //return (int)page.Width; return DoubleUtil.DoubleToInt(PointWidth); } } /// /// Gets the height in point of the page identified by the property PageNumber. /// public override int PixelHeight { get { //PdfPage page = ExternalDocument.Pages[this.pageNumber - 1]; //return (int)page.Height; return DoubleUtil.DoubleToInt(PointHeight); } } /// /// Get the size of the page identified by the property PageNumber. /// public override XSize Size { get { PdfPage page = ExternalDocument.Pages[this.pageNumber - 1]; return new XSize(page.Width, page.Height); } } /// /// Gets or sets the transformation matrix. /// public override XMatrix Transform { get { return this.transform; } set { if (this.transform != value) { // discard PdfFromXObject when Transform changed this.pdfForm = null; this.transform = value; } } } /// /// Gets or sets the page number in the external PDF document this object refers to. The page number /// is one-based, i.e. it is in the range from 1 to PageCount. The default value is 1. /// public int PageNumber { get { return this.pageNumber; } set { if (IsTemplate) throw new InvalidOperationException("The page number of an XPdfForm template cannot be modified."); if (this.pageNumber != value) { this.pageNumber = value; // dispose PdfFromXObject when number has changed this.pdfForm = null; } } } int pageNumber = 1; /// /// Gets or sets the page index in the external PDF document this object refers to. The page index /// is zero-based, i.e. it is in the range from 0 to PageCount - 1. The default value is 0. /// public int PageIndex { get { return PageNumber - 1; } set { PageNumber = value + 1; } } /// /// Gets the underlying document from which pages are imported. /// internal PdfDocument ExternalDocument { // The problem is that you can ask an XPdfForm about the number of its pages before it was // drawn the first time. At this moment the XPdfForm doesn't know the document where it will // be later draw on one of its pages. To prevent the import of the same document more than // once, all imported documents of a thread are cached. The cache is local to the current // thread and not to the appdomain, because I won't get problems in a multi-thread environment // that I don't understand. get { if (IsTemplate) throw new InvalidOperationException("This XPdfForm is a template and not an imported PDF page; therefore it has no external document."); if (this.externalDocument == null) this.externalDocument = PdfDocument.Tls.GetDocument(path); return this.externalDocument; } } internal PdfDocument externalDocument; /// /// Extracts the page number if the path has the form 'MyFile.pdf#123' and returns /// the actual path without the number sign and the following digits. /// public static string ExtractPageNumber(string path, out int pageNumber) { if (path == null) throw new ArgumentNullException("path"); pageNumber = 0; int length = path.Length; if (length != 0) { length--; if (Char.IsDigit(path, length)) { while (Char.IsDigit(path, length) && length >= 0) length--; if (length > 0 && path[length] == '#') { // must have at least one dot left of colon to distinguish from e.g. '#123' if (path.IndexOf('.') != -1) { pageNumber = Int32.Parse(path.Substring(length + 1)); path = path.Substring(0, length); } } } } return path; } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XColors.cs0000644000175000001440000005250311435766646022434 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.ComponentModel; using System.Threading; #if GDI using System.Drawing; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Internal; namespace PdfSharp.Drawing { /// /// Represents a set of 141 pre-defined RGB colors. Incidentally the values are the same /// as in System.Drawing.Color. /// public static class XColors { ///Gets a predefined color. public static XColor AliceBlue { get { return new XColor(XKnownColor.AliceBlue); } } ///Gets a predefined color. public static XColor AntiqueWhite { get { return new XColor(XKnownColor.AntiqueWhite); } } ///Gets a predefined color. public static XColor Aqua { get { return new XColor(XKnownColor.Aqua); } } ///Gets a predefined color. public static XColor Aquamarine { get { return new XColor(XKnownColor.Aquamarine); } } ///Gets a predefined color. public static XColor Azure { get { return new XColor(XKnownColor.Azure); } } ///Gets a predefined color. public static XColor Beige { get { return new XColor(XKnownColor.Beige); } } ///Gets a predefined color. public static XColor Bisque { get { return new XColor(XKnownColor.Bisque); } } ///Gets a predefined color. public static XColor Black { get { return new XColor(XKnownColor.Black); } } ///Gets a predefined color. public static XColor BlanchedAlmond { get { return new XColor(XKnownColor.BlanchedAlmond); } } ///Gets a predefined color. public static XColor Blue { get { return new XColor(XKnownColor.Blue); } } ///Gets a predefined color. public static XColor BlueViolet { get { return new XColor(XKnownColor.BlueViolet); } } ///Gets a predefined color. public static XColor Brown { get { return new XColor(XKnownColor.Brown); } } ///Gets a predefined color. public static XColor BurlyWood { get { return new XColor(XKnownColor.BurlyWood); } } ///Gets a predefined color. public static XColor CadetBlue { get { return new XColor(XKnownColor.CadetBlue); } } ///Gets a predefined color. public static XColor Chartreuse { get { return new XColor(XKnownColor.Chartreuse); } } ///Gets a predefined color. public static XColor Chocolate { get { return new XColor(XKnownColor.Chocolate); } } ///Gets a predefined color. public static XColor Coral { get { return new XColor(XKnownColor.Coral); } } ///Gets a predefined color. public static XColor CornflowerBlue { get { return new XColor(XKnownColor.CornflowerBlue); } } ///Gets a predefined color. public static XColor Cornsilk { get { return new XColor(XKnownColor.Cornsilk); } } ///Gets a predefined color. public static XColor Crimson { get { return new XColor(XKnownColor.Crimson); } } ///Gets a predefined color. public static XColor Cyan { get { return new XColor(XKnownColor.Cyan); } } ///Gets a predefined color. public static XColor DarkBlue { get { return new XColor(XKnownColor.DarkBlue); } } ///Gets a predefined color. public static XColor DarkCyan { get { return new XColor(XKnownColor.DarkCyan); } } ///Gets a predefined color. public static XColor DarkGoldenrod { get { return new XColor(XKnownColor.DarkGoldenrod); } } ///Gets a predefined color. public static XColor DarkGray { get { return new XColor(XKnownColor.DarkGray); } } ///Gets a predefined color. public static XColor DarkGreen { get { return new XColor(XKnownColor.DarkGreen); } } ///Gets a predefined color. public static XColor DarkKhaki { get { return new XColor(XKnownColor.DarkKhaki); } } ///Gets a predefined color. public static XColor DarkMagenta { get { return new XColor(XKnownColor.DarkMagenta); } } ///Gets a predefined color. public static XColor DarkOliveGreen { get { return new XColor(XKnownColor.DarkOliveGreen); } } ///Gets a predefined color. public static XColor DarkOrange { get { return new XColor(XKnownColor.DarkOrange); } } ///Gets a predefined color. public static XColor DarkOrchid { get { return new XColor(XKnownColor.DarkOrchid); } } ///Gets a predefined color. public static XColor DarkRed { get { return new XColor(XKnownColor.DarkRed); } } ///Gets a predefined color. public static XColor DarkSalmon { get { return new XColor(XKnownColor.DarkSalmon); } } ///Gets a predefined color. public static XColor DarkSeaGreen { get { return new XColor(XKnownColor.DarkSeaGreen); } } ///Gets a predefined color. public static XColor DarkSlateBlue { get { return new XColor(XKnownColor.DarkSlateBlue); } } ///Gets a predefined color. public static XColor DarkSlateGray { get { return new XColor(XKnownColor.DarkSlateGray); } } ///Gets a predefined color. public static XColor DarkTurquoise { get { return new XColor(XKnownColor.DarkTurquoise); } } ///Gets a predefined color. public static XColor DarkViolet { get { return new XColor(XKnownColor.DarkViolet); } } ///Gets a predefined color. public static XColor DeepPink { get { return new XColor(XKnownColor.DeepPink); } } ///Gets a predefined color. public static XColor DeepSkyBlue { get { return new XColor(XKnownColor.DeepSkyBlue); } } ///Gets a predefined color. public static XColor DimGray { get { return new XColor(XKnownColor.DimGray); } } ///Gets a predefined color. public static XColor DodgerBlue { get { return new XColor(XKnownColor.DodgerBlue); } } ///Gets a predefined color. public static XColor Firebrick { get { return new XColor(XKnownColor.Firebrick); } } ///Gets a predefined color. public static XColor FloralWhite { get { return new XColor(XKnownColor.FloralWhite); } } ///Gets a predefined color. public static XColor ForestGreen { get { return new XColor(XKnownColor.ForestGreen); } } ///Gets a predefined color. public static XColor Fuchsia { get { return new XColor(XKnownColor.Fuchsia); } } ///Gets a predefined color. public static XColor Gainsboro { get { return new XColor(XKnownColor.Gainsboro); } } ///Gets a predefined color. public static XColor GhostWhite { get { return new XColor(XKnownColor.GhostWhite); } } ///Gets a predefined color. public static XColor Gold { get { return new XColor(XKnownColor.Gold); } } ///Gets a predefined color. public static XColor Goldenrod { get { return new XColor(XKnownColor.Goldenrod); } } ///Gets a predefined color. public static XColor Gray { get { return new XColor(XKnownColor.Gray); } } ///Gets a predefined color. public static XColor Green { get { return new XColor(XKnownColor.Green); } } ///Gets a predefined color. public static XColor GreenYellow { get { return new XColor(XKnownColor.GreenYellow); } } ///Gets a predefined color. public static XColor Honeydew { get { return new XColor(XKnownColor.Honeydew); } } ///Gets a predefined color. public static XColor HotPink { get { return new XColor(XKnownColor.HotPink); } } ///Gets a predefined color. public static XColor IndianRed { get { return new XColor(XKnownColor.IndianRed); } } ///Gets a predefined color. public static XColor Indigo { get { return new XColor(XKnownColor.Indigo); } } ///Gets a predefined color. public static XColor Ivory { get { return new XColor(XKnownColor.Ivory); } } ///Gets a predefined color. public static XColor Khaki { get { return new XColor(XKnownColor.Khaki); } } ///Gets a predefined color. public static XColor Lavender { get { return new XColor(XKnownColor.Lavender); } } ///Gets a predefined color. public static XColor LavenderBlush { get { return new XColor(XKnownColor.LavenderBlush); } } ///Gets a predefined color. public static XColor LawnGreen { get { return new XColor(XKnownColor.LawnGreen); } } ///Gets a predefined color. public static XColor LemonChiffon { get { return new XColor(XKnownColor.LemonChiffon); } } ///Gets a predefined color. public static XColor LightBlue { get { return new XColor(XKnownColor.LightBlue); } } ///Gets a predefined color. public static XColor LightCoral { get { return new XColor(XKnownColor.LightCoral); } } ///Gets a predefined color. public static XColor LightCyan { get { return new XColor(XKnownColor.LightCyan); } } ///Gets a predefined color. public static XColor LightGoldenrodYellow { get { return new XColor(XKnownColor.LightGoldenrodYellow); } } ///Gets a predefined color. public static XColor LightGray { get { return new XColor(XKnownColor.LightGray); } } ///Gets a predefined color. public static XColor LightGreen { get { return new XColor(XKnownColor.LightGreen); } } ///Gets a predefined color. public static XColor LightPink { get { return new XColor(XKnownColor.LightPink); } } ///Gets a predefined color. public static XColor LightSalmon { get { return new XColor(XKnownColor.LightSalmon); } } ///Gets a predefined color. public static XColor LightSeaGreen { get { return new XColor(XKnownColor.LightSeaGreen); } } ///Gets a predefined color. public static XColor LightSkyBlue { get { return new XColor(XKnownColor.LightSkyBlue); } } ///Gets a predefined color. public static XColor LightSlateGray { get { return new XColor(XKnownColor.LightSlateGray); } } ///Gets a predefined color. public static XColor LightSteelBlue { get { return new XColor(XKnownColor.LightSteelBlue); } } ///Gets a predefined color. public static XColor LightYellow { get { return new XColor(XKnownColor.LightYellow); } } ///Gets a predefined color. public static XColor Lime { get { return new XColor(XKnownColor.Lime); } } ///Gets a predefined color. public static XColor LimeGreen { get { return new XColor(XKnownColor.LimeGreen); } } ///Gets a predefined color. public static XColor Linen { get { return new XColor(XKnownColor.Linen); } } ///Gets a predefined color. public static XColor Magenta { get { return new XColor(XKnownColor.Magenta); } } ///Gets a predefined color. public static XColor Maroon { get { return new XColor(XKnownColor.Maroon); } } ///Gets a predefined color. public static XColor MediumAquamarine { get { return new XColor(XKnownColor.MediumAquamarine); } } ///Gets a predefined color. public static XColor MediumBlue { get { return new XColor(XKnownColor.MediumBlue); } } ///Gets a predefined color. public static XColor MediumOrchid { get { return new XColor(XKnownColor.MediumOrchid); } } ///Gets a predefined color. public static XColor MediumPurple { get { return new XColor(XKnownColor.MediumPurple); } } ///Gets a predefined color. public static XColor MediumSeaGreen { get { return new XColor(XKnownColor.MediumSeaGreen); } } ///Gets a predefined color. public static XColor MediumSlateBlue { get { return new XColor(XKnownColor.MediumSlateBlue); } } ///Gets a predefined color. public static XColor MediumSpringGreen { get { return new XColor(XKnownColor.MediumSpringGreen); } } ///Gets a predefined color. public static XColor MediumTurquoise { get { return new XColor(XKnownColor.MediumTurquoise); } } ///Gets a predefined color. public static XColor MediumVioletRed { get { return new XColor(XKnownColor.MediumVioletRed); } } ///Gets a predefined color. public static XColor MidnightBlue { get { return new XColor(XKnownColor.MidnightBlue); } } ///Gets a predefined color. public static XColor MintCream { get { return new XColor(XKnownColor.MintCream); } } ///Gets a predefined color. public static XColor MistyRose { get { return new XColor(XKnownColor.MistyRose); } } ///Gets a predefined color. public static XColor Moccasin { get { return new XColor(XKnownColor.Moccasin); } } ///Gets a predefined color. public static XColor NavajoWhite { get { return new XColor(XKnownColor.NavajoWhite); } } ///Gets a predefined color. public static XColor Navy { get { return new XColor(XKnownColor.Navy); } } ///Gets a predefined color. public static XColor OldLace { get { return new XColor(XKnownColor.OldLace); } } ///Gets a predefined color. public static XColor Olive { get { return new XColor(XKnownColor.Olive); } } ///Gets a predefined color. public static XColor OliveDrab { get { return new XColor(XKnownColor.OliveDrab); } } ///Gets a predefined color. public static XColor Orange { get { return new XColor(XKnownColor.Orange); } } ///Gets a predefined color. public static XColor OrangeRed { get { return new XColor(XKnownColor.OrangeRed); } } ///Gets a predefined color. public static XColor Orchid { get { return new XColor(XKnownColor.Orchid); } } ///Gets a predefined color. public static XColor PaleGoldenrod { get { return new XColor(XKnownColor.PaleGoldenrod); } } ///Gets a predefined color. public static XColor PaleGreen { get { return new XColor(XKnownColor.PaleGreen); } } ///Gets a predefined color. public static XColor PaleTurquoise { get { return new XColor(XKnownColor.PaleTurquoise); } } ///Gets a predefined color. public static XColor PaleVioletRed { get { return new XColor(XKnownColor.PaleVioletRed); } } ///Gets a predefined color. public static XColor PapayaWhip { get { return new XColor(XKnownColor.PapayaWhip); } } ///Gets a predefined color. public static XColor PeachPuff { get { return new XColor(XKnownColor.PeachPuff); } } ///Gets a predefined color. public static XColor Peru { get { return new XColor(XKnownColor.Peru); } } ///Gets a predefined color. public static XColor Pink { get { return new XColor(XKnownColor.Pink); } } ///Gets a predefined color. public static XColor Plum { get { return new XColor(XKnownColor.Plum); } } ///Gets a predefined color. public static XColor PowderBlue { get { return new XColor(XKnownColor.PowderBlue); } } ///Gets a predefined color. public static XColor Purple { get { return new XColor(XKnownColor.Purple); } } ///Gets a predefined color. public static XColor Red { get { return new XColor(XKnownColor.Red); } } ///Gets a predefined color. public static XColor RosyBrown { get { return new XColor(XKnownColor.RosyBrown); } } ///Gets a predefined color. public static XColor RoyalBlue { get { return new XColor(XKnownColor.RoyalBlue); } } ///Gets a predefined color. public static XColor SaddleBrown { get { return new XColor(XKnownColor.SaddleBrown); } } ///Gets a predefined color. public static XColor Salmon { get { return new XColor(XKnownColor.Salmon); } } ///Gets a predefined color. public static XColor SandyBrown { get { return new XColor(XKnownColor.SandyBrown); } } ///Gets a predefined color. public static XColor SeaGreen { get { return new XColor(XKnownColor.SeaGreen); } } ///Gets a predefined color. public static XColor SeaShell { get { return new XColor(XKnownColor.SeaShell); } } ///Gets a predefined color. public static XColor Sienna { get { return new XColor(XKnownColor.Sienna); } } ///Gets a predefined color. public static XColor Silver { get { return new XColor(XKnownColor.Silver); } } ///Gets a predefined color. public static XColor SkyBlue { get { return new XColor(XKnownColor.SkyBlue); } } ///Gets a predefined color. public static XColor SlateBlue { get { return new XColor(XKnownColor.SlateBlue); } } ///Gets a predefined color. public static XColor SlateGray { get { return new XColor(XKnownColor.SlateGray); } } ///Gets a predefined color. public static XColor Snow { get { return new XColor(XKnownColor.Snow); } } ///Gets a predefined color. public static XColor SpringGreen { get { return new XColor(XKnownColor.SpringGreen); } } ///Gets a predefined color. public static XColor SteelBlue { get { return new XColor(XKnownColor.SteelBlue); } } ///Gets a predefined color. public static XColor Tan { get { return new XColor(XKnownColor.Tan); } } ///Gets a predefined color. public static XColor Teal { get { return new XColor(XKnownColor.Teal); } } ///Gets a predefined color. public static XColor Thistle { get { return new XColor(XKnownColor.Thistle); } } ///Gets a predefined color. public static XColor Tomato { get { return new XColor(XKnownColor.Tomato); } } ///Gets a predefined color. public static XColor Transparent { get { return new XColor(XKnownColor.Transparent); } } ///Gets a predefined color. public static XColor Turquoise { get { return new XColor(XKnownColor.Turquoise); } } ///Gets a predefined color. public static XColor Violet { get { return new XColor(XKnownColor.Violet); } } ///Gets a predefined color. public static XColor Wheat { get { return new XColor(XKnownColor.Wheat); } } ///Gets a predefined color. public static XColor White { get { return new XColor(XKnownColor.White); } } ///Gets a predefined color. public static XColor WhiteSmoke { get { return new XColor(XKnownColor.WhiteSmoke); } } ///Gets a predefined color. public static XColor Yellow { get { return new XColor(XKnownColor.Yellow); } } ///Gets a predefined color. public static XColor YellowGreen { get { return new XColor(XKnownColor.YellowGreen); } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XPens.cs0000644000175000001440000012670011435766646022101 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Drawing { /// /// Pens for all the pre-defined colors. /// public static class XPens { /// Gets a pre-defined XPen object. public static XPen AliceBlue { get { if (XPens.aliceBlue == null) XPens.aliceBlue = new XPen(XColors.AliceBlue, 1, true); return XPens.aliceBlue; } } /// Gets a pre-defined XPen object. public static XPen AntiqueWhite { get { if (XPens.antiqueWhite == null) XPens.antiqueWhite = new XPen(XColors.AntiqueWhite, 1, true); return XPens.antiqueWhite; } } /// Gets a pre-defined XPen object. public static XPen Aqua { get { if (XPens.aqua == null) XPens.aqua = new XPen(XColors.Aqua, 1, true); return XPens.aqua; } } /// Gets a pre-defined XPen object. public static XPen Aquamarine { get { if (XPens.aquamarine == null) XPens.aquamarine = new XPen(XColors.Aquamarine, 1, true); return XPens.aquamarine; } } /// Gets a pre-defined XPen object. public static XPen Azure { get { if (XPens.azure == null) XPens.azure = new XPen(XColors.Azure, 1, true); return XPens.azure; } } /// Gets a pre-defined XPen object. public static XPen Beige { get { if (XPens.beige == null) XPens.beige = new XPen(XColors.Beige, 1, true); return XPens.beige; } } /// Gets a pre-defined XPen object. public static XPen Bisque { get { if (XPens.bisque == null) XPens.bisque = new XPen(XColors.Bisque, 1, true); return XPens.bisque; } } /// Gets a pre-defined XPen object. public static XPen Black { get { if (XPens.black == null) XPens.black = new XPen(XColors.Black, 1, true); return XPens.black; } } /// Gets a pre-defined XPen object. public static XPen BlanchedAlmond { get { if (XPens.blanchedAlmond == null) XPens.blanchedAlmond = new XPen(XColors.BlanchedAlmond, 1, true); return XPens.blanchedAlmond; } } /// Gets a pre-defined XPen object. public static XPen Blue { get { if (XPens.blue == null) XPens.blue = new XPen(XColors.Blue, 1, true); return XPens.blue; } } /// Gets a pre-defined XPen object. public static XPen BlueViolet { get { if (XPens.blueViolet == null) XPens.blueViolet = new XPen(XColors.BlueViolet, 1, true); return XPens.blueViolet; } } /// Gets a pre-defined XPen object. public static XPen Brown { get { if (XPens.brown == null) XPens.brown = new XPen(XColors.Brown, 1, true); return XPens.brown; } } /// Gets a pre-defined XPen object. public static XPen BurlyWood { get { if (XPens.burlyWood == null) XPens.burlyWood = new XPen(XColors.BurlyWood, 1, true); return XPens.burlyWood; } } /// Gets a pre-defined XPen object. public static XPen CadetBlue { get { if (XPens.cadetBlue == null) XPens.cadetBlue = new XPen(XColors.CadetBlue, 1, true); return XPens.cadetBlue; } } /// Gets a pre-defined XPen object. public static XPen Chartreuse { get { if (XPens.chartreuse == null) XPens.chartreuse = new XPen(XColors.Chartreuse, 1, true); return XPens.chartreuse; } } /// Gets a pre-defined XPen object. public static XPen Chocolate { get { if (XPens.chocolate == null) XPens.chocolate = new XPen(XColors.Chocolate, 1, true); return XPens.chocolate; } } /// Gets a pre-defined XPen object. public static XPen Coral { get { if (XPens.coral == null) XPens.coral = new XPen(XColors.Coral, 1, true); return XPens.coral; } } /// Gets a pre-defined XPen object. public static XPen CornflowerBlue { get { if (XPens.cornflowerBlue == null) XPens.cornflowerBlue = new XPen(XColors.CornflowerBlue, 1, true); return XPens.cornflowerBlue; } } /// Gets a pre-defined XPen object. public static XPen Cornsilk { get { if (XPens.cornsilk == null) XPens.cornsilk = new XPen(XColors.Cornsilk, 1, true); return XPens.cornsilk; } } /// Gets a pre-defined XPen object. public static XPen Crimson { get { if (XPens.crimson == null) XPens.crimson = new XPen(XColors.Crimson, 1, true); return XPens.crimson; } } /// Gets a pre-defined XPen object. public static XPen Cyan { get { if (XPens.cyan == null) XPens.cyan = new XPen(XColors.Cyan, 1, true); return XPens.cyan; } } /// Gets a pre-defined XPen object. public static XPen DarkBlue { get { if (XPens.darkBlue == null) XPens.darkBlue = new XPen(XColors.DarkBlue, 1, true); return XPens.darkBlue; } } /// Gets a pre-defined XPen object. public static XPen DarkCyan { get { if (XPens.darkCyan == null) XPens.darkCyan = new XPen(XColors.DarkCyan, 1, true); return XPens.darkCyan; } } /// Gets a pre-defined XPen object. public static XPen DarkGoldenrod { get { if (XPens.darkGoldenrod == null) XPens.darkGoldenrod = new XPen(XColors.DarkGoldenrod, 1, true); return XPens.darkGoldenrod; } } /// Gets a pre-defined XPen object. public static XPen DarkGray { get { if (XPens.darkGray == null) XPens.darkGray = new XPen(XColors.DarkGray, 1, true); return XPens.darkGray; } } /// Gets a pre-defined XPen object. public static XPen DarkGreen { get { if (XPens.darkGreen == null) XPens.darkGreen = new XPen(XColors.DarkGreen, 1, true); return XPens.darkGreen; } } /// Gets a pre-defined XPen object. public static XPen DarkKhaki { get { if (XPens.darkKhaki == null) XPens.darkKhaki = new XPen(XColors.DarkKhaki, 1, true); return XPens.darkKhaki; } } /// Gets a pre-defined XPen object. public static XPen DarkMagenta { get { if (XPens.darkMagenta == null) XPens.darkMagenta = new XPen(XColors.DarkMagenta, 1, true); return XPens.darkMagenta; } } /// Gets a pre-defined XPen object. public static XPen DarkOliveGreen { get { if (XPens.darkOliveGreen == null) XPens.darkOliveGreen = new XPen(XColors.DarkOliveGreen, 1, true); return XPens.darkOliveGreen; } } /// Gets a pre-defined XPen object. public static XPen DarkOrange { get { if (XPens.darkOrange == null) XPens.darkOrange = new XPen(XColors.DarkOrange, 1, true); return XPens.darkOrange; } } /// Gets a pre-defined XPen object. public static XPen DarkOrchid { get { if (XPens.darkOrchid == null) XPens.darkOrchid = new XPen(XColors.DarkOrchid, 1, true); return XPens.darkOrchid; } } /// Gets a pre-defined XPen object. public static XPen DarkRed { get { if (XPens.darkRed == null) XPens.darkRed = new XPen(XColors.DarkRed, 1, true); return XPens.darkRed; } } /// Gets a pre-defined XPen object. public static XPen DarkSalmon { get { if (XPens.darkSalmon == null) XPens.darkSalmon = new XPen(XColors.DarkSalmon, 1, true); return XPens.darkSalmon; } } /// Gets a pre-defined XPen object. public static XPen DarkSeaGreen { get { if (XPens.darkSeaGreen == null) XPens.darkSeaGreen = new XPen(XColors.DarkSeaGreen, 1, true); return XPens.darkSeaGreen; } } /// Gets a pre-defined XPen object. public static XPen DarkSlateBlue { get { if (XPens.darkSlateBlue == null) XPens.darkSlateBlue = new XPen(XColors.DarkSlateBlue, 1, true); return XPens.darkSlateBlue; } } /// Gets a pre-defined XPen object. public static XPen DarkSlateGray { get { if (XPens.darkSlateGray == null) XPens.darkSlateGray = new XPen(XColors.DarkSlateGray, 1, true); return XPens.darkSlateGray; } } /// Gets a pre-defined XPen object. public static XPen DarkTurquoise { get { if (XPens.darkTurquoise == null) XPens.darkTurquoise = new XPen(XColors.DarkTurquoise, 1, true); return XPens.darkTurquoise; } } /// Gets a pre-defined XPen object. public static XPen DarkViolet { get { if (XPens.darkViolet == null) XPens.darkViolet = new XPen(XColors.DarkViolet, 1, true); return XPens.darkViolet; } } /// Gets a pre-defined XPen object. public static XPen DeepPink { get { if (XPens.deepPink == null) XPens.deepPink = new XPen(XColors.DeepPink, 1, true); return XPens.deepPink; } } /// Gets a pre-defined XPen object. public static XPen DeepSkyBlue { get { if (XPens.deepSkyBlue == null) XPens.deepSkyBlue = new XPen(XColors.DeepSkyBlue, 1, true); return XPens.deepSkyBlue; } } /// Gets a pre-defined XPen object. public static XPen DimGray { get { if (XPens.dimGray == null) XPens.dimGray = new XPen(XColors.DimGray, 1, true); return XPens.dimGray; } } /// Gets a pre-defined XPen object. public static XPen DodgerBlue { get { if (XPens.dodgerBlue == null) XPens.dodgerBlue = new XPen(XColors.DodgerBlue, 1, true); return XPens.dodgerBlue; } } /// Gets a pre-defined XPen object. public static XPen Firebrick { get { if (XPens.firebrick == null) XPens.firebrick = new XPen(XColors.Firebrick, 1, true); return XPens.firebrick; } } /// Gets a pre-defined XPen object. public static XPen FloralWhite { get { if (XPens.floralWhite == null) XPens.floralWhite = new XPen(XColors.FloralWhite, 1, true); return XPens.floralWhite; } } /// Gets a pre-defined XPen object. public static XPen ForestGreen { get { if (XPens.forestGreen == null) XPens.forestGreen = new XPen(XColors.ForestGreen, 1, true); return XPens.forestGreen; } } /// Gets a pre-defined XPen object. public static XPen Fuchsia { get { if (XPens.fuchsia == null) XPens.fuchsia = new XPen(XColors.Fuchsia, 1, true); return XPens.fuchsia; } } /// Gets a pre-defined XPen object. public static XPen Gainsboro { get { if (XPens.gainsboro == null) XPens.gainsboro = new XPen(XColors.Gainsboro, 1, true); return XPens.gainsboro; } } /// Gets a pre-defined XPen object. public static XPen GhostWhite { get { if (XPens.ghostWhite == null) XPens.ghostWhite = new XPen(XColors.GhostWhite, 1, true); return XPens.ghostWhite; } } /// Gets a pre-defined XPen object. public static XPen Gold { get { if (XPens.gold == null) XPens.gold = new XPen(XColors.Gold, 1, true); return XPens.gold; } } /// Gets a pre-defined XPen object. public static XPen Goldenrod { get { if (XPens.goldenrod == null) XPens.goldenrod = new XPen(XColors.Goldenrod, 1, true); return XPens.goldenrod; } } /// Gets a pre-defined XPen object. public static XPen Gray { get { if (XPens.gray == null) XPens.gray = new XPen(XColors.Gray, 1, true); return XPens.gray; } } /// Gets a pre-defined XPen object. public static XPen Green { get { if (XPens.green == null) XPens.green = new XPen(XColors.Green, 1, true); return XPens.green; } } /// Gets a pre-defined XPen object. public static XPen GreenYellow { get { if (XPens.greenYellow == null) XPens.greenYellow = new XPen(XColors.GreenYellow, 1, true); return XPens.greenYellow; } } /// Gets a pre-defined XPen object. public static XPen Honeydew { get { if (XPens.honeydew == null) XPens.honeydew = new XPen(XColors.Honeydew, 1, true); return XPens.honeydew; } } /// Gets a pre-defined XPen object. public static XPen HotPink { get { if (XPens.hotPink == null) XPens.hotPink = new XPen(XColors.HotPink, 1, true); return XPens.hotPink; } } /// Gets a pre-defined XPen object. public static XPen IndianRed { get { if (XPens.indianRed == null) XPens.indianRed = new XPen(XColors.IndianRed, 1, true); return XPens.indianRed; } } /// Gets a pre-defined XPen object. public static XPen Indigo { get { if (XPens.indigo == null) XPens.indigo = new XPen(XColors.Indigo, 1, true); return XPens.indigo; } } /// Gets a pre-defined XPen object. public static XPen Ivory { get { if (XPens.ivory == null) XPens.ivory = new XPen(XColors.Ivory, 1, true); return XPens.ivory; } } /// Gets a pre-defined XPen object. public static XPen Khaki { get { if (XPens.khaki == null) XPens.khaki = new XPen(XColors.Khaki, 1, true); return XPens.khaki; } } /// Gets a pre-defined XPen object. public static XPen Lavender { get { if (XPens.lavender == null) XPens.lavender = new XPen(XColors.Lavender, 1, true); return XPens.lavender; } } /// Gets a pre-defined XPen object. public static XPen LavenderBlush { get { if (XPens.lavenderBlush == null) XPens.lavenderBlush = new XPen(XColors.LavenderBlush, 1, true); return XPens.lavenderBlush; } } /// Gets a pre-defined XPen object. public static XPen LawnGreen { get { if (XPens.lawnGreen == null) XPens.lawnGreen = new XPen(XColors.LawnGreen, 1, true); return XPens.lawnGreen; } } /// Gets a pre-defined XPen object. public static XPen LemonChiffon { get { if (XPens.lemonChiffon == null) XPens.lemonChiffon = new XPen(XColors.LemonChiffon, 1, true); return XPens.lemonChiffon; } } /// Gets a pre-defined XPen object. public static XPen LightBlue { get { if (XPens.lightBlue == null) XPens.lightBlue = new XPen(XColors.LightBlue, 1, true); return XPens.lightBlue; } } /// Gets a pre-defined XPen object. public static XPen LightCoral { get { if (XPens.lightCoral == null) XPens.lightCoral = new XPen(XColors.LightCoral, 1, true); return XPens.lightCoral; } } /// Gets a pre-defined XPen object. public static XPen LightCyan { get { if (XPens.lightCyan == null) XPens.lightCyan = new XPen(XColors.LightCyan, 1, true); return XPens.lightCyan; } } /// Gets a pre-defined XPen object. public static XPen LightGoldenrodYellow { get { if (XPens.lightGoldenrodYellow == null) XPens.lightGoldenrodYellow = new XPen(XColors.LightGoldenrodYellow, 1, true); return XPens.lightGoldenrodYellow; } } /// Gets a pre-defined XPen object. public static XPen LightGray { get { if (XPens.lightGray == null) XPens.lightGray = new XPen(XColors.LightGray, 1, true); return XPens.lightGray; } } /// Gets a pre-defined XPen object. public static XPen LightGreen { get { if (XPens.lightGreen == null) XPens.lightGreen = new XPen(XColors.LightGreen, 1, true); return XPens.lightGreen; } } /// Gets a pre-defined XPen object. public static XPen LightPink { get { if (XPens.lightPink == null) XPens.lightPink = new XPen(XColors.LightPink, 1, true); return XPens.lightPink; } } /// Gets a pre-defined XPen object. public static XPen LightSalmon { get { if (XPens.lightSalmon == null) XPens.lightSalmon = new XPen(XColors.LightSalmon, 1, true); return XPens.lightSalmon; } } /// Gets a pre-defined XPen object. public static XPen LightSeaGreen { get { if (XPens.lightSeaGreen == null) XPens.lightSeaGreen = new XPen(XColors.LightSeaGreen, 1, true); return XPens.lightSeaGreen; } } /// Gets a pre-defined XPen object. public static XPen LightSkyBlue { get { if (XPens.lightSkyBlue == null) XPens.lightSkyBlue = new XPen(XColors.LightSkyBlue, 1, true); return XPens.lightSkyBlue; } } /// Gets a pre-defined XPen object. public static XPen LightSlateGray { get { if (XPens.lightSlateGray == null) XPens.lightSlateGray = new XPen(XColors.LightSlateGray, 1, true); return XPens.lightSlateGray; } } /// Gets a pre-defined XPen object. public static XPen LightSteelBlue { get { if (XPens.lightSteelBlue == null) XPens.lightSteelBlue = new XPen(XColors.LightSteelBlue, 1, true); return XPens.lightSteelBlue; } } /// Gets a pre-defined XPen object. public static XPen LightYellow { get { if (XPens.lightYellow == null) XPens.lightYellow = new XPen(XColors.LightYellow, 1, true); return XPens.lightYellow; } } /// Gets a pre-defined XPen object. public static XPen Lime { get { if (XPens.lime == null) XPens.lime = new XPen(XColors.Lime, 1, true); return XPens.lime; } } /// Gets a pre-defined XPen object. public static XPen LimeGreen { get { if (XPens.limeGreen == null) XPens.limeGreen = new XPen(XColors.LimeGreen, 1, true); return XPens.limeGreen; } } /// Gets a pre-defined XPen object. public static XPen Linen { get { if (XPens.linen == null) XPens.linen = new XPen(XColors.Linen, 1, true); return XPens.linen; } } /// Gets a pre-defined XPen object. public static XPen Magenta { get { if (XPens.magenta == null) XPens.magenta = new XPen(XColors.Magenta, 1, true); return XPens.magenta; } } /// Gets a pre-defined XPen object. public static XPen Maroon { get { if (XPens.maroon == null) XPens.maroon = new XPen(XColors.Maroon, 1, true); return XPens.maroon; } } /// Gets a pre-defined XPen object. public static XPen MediumAquamarine { get { if (XPens.mediumAquamarine == null) XPens.mediumAquamarine = new XPen(XColors.MediumAquamarine, 1, true); return XPens.mediumAquamarine; } } /// Gets a pre-defined XPen object. public static XPen MediumBlue { get { if (XPens.mediumBlue == null) XPens.mediumBlue = new XPen(XColors.MediumBlue, 1, true); return XPens.mediumBlue; } } /// Gets a pre-defined XPen object. public static XPen MediumOrchid { get { if (XPens.mediumOrchid == null) XPens.mediumOrchid = new XPen(XColors.MediumOrchid, 1, true); return XPens.mediumOrchid; } } /// Gets a pre-defined XPen object. public static XPen MediumPurple { get { if (XPens.mediumPurple == null) XPens.mediumPurple = new XPen(XColors.MediumPurple, 1, true); return XPens.mediumPurple; } } /// Gets a pre-defined XPen object. public static XPen MediumSeaGreen { get { if (XPens.mediumSeaGreen == null) XPens.mediumSeaGreen = new XPen(XColors.MediumSeaGreen, 1, true); return XPens.mediumSeaGreen; } } /// Gets a pre-defined XPen object. public static XPen MediumSlateBlue { get { if (XPens.mediumSlateBlue == null) XPens.mediumSlateBlue = new XPen(XColors.MediumSlateBlue, 1, true); return XPens.mediumSlateBlue; } } /// Gets a pre-defined XPen object. public static XPen MediumSpringGreen { get { if (XPens.mediumSpringGreen == null) XPens.mediumSpringGreen = new XPen(XColors.MediumSpringGreen, 1, true); return XPens.mediumSpringGreen; } } /// Gets a pre-defined XPen object. public static XPen MediumTurquoise { get { if (XPens.mediumTurquoise == null) XPens.mediumTurquoise = new XPen(XColors.MediumTurquoise, 1, true); return XPens.mediumTurquoise; } } /// Gets a pre-defined XPen object. public static XPen MediumVioletRed { get { if (XPens.mediumVioletRed == null) XPens.mediumVioletRed = new XPen(XColors.MediumVioletRed, 1, true); return XPens.mediumVioletRed; } } /// Gets a pre-defined XPen object. public static XPen MidnightBlue { get { if (XPens.midnightBlue == null) XPens.midnightBlue = new XPen(XColors.MidnightBlue, 1, true); return XPens.midnightBlue; } } /// Gets a pre-defined XPen object. public static XPen MintCream { get { if (XPens.mintCream == null) XPens.mintCream = new XPen(XColors.MintCream, 1, true); return XPens.mintCream; } } /// Gets a pre-defined XPen object. public static XPen MistyRose { get { if (XPens.mistyRose == null) XPens.mistyRose = new XPen(XColors.MistyRose, 1, true); return XPens.mistyRose; } } /// Gets a pre-defined XPen object. public static XPen Moccasin { get { if (XPens.moccasin == null) XPens.moccasin = new XPen(XColors.Moccasin, 1, true); return XPens.moccasin; } } /// Gets a pre-defined XPen object. public static XPen NavajoWhite { get { if (XPens.navajoWhite == null) XPens.navajoWhite = new XPen(XColors.NavajoWhite, 1, true); return XPens.navajoWhite; } } /// Gets a pre-defined XPen object. public static XPen Navy { get { if (XPens.navy == null) XPens.navy = new XPen(XColors.Navy, 1, true); return XPens.navy; } } /// Gets a pre-defined XPen object. public static XPen OldLace { get { if (XPens.oldLace == null) XPens.oldLace = new XPen(XColors.OldLace, 1, true); return XPens.oldLace; } } /// Gets a pre-defined XPen object. public static XPen Olive { get { if (XPens.olive == null) XPens.olive = new XPen(XColors.Olive, 1, true); return XPens.olive; } } /// Gets a pre-defined XPen object. public static XPen OliveDrab { get { if (XPens.oliveDrab == null) XPens.oliveDrab = new XPen(XColors.OliveDrab, 1, true); return XPens.oliveDrab; } } /// Gets a pre-defined XPen object. public static XPen Orange { get { if (XPens.orange == null) XPens.orange = new XPen(XColors.Orange, 1, true); return XPens.orange; } } /// Gets a pre-defined XPen object. public static XPen OrangeRed { get { if (XPens.orangeRed == null) XPens.orangeRed = new XPen(XColors.OrangeRed, 1, true); return XPens.orangeRed; } } /// Gets a pre-defined XPen object. public static XPen Orchid { get { if (XPens.orchid == null) XPens.orchid = new XPen(XColors.Orchid, 1, true); return XPens.orchid; } } /// Gets a pre-defined XPen object. public static XPen PaleGoldenrod { get { if (XPens.paleGoldenrod == null) XPens.paleGoldenrod = new XPen(XColors.PaleGoldenrod, 1, true); return XPens.paleGoldenrod; } } /// Gets a pre-defined XPen object. public static XPen PaleGreen { get { if (XPens.paleGreen == null) XPens.paleGreen = new XPen(XColors.PaleGreen, 1, true); return XPens.paleGreen; } } /// Gets a pre-defined XPen object. public static XPen PaleTurquoise { get { if (XPens.paleTurquoise == null) XPens.paleTurquoise = new XPen(XColors.PaleTurquoise, 1, true); return XPens.paleTurquoise; } } /// Gets a pre-defined XPen object. public static XPen PaleVioletRed { get { if (XPens.paleVioletRed == null) XPens.paleVioletRed = new XPen(XColors.PaleVioletRed, 1, true); return XPens.paleVioletRed; } } /// Gets a pre-defined XPen object. public static XPen PapayaWhip { get { if (XPens.papayaWhip == null) XPens.papayaWhip = new XPen(XColors.PapayaWhip, 1, true); return XPens.papayaWhip; } } /// Gets a pre-defined XPen object. public static XPen PeachPuff { get { if (XPens.peachPuff == null) XPens.peachPuff = new XPen(XColors.PeachPuff, 1, true); return XPens.peachPuff; } } /// Gets a pre-defined XPen object. public static XPen Peru { get { if (XPens.peru == null) XPens.peru = new XPen(XColors.Peru, 1, true); return XPens.peru; } } /// Gets a pre-defined XPen object. public static XPen Pink { get { if (XPens.pink == null) XPens.pink = new XPen(XColors.Pink, 1, true); return XPens.pink; } } /// Gets a pre-defined XPen object. public static XPen Plum { get { if (XPens.plum == null) XPens.plum = new XPen(XColors.Plum, 1, true); return XPens.plum; } } /// Gets a pre-defined XPen object. public static XPen PowderBlue { get { if (XPens.powderBlue == null) XPens.powderBlue = new XPen(XColors.PowderBlue, 1, true); return XPens.powderBlue; } } /// Gets a pre-defined XPen object. public static XPen Purple { get { if (XPens.purple == null) XPens.purple = new XPen(XColors.Purple, 1, true); return XPens.purple; } } /// Gets a pre-defined XPen object. public static XPen Red { get { if (XPens.red == null) XPens.red = new XPen(XColors.Red, 1, true); return XPens.red; } } /// Gets a pre-defined XPen object. public static XPen RosyBrown { get { if (XPens.rosyBrown == null) XPens.rosyBrown = new XPen(XColors.RosyBrown, 1, true); return XPens.rosyBrown; } } /// Gets a pre-defined XPen object. public static XPen RoyalBlue { get { if (XPens.royalBlue == null) XPens.royalBlue = new XPen(XColors.RoyalBlue, 1, true); return XPens.royalBlue; } } /// Gets a pre-defined XPen object. public static XPen SaddleBrown { get { if (XPens.saddleBrown == null) XPens.saddleBrown = new XPen(XColors.SaddleBrown, 1, true); return XPens.saddleBrown; } } /// Gets a pre-defined XPen object. public static XPen Salmon { get { if (XPens.salmon == null) XPens.salmon = new XPen(XColors.Salmon, 1, true); return XPens.salmon; } } /// Gets a pre-defined XPen object. public static XPen SandyBrown { get { if (XPens.sandyBrown == null) XPens.sandyBrown = new XPen(XColors.SandyBrown, 1, true); return XPens.sandyBrown; } } /// Gets a pre-defined XPen object. public static XPen SeaGreen { get { if (XPens.seaGreen == null) XPens.seaGreen = new XPen(XColors.SeaGreen, 1, true); return XPens.seaGreen; } } /// Gets a pre-defined XPen object. public static XPen SeaShell { get { if (XPens.seaShell == null) XPens.seaShell = new XPen(XColors.SeaShell, 1, true); return XPens.seaShell; } } /// Gets a pre-defined XPen object. public static XPen Sienna { get { if (XPens.sienna == null) XPens.sienna = new XPen(XColors.Sienna, 1, true); return XPens.sienna; } } /// Gets a pre-defined XPen object. public static XPen Silver { get { if (XPens.silver == null) XPens.silver = new XPen(XColors.Silver, 1, true); return XPens.silver; } } /// Gets a pre-defined XPen object. public static XPen SkyBlue { get { if (XPens.skyBlue == null) XPens.skyBlue = new XPen(XColors.SkyBlue, 1, true); return XPens.skyBlue; } } /// Gets a pre-defined XPen object. public static XPen SlateBlue { get { if (XPens.slateBlue == null) XPens.slateBlue = new XPen(XColors.SlateBlue, 1, true); return XPens.slateBlue; } } /// Gets a pre-defined XPen object. public static XPen SlateGray { get { if (XPens.slateGray == null) XPens.slateGray = new XPen(XColors.SlateGray, 1, true); return XPens.slateGray; } } /// Gets a pre-defined XPen object. public static XPen Snow { get { if (XPens.snow == null) XPens.snow = new XPen(XColors.Snow, 1, true); return XPens.snow; } } /// Gets a pre-defined XPen object. public static XPen SpringGreen { get { if (XPens.springGreen == null) XPens.springGreen = new XPen(XColors.SpringGreen, 1, true); return XPens.springGreen; } } /// Gets a pre-defined XPen object. public static XPen SteelBlue { get { if (XPens.steelBlue == null) XPens.steelBlue = new XPen(XColors.SteelBlue, 1, true); return XPens.steelBlue; } } /// Gets a pre-defined XPen object. public static XPen Tan { get { if (XPens.tan == null) XPens.tan = new XPen(XColors.Tan, 1, true); return XPens.tan; } } /// Gets a pre-defined XPen object. public static XPen Teal { get { if (XPens.teal == null) XPens.teal = new XPen(XColors.Teal, 1, true); return XPens.teal; } } /// Gets a pre-defined XPen object. public static XPen Thistle { get { if (XPens.thistle == null) XPens.thistle = new XPen(XColors.Thistle, 1, true); return XPens.thistle; } } /// Gets a pre-defined XPen object. public static XPen Tomato { get { if (XPens.tomato == null) XPens.tomato = new XPen(XColors.Tomato, 1, true); return XPens.tomato; } } /// Gets a pre-defined XPen object. public static XPen Transparent { get { if (XPens.transparent == null) XPens.transparent = new XPen(XColors.Transparent, 1, true); return XPens.transparent; } } /// Gets a pre-defined XPen object. public static XPen Turquoise { get { if (XPens.turquoise == null) XPens.turquoise = new XPen(XColors.Turquoise, 1, true); return XPens.turquoise; } } /// Gets a pre-defined XPen object. public static XPen Violet { get { if (XPens.violet == null) XPens.violet = new XPen(XColors.Violet, 1, true); return XPens.violet; } } /// Gets a pre-defined XPen object. public static XPen Wheat { get { if (XPens.wheat == null) XPens.wheat = new XPen(XColors.Wheat, 1, true); return XPens.wheat; } } /// Gets a pre-defined XPen object. public static XPen White { get { if (XPens.white == null) XPens.white = new XPen(XColors.White, 1, true); return XPens.white; } } /// Gets a pre-defined XPen object. public static XPen WhiteSmoke { get { if (XPens.whiteSmoke == null) XPens.whiteSmoke = new XPen(XColors.WhiteSmoke, 1, true); return XPens.whiteSmoke; } } /// Gets a pre-defined XPen object. public static XPen Yellow { get { if (XPens.yellow == null) XPens.yellow = new XPen(XColors.Yellow, 1, true); return XPens.yellow; } } /// Gets a pre-defined XPen object. public static XPen YellowGreen { get { if (XPens.yellowGreen == null) XPens.yellowGreen = new XPen(XColors.YellowGreen, 1, true); return XPens.yellowGreen; } } static XPen aliceBlue; static XPen antiqueWhite; static XPen aqua; static XPen aquamarine; static XPen azure; static XPen beige; static XPen bisque; static XPen black; static XPen blanchedAlmond; static XPen blue; static XPen blueViolet; static XPen brown; static XPen burlyWood; static XPen cadetBlue; static XPen chartreuse; static XPen chocolate; static XPen coral; static XPen cornflowerBlue; static XPen cornsilk; static XPen crimson; static XPen cyan; static XPen darkBlue; static XPen darkCyan; static XPen darkGoldenrod; static XPen darkGray; static XPen darkGreen; static XPen darkKhaki; static XPen darkMagenta; static XPen darkOliveGreen; static XPen darkOrange; static XPen darkOrchid; static XPen darkRed; static XPen darkSalmon; static XPen darkSeaGreen; static XPen darkSlateBlue; static XPen darkSlateGray; static XPen darkTurquoise; static XPen darkViolet; static XPen deepPink; static XPen deepSkyBlue; static XPen dimGray; static XPen dodgerBlue; static XPen firebrick; static XPen floralWhite; static XPen forestGreen; static XPen fuchsia; static XPen gainsboro; static XPen ghostWhite; static XPen gold; static XPen goldenrod; static XPen gray; static XPen green; static XPen greenYellow; static XPen honeydew; static XPen hotPink; static XPen indianRed; static XPen indigo; static XPen ivory; static XPen khaki; static XPen lavender; static XPen lavenderBlush; static XPen lawnGreen; static XPen lemonChiffon; static XPen lightBlue; static XPen lightCoral; static XPen lightCyan; static XPen lightGoldenrodYellow; static XPen lightGray; static XPen lightGreen; static XPen lightPink; static XPen lightSalmon; static XPen lightSeaGreen; static XPen lightSkyBlue; static XPen lightSlateGray; static XPen lightSteelBlue; static XPen lightYellow; static XPen lime; static XPen limeGreen; static XPen linen; static XPen magenta; static XPen maroon; static XPen mediumAquamarine; static XPen mediumBlue; static XPen mediumOrchid; static XPen mediumPurple; static XPen mediumSeaGreen; static XPen mediumSlateBlue; static XPen mediumSpringGreen; static XPen mediumTurquoise; static XPen mediumVioletRed; static XPen midnightBlue; static XPen mintCream; static XPen mistyRose; static XPen moccasin; static XPen navajoWhite; static XPen navy; static XPen oldLace; static XPen olive; static XPen oliveDrab; static XPen orange; static XPen orangeRed; static XPen orchid; static XPen paleGoldenrod; static XPen paleGreen; static XPen paleTurquoise; static XPen paleVioletRed; static XPen papayaWhip; static XPen peachPuff; static XPen peru; static XPen pink; static XPen plum; static XPen powderBlue; static XPen purple; static XPen red; static XPen rosyBrown; static XPen royalBlue; static XPen saddleBrown; static XPen salmon; static XPen sandyBrown; static XPen seaGreen; static XPen seaShell; static XPen sienna; static XPen silver; static XPen skyBlue; static XPen slateBlue; static XPen slateGray; static XPen snow; static XPen springGreen; static XPen steelBlue; static XPen tan; static XPen teal; static XPen thistle; static XPen tomato; static XPen transparent; static XPen turquoise; static XPen violet; static XPen wheat; static XPen white; static XPen whiteSmoke; static XPen yellow; static XPen yellowGreen; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XLinearGradientBrush.cs0000644000175000001440000003130411435766646025063 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.ComponentModel; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp; using PdfSharp.Internal; namespace PdfSharp.Drawing { /// /// Defines a Brush with a linear gradient. /// public sealed class XLinearGradientBrush : XBrush { //internal XLinearGradientBrush(); #if GDI /// /// Initializes a new instance of the class. /// public XLinearGradientBrush(System.Drawing.Point point1, System.Drawing.Point point2, XColor color1, XColor color2) : this(new XPoint(point1), new XPoint(point2), color1, color2) { } #endif #if WPF /// /// Initializes a new instance of the class. /// public XLinearGradientBrush(System.Windows.Point point1, System.Windows.Point point2, XColor color1, XColor color2) : this(new XPoint(point1), new XPoint(point2), color1, color2) { } #endif #if GDI /// /// Initializes a new instance of the class. /// public XLinearGradientBrush(PointF point1, PointF point2, XColor color1, XColor color2) : this(new XPoint(point1), new XPoint(point2), color1, color2) { } #endif /// /// Initializes a new instance of the class. /// public XLinearGradientBrush(XPoint point1, XPoint point2, XColor color1, XColor color2) { this.point1 = point1; this.point2 = point2; this.color1 = color1; this.color2 = color2; } #if GDI /// /// Initializes a new instance of the class. /// public XLinearGradientBrush(Rectangle rect, XColor color1, XColor color2, XLinearGradientMode linearGradientMode) : this(new XRect(rect), color1, color2, linearGradientMode) { } /// /// Initializes a new instance of the class. /// public XLinearGradientBrush(RectangleF rect, XColor color1, XColor color2, XLinearGradientMode linearGradientMode) : this(new XRect(rect), color1, color2, linearGradientMode) { } #endif #if WPF /// /// Initializes a new instance of the class. /// public XLinearGradientBrush(Rect rect, XColor color1, XColor color2, XLinearGradientMode linearGradientMode) : this(new XRect(rect), color1, color2, linearGradientMode) { } #endif /// /// Initializes a new instance of the class. /// public XLinearGradientBrush(XRect rect, XColor color1, XColor color2, XLinearGradientMode linearGradientMode) { if (!Enum.IsDefined(typeof(XLinearGradientMode), linearGradientMode)) throw new InvalidEnumArgumentException("linearGradientMode", (int)linearGradientMode, typeof(XLinearGradientMode)); if (rect.Width == 0 || rect.Height == 0) throw new ArgumentException("Invalid rectangle.", "rect"); this.useRect = true; this.color1 = color1; this.color2 = color2; this.rect = rect; this.linearGradientMode = linearGradientMode; } // TODO: //public XLinearGradientBrush(Rectangle rect, XColor color1, XColor color2, double angle); //public XLinearGradientBrush(RectangleF rect, XColor color1, XColor color2, double angle); //public XLinearGradientBrush(Rectangle rect, XColor color1, XColor color2, double angle, bool isAngleScaleable); //public XLinearGradientBrush(RectangleF rect, XColor color1, XColor color2, double angle, bool isAngleScaleable); //public XLinearGradientBrush(RectangleF rect, XColor color1, XColor color2, double angle, bool isAngleScaleable); //private Blend _GetBlend(); //private ColorBlend _GetInterpolationColors(); //private XColor[] _GetLinearColors(); //private RectangleF _GetRectangle(); //private Matrix _GetTransform(); //private WrapMode _GetWrapMode(); //private void _SetBlend(Blend blend); //private void _SetInterpolationColors(ColorBlend blend); //private void _SetLinearColors(XColor color1, XColor color2); //private void _SetTransform(Matrix matrix); //private void _SetWrapMode(WrapMode wrapMode); //public override object Clone(); /// /// Gets or sets an XMatrix that defines a local geometric transform for this LinearGradientBrush. /// public XMatrix Transform { get { return this.matrix; } set { this.matrix = value; } } /// /// Translates the brush with the specified offset. /// public void TranslateTransform(double dx, double dy) { this.matrix.TranslatePrepend(dx, dy); } /// /// Translates the brush with the specified offset. /// public void TranslateTransform(double dx, double dy, XMatrixOrder order) { this.matrix.Translate(dx, dy, order); } /// /// Scales the brush with the specified scalars. /// public void ScaleTransform(double sx, double sy) { this.matrix.ScalePrepend(sx, sy); } /// /// Scales the brush with the specified scalars. /// public void ScaleTransform(double sx, double sy, XMatrixOrder order) { this.matrix.Scale(sx, sy, order); } /// /// Rotates the brush with the specified angle. /// public void RotateTransform(double angle) { this.matrix.RotatePrepend(angle); } /// /// Rotates the brush with the specified angle. /// public void RotateTransform(double angle, XMatrixOrder order) { this.matrix.Rotate(angle, order); } /// /// Multiply the brush transformation matrix with the specified matrix. /// public void MultiplyTransform(XMatrix matrix) { this.matrix.Prepend(matrix); } /// /// Multiply the brush transformation matrix with the specified matrix. /// public void MultiplyTransform(XMatrix matrix, XMatrixOrder order) { this.matrix.Multiply(matrix, order); } /// /// Resets the brush transformation matrix with identity matrix. /// public void ResetTransform() { this.matrix = new XMatrix(); //XMatrix.Identity; } //public void SetBlendTriangularShape(double focus); //public void SetBlendTriangularShape(double focus, double scale); //public void SetSigmaBellShape(double focus); //public void SetSigmaBellShape(double focus, double scale); #if GDI internal override System.Drawing.Brush RealizeGdiBrush() { //if (this.dirty) //{ // if (this.brush == null) // this.brush = new SolidBrush(this.color.ToGdiColor()); // else // { // this.brush.Color = this.color.ToGdiColor(); // } // this.dirty = false; //} // TODO: use this.dirty to optimize code System.Drawing.Drawing2D.LinearGradientBrush brush; if (this.useRect) { brush = new System.Drawing.Drawing2D.LinearGradientBrush(this.rect.ToRectangleF(), this.color1.ToGdiColor(), this.color2.ToGdiColor(), (LinearGradientMode)this.linearGradientMode); } else { brush = new System.Drawing.Drawing2D.LinearGradientBrush( this.point1.ToPointF(), this.point2.ToPointF(), this.color1.ToGdiColor(), this.color2.ToGdiColor()); } if (!this.matrix.IsIdentity) brush.Transform = this.matrix.ToGdiMatrix(); //brush.WrapMode = WrapMode.Clamp; return brush; //this.brush; } #endif #if WPF internal override System.Windows.Media.Brush RealizeWpfBrush() { //if (this.dirty) //{ // if (this.brush == null) // this.brush = new SolidBrush(this.color.ToGdiColor()); // else // { // this.brush.Color = this.color.ToGdiColor(); // } // this.dirty = false; //} System.Windows.Media.LinearGradientBrush brush; if (this.useRect) { #if !SILVERLIGHT brush = new System.Windows.Media.LinearGradientBrush(this.color1.ToWpfColor(), this.color2.ToWpfColor(), new System.Windows.Point(0, 0), new System.Windows.Point(1,1));// this.rect.TopLeft, this.rect.BottomRight); //brush = new System.Drawing.Drawing2D.LinearGradientBrush(this.rect.ToRectangleF(), // this.color1.ToGdiColor(), this.color2.ToGdiColor(), (LinearGradientMode)this.linearGradientMode); #else GradientStop gs1 = new GradientStop(); gs1.Color = this.color1.ToWpfColor(); gs1.Offset = 0; GradientStop gs2 = new GradientStop(); gs2.Color = this.color2.ToWpfColor(); gs2.Offset = 1; GradientStopCollection gsc = new GradientStopCollection(); gsc.Add(gs1); gsc.Add(gs2); brush = new LinearGradientBrush(gsc, 0); brush.StartPoint = new Point(0, 0); brush.EndPoint = new Point(1, 1); #endif } else { #if !SILVERLIGHT brush = new System.Windows.Media.LinearGradientBrush(this.color1.ToWpfColor(), this.color2.ToWpfColor(), this.point1, this.point2); //brush = new System.Drawing.Drawing2D.LinearGradientBrush( // this.point1.ToPointF(), this.point2.ToPointF(), // this.color1.ToGdiColor(), this.color2.ToGdiColor()); #else GradientStop gs1 = new GradientStop(); gs1.Color = this.color1.ToWpfColor(); gs1.Offset = 0; GradientStop gs2 = new GradientStop(); gs2.Color = this.color2.ToWpfColor(); gs2.Offset = 1; GradientStopCollection gsc = new GradientStopCollection(); gsc.Add(gs1); gsc.Add(gs2); brush = new LinearGradientBrush(gsc, 0); brush.StartPoint = this.point1; brush.EndPoint = this.point2; #endif } if (!this.matrix.IsIdentity) { #if !SILVERLIGHT brush.Transform = new MatrixTransform(this.matrix.ToWpfMatrix()); #else MatrixTransform transform = new MatrixTransform(); transform.Matrix = this.matrix.ToWpfMatrix(); brush.Transform = transform; #endif } return brush; //this.brush; } #endif //public Blend Blend { get; set; } //public bool GammaCorrection { get; set; } //public ColorBlend InterpolationColors { get; set; } //public XColor[] LinearColors { get; set; } //public RectangleF Rectangle { get; } //public WrapMode WrapMode { get; set; } //private bool interpolationColorsWasSet; internal bool useRect; internal XPoint point1, point2; internal XColor color1, color2; internal XRect rect; internal XLinearGradientMode linearGradientMode; internal XMatrix matrix; //bool dirty = true; //LinearGradientBrush brush; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XColorResourceManager.cs0000644000175000001440000006155011435766646025256 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.ComponentModel; using System.Threading; #if GDI using System.Drawing; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Internal; namespace PdfSharp.Drawing { /// /// Manages the localization of the color class. /// public class XColorResourceManager { /// /// Initializes a new instance of the class. /// public XColorResourceManager() : this(Thread.CurrentThread.CurrentUICulture) { } /// /// Initializes a new instance of the class. /// /// The culture info. public XColorResourceManager(CultureInfo cultureInfo) { this.cultureInfo = cultureInfo; } CultureInfo cultureInfo; #if DEBUG_ static public void Test() { int kcc = XKnownColorTable.colorTable.Length; for (int idx = 0; idx < kcc; idx++) { uint argb = XKnownColorTable.colorTable[idx]; ColorResourceInfo info = GetColorInfo((XKnownColor)idx); if ((int)info.knownColor == -1) { kcc.GetType(); } else { if (argb != info.Argb) { kcc.GetType(); } } } for (int idx = 0; idx < colorInfos.Length; idx++) { ColorResourceInfo c2 = colorInfos[idx]; if (c2.Argb != c2.color.Rgb) c2.GetType(); } } #endif /// /// Gets a known color from an ARGB value. Throws an ArgumentException if the value is not a known color. /// public static XKnownColor GetKnownColor(uint argb) { XKnownColor knownColor = XKnownColorTable.GetKnownColor(argb); if ((int)knownColor == -1) throw new ArgumentException("The argument is not a known color", "argb"); return knownColor; } /// /// Gets all known colors. /// /// Indicates whether to include the color Transparent. public static XKnownColor[] GetKnownColors(bool includeTransparent) { int count = colorInfos.Length; XKnownColor[] knownColor = new XKnownColor[count - (includeTransparent ? 0 : 1)]; for (int idxIn = includeTransparent ? 0 : 1, idxOut = 0; idxIn < count; idxIn++, idxOut++) knownColor[idxOut] = colorInfos[idxIn].knownColor; return knownColor; } /// /// Converts a known color to a localized color name. /// public string ToColorName(XKnownColor knownColor) { ColorResourceInfo colorInfo = GetColorInfo(knownColor); // Currently German only if (this.cultureInfo.TwoLetterISOLanguageName == "de") return colorInfo.NameDE; return colorInfo.Name; } /// /// Converts a color to a localized color name or an ARGB value. /// public string ToColorName(XColor color) { string name; if (color.IsKnownColor) name = ToColorName(XKnownColorTable.GetKnownColor(color.Argb)); else name = String.Format("{0}, {1}, {2}, {3}", (int)(255 * color.A), color.R, color.G, color.B); return name; } static ColorResourceInfo GetColorInfo(XKnownColor knownColor) { for (int idx = 0; idx < colorInfos.Length; idx++) { ColorResourceInfo colorInfo = colorInfos[idx]; if (colorInfo.knownColor == knownColor) return colorInfo; } throw new InvalidEnumArgumentException("Enum is not an XKnownColor."); } // I found no official translation for the 140 pre-defined colors. Some folks made their own translations. // http://unnecessary.de/wuest/farbtab/farbtabelle-w.html // http://blog.patrickkempf.de/archives/2004/04/10/html-farben/ // http://www.grafikwunder.de/Grafikecke/Farbtabelle/farbtabelle-006.php // Silke changed some German translations (women know more colors than men :-) internal static ColorResourceInfo[] colorInfos = new ColorResourceInfo[] { new ColorResourceInfo(XKnownColor.Transparent, XColors.Transparent, 0x00FFFFFF, "Transparent", "Transparent"), new ColorResourceInfo(XKnownColor.Black, XColors.Black, 0xFF000000, "Black", "Schwarz"), new ColorResourceInfo(XKnownColor.DarkSlateGray, XColors.DarkSlateGray, 0xFF8FBC8F, "Darkslategray", "Dunkles Schiefergrau"), new ColorResourceInfo(XKnownColor.SlateGray, XColors.SlateGray, 0xFF708090, "Slategray", "Schiefergrau"), new ColorResourceInfo(XKnownColor.LightSlateGray, XColors.LightSlateGray, 0xFF778899, "Lightslategray", "Helles Schiefergrau"), new ColorResourceInfo(XKnownColor.LightSteelBlue, XColors.LightSteelBlue, 0xFFB0C4DE, "Lightsteelblue", "Helles Stahlblau"), //new ColorResourceInfo(XKnownColor.DimGray, XColors.DimGray, 0xFF696969, "Dimgray", "Mattes Grau"), new ColorResourceInfo(XKnownColor.DimGray, XColors.DimGray, 0xFF696969, "Dimgray", "Gedecktes Grau"), new ColorResourceInfo(XKnownColor.Gray, XColors.Gray, 0xFF808080, "Gray", "Grau"), new ColorResourceInfo(XKnownColor.DarkGray, XColors.DarkGray, 0xFFA9A9A9, "Darkgray", "Dunkelgrau"), new ColorResourceInfo(XKnownColor.Silver, XColors.Silver, 0xFFC0C0C0, "Silver", "Silber"), //new ColorResourceInfo(XKnownColor.Gainsboro, XColors.Gainsboro, 0xFFDCDCDC, "Gainsboro", "Gainsboro"), new ColorResourceInfo(XKnownColor.Gainsboro, XColors.Gainsboro, 0xFFDCDCDC, "Gainsboro", "Helles Blaugrau"), //new ColorResourceInfo(XKnownColor.WhiteSmoke, XColors.WhiteSmoke, 0xFFF5F5F5, "Whitesmoke", "Rauchiges Weiß"), new ColorResourceInfo(XKnownColor.WhiteSmoke, XColors.WhiteSmoke, 0xFFF5F5F5, "Whitesmoke", "Rauchweiß"), //new ColorResourceInfo(XKnownColor.GhostWhite, XColors.GhostWhite, 0xFFF8F8FF, "Ghostwhite", "Geisterweiß"), new ColorResourceInfo(XKnownColor.GhostWhite, XColors.GhostWhite, 0xFFF8F8FF, "Ghostwhite", "Schattenweiß"), new ColorResourceInfo(XKnownColor.White, XColors.White, 0xFFFFFFFF, "White", "Weiß"), new ColorResourceInfo(XKnownColor.Snow, XColors.Snow, 0xFFFFFAFA, "Snow", "Schneeweiß"), new ColorResourceInfo(XKnownColor.Ivory, XColors.Ivory, 0xFFFFFFF0, "Ivory", "Elfenbein"), new ColorResourceInfo(XKnownColor.FloralWhite, XColors.FloralWhite, 0xFFFFFAF0, "Floralwhite", "Blütenweiß"), new ColorResourceInfo(XKnownColor.SeaShell, XColors.SeaShell, 0xFFFFF5EE, "Seashell", "Muschel"), //new ColorResourceInfo(XKnownColor.OldLace, XColors.OldLace, 0xFFFDF5E6, "Oldlace", "Altgold"), new ColorResourceInfo(XKnownColor.OldLace, XColors.OldLace, 0xFFFDF5E6, "Oldlace", "Altweiß"), //new ColorResourceInfo(XKnownColor.Linen, XColors.Linen, 0xFFFAF0E6, "Linen", "Leinenfarbe"), new ColorResourceInfo(XKnownColor.Linen, XColors.Linen, 0xFFFAF0E6, "Linen", "Leinen"), new ColorResourceInfo(XKnownColor.AntiqueWhite, XColors.AntiqueWhite, 0xFFFAEBD7, "Antiquewhite", "Antikes Weiß"), new ColorResourceInfo(XKnownColor.BlanchedAlmond, XColors.BlanchedAlmond, 0xFFFFEBCD, "Blanchedalmond", "Mandelweiß"), //new ColorResourceInfo(XKnownColor.PapayaWhip, XColors.PapayaWhip, 0xFFFFEFD5, "Papayawhip", "Cremiges Papaya"), new ColorResourceInfo(XKnownColor.PapayaWhip, XColors.PapayaWhip, 0xFFFFEFD5, "Papayawhip", "Papayacreme"), new ColorResourceInfo(XKnownColor.Beige, XColors.Beige, 0xFFF5F5DC, "Beige", "Beige"), new ColorResourceInfo(XKnownColor.Cornsilk, XColors.Cornsilk, 0xFFFFF8DC, "Cornsilk", "Mais"), //new ColorResourceInfo(XKnownColor.LightGoldenrodYellow, XColors.LightGoldenrodYellow, 0xFFFAFAD2, "Lightgoldenrodyellow", "Helles Goldrutengelb"), new ColorResourceInfo(XKnownColor.LightGoldenrodYellow, XColors.LightGoldenrodYellow, 0xFFFAFAD2, "Lightgoldenrodyellow", "Helles Goldgelb"), new ColorResourceInfo(XKnownColor.LightYellow, XColors.LightYellow, 0xFFFFFFE0, "Lightyellow", "Hellgelb"), new ColorResourceInfo(XKnownColor.LemonChiffon, XColors.LemonChiffon, 0xFFFFFACD, "Lemonchiffon", "Pastellgelb"), //new ColorResourceInfo(XKnownColor.PaleGoldenrod, XColors.PaleGoldenrod, 0xFFEEE8AA, "Palegoldenrod", "Blasse Goldrutenfarbe"), new ColorResourceInfo(XKnownColor.PaleGoldenrod, XColors.PaleGoldenrod, 0xFFEEE8AA, "Palegoldenrod", "Blasses Goldgelb"), new ColorResourceInfo(XKnownColor.Khaki, XColors.Khaki, 0xFFF0E68C, "Khaki", "Khaki"), new ColorResourceInfo(XKnownColor.Yellow, XColors.Yellow, 0xFFFFFF00, "Yellow", "Gelb"), new ColorResourceInfo(XKnownColor.Gold, XColors.Gold, 0xFFFFD700, "Gold", "Gold"), new ColorResourceInfo(XKnownColor.Orange, XColors.Orange, 0xFFFFA500, "Orange", "Orange"), new ColorResourceInfo(XKnownColor.DarkOrange, XColors.DarkOrange, 0xFFFF8C00, "Darkorange", "Dunkles Orange"), //new ColorResourceInfo(XKnownColor.Goldenrod, XColors.Goldenrod, 0xFFDAA520, "Goldenrod", "Goldrute"), new ColorResourceInfo(XKnownColor.Goldenrod, XColors.Goldenrod, 0xFFDAA520, "Goldenrod", "Goldgelb"), //new ColorResourceInfo(XKnownColor.DarkGoldenrod, XColors.DarkGoldenrod, 0xFFB8860B, "Darkgoldenrod", "Dunkle Goldrutenfarbe"), new ColorResourceInfo(XKnownColor.DarkGoldenrod, XColors.DarkGoldenrod, 0xFFB8860B, "Darkgoldenrod", "Dunkles Goldgelb"), new ColorResourceInfo(XKnownColor.Peru, XColors.Peru, 0xFFCD853F, "Peru", "Peru"), new ColorResourceInfo(XKnownColor.Chocolate, XColors.Chocolate, 0xFFD2691E, "Chocolate", "Schokolade"), new ColorResourceInfo(XKnownColor.SaddleBrown, XColors.SaddleBrown, 0xFF8B4513, "Saddlebrown", "Sattelbraun"), new ColorResourceInfo(XKnownColor.Sienna, XColors.Sienna, 0xFFA0522D, "Sienna", "Ocker"), new ColorResourceInfo(XKnownColor.Brown, XColors.Brown, 0xFFA52A2A, "Brown", "Braun"), new ColorResourceInfo(XKnownColor.DarkRed, XColors.DarkRed, 0xFF8B0000, "Darkred", "Dunkelrot"), new ColorResourceInfo(XKnownColor.Maroon, XColors.Maroon, 0xFF800000, "Maroon", "Kastanienbraun"), new ColorResourceInfo(XKnownColor.PaleTurquoise, XColors.PaleTurquoise, 0xFFAFEEEE, "Paleturquoise", "Blasses Türkis"), //new ColorResourceInfo(XKnownColor.Firebrick, XColors.Firebrick, 0xFFB22222, "Firebrick", "Ziegelfarbe"), new ColorResourceInfo(XKnownColor.Firebrick, XColors.Firebrick, 0xFFB22222, "Firebrick", "Ziegel"), new ColorResourceInfo(XKnownColor.IndianRed, XColors.IndianRed, 0xFFCD5C5C, "Indianred", "Indischrot"), new ColorResourceInfo(XKnownColor.Crimson, XColors.Crimson, 0xFFDC143C, "Crimson", "Karmesinrot"), new ColorResourceInfo(XKnownColor.Red, XColors.Red, 0xFFFF0000, "Red", "Rot"), //new ColorResourceInfo(XKnownColor.OrangeRed, XColors.OrangeRed, 0xFFFF4500, "Orangered", "Orangenrot"), new ColorResourceInfo(XKnownColor.OrangeRed, XColors.OrangeRed, 0xFFFF4500, "Orangered", "Orangerot"), //new ColorResourceInfo(XKnownColor.Tomato, XColors.Tomato, 0xFFFF6347, "Tomato", "Tomatenrot"), new ColorResourceInfo(XKnownColor.Tomato, XColors.Tomato, 0xFFFF6347, "Tomato", "Tomate"), new ColorResourceInfo(XKnownColor.Coral, XColors.Coral, 0xFFFF7F50, "Coral", "Koralle"), new ColorResourceInfo(XKnownColor.Salmon, XColors.Salmon, 0xFFFA8072, "Salmon", "Lachs"), new ColorResourceInfo(XKnownColor.LightCoral, XColors.LightCoral, 0xFFF08080, "Lightcoral", "Helles Korallenrot"), //new ColorResourceInfo(XKnownColor.DarkSalmon, XColors.DarkSalmon, 0xFFE9967A, "Darksalmon", "Dunkle Lachsfarbe"), new ColorResourceInfo(XKnownColor.DarkSalmon, XColors.DarkSalmon, 0xFFE9967A, "Darksalmon", "Dunkles Lachs"), //new ColorResourceInfo(XKnownColor.LightSalmon, XColors.LightSalmon, 0xFFFFA07A, "Lightsalmon", "Helle Lachsfarbe"), new ColorResourceInfo(XKnownColor.LightSalmon, XColors.LightSalmon, 0xFFFFA07A, "Lightsalmon", "Helles Lachs"), new ColorResourceInfo(XKnownColor.SandyBrown, XColors.SandyBrown, 0xFFF4A460, "Sandybrown", "Sandbraun"), //new ColorResourceInfo(XKnownColor.RosyBrown, XColors.RosyBrown, 0xFFBC8F8F, "Rosybrown", "Rosiges Braun"), new ColorResourceInfo(XKnownColor.RosyBrown, XColors.RosyBrown, 0xFFBC8F8F, "Rosybrown", "Rotbraun"), new ColorResourceInfo(XKnownColor.Tan, XColors.Tan, 0xFFD2B48C, "Tan", "Gelbbraun"), //new ColorResourceInfo(XKnownColor.BurlyWood, XColors.BurlyWood, 0xFFDEB887, "Burlywood", "Grobes Braun"), new ColorResourceInfo(XKnownColor.BurlyWood, XColors.BurlyWood, 0xFFDEB887, "Burlywood", "Kräftiges Sandbraun"), new ColorResourceInfo(XKnownColor.Wheat, XColors.Wheat, 0xFFF5DEB3, "Wheat", "Weizen"), new ColorResourceInfo(XKnownColor.PeachPuff, XColors.PeachPuff, 0xFFFFDAB9, "Peachpuff", "Pfirsich"), //new ColorResourceInfo(XKnownColor.NavajoWhite, XColors.NavajoWhite, 0xFFFFDEAD, "Navajowhite", "Navajoweiß"), new ColorResourceInfo(XKnownColor.NavajoWhite, XColors.NavajoWhite, 0xFFFFDEAD, "Navajowhite", "Orangeweiß"), //new ColorResourceInfo(XKnownColor.Bisque, XColors.Bisque, 0xFFFFE4C4, "Bisque", "Tomatencreme"), new ColorResourceInfo(XKnownColor.Bisque, XColors.Bisque, 0xFFFFE4C4, "Bisque", "Blasses Rotbraun"), //new ColorResourceInfo(XKnownColor.Moccasin, XColors.Moccasin, 0xFFFFE4B5, "Moccasin", "Moccasin"), new ColorResourceInfo(XKnownColor.Moccasin, XColors.Moccasin, 0xFFFFE4B5, "Moccasin", "Mokassin"), //new ColorResourceInfo(XKnownColor.LavenderBlush, XColors.LavenderBlush, 0xFFFFF0F5, "Lavenderblush", "Rosige Lavenderfarbe"), new ColorResourceInfo(XKnownColor.LavenderBlush, XColors.LavenderBlush, 0xFFFFF0F5, "Lavenderblush", "Roter Lavendel"), new ColorResourceInfo(XKnownColor.MistyRose, XColors.MistyRose, 0xFFFFE4E1, "Mistyrose", "Altrosa"), new ColorResourceInfo(XKnownColor.Pink, XColors.Pink, 0xFFFFC0CB, "Pink", "Rosa"), new ColorResourceInfo(XKnownColor.LightPink, XColors.LightPink, 0xFFFFB6C1, "Lightpink", "Hellrosa"), new ColorResourceInfo(XKnownColor.HotPink, XColors.HotPink, 0xFFFF69B4, "Hotpink", "Leuchtendes Rosa"), //// XKnownColor.Fuchsia removed because the same as XKnownColor.Magenta ////new ColorResourceInfo(XKnownColor.Fuchsia, XColors.Fuchsia, 0xFFFF00FF, "Fuchsia", "Fuchsie"), new ColorResourceInfo(XKnownColor.Magenta, XColors.Magenta, 0xFFFF00FF, "Magenta", "Magentarot"), new ColorResourceInfo(XKnownColor.DeepPink, XColors.DeepPink, 0xFFFF1493, "Deeppink", "Tiefrosa"), new ColorResourceInfo(XKnownColor.MediumVioletRed, XColors.MediumVioletRed, 0xFFC71585, "Mediumvioletred", "Mittleres Violettrot"), new ColorResourceInfo(XKnownColor.PaleVioletRed, XColors.PaleVioletRed, 0xFFDB7093, "Palevioletred", "Blasses Violettrot"), new ColorResourceInfo(XKnownColor.Plum, XColors.Plum, 0xFFDDA0DD, "Plum", "Pflaume"), new ColorResourceInfo(XKnownColor.Thistle, XColors.Thistle, 0xFFD8BFD8, "Thistle", "Distel"), //new ColorResourceInfo(XKnownColor.Lavender, XColors.Lavender, 0xFFE6E6FA, "Lavender", "Lavendelfarbe"), new ColorResourceInfo(XKnownColor.Lavender, XColors.Lavender, 0xFFE6E6FA, "Lavender", "Lavendel"), new ColorResourceInfo(XKnownColor.Violet, XColors.Violet, 0xFFEE82EE, "Violet", "Violett"), new ColorResourceInfo(XKnownColor.Orchid, XColors.Orchid, 0xFFDA70D6, "Orchid", "Orchidee"), new ColorResourceInfo(XKnownColor.DarkMagenta, XColors.DarkMagenta, 0xFF8B008B, "Darkmagenta", "Dunkles Magentarot"), new ColorResourceInfo(XKnownColor.Purple, XColors.Purple, 0xFF800080, "Purple", "Violett"), new ColorResourceInfo(XKnownColor.Indigo, XColors.Indigo, 0xFF4B0082, "Indigo", "Indigo"), new ColorResourceInfo(XKnownColor.BlueViolet, XColors.BlueViolet, 0xFF8A2BE2, "Blueviolet", "Blauviolett"), new ColorResourceInfo(XKnownColor.DarkViolet, XColors.DarkViolet, 0xFF9400D3, "Darkviolet", "Dunkles Violett"), //new ColorResourceInfo(XKnownColor.DarkOrchid, XColors.DarkOrchid, 0xFF9932CC, "Darkorchid", "Dunkle Orchideenfarbe"), new ColorResourceInfo(XKnownColor.DarkOrchid, XColors.DarkOrchid, 0xFF9932CC, "Darkorchid", "Dunkle Orchidee"), new ColorResourceInfo(XKnownColor.MediumPurple, XColors.MediumPurple, 0xFF9370DB, "Mediumpurple", "Mittleres Violett"), //new ColorResourceInfo(XKnownColor.MediumOrchid, XColors.MediumOrchid, 0xFFBA55D3, "Mediumorchid", "Mittlere Orchideenfarbe"), new ColorResourceInfo(XKnownColor.MediumOrchid, XColors.MediumOrchid, 0xFFBA55D3, "Mediumorchid", "Mittlere Orchidee"), new ColorResourceInfo(XKnownColor.MediumSlateBlue, XColors.MediumSlateBlue, 0xFF7B68EE, "Mediumslateblue", "Mittleres Schieferblau"), new ColorResourceInfo(XKnownColor.SlateBlue, XColors.SlateBlue, 0xFF6A5ACD, "Slateblue", "Schieferblau"), new ColorResourceInfo(XKnownColor.DarkSlateBlue, XColors.DarkSlateBlue, 0xFF483D8B, "Darkslateblue", "Dunkles Schiefergrau"), new ColorResourceInfo(XKnownColor.MidnightBlue, XColors.MidnightBlue, 0xFF191970, "Midnightblue", "Mitternachtsblau"), new ColorResourceInfo(XKnownColor.Navy, XColors.Navy, 0xFF000080, "Navy", "Marineblau"), new ColorResourceInfo(XKnownColor.DarkBlue, XColors.DarkBlue, 0xFF00008B, "Darkblue", "Dunkelblau"), new ColorResourceInfo(XKnownColor.LightGray, XColors.LightGray, 0xFFD3D3D3, "Lightgray", "Hellgrau"), new ColorResourceInfo(XKnownColor.MediumBlue, XColors.MediumBlue, 0xFF0000CD, "Mediumblue", "Mittelblau"), new ColorResourceInfo(XKnownColor.Blue, XColors.Blue, 0xFF0000FF, "Blue", "Blau"), new ColorResourceInfo(XKnownColor.RoyalBlue, XColors.RoyalBlue, 0xFF4169E1, "Royalblue", "Königsblau"), new ColorResourceInfo(XKnownColor.SteelBlue, XColors.SteelBlue, 0xFF4682B4, "Steelblue", "Stahlblau"), new ColorResourceInfo(XKnownColor.CornflowerBlue, XColors.CornflowerBlue, 0xFF6495ED, "Cornflowerblue", "Kornblumenblau"), new ColorResourceInfo(XKnownColor.DodgerBlue, XColors.DodgerBlue, 0xFF1E90FF, "Dodgerblue", "Dodger-Blau"), new ColorResourceInfo(XKnownColor.DeepSkyBlue, XColors.DeepSkyBlue, 0xFF00BFFF, "Deepskyblue", "Tiefes Himmelblau"), new ColorResourceInfo(XKnownColor.LightSkyBlue, XColors.LightSkyBlue, 0xFF87CEFA, "Lightskyblue", "Helles Himmelblau"), new ColorResourceInfo(XKnownColor.SkyBlue, XColors.SkyBlue, 0xFF87CEEB, "Skyblue", "Himmelblau"), new ColorResourceInfo(XKnownColor.LightBlue, XColors.LightBlue, 0xFFADD8E6, "Lightblue", "Hellblau"), //// XKnownColor.Aqua removed because the same as XKnownColor.Cyan ////new ColorResourceInfo(XKnownColor.Aqua, XColors.Aqua, 0xFF00FFFF, "Aqua", "Blaugrün"), new ColorResourceInfo(XKnownColor.Cyan, XColors.Cyan, 0xFF00FFFF, "Cyan", "Zyan"), new ColorResourceInfo(XKnownColor.PowderBlue, XColors.PowderBlue, 0xFFB0E0E6, "Powderblue", "Taubenblau"), new ColorResourceInfo(XKnownColor.LightCyan, XColors.LightCyan, 0xFFE0FFFF, "Lightcyan", "Helles Cyanblau"), new ColorResourceInfo(XKnownColor.AliceBlue, XColors.AliceBlue, 0xFFA0CE00, "Aliceblue", "Aliceblau"), new ColorResourceInfo(XKnownColor.Azure, XColors.Azure, 0xFFF0FFFF, "Azure", "Himmelblau"), //new ColorResourceInfo(XKnownColor.MintCream, XColors.MintCream, 0xFFF5FFFA, "Mintcream", "Cremige Pfefferminzfarbe"), new ColorResourceInfo(XKnownColor.MintCream, XColors.MintCream, 0xFFF5FFFA, "Mintcream", "Helles Pfefferminzgrün"), new ColorResourceInfo(XKnownColor.Honeydew, XColors.Honeydew, 0xFFF0FFF0, "Honeydew", "Honigmelone"), new ColorResourceInfo(XKnownColor.Aquamarine, XColors.Aquamarine, 0xFF7FFFD4, "Aquamarine", "Aquamarinblau"), new ColorResourceInfo(XKnownColor.Turquoise, XColors.Turquoise, 0xFF40E0D0, "Turquoise", "Türkis"), new ColorResourceInfo(XKnownColor.MediumTurquoise, XColors.MediumTurquoise, 0xFF48D1CC, "Mediumturqoise", "Mittleres Türkis"), new ColorResourceInfo(XKnownColor.DarkTurquoise, XColors.DarkTurquoise, 0xFF00CED1, "Darkturquoise", "Dunkles Türkis"), new ColorResourceInfo(XKnownColor.MediumAquamarine, XColors.MediumAquamarine, 0xFF66CDAA, "Mediumaquamarine", "Mittleres Aquamarinblau"), new ColorResourceInfo(XKnownColor.LightSeaGreen, XColors.LightSeaGreen, 0xFF20B2AA, "Lightseagreen", "Helles Seegrün"), new ColorResourceInfo(XKnownColor.DarkCyan, XColors.DarkCyan, 0xFF008B8B, "Darkcyan", "Dunkles Zyanblau"), //new ColorResourceInfo(XKnownColor.Teal, XColors.Teal, 0xFF008080, "Teal", "Entenbraun"), new ColorResourceInfo(XKnownColor.Teal, XColors.Teal, 0xFF008080, "Teal", "Entenblau"), new ColorResourceInfo(XKnownColor.CadetBlue, XColors.CadetBlue, 0xFF5F9EA0, "Cadetblue", "Kadettblau"), new ColorResourceInfo(XKnownColor.MediumSeaGreen, XColors.MediumSeaGreen, 0xFF3CB371, "Mediumseagreen", "Mittleres Seegrün"), new ColorResourceInfo(XKnownColor.DarkSeaGreen, XColors.DarkSeaGreen, 0xFF8FBC8F, "Darkseagreen", "Dunkles Seegrün"), new ColorResourceInfo(XKnownColor.LightGreen, XColors.LightGreen, 0xFF90EE90, "Lightgreen", "Hellgrün"), new ColorResourceInfo(XKnownColor.PaleGreen, XColors.PaleGreen, 0xFF98FB98, "Palegreen", "Blassgrün"), new ColorResourceInfo(XKnownColor.MediumSpringGreen, XColors.MediumSpringGreen, 0xFF00FA9A, "Mediumspringgreen", "Mittleres Frühlingsgrün"), new ColorResourceInfo(XKnownColor.SpringGreen, XColors.SpringGreen, 0xFF00FF7F, "Springgreen", "Frühlingsgrün"), new ColorResourceInfo(XKnownColor.Lime, XColors.Lime, 0xFF00FF00, "Lime", "Zitronengrün"), new ColorResourceInfo(XKnownColor.LimeGreen, XColors.LimeGreen, 0xFF32CD32, "Limegreen", "Gelbgrün"), new ColorResourceInfo(XKnownColor.SeaGreen, XColors.SeaGreen, 0xFF2E8B57, "Seagreen", "Seegrün"), new ColorResourceInfo(XKnownColor.ForestGreen, XColors.ForestGreen, 0xFF228B22, "Forestgreen", "Waldgrün"), new ColorResourceInfo(XKnownColor.Green, XColors.Green, 0xFF008000, "Green", "Grün"), new ColorResourceInfo(XKnownColor.LawnGreen, XColors.LawnGreen, 0xFF008000, "LawnGreen", "Grasgrün"), new ColorResourceInfo(XKnownColor.DarkGreen, XColors.DarkGreen, 0xFF006400, "Darkgreen", "Dunkelgrün"), //new ColorResourceInfo(XKnownColor.OliveDrab, XColors.OliveDrab, 0xFF6B8E23, "Olivedrab", "Olivfarbiges Graubraun"), new ColorResourceInfo(XKnownColor.OliveDrab, XColors.OliveDrab, 0xFF6B8E23, "Olivedrab", "Reife Olive"), new ColorResourceInfo(XKnownColor.DarkOliveGreen, XColors.DarkOliveGreen, 0xFF556B2F, "Darkolivegreen", "Dunkles Olivgrün"), new ColorResourceInfo(XKnownColor.Olive, XColors.Olive, 0xFF808000, "Olive", "Olivgrün"), new ColorResourceInfo(XKnownColor.DarkKhaki, XColors.DarkKhaki, 0xFFBDB76B, "Darkkhaki", "Dunkles Khaki"), new ColorResourceInfo(XKnownColor.YellowGreen, XColors.YellowGreen, 0xFF9ACD32, "Yellowgreen", "Gelbgrün"), new ColorResourceInfo(XKnownColor.Chartreuse, XColors.Chartreuse, 0xFF7FFF00, "Chartreuse", "Hellgrün"), new ColorResourceInfo(XKnownColor.GreenYellow, XColors.GreenYellow, 0xFFADFF2F, "Greenyellow", "Grüngelb"), }; internal struct ColorResourceInfo { public ColorResourceInfo(XKnownColor knownColor, XColor color, uint argb, string name, string nameDE) { this.knownColor = knownColor; this.color = color; this.Argb = argb; this.Name = name; this.NameDE = nameDE; } public XKnownColor knownColor; public XColor color; public uint Argb; public string Name; public string NameDE; } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XRect.cs0000644000175000001440000005551711435766646022100 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.ComponentModel; using System.Runtime.InteropServices; #if GDI using System.Drawing; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Internal; namespace PdfSharp.Drawing { /// /// Stores a set of four floating-point numbers that represent the location and size of a rectangle. /// [DebuggerDisplay("({X}, {Y}, {Width}, {Height})")] [Serializable, StructLayout(LayoutKind.Sequential)] // , ValueSerializer(typeof(RectValueSerializer)), TypeConverter(typeof(RectConverter))] public struct XRect : IFormattable { /// /// Initializes a new instance of the XRect class. /// public XRect(double x, double y, double width, double height) { if (width < 0 || height < 0) throw new ArgumentException("WidthAndHeightCannotBeNegative"); //SR.Get(SRID.Size_WidthAndHeightCannotBeNegative, new object[0])); this.x = x; this.y = y; this.width = width; this.height = height; } /// /// Initializes a new instance of the XRect class. /// public XRect(XPoint point1, XPoint point2) { this.x = Math.Min(point1.x, point2.x); this.y = Math.Min(point1.y, point2.y); this.width = Math.Max(Math.Max(point1.x, point2.x) - this.x, 0); this.height = Math.Max(Math.Max(point1.y, point2.y) - this.y, 0); } /// /// Initializes a new instance of the XRect class. /// public XRect(XPoint point, XVector vector) : this(point, point + vector) { } /// /// Initializes a new instance of the XRect class. /// public XRect(XPoint location, XSize size) { if (size.IsEmpty) this = s_empty; else { this.x = location.x; this.y = location.y; this.width = size.width; this.height = size.height; } } /// /// Initializes a new instance of the XRect class. /// public XRect(XSize size) { if (size.IsEmpty) this = s_empty; else { this.x = this.y = 0; this.width = size.Width; this.height = size.Height; } } #if GDI /// /// Initializes a new instance of the XRect class. /// public XRect(PointF location, SizeF size) { this.x = location.X; this.y = location.Y; this.width = size.Width; this.height = size.Height; } #endif #if GDI /// /// Initializes a new instance of the XRect class. /// public XRect(RectangleF rect) { this.x = rect.X; this.y = rect.Y; this.width = rect.Width; this.height = rect.Height; } #endif #if WPF /// /// Initializes a new instance of the XRect class. /// public XRect(Rect rect) { this.x = rect.X; this.y = rect.Y; this.width = rect.Width; this.height = rect.Height; } #endif /// /// Creates a rectangle from for straight lines. /// public static XRect FromLTRB(double left, double top, double right, double bottom) { return new XRect(left, top, right - left, bottom - top); } /// /// Determines whether the two rectangles are equal. /// public static bool operator ==(XRect rect1, XRect rect2) { return rect1.X == rect2.X && rect1.Y == rect2.Y && rect1.Width == rect2.Width && rect1.Height == rect2.Height; } /// /// Determines whether the two rectangles are not equal. /// public static bool operator !=(XRect rect1, XRect rect2) { return !(rect1 == rect2); } /// /// Determines whether the two rectangles are equal. /// public static bool Equals(XRect rect1, XRect rect2) { if (rect1.IsEmpty) return rect2.IsEmpty; return rect1.X.Equals(rect2.X) && rect1.Y.Equals(rect2.Y) && rect1.Width.Equals(rect2.Width) && rect1.Height.Equals(rect2.Height); } /// /// Determines whether this instance and the specified object are equal. /// public override bool Equals(object o) { if ((o == null) || !(o is XRect)) return false; XRect rect = (XRect)o; return Equals(this, rect); } /// /// Determines whether this instance and the specified rect are equal. /// public bool Equals(XRect value) { return Equals(this, value); } /// /// Returns the hash code for this instance. /// public override int GetHashCode() { if (IsEmpty) return 0; return X.GetHashCode() ^ Y.GetHashCode() ^ Width.GetHashCode() ^ Height.GetHashCode(); } /// /// Parses the rectangle from a string. /// public static XRect Parse(string source) { XRect empty; CultureInfo cultureInfo = CultureInfo.InvariantCulture; TokenizerHelper helper = new TokenizerHelper(source, cultureInfo); string str = helper.NextTokenRequired(); if (str == "Empty") empty = Empty; else empty = new XRect(Convert.ToDouble(str, cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo)); helper.LastTokenRequired(); return empty; } /// /// Converts this XRect to a human readable string. /// public override string ToString() { return ConvertToString(null, null); } /// /// Converts this XRect to a human readable string. /// public string ToString(IFormatProvider provider) { return ConvertToString(null, provider); } /// /// Converts this XRect to a human readable string. /// string IFormattable.ToString(string format, IFormatProvider provider) { return ConvertToString(format, provider); } internal string ConvertToString(string format, IFormatProvider provider) { if (IsEmpty) return "Empty"; char numericListSeparator = TokenizerHelper.GetNumericListSeparator(provider); return string.Format(provider, "{1:" + format + "}{0}{2:" + format + "}{0}{3:" + format + "}{0}{4:" + format + "}", new object[] { numericListSeparator, this.x, this.y, this.width, this.height }); } /// /// Gets the empty rectangle. /// public static XRect Empty { get { return s_empty; } } /// /// Gets a value indicating whether this instance is empty. /// public bool IsEmpty { get { return this.width < 0; } } /// /// Gets or sets the location of the rectangle. /// public XPoint Location { get { return new XPoint(this.x, this.y); } set { if (IsEmpty) throw new InvalidOperationException("CannotModifyEmptyRect"); //SR.Get(SRID.Rect_CannotModifyEmptyRect, new object[0])); this.x = value.x; this.y = value.y; } } /// /// Gets or sets the size of the rectangle. /// //[Browsable(false)] public XSize Size { get { if (IsEmpty) return XSize.Empty; return new XSize(this.width, this.height); } set { if (value.IsEmpty) this = s_empty; else { if (IsEmpty) throw new InvalidOperationException("CannotModifyEmptyRect"); //SR.Get(SRID.Rect_CannotModifyEmptyRect, new object[0])); this.width = value.width; this.height = value.height; } } } /// /// Gets or sets the X value of the rectangle. /// public double X { get { return this.x; } set { if (IsEmpty) throw new InvalidOperationException("CannotModifyEmptyRect"); //SR.Get(SRID.Rect_CannotModifyEmptyRect, new object[0])); this.x = value; } } /// /// Gets or sets the Y value of the rectangle. /// public double Y { get { return this.y; } set { if (IsEmpty) throw new InvalidOperationException("CannotModifyEmptyRect"); //SR.Get(SRID.Rect_CannotModifyEmptyRect, new object[0])); this.y = value; } } /// /// Gets or sets the width of the rectangle. /// public double Width { get { return this.width; } set { if (IsEmpty) throw new InvalidOperationException("CannotModifyEmptyRect"); //SR.Get(SRID.Rect_CannotModifyEmptyRect, new object[0])); if (value < 0) throw new ArgumentException("WidthCannotBeNegative"); //SR.Get(SRID.Size_WidthCannotBeNegative, new object[0])); this.width = value; } } /// /// Gets or sets the height of the rectangle. /// public double Height { get { return this.height; } set { if (IsEmpty) throw new InvalidOperationException("CannotModifyEmptyRect"); //SR.Get(SRID.Rect_CannotModifyEmptyRect, new object[0])); if (value < 0) throw new ArgumentException("WidthCannotBeNegative"); //SR.Get(SRID.Size_WidthCannotBeNegative, new object[0])); this.height = value; } } /// /// Gets the x-axis value of the left side of the rectangle. /// public double Left { get { return this.x; } } /// /// Gets the y-axis value of the top side of the rectangle. /// public double Top { get { return this.y; } } /// /// Gets the x-axis value of the right side of the rectangle. /// public double Right { get { if (IsEmpty) return double.NegativeInfinity; return this.x + this.width; } } /// /// Gets the y-axis value of the bottom side of the rectangle. /// public double Bottom { get { if (IsEmpty) return double.NegativeInfinity; return this.y + this.height; } } /// /// Gets the position of the top-left corner of the rectangle. /// public XPoint TopLeft { get { return new XPoint(Left, Top); } } /// /// Gets the position of the top-right corner of the rectangle. /// public XPoint TopRight { get { return new XPoint(Right, Top); } } /// /// Gets the position of the bottom-left corner of the rectangle. /// public XPoint BottomLeft { get { return new XPoint(Left, Bottom); } } /// /// Gets the position of the bottom-right corner of the rectangle. /// public XPoint BottomRight { get { return new XPoint(Right, Bottom); } } /// /// Gets the center of the rectangle. /// //[Browsable(false)] public XPoint Center { get { return new XPoint(this.x + this.width / 2, this.y + this.height / 2); } } /// /// Indicates whether the rectangle contains the specified point. /// public bool Contains(XPoint point) { return Contains(point.x, point.y); } /// /// Indicates whether the rectangle contains the specified point. /// public bool Contains(double x, double y) { if (IsEmpty) return false; return ContainsInternal(x, y); } /// /// Indicates whether the rectangle contains the specified rectangle. /// public bool Contains(XRect rect) { return !IsEmpty && !rect.IsEmpty && this.x <= rect.x && this.y <= rect.y && this.x + this.width >= rect.x + rect.width && this.y + this.height >= rect.y + rect.height; } /// /// Indicates whether the specified rectangle intersects with the current rectangle. /// public bool IntersectsWith(XRect rect) { return !IsEmpty && !rect.IsEmpty && rect.Left <= Right && rect.Right >= Left && rect.Top <= Bottom && rect.Bottom >= Top; } /// /// Sets current rectangle to the intersection of the current rectangle and the specified rectangle. /// public void Intersect(XRect rect) { if (!IntersectsWith(rect)) this = Empty; else { double left = Math.Max(Left, rect.Left); double top = Math.Max(Top, rect.Top); this.width = Math.Max(Math.Min(Right, rect.Right) - left, 0.0); this.height = Math.Max(Math.Min(Bottom, rect.Bottom) - top, 0.0); this.x = left; this.y = top; } } /// /// Returns the intersection of two rectangles. /// public static XRect Intersect(XRect rect1, XRect rect2) { rect1.Intersect(rect2); return rect1; } /// /// Sets current rectangle to the union of the current rectangle and the specified rectangle. /// public void Union(XRect rect) { if (IsEmpty) this = rect; else if (!rect.IsEmpty) { double left = Math.Min(Left, rect.Left); double top = Math.Min(Top, rect.Top); if (rect.Width == Double.PositiveInfinity || Width == Double.PositiveInfinity) this.width = Double.PositiveInfinity; else { double right = Math.Max(Right, rect.Right); this.width = Math.Max(right - left, 0.0); } if (rect.Height == Double.PositiveInfinity || this.height == Double.PositiveInfinity) this.height = Double.PositiveInfinity; else { double bottom = Math.Max(Bottom, rect.Bottom); this.height = Math.Max(bottom - top, 0.0); } this.x = left; this.y = top; } } /// /// Returns the union of two rectangles. /// public static XRect Union(XRect rect1, XRect rect2) { rect1.Union(rect2); return rect1; } /// /// Sets current rectangle to the union of the current rectangle and the specified point. /// public void Union(XPoint point) { Union(new XRect(point, point)); } /// /// Returns the intersection of a rectangle and a point. /// public static XRect Union(XRect rect, XPoint point) { rect.Union(new XRect(point, point)); return rect; } /// /// Moves a rectangle by the specified amount. /// public void Offset(XVector offsetVector) { if (IsEmpty) throw new InvalidOperationException("CannotCallMethod"); //SR.Get(SRID.Rect_CannotCallMethod, new object[0])); this.x += offsetVector.x; this.y += offsetVector.y; } /// /// Moves a rectangle by the specified amount. /// public void Offset(double offsetX, double offsetY) { if (IsEmpty) throw new InvalidOperationException("CannotCallMethod"); //SR.Get(SRID.Rect_CannotCallMethod, new object[0])); this.x += offsetX; this.y += offsetY; } /// /// Returns a rectangle that is offset from the specified rectangle by using the specified vector. /// public static XRect Offset(XRect rect, XVector offsetVector) { rect.Offset(offsetVector.X, offsetVector.Y); return rect; } /// /// Returns a rectangle that is offset from the specified rectangle by using specified horizontal and vertical amounts. /// public static XRect Offset(XRect rect, double offsetX, double offsetY) { rect.Offset(offsetX, offsetY); return rect; } /// /// Translates the rectangle by adding the specified point. /// //[Obsolete("Use Offset.")] public static XRect operator +(XRect rect, XPoint point) { return new XRect(rect.x + point.x, rect.Y + point.y, rect.width, rect.height); } /// /// Translates the rectangle by subtracting the specified point. /// //[Obsolete("Use Offset.")] public static XRect operator -(XRect rect, XPoint point) { return new XRect(rect.x - point.x, rect.Y - point.y, rect.width, rect.height); } /// /// Expands the rectangle by using the specified Size, in all directions. /// public void Inflate(XSize size) { Inflate(size.width, size.height); } /// /// Expands or shrinks the rectangle by using the specified width and height amounts, in all directions. /// public void Inflate(double width, double height) { if (IsEmpty) throw new InvalidOperationException("CannotCallMethod"); //SR.Get(SRID.Rect_CannotCallMethod, new object[0])); this.x -= width; this.y -= height; this.width += width; this.width += width; this.height += height; this.height += height; if (this.width < 0 || this.height < 0) this = s_empty; } /// /// Returns the rectangle that results from expanding the specified rectangle by the specified Size, in all directions. /// public static XRect Inflate(XRect rect, XSize size) { rect.Inflate(size.width, size.height); return rect; } /// /// Creates a rectangle that results from expanding or shrinking the specified rectangle by the specified width and height amounts, in all directions. /// public static XRect Inflate(XRect rect, double width, double height) { rect.Inflate(width, height); return rect; } /// /// Returns the rectangle that results from applying the specified matrix to the specified rectangle. /// public static XRect Transform(XRect rect, XMatrix matrix) { XMatrix.MatrixHelper.TransformRect(ref rect, ref matrix); return rect; } /// /// Transforms the rectangle by applying the specified matrix. /// public void Transform(XMatrix matrix) { XMatrix.MatrixHelper.TransformRect(ref this, ref matrix); } /// /// Multiplies the size of the current rectangle by the specified x and y values. /// public void Scale(double scaleX, double scaleY) { if (!IsEmpty) { this.x *= scaleX; this.y *= scaleY; this.width *= scaleX; this.height *= scaleY; if (scaleX < 0) { this.x += this.width; this.width *= -1.0; } if (scaleY < 0) { this.y += this.height; this.height *= -1.0; } } } #if GDI /// /// Converts this instance to a System.Drawing.RectangleF. /// public RectangleF ToRectangleF() { return new RectangleF((float)this.x, (float)this.y, (float)this.width, (float)this.height); } #endif #if GDI /// /// Performs an implicit conversion from a System.Drawing.Rectangle to an XRect. /// public static implicit operator XRect(Rectangle rect) { return new XRect(rect.X, rect.Y, rect.Width, rect.Height); } /// /// Performs an implicit conversion from a System.Drawing.RectangleF to an XRect. /// public static implicit operator XRect(RectangleF rect) { return new XRect(rect.X, rect.Y, rect.Width, rect.Height); } #endif #if WPF /// /// Performs an implicit conversion from System.Windows.Rect to XRect. /// public static implicit operator XRect(Rect rect) { return new XRect(rect.X, rect.Y, rect.Width, rect.Height); } #endif bool ContainsInternal(double x, double y) { return x >= this.x && x - this.width <= this.x && y >= this.y && y - this.height <= this.y; } static XRect CreateEmptyRect() { XRect rect = new XRect(); rect.x = double.PositiveInfinity; rect.y = double.PositiveInfinity; rect.width = double.NegativeInfinity; rect.height = double.NegativeInfinity; return rect; } static XRect() { s_empty = CreateEmptyRect(); } internal double x; internal double y; internal double width; internal double height; private static readonly XRect s_empty; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/PdfFontOptions.cs0000644000175000001440000002000711435766646023751 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Runtime.InteropServices; using System.ComponentModel; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Internal; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; namespace PdfSharp.Drawing { /// /// Specifies details about how the font is used in PDF creation. /// public class XPdfFontOptions { internal XPdfFontOptions() { } /// /// Initializes a new instance of the class. /// public XPdfFontOptions(PdfFontEncoding encoding, PdfFontEmbedding embedding) { this.fontEncoding = encoding; this.fontEmbedding = embedding; } /// /// Initializes a new instance of the class. /// public XPdfFontOptions(PdfFontEncoding encoding) { this.fontEncoding = encoding; this.fontEmbedding = PdfFontEmbedding.None; } /// /// Initializes a new instance of the class. /// public XPdfFontOptions(PdfFontEmbedding embedding) { this.fontEncoding = PdfFontEncoding.WinAnsi; this.fontEmbedding = embedding; } /// /// Initializes a new instance of the class. /// /// If set to true the font is embedded. /// If set to true Unicode encoding is used. /// Not yet implemented. Should be "". /// Not yet implemented. Should be "". [Obsolete("Use other constructor")] XPdfFontOptions(bool embed, bool unicode, string baseFont, string fontFile) { this.fontEmbedding = embed ? PdfFontEmbedding.Always : PdfFontEmbedding.None; this.fontEncoding = unicode ? PdfFontEncoding.Unicode : PdfFontEncoding.WinAnsi; //this.baseFont = baseFont == null ? "" : baseFont; //this.fontFile = fontFile == null ? "" : fontFile; this.fontEmbedding = PdfFontEmbedding.Default; this.fontEncoding = PdfFontEncoding.WinAnsi; } /// /// Initializes a new instance of the class. /// /// If set to true Unicode encoding is used. /// User supplied font data. [Obsolete("Use other constructor")] public XPdfFontOptions(bool unicode, byte[] fontData) { this.fontEmbedding = PdfFontEmbedding.None; this.fontEncoding = unicode ? PdfFontEncoding.Unicode : PdfFontEncoding.WinAnsi; //this.baseFont = ""; //this.fontFile = ""; //this.fontData = fontData; } /// /// Initializes a new instance of the class. /// /// If set to true the font is embedded. /// Not yet implemented. Should be "". [Obsolete("Use other constructor")] public XPdfFontOptions(bool embed, string baseFont) : this(embed, false, baseFont, "") { } /// /// Initializes a new instance of the class. /// /// If set to true the font is embedded. /// If set to true Unicode encoding is used. [Obsolete("Use other constructor")] public XPdfFontOptions(bool embed, bool unicode) : this(embed, unicode, "", "") { } /// /// Initializes a new instance of the class. /// /// If set to true the font is embedded. [Obsolete("Use other constructor")] public XPdfFontOptions(bool embed) : this(embed, false, "", "") { } /// /// Initializes a new instance of the class. /// /// Indicates how font is embedded. /// If set to true Unicode encoding is used. [Obsolete("Use other constructor")] public XPdfFontOptions(PdfFontEmbedding fontEmbedding, bool unicode) : this(fontEmbedding == PdfFontEmbedding.Always || fontEmbedding == PdfFontEmbedding.Automatic, unicode, "", "") { } /// /// Gets a value indicating whether the gets embedded in the PDF file. /// [Obsolete("Use FontEmbedding")] public bool Embed { get { return this.fontEmbedding != PdfFontEmbedding.None; } } //bool embed; /// /// Gets a value indicating the font embedding. /// public PdfFontEmbedding FontEmbedding { get { return this.fontEmbedding; } } PdfFontEmbedding fontEmbedding; //public bool Subset //{ // get {return this.subset;} //} //bool subset; /// /// Gets a value indicating whether the font is encoded as Unicode. /// [Obsolete("Use FontEncoding")] public bool Unicode { get { return this.fontEncoding == PdfFontEncoding.Unicode; } } //bool unicode; /// /// Gets a value indicating how the font is encoded. /// public PdfFontEncoding FontEncoding { get { return this.fontEncoding; } } PdfFontEncoding fontEncoding; /// /// Not yet implemented. /// [Obsolete("Not yet implemented")] public string BaseFont { //get { return this.baseFont; } get { return ""; } } //string baseFont = ""; /// /// Not yet implemented. /// [Obsolete("Not yet implemented")] public string FontFile { //get { return this.fontFile; } get { return ""; } } //string fontFile = ""; /// /// Gets the font image. /// [Obsolete("Not yet implemented")] public byte[] FontData { //get { return this.fontData; } get { return null; } } //byte[] fontData; // this is part of XGraphics // public double CharacterSpacing; // public double WordSpacing; // public double HorizontalScaling; // public double Leading; // public double TextRise; // Kerning } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XGraphicsPathItem.cs0000644000175000001440000000473411435766646024372 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Text; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows.Media; #endif namespace PdfSharp.Drawing { #if true /// /// Represents a segment of a path defined by a type and a set of points. /// internal sealed class XGraphicsPathItem { public XGraphicsPathItem(XGraphicsPathItemType type) { this.type = type; this.points = null; } #if GDI public XGraphicsPathItem(XGraphicsPathItemType type, params PointF[] points) { this.type = type; this.points = XGraphics.MakeXPointArray(points); } #endif public XGraphicsPathItem(XGraphicsPathItemType type, params XPoint[] points) { this.type = type; this.points = (XPoint[])points.Clone(); } public XGraphicsPathItem Clone() { XGraphicsPathItem item = MemberwiseClone() as XGraphicsPathItem; item.points = this.points.Clone() as XPoint[]; return item; } public XGraphicsPathItemType type; public XPoint[] points; } #endif }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XSize.cs0000644000175000001440000002452511435766646022110 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.ComponentModel; using System.Runtime.InteropServices; #if GDI using System.Drawing; #endif #if WPF using System.Windows; #endif using PdfSharp.Internal; namespace PdfSharp.Drawing { /// /// Represents a pair of floating-point numbers, typically the width and height of a /// graphical object. /// //[DebuggerDisplay("({Width}, {Height})")] [DebuggerDisplay("Width={Width.ToString(\"0.####\",System.Globalization.CultureInfo.InvariantCulture)}, Height={Height.ToString(\"0.####\",System.Globalization.CultureInfo.InvariantCulture)}")] [Serializable, StructLayout(LayoutKind.Sequential)] //, ValueSerializer(typeof(SizeValueSerializer)), TypeConverter(typeof(SizeConverter))] public struct XSize : IFormattable { /// /// Initializes a new instance of the XPoint class with the specified values. /// public XSize(double width, double height) { if (width < 0 || height < 0) throw new ArgumentException("WidthAndHeightCannotBeNegative"); //SR.Get(SRID.Size_WidthAndHeightCannotBeNegative, new object[0])); this.width = width; this.height = height; } /// /// Initializes a new instance of the class. /// [Obsolete("Use explicit conversion to make your code more readable.")] public XSize(XPoint pt) // DELETE: 08-12-31 { this.width = pt.X; this.height = pt.Y; } /// /// Determines whether two size objects are equal. /// public static bool operator ==(XSize size1, XSize size2) { return size1.Width == size2.Width && size1.Height == size2.Height; } /// /// Determines whether two size objects are not equal. /// public static bool operator !=(XSize size1, XSize size2) { return !(size1 == size2); } /// /// Indicates whether this tow instance are equal. /// public static bool Equals(XSize size1, XSize size2) { if (size1.IsEmpty) return size2.IsEmpty; return size1.Width.Equals(size2.Width) && size1.Height.Equals(size2.Height); } /// /// Indicates whether this instance and a specified object are equal. /// public override bool Equals(object o) { if (o == null || !(o is XSize)) return false; XSize size = (XSize)o; return Equals(this, size); } /// /// Indicates whether this instance and a specified size are equal. /// public bool Equals(XSize value) { return Equals(this, value); } /// /// Returns the hash code for this instance. /// public override int GetHashCode() { if (IsEmpty) return 0; return Width.GetHashCode() ^ Height.GetHashCode(); } /// /// Parses the size from a string. /// public static XSize Parse(string source) { XSize empty; CultureInfo cultureInfo = CultureInfo.InvariantCulture; TokenizerHelper helper = new TokenizerHelper(source, cultureInfo); string str = helper.NextTokenRequired(); if (str == "Empty") empty = Empty; else empty = new XSize(Convert.ToDouble(str, cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo)); helper.LastTokenRequired(); return empty; } #if GDI /// /// Converts this XSize to a PointF. /// public PointF ToPointF() { return new PointF((float)this.width, (float)this.height); } #endif /// /// Converts this XSize to an XPoint. /// public XPoint ToXPoint() { return new XPoint(this.width, this.height); } /// /// Converts this XSize to an XVector. /// public XVector ToXVector() { return new XVector(this.width, this.height); } #if GDI /// /// Converts this XSize to a SizeF. /// public SizeF ToSizeF() { return new SizeF((float)this.width, (float)this.height); } #endif #if WPF /// /// Converts this XSize to a System.Windows.Size. /// public System.Windows.Size ToSize() { return new System.Windows.Size(this.width, this.height); } #endif #if GDI /// /// Creates an XSize from a System.Drawing.Size. /// public static XSize FromSize(System.Drawing.Size size) { return new XSize(size.Width, size.Height); } /// /// Implicit conversion from XSize to System.Drawing.Size. The conversion must be implicit because the /// WinForms designer uses it. /// public static implicit operator XSize(System.Drawing.Size size) { return new XSize(size.Width, size.Height); } #endif #if WPF /// /// Creates an XSize from a System.Drawing.Size. /// public static XSize FromSize(System.Windows.Size size) { return new XSize(size.Width, size.Height); } #endif #if GDI /// /// Creates an XSize from a System.Drawing.Size. /// public static XSize FromSizeF(SizeF size) { return new XSize(size.Width, size.Height); } #endif /// /// Converts this XSize to a human readable string. /// public override string ToString() { return ConvertToString(null, null); } /// /// Converts this XSize to a human readable string. /// public string ToString(IFormatProvider provider) { return ConvertToString(null, provider); } /// /// Converts this XSize to a human readable string. /// string IFormattable.ToString(string format, IFormatProvider provider) { return ConvertToString(format, provider); } internal string ConvertToString(string format, IFormatProvider provider) { if (IsEmpty) return "Empty"; char numericListSeparator = TokenizerHelper.GetNumericListSeparator(provider); return string.Format(provider, "{1:" + format + "}{0}{2:" + format + "}", new object[] { numericListSeparator, this.width, this.height }); } /// /// Returns an empty size, i.e. a size with a width or height less than 0. /// public static XSize Empty { get { return s_empty; } } /// /// Gets a value indicating whether this instance is empty. /// public bool IsEmpty { get { return this.width < 0; } } /// /// Gets or sets the width. /// public double Width { get { return this.width; } set { if (IsEmpty) throw new InvalidOperationException("CannotModifyEmptySize"); //SR.Get(SRID.Size_CannotModifyEmptySize, new object[0])); if (value < 0) throw new ArgumentException("WidthCannotBeNegative"); //SR.Get(SRID.Size_WidthCannotBeNegative, new object[0])); this.width = value; } } /// /// Gets or sets the height. /// public double Height { get { return this.height; } set { if (IsEmpty) throw new InvalidOperationException("CannotModifyEmptySize"); // SR.Get(SRID.Size_CannotModifyEmptySize, new object[0])); if (value < 0) throw new ArgumentException("HeightCannotBeNegative"); //SR.Get(SRID.Size_HeightCannotBeNegative, new object[0])); this.height = value; } } /// /// Performs an explicit conversion from XSize to XVector. /// public static explicit operator XVector(XSize size) { return new XVector(size.width, size.height); } /// /// Performs an explicit conversion from XSize to XPoint. /// public static explicit operator XPoint(XSize size) { return new XPoint(size.width, size.height); } #if WPF /// /// Performs an explicit conversion from Size to XSize. /// public static explicit operator XSize(System.Windows.Size size) { return new XSize(size.Width, size.Height); } #endif private static XSize CreateEmptySize() { XSize size = new XSize(); size.width = double.NegativeInfinity; size.height = double.NegativeInfinity; return size; } static XSize() { s_empty = CreateEmptySize(); } internal double width; internal double height; private static readonly XSize s_empty; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XVector.cs0000644000175000001440000001731311435766646022435 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Runtime.InteropServices; #if GDI using System.Drawing; #endif #if WPF using System.Windows.Media; using System.Globalization; #endif #pragma warning disable 1591 namespace PdfSharp.Drawing { /// /// Represents a two-dimensional vector specified by x- and y-coordinates. /// [Serializable] [StructLayout(LayoutKind.Sequential)] public struct XVector : IFormattable { public XVector(double x, double y) { this.x = x; this.y = y; } public static bool operator ==(XVector vector1, XVector vector2) { return vector1.x == vector2.x && vector1.y == vector2.y; } public static bool operator !=(XVector vector1, XVector vector2) { return vector1.x != vector2.x || vector1.y != vector2.y; } public static bool Equals(XVector vector1, XVector vector2) { if (vector1.X.Equals(vector2.X)) return vector1.Y.Equals(vector2.Y); return false; } public override bool Equals(object o) { if ((o == null) || !(o is XVector)) return false; XVector vector = (XVector)o; return Equals(this, vector); } public bool Equals(XVector value) { return Equals(this, value); } public override int GetHashCode() { return this.x.GetHashCode() ^ this.y.GetHashCode(); } //public static XVector Parse(string source) //{ // IFormatProvider cultureInfo = CultureInfo.GetCultureInfo("en-us"); // TokenizerHelper helper = new TokenizerHelper(source, cultureInfo); // string str = helper.NextTokenRequired(); // XVector vector = new XVector(Convert.ToDouble(str, cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo)); // helper.LastTokenRequired(); // return vector; //} public double X { get { return this.x; } set { this.x = value; } } public double Y { get { return this.y; } set { this.y = value; } } public override string ToString() { return ConvertToString(null, null); } public string ToString(IFormatProvider provider) { return ConvertToString(null, provider); } string IFormattable.ToString(string format, IFormatProvider provider) { return ConvertToString(format, provider); } internal string ConvertToString(string format, IFormatProvider provider) { const char numericListSeparator = ','; return string.Format(provider, "{1:" + format + "}{0}{2:" + format + "}", new object[] { numericListSeparator, this.x, this.y }); } public double Length { get { return Math.Sqrt((this.x * this.x) + (this.y * this.y)); } } public double LengthSquared { get { return this.x * this.x + this.y * this.y; } } public void Normalize() { this = this / Math.Max(Math.Abs(this.x), Math.Abs(this.y)); this = this / Length; } public static double CrossProduct(XVector vector1, XVector vector2) { return vector1.x * vector2.y - vector1.y * vector2.x; } public static double AngleBetween(XVector vector1, XVector vector2) { double y = vector1.x * vector2.y - vector2.x * vector1.y; double x = vector1.x * vector2.x + vector1.y * vector2.y; return (Math.Atan2(y, x) * 57.295779513082323); } public static XVector operator -(XVector vector) { return new XVector(-vector.x, -vector.y); } public void Negate() { this.x = -this.x; this.y = -this.y; } public static XVector operator +(XVector vector1, XVector vector2) { return new XVector(vector1.x + vector2.x, vector1.y + vector2.y); } public static XVector Add(XVector vector1, XVector vector2) { return new XVector(vector1.x + vector2.x, vector1.y + vector2.y); } public static XVector operator -(XVector vector1, XVector vector2) { return new XVector(vector1.x - vector2.x, vector1.y - vector2.y); } public static XVector Subtract(XVector vector1, XVector vector2) { return new XVector(vector1.x - vector2.x, vector1.y - vector2.y); } public static XPoint operator +(XVector vector, XPoint point) { return new XPoint(point.x + vector.x, point.y + vector.y); } public static XPoint Add(XVector vector, XPoint point) { return new XPoint(point.x + vector.x, point.y + vector.y); } public static XVector operator *(XVector vector, double scalar) { return new XVector(vector.x * scalar, vector.y * scalar); } public static XVector Multiply(XVector vector, double scalar) { return new XVector(vector.x * scalar, vector.y * scalar); } public static XVector operator *(double scalar, XVector vector) { return new XVector(vector.x * scalar, vector.y * scalar); } public static XVector Multiply(double scalar, XVector vector) { return new XVector(vector.x * scalar, vector.y * scalar); } public static XVector operator /(XVector vector, double scalar) { return vector * (1.0 / scalar); } public static XVector Divide(XVector vector, double scalar) { return vector * (1.0 / scalar); } public static XVector operator *(XVector vector, XMatrix matrix) { return matrix.Transform(vector); } public static XVector Multiply(XVector vector, XMatrix matrix) { return matrix.Transform(vector); } public static double operator *(XVector vector1, XVector vector2) { return vector1.x * vector2.x + vector1.y * vector2.y; } public static double Multiply(XVector vector1, XVector vector2) { return vector1.x * vector2.x + vector1.y * vector2.y; } public static double Determinant(XVector vector1, XVector vector2) { return vector1.x * vector2.y - vector1.y * vector2.x; } public static explicit operator XSize(XVector vector) { return new XSize(Math.Abs(vector.x), Math.Abs(vector.y)); } public static explicit operator XPoint(XVector vector) { return new XPoint(vector.x, vector.y); } internal double x; internal double y; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XBrushes.cs0000644000175000001440000013667511435766646022623 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Drawing { /// /// Brushes for all the pre-defined colors. /// public static class XBrushes { /// Gets a pre-defined XBrush object. public static XSolidBrush AliceBlue { get { if (XBrushes.aliceBlue == null) XBrushes.aliceBlue = new XSolidBrush(XColors.AliceBlue, true); return XBrushes.aliceBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush AntiqueWhite { get { if (XBrushes.antiqueWhite == null) XBrushes.antiqueWhite = new XSolidBrush(XColors.AntiqueWhite, true); return XBrushes.antiqueWhite; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Aqua { get { if (XBrushes.aqua == null) XBrushes.aqua = new XSolidBrush(XColors.Aqua, true); return XBrushes.aqua; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Aquamarine { get { if (XBrushes.aquamarine == null) XBrushes.aquamarine = new XSolidBrush(XColors.Aquamarine, true); return XBrushes.aquamarine; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Azure { get { if (XBrushes.azure == null) XBrushes.azure = new XSolidBrush(XColors.Azure, true); return XBrushes.azure; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Beige { get { if (XBrushes.beige == null) XBrushes.beige = new XSolidBrush(XColors.Beige, true); return XBrushes.beige; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Bisque { get { if (XBrushes.bisque == null) XBrushes.bisque = new XSolidBrush(XColors.Bisque, true); return XBrushes.bisque; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Black { get { if (XBrushes.black == null) XBrushes.black = new XSolidBrush(XColors.Black, true); return XBrushes.black; } } /// Gets a pre-defined XBrush object. public static XSolidBrush BlanchedAlmond { get { if (XBrushes.blanchedAlmond == null) XBrushes.blanchedAlmond = new XSolidBrush(XColors.BlanchedAlmond, true); return XBrushes.blanchedAlmond; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Blue { get { if (XBrushes.blue == null) XBrushes.blue = new XSolidBrush(XColors.Blue, true); return XBrushes.blue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush BlueViolet { get { if (XBrushes.blueViolet == null) XBrushes.blueViolet = new XSolidBrush(XColors.BlueViolet, true); return XBrushes.blueViolet; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Brown { get { if (XBrushes.brown == null) XBrushes.brown = new XSolidBrush(XColors.Brown, true); return XBrushes.brown; } } /// Gets a pre-defined XBrush object. public static XSolidBrush BurlyWood { get { if (XBrushes.burlyWood == null) XBrushes.burlyWood = new XSolidBrush(XColors.BurlyWood, true); return XBrushes.burlyWood; } } /// Gets a pre-defined XBrush object. public static XSolidBrush CadetBlue { get { if (XBrushes.cadetBlue == null) XBrushes.cadetBlue = new XSolidBrush(XColors.CadetBlue, true); return XBrushes.cadetBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Chartreuse { get { if (XBrushes.chartreuse == null) XBrushes.chartreuse = new XSolidBrush(XColors.Chartreuse, true); return XBrushes.chartreuse; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Chocolate { get { if (XBrushes.chocolate == null) XBrushes.chocolate = new XSolidBrush(XColors.Chocolate, true); return XBrushes.chocolate; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Coral { get { if (XBrushes.coral == null) XBrushes.coral = new XSolidBrush(XColors.Coral, true); return XBrushes.coral; } } /// Gets a pre-defined XBrush object. public static XSolidBrush CornflowerBlue { get { if (XBrushes.cornflowerBlue == null) XBrushes.cornflowerBlue = new XSolidBrush(XColors.CornflowerBlue, true); return XBrushes.cornflowerBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Cornsilk { get { if (XBrushes.cornsilk == null) XBrushes.cornsilk = new XSolidBrush(XColors.Cornsilk, true); return XBrushes.cornsilk; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Crimson { get { if (XBrushes.crimson == null) XBrushes.crimson = new XSolidBrush(XColors.Crimson, true); return XBrushes.crimson; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Cyan { get { if (XBrushes.cyan == null) XBrushes.cyan = new XSolidBrush(XColors.Cyan, true); return XBrushes.cyan; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkBlue { get { if (XBrushes.darkBlue == null) XBrushes.darkBlue = new XSolidBrush(XColors.DarkBlue, true); return XBrushes.darkBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkCyan { get { if (XBrushes.darkCyan == null) XBrushes.darkCyan = new XSolidBrush(XColors.DarkCyan, true); return XBrushes.darkCyan; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkGoldenrod { get { if (XBrushes.darkGoldenrod == null) XBrushes.darkGoldenrod = new XSolidBrush(XColors.DarkGoldenrod, true); return XBrushes.darkGoldenrod; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkGray { get { if (XBrushes.darkGray == null) XBrushes.darkGray = new XSolidBrush(XColors.DarkGray, true); return XBrushes.darkGray; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkGreen { get { if (XBrushes.darkGreen == null) XBrushes.darkGreen = new XSolidBrush(XColors.DarkGreen, true); return XBrushes.darkGreen; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkKhaki { get { if (XBrushes.darkKhaki == null) XBrushes.darkKhaki = new XSolidBrush(XColors.DarkKhaki, true); return XBrushes.darkKhaki; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkMagenta { get { if (XBrushes.darkMagenta == null) XBrushes.darkMagenta = new XSolidBrush(XColors.DarkMagenta, true); return XBrushes.darkMagenta; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkOliveGreen { get { if (XBrushes.darkOliveGreen == null) XBrushes.darkOliveGreen = new XSolidBrush(XColors.DarkOliveGreen, true); return XBrushes.darkOliveGreen; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkOrange { get { if (XBrushes.darkOrange == null) XBrushes.darkOrange = new XSolidBrush(XColors.DarkOrange, true); return XBrushes.darkOrange; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkOrchid { get { if (XBrushes.darkOrchid == null) XBrushes.darkOrchid = new XSolidBrush(XColors.DarkOrchid, true); return XBrushes.darkOrchid; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkRed { get { if (XBrushes.darkRed == null) XBrushes.darkRed = new XSolidBrush(XColors.DarkRed, true); return XBrushes.darkRed; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkSalmon { get { if (XBrushes.darkSalmon == null) XBrushes.darkSalmon = new XSolidBrush(XColors.DarkSalmon, true); return XBrushes.darkSalmon; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkSeaGreen { get { if (XBrushes.darkSeaGreen == null) XBrushes.darkSeaGreen = new XSolidBrush(XColors.DarkSeaGreen, true); return XBrushes.darkSeaGreen; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkSlateBlue { get { if (XBrushes.darkSlateBlue == null) XBrushes.darkSlateBlue = new XSolidBrush(XColors.DarkSlateBlue, true); return XBrushes.darkSlateBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkSlateGray { get { if (XBrushes.darkSlateGray == null) XBrushes.darkSlateGray = new XSolidBrush(XColors.DarkSlateGray, true); return XBrushes.darkSlateGray; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkTurquoise { get { if (XBrushes.darkTurquoise == null) XBrushes.darkTurquoise = new XSolidBrush(XColors.DarkTurquoise, true); return XBrushes.darkTurquoise; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DarkViolet { get { if (XBrushes.darkViolet == null) XBrushes.darkViolet = new XSolidBrush(XColors.DarkViolet, true); return XBrushes.darkViolet; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DeepPink { get { if (XBrushes.deepPink == null) XBrushes.deepPink = new XSolidBrush(XColors.DeepPink, true); return XBrushes.deepPink; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DeepSkyBlue { get { if (XBrushes.deepSkyBlue == null) XBrushes.deepSkyBlue = new XSolidBrush(XColors.DeepSkyBlue, true); return XBrushes.deepSkyBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DimGray { get { if (XBrushes.dimGray == null) XBrushes.dimGray = new XSolidBrush(XColors.DimGray, true); return XBrushes.dimGray; } } /// Gets a pre-defined XBrush object. public static XSolidBrush DodgerBlue { get { if (XBrushes.dodgerBlue == null) XBrushes.dodgerBlue = new XSolidBrush(XColors.DodgerBlue, true); return XBrushes.dodgerBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Firebrick { get { if (XBrushes.firebrick == null) XBrushes.firebrick = new XSolidBrush(XColors.Firebrick, true); return XBrushes.firebrick; } } /// Gets a pre-defined XBrush object. public static XSolidBrush FloralWhite { get { if (XBrushes.floralWhite == null) XBrushes.floralWhite = new XSolidBrush(XColors.FloralWhite, true); return XBrushes.floralWhite; } } /// Gets a pre-defined XBrush object. public static XSolidBrush ForestGreen { get { if (XBrushes.forestGreen == null) XBrushes.forestGreen = new XSolidBrush(XColors.ForestGreen, true); return XBrushes.forestGreen; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Fuchsia { get { if (XBrushes.fuchsia == null) XBrushes.fuchsia = new XSolidBrush(XColors.Fuchsia, true); return XBrushes.fuchsia; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Gainsboro { get { if (XBrushes.gainsboro == null) XBrushes.gainsboro = new XSolidBrush(XColors.Gainsboro, true); return XBrushes.gainsboro; } } /// Gets a pre-defined XBrush object. public static XSolidBrush GhostWhite { get { if (XBrushes.ghostWhite == null) XBrushes.ghostWhite = new XSolidBrush(XColors.GhostWhite, true); return XBrushes.ghostWhite; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Gold { get { if (XBrushes.gold == null) XBrushes.gold = new XSolidBrush(XColors.Gold, true); return XBrushes.gold; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Goldenrod { get { if (XBrushes.goldenrod == null) XBrushes.goldenrod = new XSolidBrush(XColors.Goldenrod, true); return XBrushes.goldenrod; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Gray { get { if (XBrushes.gray == null) XBrushes.gray = new XSolidBrush(XColors.Gray, true); return XBrushes.gray; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Green { get { if (XBrushes.green == null) XBrushes.green = new XSolidBrush(XColors.Green, true); return XBrushes.green; } } /// Gets a pre-defined XBrush object. public static XSolidBrush GreenYellow { get { if (XBrushes.greenYellow == null) XBrushes.greenYellow = new XSolidBrush(XColors.GreenYellow, true); return XBrushes.greenYellow; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Honeydew { get { if (XBrushes.honeydew == null) XBrushes.honeydew = new XSolidBrush(XColors.Honeydew, true); return XBrushes.honeydew; } } /// Gets a pre-defined XBrush object. public static XSolidBrush HotPink { get { if (XBrushes.hotPink == null) XBrushes.hotPink = new XSolidBrush(XColors.HotPink, true); return XBrushes.hotPink; } } /// Gets a pre-defined XBrush object. public static XSolidBrush IndianRed { get { if (XBrushes.indianRed == null) XBrushes.indianRed = new XSolidBrush(XColors.IndianRed, true); return XBrushes.indianRed; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Indigo { get { if (XBrushes.indigo == null) XBrushes.indigo = new XSolidBrush(XColors.Indigo, true); return XBrushes.indigo; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Ivory { get { if (XBrushes.ivory == null) XBrushes.ivory = new XSolidBrush(XColors.Ivory, true); return XBrushes.ivory; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Khaki { get { if (XBrushes.khaki == null) XBrushes.khaki = new XSolidBrush(XColors.Khaki, true); return XBrushes.khaki; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Lavender { get { if (XBrushes.lavender == null) XBrushes.lavender = new XSolidBrush(XColors.Lavender, true); return XBrushes.lavender; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LavenderBlush { get { if (XBrushes.lavenderBlush == null) XBrushes.lavenderBlush = new XSolidBrush(XColors.LavenderBlush, true); return XBrushes.lavenderBlush; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LawnGreen { get { if (XBrushes.lawnGreen == null) XBrushes.lawnGreen = new XSolidBrush(XColors.LawnGreen, true); return XBrushes.lawnGreen; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LemonChiffon { get { if (XBrushes.lemonChiffon == null) XBrushes.lemonChiffon = new XSolidBrush(XColors.LemonChiffon, true); return XBrushes.lemonChiffon; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LightBlue { get { if (XBrushes.lightBlue == null) XBrushes.lightBlue = new XSolidBrush(XColors.LightBlue, true); return XBrushes.lightBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LightCoral { get { if (XBrushes.lightCoral == null) XBrushes.lightCoral = new XSolidBrush(XColors.LightCoral, true); return XBrushes.lightCoral; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LightCyan { get { if (XBrushes.lightCyan == null) XBrushes.lightCyan = new XSolidBrush(XColors.LightCyan, true); return XBrushes.lightCyan; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LightGoldenrodYellow { get { if (XBrushes.lightGoldenrodYellow == null) XBrushes.lightGoldenrodYellow = new XSolidBrush(XColors.LightGoldenrodYellow, true); return XBrushes.lightGoldenrodYellow; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LightGray { get { if (XBrushes.lightGray == null) XBrushes.lightGray = new XSolidBrush(XColors.LightGray, true); return XBrushes.lightGray; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LightGreen { get { if (XBrushes.lightGreen == null) XBrushes.lightGreen = new XSolidBrush(XColors.LightGreen, true); return XBrushes.lightGreen; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LightPink { get { if (XBrushes.lightPink == null) XBrushes.lightPink = new XSolidBrush(XColors.LightPink, true); return XBrushes.lightPink; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LightSalmon { get { if (XBrushes.lightSalmon == null) XBrushes.lightSalmon = new XSolidBrush(XColors.LightSalmon, true); return XBrushes.lightSalmon; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LightSeaGreen { get { if (XBrushes.lightSeaGreen == null) XBrushes.lightSeaGreen = new XSolidBrush(XColors.LightSeaGreen, true); return XBrushes.lightSeaGreen; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LightSkyBlue { get { if (XBrushes.lightSkyBlue == null) XBrushes.lightSkyBlue = new XSolidBrush(XColors.LightSkyBlue, true); return XBrushes.lightSkyBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LightSlateGray { get { if (XBrushes.lightSlateGray == null) XBrushes.lightSlateGray = new XSolidBrush(XColors.LightSlateGray, true); return XBrushes.lightSlateGray; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LightSteelBlue { get { if (XBrushes.lightSteelBlue == null) XBrushes.lightSteelBlue = new XSolidBrush(XColors.LightSteelBlue, true); return XBrushes.lightSteelBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LightYellow { get { if (XBrushes.lightYellow == null) XBrushes.lightYellow = new XSolidBrush(XColors.LightYellow, true); return XBrushes.lightYellow; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Lime { get { if (XBrushes.lime == null) XBrushes.lime = new XSolidBrush(XColors.Lime, true); return XBrushes.lime; } } /// Gets a pre-defined XBrush object. public static XSolidBrush LimeGreen { get { if (XBrushes.limeGreen == null) XBrushes.limeGreen = new XSolidBrush(XColors.LimeGreen, true); return XBrushes.limeGreen; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Linen { get { if (XBrushes.linen == null) XBrushes.linen = new XSolidBrush(XColors.Linen, true); return XBrushes.linen; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Magenta { get { if (XBrushes.magenta == null) XBrushes.magenta = new XSolidBrush(XColors.Magenta, true); return XBrushes.magenta; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Maroon { get { if (XBrushes.maroon == null) XBrushes.maroon = new XSolidBrush(XColors.Maroon, true); return XBrushes.maroon; } } /// Gets a pre-defined XBrush object. public static XSolidBrush MediumAquamarine { get { if (XBrushes.mediumAquamarine == null) XBrushes.mediumAquamarine = new XSolidBrush(XColors.MediumAquamarine, true); return XBrushes.mediumAquamarine; } } /// Gets a pre-defined XBrush object. public static XSolidBrush MediumBlue { get { if (XBrushes.mediumBlue == null) XBrushes.mediumBlue = new XSolidBrush(XColors.MediumBlue, true); return XBrushes.mediumBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush MediumOrchid { get { if (XBrushes.mediumOrchid == null) XBrushes.mediumOrchid = new XSolidBrush(XColors.MediumOrchid, true); return XBrushes.mediumOrchid; } } /// Gets a pre-defined XBrush object. public static XSolidBrush MediumPurple { get { if (XBrushes.mediumPurple == null) XBrushes.mediumPurple = new XSolidBrush(XColors.MediumPurple, true); return XBrushes.mediumPurple; } } /// Gets a pre-defined XBrush object. public static XSolidBrush MediumSeaGreen { get { if (XBrushes.mediumSeaGreen == null) XBrushes.mediumSeaGreen = new XSolidBrush(XColors.MediumSeaGreen, true); return XBrushes.mediumSeaGreen; } } /// Gets a pre-defined XBrush object. public static XSolidBrush MediumSlateBlue { get { if (XBrushes.mediumSlateBlue == null) XBrushes.mediumSlateBlue = new XSolidBrush(XColors.MediumSlateBlue, true); return XBrushes.mediumSlateBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush MediumSpringGreen { get { if (XBrushes.mediumSpringGreen == null) XBrushes.mediumSpringGreen = new XSolidBrush(XColors.MediumSpringGreen, true); return XBrushes.mediumSpringGreen; } } /// Gets a pre-defined XBrush object. public static XSolidBrush MediumTurquoise { get { if (XBrushes.mediumTurquoise == null) XBrushes.mediumTurquoise = new XSolidBrush(XColors.MediumTurquoise, true); return XBrushes.mediumTurquoise; } } /// Gets a pre-defined XBrush object. public static XSolidBrush MediumVioletRed { get { if (XBrushes.mediumVioletRed == null) XBrushes.mediumVioletRed = new XSolidBrush(XColors.MediumVioletRed, true); return XBrushes.mediumVioletRed; } } /// Gets a pre-defined XBrush object. public static XSolidBrush MidnightBlue { get { if (XBrushes.midnightBlue == null) XBrushes.midnightBlue = new XSolidBrush(XColors.MidnightBlue, true); return XBrushes.midnightBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush MintCream { get { if (XBrushes.mintCream == null) XBrushes.mintCream = new XSolidBrush(XColors.MintCream, true); return XBrushes.mintCream; } } /// Gets a pre-defined XBrush object. public static XSolidBrush MistyRose { get { if (XBrushes.mistyRose == null) XBrushes.mistyRose = new XSolidBrush(XColors.MistyRose, true); return XBrushes.mistyRose; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Moccasin { get { if (XBrushes.moccasin == null) XBrushes.moccasin = new XSolidBrush(XColors.Moccasin, true); return XBrushes.moccasin; } } /// Gets a pre-defined XBrush object. public static XSolidBrush NavajoWhite { get { if (XBrushes.navajoWhite == null) XBrushes.navajoWhite = new XSolidBrush(XColors.NavajoWhite, true); return XBrushes.navajoWhite; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Navy { get { if (XBrushes.navy == null) XBrushes.navy = new XSolidBrush(XColors.Navy, true); return XBrushes.navy; } } /// Gets a pre-defined XBrush object. public static XSolidBrush OldLace { get { if (XBrushes.oldLace == null) XBrushes.oldLace = new XSolidBrush(XColors.OldLace, true); return XBrushes.oldLace; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Olive { get { if (XBrushes.olive == null) XBrushes.olive = new XSolidBrush(XColors.Olive, true); return XBrushes.olive; } } /// Gets a pre-defined XBrush object. public static XSolidBrush OliveDrab { get { if (XBrushes.oliveDrab == null) XBrushes.oliveDrab = new XSolidBrush(XColors.OliveDrab, true); return XBrushes.oliveDrab; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Orange { get { if (XBrushes.orange == null) XBrushes.orange = new XSolidBrush(XColors.Orange, true); return XBrushes.orange; } } /// Gets a pre-defined XBrush object. public static XSolidBrush OrangeRed { get { if (XBrushes.orangeRed == null) XBrushes.orangeRed = new XSolidBrush(XColors.OrangeRed, true); return XBrushes.orangeRed; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Orchid { get { if (XBrushes.orchid == null) XBrushes.orchid = new XSolidBrush(XColors.Orchid, true); return XBrushes.orchid; } } /// Gets a pre-defined XBrush object. public static XSolidBrush PaleGoldenrod { get { if (XBrushes.paleGoldenrod == null) XBrushes.paleGoldenrod = new XSolidBrush(XColors.PaleGoldenrod, true); return XBrushes.paleGoldenrod; } } /// Gets a pre-defined XBrush object. public static XSolidBrush PaleGreen { get { if (XBrushes.paleGreen == null) XBrushes.paleGreen = new XSolidBrush(XColors.PaleGreen, true); return XBrushes.paleGreen; } } /// Gets a pre-defined XBrush object. public static XSolidBrush PaleTurquoise { get { if (XBrushes.paleTurquoise == null) XBrushes.paleTurquoise = new XSolidBrush(XColors.PaleTurquoise, true); return XBrushes.paleTurquoise; } } /// Gets a pre-defined XBrush object. public static XSolidBrush PaleVioletRed { get { if (XBrushes.paleVioletRed == null) XBrushes.paleVioletRed = new XSolidBrush(XColors.PaleVioletRed, true); return XBrushes.paleVioletRed; } } /// Gets a pre-defined XBrush object. public static XSolidBrush PapayaWhip { get { if (XBrushes.papayaWhip == null) XBrushes.papayaWhip = new XSolidBrush(XColors.PapayaWhip, true); return XBrushes.papayaWhip; } } /// Gets a pre-defined XBrush object. public static XSolidBrush PeachPuff { get { if (XBrushes.peachPuff == null) XBrushes.peachPuff = new XSolidBrush(XColors.PeachPuff, true); return XBrushes.peachPuff; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Peru { get { if (XBrushes.peru == null) XBrushes.peru = new XSolidBrush(XColors.Peru, true); return XBrushes.peru; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Pink { get { if (XBrushes.pink == null) XBrushes.pink = new XSolidBrush(XColors.Pink, true); return XBrushes.pink; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Plum { get { if (XBrushes.plum == null) XBrushes.plum = new XSolidBrush(XColors.Plum, true); return XBrushes.plum; } } /// Gets a pre-defined XBrush object. public static XSolidBrush PowderBlue { get { if (XBrushes.powderBlue == null) XBrushes.powderBlue = new XSolidBrush(XColors.PowderBlue, true); return XBrushes.powderBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Purple { get { if (XBrushes.purple == null) XBrushes.purple = new XSolidBrush(XColors.Purple, true); return XBrushes.purple; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Red { get { if (XBrushes.red == null) XBrushes.red = new XSolidBrush(XColors.Red, true); return XBrushes.red; } } /// Gets a pre-defined XBrush object. public static XSolidBrush RosyBrown { get { if (XBrushes.rosyBrown == null) XBrushes.rosyBrown = new XSolidBrush(XColors.RosyBrown, true); return XBrushes.rosyBrown; } } /// Gets a pre-defined XBrush object. public static XSolidBrush RoyalBlue { get { if (XBrushes.royalBlue == null) XBrushes.royalBlue = new XSolidBrush(XColors.RoyalBlue, true); return XBrushes.royalBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush SaddleBrown { get { if (XBrushes.saddleBrown == null) XBrushes.saddleBrown = new XSolidBrush(XColors.SaddleBrown, true); return XBrushes.saddleBrown; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Salmon { get { if (XBrushes.salmon == null) XBrushes.salmon = new XSolidBrush(XColors.Salmon, true); return XBrushes.salmon; } } /// Gets a pre-defined XBrush object. public static XSolidBrush SandyBrown { get { if (XBrushes.sandyBrown == null) XBrushes.sandyBrown = new XSolidBrush(XColors.SandyBrown, true); return XBrushes.sandyBrown; } } /// Gets a pre-defined XBrush object. public static XSolidBrush SeaGreen { get { if (XBrushes.seaGreen == null) XBrushes.seaGreen = new XSolidBrush(XColors.SeaGreen, true); return XBrushes.seaGreen; } } /// Gets a pre-defined XBrush object. public static XSolidBrush SeaShell { get { if (XBrushes.seaShell == null) XBrushes.seaShell = new XSolidBrush(XColors.SeaShell, true); return XBrushes.seaShell; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Sienna { get { if (XBrushes.sienna == null) XBrushes.sienna = new XSolidBrush(XColors.Sienna, true); return XBrushes.sienna; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Silver { get { if (XBrushes.silver == null) XBrushes.silver = new XSolidBrush(XColors.Silver, true); return XBrushes.silver; } } /// Gets a pre-defined XBrush object. public static XSolidBrush SkyBlue { get { if (XBrushes.skyBlue == null) XBrushes.skyBlue = new XSolidBrush(XColors.SkyBlue, true); return XBrushes.skyBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush SlateBlue { get { if (XBrushes.slateBlue == null) XBrushes.slateBlue = new XSolidBrush(XColors.SlateBlue, true); return XBrushes.slateBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush SlateGray { get { if (XBrushes.slateGray == null) XBrushes.slateGray = new XSolidBrush(XColors.SlateGray, true); return XBrushes.slateGray; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Snow { get { if (XBrushes.snow == null) XBrushes.snow = new XSolidBrush(XColors.Snow, true); return XBrushes.snow; } } /// Gets a pre-defined XBrush object. public static XSolidBrush SpringGreen { get { if (XBrushes.springGreen == null) XBrushes.springGreen = new XSolidBrush(XColors.SpringGreen, true); return XBrushes.springGreen; } } /// Gets a pre-defined XBrush object. public static XSolidBrush SteelBlue { get { if (XBrushes.steelBlue == null) XBrushes.steelBlue = new XSolidBrush(XColors.SteelBlue, true); return XBrushes.steelBlue; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Tan { get { if (XBrushes.tan == null) XBrushes.tan = new XSolidBrush(XColors.Tan, true); return XBrushes.tan; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Teal { get { if (XBrushes.teal == null) XBrushes.teal = new XSolidBrush(XColors.Teal, true); return XBrushes.teal; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Thistle { get { if (XBrushes.thistle == null) XBrushes.thistle = new XSolidBrush(XColors.Thistle, true); return XBrushes.thistle; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Tomato { get { if (XBrushes.tomato == null) XBrushes.tomato = new XSolidBrush(XColors.Tomato, true); return XBrushes.tomato; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Transparent { get { if (XBrushes.transparent == null) XBrushes.transparent = new XSolidBrush(XColors.Transparent, true); return XBrushes.transparent; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Turquoise { get { if (XBrushes.turquoise == null) XBrushes.turquoise = new XSolidBrush(XColors.Turquoise, true); return XBrushes.turquoise; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Violet { get { if (XBrushes.violet == null) XBrushes.violet = new XSolidBrush(XColors.Violet, true); return XBrushes.violet; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Wheat { get { if (XBrushes.wheat == null) XBrushes.wheat = new XSolidBrush(XColors.Wheat, true); return XBrushes.wheat; } } /// Gets a pre-defined XBrush object. public static XSolidBrush White { get { if (XBrushes.white == null) XBrushes.white = new XSolidBrush(XColors.White, true); return XBrushes.white; } } /// Gets a pre-defined XBrush object. public static XSolidBrush WhiteSmoke { get { if (XBrushes.whiteSmoke == null) XBrushes.whiteSmoke = new XSolidBrush(XColors.WhiteSmoke, true); return XBrushes.whiteSmoke; } } /// Gets a pre-defined XBrush object. public static XSolidBrush Yellow { get { if (XBrushes.yellow == null) XBrushes.yellow = new XSolidBrush(XColors.Yellow, true); return XBrushes.yellow; } } /// Gets a pre-defined XBrush object. public static XSolidBrush YellowGreen { get { if (XBrushes.yellowGreen == null) XBrushes.yellowGreen = new XSolidBrush(XColors.YellowGreen, true); return XBrushes.yellowGreen; } } static XSolidBrush aliceBlue; static XSolidBrush antiqueWhite; static XSolidBrush aqua; static XSolidBrush aquamarine; static XSolidBrush azure; static XSolidBrush beige; static XSolidBrush bisque; static XSolidBrush black; static XSolidBrush blanchedAlmond; static XSolidBrush blue; static XSolidBrush blueViolet; static XSolidBrush brown; static XSolidBrush burlyWood; static XSolidBrush cadetBlue; static XSolidBrush chartreuse; static XSolidBrush chocolate; static XSolidBrush coral; static XSolidBrush cornflowerBlue; static XSolidBrush cornsilk; static XSolidBrush crimson; static XSolidBrush cyan; static XSolidBrush darkBlue; static XSolidBrush darkCyan; static XSolidBrush darkGoldenrod; static XSolidBrush darkGray; static XSolidBrush darkGreen; static XSolidBrush darkKhaki; static XSolidBrush darkMagenta; static XSolidBrush darkOliveGreen; static XSolidBrush darkOrange; static XSolidBrush darkOrchid; static XSolidBrush darkRed; static XSolidBrush darkSalmon; static XSolidBrush darkSeaGreen; static XSolidBrush darkSlateBlue; static XSolidBrush darkSlateGray; static XSolidBrush darkTurquoise; static XSolidBrush darkViolet; static XSolidBrush deepPink; static XSolidBrush deepSkyBlue; static XSolidBrush dimGray; static XSolidBrush dodgerBlue; static XSolidBrush firebrick; static XSolidBrush floralWhite; static XSolidBrush forestGreen; static XSolidBrush fuchsia; static XSolidBrush gainsboro; static XSolidBrush ghostWhite; static XSolidBrush gold; static XSolidBrush goldenrod; static XSolidBrush gray; static XSolidBrush green; static XSolidBrush greenYellow; static XSolidBrush honeydew; static XSolidBrush hotPink; static XSolidBrush indianRed; static XSolidBrush indigo; static XSolidBrush ivory; static XSolidBrush khaki; static XSolidBrush lavender; static XSolidBrush lavenderBlush; static XSolidBrush lawnGreen; static XSolidBrush lemonChiffon; static XSolidBrush lightBlue; static XSolidBrush lightCoral; static XSolidBrush lightCyan; static XSolidBrush lightGoldenrodYellow; static XSolidBrush lightGray; static XSolidBrush lightGreen; static XSolidBrush lightPink; static XSolidBrush lightSalmon; static XSolidBrush lightSeaGreen; static XSolidBrush lightSkyBlue; static XSolidBrush lightSlateGray; static XSolidBrush lightSteelBlue; static XSolidBrush lightYellow; static XSolidBrush lime; static XSolidBrush limeGreen; static XSolidBrush linen; static XSolidBrush magenta; static XSolidBrush maroon; static XSolidBrush mediumAquamarine; static XSolidBrush mediumBlue; static XSolidBrush mediumOrchid; static XSolidBrush mediumPurple; static XSolidBrush mediumSeaGreen; static XSolidBrush mediumSlateBlue; static XSolidBrush mediumSpringGreen; static XSolidBrush mediumTurquoise; static XSolidBrush mediumVioletRed; static XSolidBrush midnightBlue; static XSolidBrush mintCream; static XSolidBrush mistyRose; static XSolidBrush moccasin; static XSolidBrush navajoWhite; static XSolidBrush navy; static XSolidBrush oldLace; static XSolidBrush olive; static XSolidBrush oliveDrab; static XSolidBrush orange; static XSolidBrush orangeRed; static XSolidBrush orchid; static XSolidBrush paleGoldenrod; static XSolidBrush paleGreen; static XSolidBrush paleTurquoise; static XSolidBrush paleVioletRed; static XSolidBrush papayaWhip; static XSolidBrush peachPuff; static XSolidBrush peru; static XSolidBrush pink; static XSolidBrush plum; static XSolidBrush powderBlue; static XSolidBrush purple; static XSolidBrush red; static XSolidBrush rosyBrown; static XSolidBrush royalBlue; static XSolidBrush saddleBrown; static XSolidBrush salmon; static XSolidBrush sandyBrown; static XSolidBrush seaGreen; static XSolidBrush seaShell; static XSolidBrush sienna; static XSolidBrush silver; static XSolidBrush skyBlue; static XSolidBrush slateBlue; static XSolidBrush slateGray; static XSolidBrush snow; static XSolidBrush springGreen; static XSolidBrush steelBlue; static XSolidBrush tan; static XSolidBrush teal; static XSolidBrush thistle; static XSolidBrush tomato; static XSolidBrush transparent; static XSolidBrush turquoise; static XSolidBrush violet; static XSolidBrush wheat; static XSolidBrush white; static XSolidBrush whiteSmoke; static XSolidBrush yellow; static XSolidBrush yellowGreen; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XConvert.cs0000644000175000001440000000563311435766646022615 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows.Media; #endif namespace PdfSharp.Drawing { /// /// Converts XGraphics enums to GDI+ enums. /// static class XConvert { #if GDI /// /// Converts XLineJoin to LineJoin. /// public static LineJoin ToLineJoin(XLineJoin lineJoin) { return gdiLineJoin[(int)lineJoin]; } static LineJoin[] gdiLineJoin = new LineJoin[3]{LineJoin.Miter, LineJoin.Round, LineJoin.Bevel}; #endif #if GDI /// /// Converts XLineCap to LineCap. /// public static LineCap ToLineCap(XLineCap lineCap) { return gdiLineCap[(int)lineCap]; } static LineCap[] gdiLineCap = new LineCap[3]{LineCap.Flat, LineCap.Round, LineCap.Square}; #endif #if WPF /// /// Converts XLineJoin to PenLineJoin. /// public static PenLineJoin ToPenLineJoin(XLineJoin lineJoin) { return wpfLineJoin[(int)lineJoin]; } static readonly PenLineJoin[] wpfLineJoin = new PenLineJoin[] { PenLineJoin.Miter, PenLineJoin.Round, PenLineJoin.Bevel }; #endif #if WPF /// /// Converts XLineCap to PenLineCap. /// public static PenLineCap ToPenLineCap(XLineCap lineCap) { return wpfLineCap[(int)lineCap]; } static readonly PenLineCap[] wpfLineCap = new PenLineCap[] { PenLineCap.Flat, PenLineCap.Round, PenLineCap.Square }; #endif } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XKnownColorTable.cs0000644000175000001440000002215211435766646024233 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.ComponentModel; using System.Threading; #if GDI using System.Drawing; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Internal; namespace PdfSharp.Drawing { internal class XKnownColorTable { internal static uint[] colorTable; public static uint KnownColorToArgb(XKnownColor color) { if (XKnownColorTable.colorTable == null) InitColorTable(); if (color <= XKnownColor.YellowGreen) return XKnownColorTable.colorTable[(int)color]; return 0; } public static bool IsKnownColor(uint argb) { for (int idx = 0; idx < XKnownColorTable.colorTable.Length; idx++) { if (XKnownColorTable.colorTable[idx] == argb) return true; } return false; } public static XKnownColor GetKnownColor(uint argb) { for (int idx = 0; idx < XKnownColorTable.colorTable.Length; idx++) { if (XKnownColorTable.colorTable[idx] == argb) return (XKnownColor)idx; } return (XKnownColor)(-1); } private static void InitColorTable() { // Same values as in GDI+ and System.Windows.Media.XColors // Note that Magenta is the same as Fuchsia and Zyan is the same as Aqua. uint[] colors = new uint[141]; colors[0] = 0xFFF0F8FF; // AliceBlue colors[1] = 0xFFFAEBD7; // AntiqueWhite colors[2] = 0xFF00FFFF; // Aqua colors[3] = 0xFF7FFFD4; // Aquamarine colors[4] = 0xFFF0FFFF; // Azure colors[5] = 0xFFF5F5DC; // Beige colors[6] = 0xFFFFE4C4; // Bisque colors[7] = 0xFF000000; // Black colors[8] = 0xFFFFEBCD; // BlanchedAlmond colors[9] = 0xFF0000FF; // Blue colors[10] = 0xFF8A2BE2; // BlueViolet colors[11] = 0xFFA52A2A; // Brown colors[12] = 0xFFDEB887; // BurlyWood colors[13] = 0xFF5F9EA0; // CadetBlue colors[14] = 0xFF7FFF00; // Chartreuse colors[15] = 0xFFD2691E; // Chocolate colors[16] = 0xFFFF7F50; // Coral colors[17] = 0xFF6495ED; // CornflowerBlue colors[18] = 0xFFFFF8DC; // Cornsilk colors[19] = 0xFFDC143C; // Crimson colors[20] = 0xFF00FFFF; // Cyan colors[21] = 0xFF00008B; // DarkBlue colors[22] = 0xFF008B8B; // DarkCyan colors[23] = 0xFFB8860B; // DarkGoldenrod colors[24] = 0xFFA9A9A9; // DarkGray colors[25] = 0xFF006400; // DarkGreen colors[26] = 0xFFBDB76B; // DarkKhaki colors[27] = 0xFF8B008B; // DarkMagenta colors[28] = 0xFF556B2F; // DarkOliveGreen colors[29] = 0xFFFF8C00; // DarkOrange colors[30] = 0xFF9932CC; // DarkOrchid colors[31] = 0xFF8B0000; // DarkRed colors[32] = 0xFFE9967A; // DarkSalmon colors[33] = 0xFF8FBC8B; // DarkSeaGreen colors[34] = 0xFF483D8B; // DarkSlateBlue colors[35] = 0xFF2F4F4F; // DarkSlateGray colors[36] = 0xFF00CED1; // DarkTurquoise colors[37] = 0xFF9400D3; // DarkViolet colors[38] = 0xFFFF1493; // DeepPink colors[39] = 0xFF00BFFF; // DeepSkyBlue colors[40] = 0xFF696969; // DimGray colors[41] = 0xFF1E90FF; // DodgerBlue colors[42] = 0xFFB22222; // Firebrick colors[43] = 0xFFFFFAF0; // FloralWhite colors[44] = 0xFF228B22; // ForestGreen colors[45] = 0xFFFF00FF; // Fuchsia colors[46] = 0xFFDCDCDC; // Gainsboro colors[47] = 0xFFF8F8FF; // GhostWhite colors[48] = 0xFFFFD700; // Gold colors[49] = 0xFFDAA520; // Goldenrod colors[50] = 0xFF808080; // Gray colors[51] = 0xFF008000; // Green colors[52] = 0xFFADFF2F; // GreenYellow colors[53] = 0xFFF0FFF0; // Honeydew colors[54] = 0xFFFF69B4; // HotPink colors[55] = 0xFFCD5C5C; // IndianRed colors[56] = 0xFF4B0082; // Indigo colors[57] = 0xFFFFFFF0; // Ivory colors[58] = 0xFFF0E68C; // Khaki colors[59] = 0xFFE6E6FA; // Lavender colors[60] = 0xFFFFF0F5; // LavenderBlush colors[61] = 0xFF7CFC00; // LawnGreen colors[62] = 0xFFFFFACD; // LemonChiffon colors[63] = 0xFFADD8E6; // LightBlue colors[64] = 0xFFF08080; // LightCoral colors[65] = 0xFFE0FFFF; // LightCyan colors[66] = 0xFFFAFAD2; // LightGoldenrodYellow colors[67] = 0xFFD3D3D3; // LightGray colors[68] = 0xFF90EE90; // LightGreen colors[69] = 0xFFFFB6C1; // LightPink colors[70] = 0xFFFFA07A; // LightSalmon colors[71] = 0xFF20B2AA; // LightSeaGreen colors[72] = 0xFF87CEFA; // LightSkyBlue colors[73] = 0xFF778899; // LightSlateGray colors[74] = 0xFFB0C4DE; // LightSteelBlue colors[75] = 0xFFFFFFE0; // LightYellow colors[76] = 0xFF00FF00; // Lime colors[77] = 0xFF32CD32; // LimeGreen colors[78] = 0xFFFAF0E6; // Linen colors[79] = 0xFFFF00FF; // Magenta colors[80] = 0xFF800000; // Maroon colors[81] = 0xFF66CDAA; // MediumAquamarine colors[82] = 0xFF0000CD; // MediumBlue colors[83] = 0xFFBA55D3; // MediumOrchid colors[84] = 0xFF9370DB; // MediumPurple colors[85] = 0xFF3CB371; // MediumSeaGreen colors[86] = 0xFF7B68EE; // MediumSlateBlue colors[87] = 0xFF00FA9A; // MediumSpringGreen colors[88] = 0xFF48D1CC; // MediumTurquoise colors[89] = 0xFFC71585; // MediumVioletRed colors[90] = 0xFF191970; // MidnightBlue colors[91] = 0xFFF5FFFA; // MintCream colors[92] = 0xFFFFE4E1; // MistyRose colors[93] = 0xFFFFE4B5; // Moccasin colors[94] = 0xFFFFDEAD; // NavajoWhite colors[95] = 0xFF000080; // Navy colors[96] = 0xFFFDF5E6; // OldLace colors[97] = 0xFF808000; // Olive colors[98] = 0xFF6B8E23; // OliveDrab colors[99] = 0xFFFFA500; // Orange colors[100] = 0xFFFF4500; // OrangeRed colors[101] = 0xFFDA70D6; // Orchid colors[102] = 0xFFEEE8AA; // PaleGoldenrod colors[103] = 0xFF98FB98; // PaleGreen colors[104] = 0xFFAFEEEE; // PaleTurquoise colors[105] = 0xFFDB7093; // PaleVioletRed colors[106] = 0xFFFFEFD5; // PapayaWhip colors[107] = 0xFFFFDAB9; // PeachPuff colors[108] = 0xFFCD853F; // Peru colors[109] = 0xFFFFC0CB; // Pink colors[110] = 0xFFDDA0DD; // Plum colors[111] = 0xFFB0E0E6; // PowderBlue colors[112] = 0xFF800080; // Purple colors[113] = 0xFFFF0000; // Red colors[114] = 0xFFBC8F8F; // RosyBrown colors[115] = 0xFF4169E1; // RoyalBlue colors[116] = 0xFF8B4513; // SaddleBrown colors[117] = 0xFFFA8072; // Salmon colors[118] = 0xFFF4A460; // SandyBrown colors[119] = 0xFF2E8B57; // SeaGreen colors[120] = 0xFFFFF5EE; // SeaShell colors[121] = 0xFFA0522D; // Sienna colors[122] = 0xFFC0C0C0; // Silver colors[123] = 0xFF87CEEB; // SkyBlue colors[124] = 0xFF6A5ACD; // SlateBlue colors[125] = 0xFF708090; // SlateGray colors[126] = 0xFFFFFAFA; // Snow colors[127] = 0xFF00FF7F; // SpringGreen colors[128] = 0xFF4682B4; // SteelBlue colors[129] = 0xFFD2B48C; // Tan colors[130] = 0xFF008080; // Teal colors[131] = 0xFFD8BFD8; // Thistle colors[132] = 0xFFFF6347; // Tomato colors[133] = 0x00FFFFFF; // Transparent colors[134] = 0xFF40E0D0; // Turquoise colors[135] = 0xFFEE82EE; // Violet colors[136] = 0xFFF5DEB3; // Wheat colors[137] = 0xFFFFFFFF; // White colors[138] = 0xFFF5F5F5; // WhiteSmoke colors[139] = 0xFFFFFF00; // Yellow colors[140] = 0xFF9ACD32; // YellowGreen XKnownColorTable.colorTable = colors; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XGraphicsPath.cs0000644000175000001440000016161511435766646023555 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Globalization; using System.Text; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Internal; namespace PdfSharp.Drawing { /// /// Represents a series of connected lines and curves. /// public sealed class XGraphicsPath { /// /// Initializes a new instance of the class. /// public XGraphicsPath() { #if GDI this.gdipPath = new GraphicsPath(); #endif #if WPF this.pathGeometry = new PathGeometry(); #endif } #if GDI /// /// Initializes a new instance of the class. /// public XGraphicsPath(PointF[] points, byte[] types, XFillMode fillMode) { #if GDI this.gdipPath = new GraphicsPath(points, types, (FillMode)fillMode); #endif #if WPF this.pathGeometry = new PathGeometry(); this.pathGeometry.FillRule = FillRule.EvenOdd; #endif } #endif #if GDI /// /// Gets access to underlying GDI+ path. /// internal GraphicsPath gdipPath; #endif #if WPF /// /// Gets access to underlying WPF path geometry. /// internal PathGeometry pathGeometry; ///// ///// The current path figure; ///// //PathFigure figure; /// /// Gets the current path figure. /// PathFigure CurrentPathFigure { get { int count = this.pathGeometry.Figures.Count; if (count == 0) { this.pathGeometry.Figures.Add(new PathFigure()); count++; } else if (this.startNewFigure && this.pathGeometry.Figures[count - 1].Segments.Count == 0) { this.pathGeometry.Figures.Add(new PathFigure()); count++; } return this.pathGeometry.Figures[count - 1]; //if (this.figure == null) //{ // this.figure = new PathFigure(); // this.pathGeometry.Figures.Add(this.figure); //} //return this.figure; } } bool startNewFigure; #endif /// /// Clones this instance. /// public XGraphicsPath Clone() { XGraphicsPath path = (XGraphicsPath)MemberwiseClone(); #if GDI path.gdipPath = this.gdipPath.Clone() as GraphicsPath; #endif #if WPF #if !SILVERLIGHT path.pathGeometry = this.pathGeometry.Clone(); #else // AGHACK #endif #endif return path; } ///// ///// For internal use only. ///// //internal XGraphicsPathItem[] GetPathData() //{ // int count = this.items.Count; // XGraphicsPathItem[] data = new XGraphicsPathItem[count]; // for (int idx = 0; idx < count; idx++) // data[idx] = ((XGraphicsPathItem)this.items[idx]).Clone() as XGraphicsPathItem; // return data; //} // ----- AddLine ------------------------------------------------------------------------------ #if GDI /// /// Adds a line segment to current figure. /// public void AddLine(System.Drawing.Point pt1, System.Drawing.Point pt2) { AddLine((double)pt1.X, (double)pt1.Y, (double)pt2.X, (double)pt2.Y); } #endif #if WPF /// /// Adds a line segment to current figure. /// public void AddLine(System.Windows.Point pt1, System.Windows.Point pt2) { AddLine(pt1.X, pt1.Y, pt2.X, pt2.Y); } #endif #if GDI /// /// Adds a line segment to current figure. /// public void AddLine(PointF pt1, PointF pt2) { AddLine((double)pt1.X, (double)pt1.Y, (double)pt2.X, (double)pt2.Y); } #endif /// /// Adds a line segment to current figure. /// public void AddLine(XPoint pt1, XPoint pt2) { AddLine(pt1.X, pt1.Y, pt2.X, pt2.Y); } /// /// Adds a line segment to current figure. /// public void AddLine(int x1, int y1, int x2, int y2) { AddLine((double)x1, (double)y1, (double)x2, (double)y2); } /// /// Adds a line segment to current figure. /// public void AddLine(double x1, double y1, double x2, double y2) { #if GDI this.gdipPath.AddLine((float)x1, (float)y1, (float)x2, (float)y2); #endif #if WPF PathFigure figure = CurrentPathFigure; if (figure.Segments.Count == 0) { figure.StartPoint = new System.Windows.Point(x1, y1); #if !SILVERLIGHT LineSegment lineSegment = new LineSegment(new System.Windows.Point(x2, y2), true); #else LineSegment lineSegment = new LineSegment(); lineSegment.Point = new Point(x2, y2); // AGHACK: ,true?? #endif figure.Segments.Add(lineSegment); } else { #if !SILVERLIGHT LineSegment lineSegment1 = new LineSegment(new System.Windows.Point(x1, y1), true); LineSegment lineSegment2 = new LineSegment(new System.Windows.Point(x2, y2), true); #else LineSegment lineSegment1 = new LineSegment(); lineSegment1.Point = new Point(x1, y1); // AGHACK: ,true?? LineSegment lineSegment2 = new LineSegment(); lineSegment2.Point = new Point(x2, y2); // AGHACK: ,true?? #endif figure.Segments.Add(lineSegment1); figure.Segments.Add(lineSegment2); } #endif } // ----- AddLines ----------------------------------------------------------------------------- #if GDI /// /// Adds a series of connected line segments to current figure. /// public void AddLines(System.Drawing.Point[] points) { AddLines(XGraphics.MakeXPointArray(points)); } #endif #if WPF /// /// Adds a series of connected line segments to current figure. /// public void AddLines(System.Windows.Point[] points) { AddLines(XGraphics.MakeXPointArray(points)); } #endif #if GDI /// /// Adds a series of connected line segments to current figure. /// public void AddLines(PointF[] points) { AddLines(XGraphics.MakeXPointArray(points)); } #endif /// /// Adds a series of connected line segments to current figure. /// public void AddLines(XPoint[] points) { if (points == null) throw new ArgumentNullException("points"); int count = points.Length; if (count == 0) return; #if GDI this.gdipPath.AddLines(XGraphics.MakePointFArray(points)); #endif #if WPF PathFigure figure = CurrentPathFigure; if (figure.Segments.Count == 0) { figure.StartPoint = new System.Windows.Point(points[0].x, points[0].y); for (int idx = 1; idx < count; idx++) { #if !SILVERLIGHT LineSegment lineSegment = new LineSegment(new System.Windows.Point(points[idx].x, points[idx].y), true); #else LineSegment lineSegment = new LineSegment(); lineSegment.Point = new Point(points[idx].x, points[idx].y); // ,true? #endif figure.Segments.Add(lineSegment); } } else { for (int idx = 0; idx < count; idx++) { // figure.Segments.Add(new LineSegment(new System.Windows.Point(points[idx].x, points[idx].y), true)); #if !SILVERLIGHT LineSegment lineSegment = new LineSegment(new System.Windows.Point(points[idx].x, points[idx].y), true); #else LineSegment lineSegment = new LineSegment(); lineSegment.Point = new Point(points[idx].x, points[idx].y); // ,true? #endif figure.Segments.Add(lineSegment); } } #endif } // ----- AddBezier ---------------------------------------------------------------------------- #if GDI /// /// Adds a cubic Bzier curve to the current figure. /// public void AddBezier(System.Drawing.Point pt1, System.Drawing.Point pt2, System.Drawing.Point pt3, System.Drawing.Point pt4) { AddBezier((double)pt1.X, (double)pt1.Y, (double)pt2.X, (double)pt2.Y, (double)pt3.X, (double)pt3.Y, (double)pt4.X, (double)pt4.Y); } #endif #if WPF /// /// Adds a cubic Bzier curve to the current figure. /// public void AddBezier(System.Windows.Point pt1, System.Windows.Point pt2, System.Windows.Point pt3, System.Windows.Point pt4) { AddBezier(pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y); } #endif #if GDI /// /// Adds a cubic Bzier curve to the current figure. /// public void AddBezier(PointF pt1, PointF pt2, PointF pt3, PointF pt4) { AddBezier((double)pt1.X, (double)pt1.Y, (double)pt2.X, (double)pt2.Y, (double)pt3.X, (double)pt3.Y, (double)pt4.X, (double)pt4.Y); } #endif /// /// Adds a cubic Bzier curve to the current figure. /// public void AddBezier(XPoint pt1, XPoint pt2, XPoint pt3, XPoint pt4) { AddBezier(pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y); } /// /// Adds a cubic Bzier curve to the current figure. /// public void AddBezier(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) { AddBezier((double)x1, (double)y1, (double)x2, (double)y2, (double)x3, (double)y3, (double)x4, (double)y4); } /// /// Adds a cubic Bzier curve to the current figure. /// public void AddBezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { #if GDI this.gdipPath.AddBezier((float)x1, (float)y1, (float)x2, (float)y2, (float)x3, (float)y3, (float)x4, (float)y4); #endif #if WPF PathFigure figure = CurrentPathFigure; if (figure.Segments.Count == 0) figure.StartPoint = new System.Windows.Point(x1, y1); else { // figure.Segments.Add(new LineSegment(new System.Windows.Point(x1, y1), true)); #if !SILVERLIGHT LineSegment lineSegment = new LineSegment(new System.Windows.Point(x1, y1), true); #else LineSegment lineSegment = new LineSegment(); lineSegment.Point = new Point(x1, y1); #endif figure.Segments.Add(lineSegment); } //figure.Segments.Add(new BezierSegment( // new System.Windows.Point(x2, y2), // new System.Windows.Point(x3, y3), // new System.Windows.Point(x4, y4), true)); #if !SILVERLIGHT BezierSegment bezierSegment = new BezierSegment( new System.Windows.Point(x2, y2), new System.Windows.Point(x3, y3), new System.Windows.Point(x4, y4), true); #else BezierSegment bezierSegment = new BezierSegment(); bezierSegment.Point1 = new Point(x2, y2); bezierSegment.Point2 = new Point(x3, y3); bezierSegment.Point3 = new Point(x4, y4); #endif figure.Segments.Add(bezierSegment); #endif } // ----- AddBeziers --------------------------------------------------------------------------- #if GDI /// /// Adds a sequence of connected cubic Bzier curves to the current figure. /// public void AddBeziers(System.Drawing.Point[] points) { AddBeziers(XGraphics.MakeXPointArray(points)); } #endif #if WPF /// /// Adds a sequence of connected cubic Bzier curves to the current figure. /// public void AddBeziers(System.Windows.Point[] points) { AddBeziers(XGraphics.MakeXPointArray(points)); } #endif #if GDI /// /// Adds a sequence of connected cubic Bzier curves to the current figure. /// public void AddBeziers(PointF[] points) { AddBeziers(XGraphics.MakeXPointArray(points)); } #endif /// /// Adds a sequence of connected cubic Bzier curves to the current figure. /// public void AddBeziers(XPoint[] points) { if (points == null) new ArgumentNullException("points"); int count = points.Length; if (points.Length < 4) throw new ArgumentException("At least four points required for bezier curve.", "points"); if ((points.Length - 1) % 3 != 0) throw new ArgumentException("Invalid number of points for bezier curve. Number must fulfil 4+3n.", "points"); #if GDI this.gdipPath.AddBeziers(XGraphics.MakePointFArray(points)); #endif #if WPF PathFigure figure = CurrentPathFigure; if (figure.Segments.Count == 0) figure.StartPoint = new System.Windows.Point(points[0].x, points[0].y); else { // figure.Segments.Add(new LineSegment(new System.Windows.Point(points[0].x, points[0].y), true)); #if !SILVERLIGHT LineSegment lineSegment = new LineSegment(new System.Windows.Point(points[0].x, points[0].y), true); #else LineSegment lineSegment = new LineSegment(); lineSegment.Point = new Point(points[0].x, points[0].y); #endif figure.Segments.Add(lineSegment); } for (int idx = 1; idx < count; idx += 3) { //figure.Segments.Add(new BezierSegment( // new System.Windows.Point(points[idx].x, points[idx].y), // new System.Windows.Point(points[idx + 1].x, points[idx + 1].y), // new System.Windows.Point(points[idx + 2].x, points[idx + 2].y), true)); #if !SILVERLIGHT BezierSegment bezierSegment = new BezierSegment( new System.Windows.Point(points[idx].x, points[idx].y), new System.Windows.Point(points[idx + 1].x, points[idx + 1].y), new System.Windows.Point(points[idx + 2].x, points[idx + 2].y), true); #else BezierSegment bezierSegment = new BezierSegment(); bezierSegment.Point1 = new Point(points[idx].x, points[idx].y); bezierSegment.Point2 = new Point(points[idx + 1].x, points[idx + 1].y); bezierSegment.Point3 = new Point(points[idx + 2].x, points[idx + 2].y); #endif figure.Segments.Add(bezierSegment); } #endif } // ----- AddCurve ----------------------------------------------------------------------- #if GDI /// /// Adds a spline curve to the current figure. /// public void AddCurve(System.Drawing.Point[] points) { AddCurve(XGraphics.MakeXPointArray(points)); } #endif #if WPF /// /// Adds a spline curve to the current figure. /// public void AddCurve(System.Windows.Point[] points) { AddCurve(XGraphics.MakeXPointArray(points)); } #endif #if GDI /// /// Adds a spline curve to the current figure. /// public void AddCurve(PointF[] points) { AddCurve(XGraphics.MakeXPointArray(points)); } #endif /// /// Adds a spline curve to the current figure. /// public void AddCurve(XPoint[] points) { AddCurve(points, 0.5); } #if GDI /// /// Adds a spline curve to the current figure. /// public void AddCurve(System.Drawing.Point[] points, double tension) { AddCurve(XGraphics.MakeXPointArray(points), tension); } #endif #if WPF /// /// Adds a spline curve to the current figure. /// public void AddCurve(System.Windows.Point[] points, double tension) { AddCurve(XGraphics.MakeXPointArray(points), tension); } #endif #if GDI /// /// Adds a spline curve to the current figure. /// public void AddCurve(PointF[] points, double tension) { AddCurve(XGraphics.MakeXPointArray(points), tension); } #endif /// /// Adds a spline curve to the current figure. /// public void AddCurve(XPoint[] points, double tension) { int count = points.Length; if (count < 2) throw new ArgumentException("AddCurve requires two or more points.", "points"); #if GDI this.gdipPath.AddCurve(XGraphics.MakePointFArray(points), (float)tension); #endif #if WPF tension /= 3; PathFigure figure = CurrentPathFigure; if (figure.Segments.Count == 0) figure.StartPoint = new System.Windows.Point(points[0].x, points[0].y); else { // figure.Segments.Add(new LineSegment(new System.Windows.Point(points[0].x, points[0].y), true)); #if !SILVERLIGHT LineSegment lineSegment = new LineSegment(new System.Windows.Point(points[0].x, points[0].y), true); #else LineSegment lineSegment = new LineSegment(); lineSegment.Point = new Point(points[0].x, points[0].y); #endif figure.Segments.Add(lineSegment); } if (count == 2) { figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[0], points[0], points[1], points[1], tension)); } else { figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[0], points[0], points[1], points[2], tension)); for (int idx = 1; idx < count - 2; idx++) figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[idx - 1], points[idx], points[idx + 1], points[idx + 2], tension)); figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 3], points[count - 2], points[count - 1], points[count - 1], tension)); } #endif } #if GDI /// /// Adds a spline curve to the current figure. /// public void AddCurve(System.Drawing.Point[] points, int offset, int numberOfSegments, float tension) { AddCurve(XGraphics.MakeXPointArray(points), offset, numberOfSegments, tension); } #endif #if WPF /// /// Adds a spline curve to the current figure. /// public void AddCurve(System.Windows.Point[] points, int offset, int numberOfSegments, float tension) { AddCurve(XGraphics.MakeXPointArray(points), offset, numberOfSegments, tension); } #endif #if GDI /// /// Adds a spline curve to the current figure. /// public void AddCurve(PointF[] points, int offset, int numberOfSegments, float tension) { AddCurve(XGraphics.MakeXPointArray(points), offset, numberOfSegments, tension); } #endif /// /// Adds a spline curve to the current figure. /// public void AddCurve(XPoint[] points, int offset, int numberOfSegments, double tension) { #if GDI this.gdipPath.AddCurve(XGraphics.MakePointFArray(points), offset, numberOfSegments, (float)tension); #endif #if WPF throw new NotImplementedException("AddCurve not yet implemented."); #endif } // ----- AddArc ------------------------------------------------------------------------------- #if GDI /// /// Adds an elliptical arc to the current figure. /// public void AddArc(Rectangle rect, double startAngle, double sweepAngle) { AddArc((double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, startAngle, sweepAngle); } #endif #if GDI /// /// Adds an elliptical arc to the current figure. /// public void AddArc(RectangleF rect, double startAngle, double sweepAngle) { AddArc((double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, startAngle, sweepAngle); } #endif /// /// Adds an elliptical arc to the current figure. /// public void AddArc(XRect rect, double startAngle, double sweepAngle) { AddArc((double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, startAngle, sweepAngle); } /// /// Adds an elliptical arc to the current figure. /// public void AddArc(int x, int y, int width, int height, int startAngle, int sweepAngle) { AddArc((double)x, (double)y, (double)width, (double)height, (double)startAngle, (double)sweepAngle); } /// /// Adds an elliptical arc to the current figure. /// public void AddArc(double x, double y, double width, double height, double startAngle, double sweepAngle) { #if GDI this.gdipPath.AddArc((float)x, (float)y, (float)width, (float)height, (float)startAngle, (float)sweepAngle); #endif #if WPF PathFigure figure = CurrentPathFigure; System.Windows.Point startPoint; ArcSegment seg = GeometryHelper.CreateArcSegment(x, y, width, height, startAngle, sweepAngle, out startPoint); if (figure.Segments.Count == 0) figure.StartPoint = startPoint; figure.Segments.Add(seg); //figure.Segments.Add( //if (figure.Segments.Count == 0) // figure.StartPoint = new System.Windows.Point(points[0].x, points[0].y); //else // figure.Segments.Add(new LineSegment(new System.Windows.Point(points[0].x, points[0].y), true)); //for (int idx = 1; idx < 5555; idx += 3) // figure.Segments.Add(new BezierSegment( // new System.Windows.Point(points[idx].x, points[idx].y), // new System.Windows.Point(points[idx + 1].x, points[idx + 1].y), // new System.Windows.Point(points[idx + 2].x, points[idx + 2].y), true)); #endif } #if WPF /// /// Adds an elliptical arc to the current figure. The arc is specified WPF like. /// public void AddArc(XPoint point1, XPoint point2, XSize size, double rotationAngle, bool isLargeArg, SweepDirection sweepDirection) { PathFigure figure = CurrentPathFigure; if (figure.Segments.Count == 0) figure.StartPoint = point1.ToPoint(); else { // figure.Segments.Add(new LineSegment(point1.ToPoint(), true)); #if !SILVERLIGHT LineSegment lineSegment = new LineSegment(point1.ToPoint(), true); #else LineSegment lineSegment = new LineSegment(); lineSegment.Point = point1.ToPoint(); #endif figure.Segments.Add(lineSegment); } // figure.Segments.Add(new ArcSegment(point2.ToPoint(), size.ToSize(), rotationAngle, isLargeArg, sweepDirection, true)); #if !SILVERLIGHT ArcSegment arcSegment = new ArcSegment(point2.ToPoint(), size.ToSize(), rotationAngle, isLargeArg, sweepDirection, true); #else ArcSegment arcSegment = new ArcSegment(); arcSegment.Point = point2.ToPoint(); arcSegment.Size = size.ToSize(); arcSegment.RotationAngle = rotationAngle; arcSegment.IsLargeArc = isLargeArg; arcSegment.SweepDirection = sweepDirection; #endif figure.Segments.Add(arcSegment); } #endif // ----- AddRectangle ------------------------------------------------------------------------- #if GDI /// /// Adds a rectangle to this path. /// public void AddRectangle(Rectangle rect) { AddRectangle(new XRect(rect)); } #endif #if GDI /// /// Adds a rectangle to this path. /// public void AddRectangle(RectangleF rect) { AddRectangle(new XRect(rect)); } #endif /// /// Adds a rectangle to this path. /// public void AddRectangle(XRect rect) { #if GDI this.gdipPath.AddRectangle(rect.ToRectangleF()); #endif #if WPF StartFigure(); PathFigure figure = CurrentPathFigure; figure.StartPoint = new System.Windows.Point(rect.x, rect.y); // figure.Segments.Add(new LineSegment(new System.Windows.Point(rect.x + rect.width, rect.y), true)); // figure.Segments.Add(new LineSegment(new System.Windows.Point(rect.x + rect.width, rect.y + rect.height), true)); // figure.Segments.Add(new LineSegment(new System.Windows.Point(rect.x, rect.y + rect.height), true)); #if !SILVERLIGHT LineSegment lineSegment1 = new LineSegment(new System.Windows.Point(rect.x + rect.width, rect.y), true); LineSegment lineSegment2 = new LineSegment(new System.Windows.Point(rect.x + rect.width, rect.y + rect.height), true); LineSegment lineSegment3 = new LineSegment(new System.Windows.Point(rect.x, rect.y + rect.height), true); #else LineSegment lineSegment1 = new LineSegment(); lineSegment1.Point = new Point(rect.x + rect.width, rect.y); LineSegment lineSegment2 = new LineSegment(); lineSegment2.Point = new Point(rect.x + rect.width, rect.y + rect.height); LineSegment lineSegment3 = new LineSegment(); lineSegment3.Point = new Point(rect.x, rect.y + rect.height); #endif figure.Segments.Add(lineSegment1); figure.Segments.Add(lineSegment2); figure.Segments.Add(lineSegment3); CloseFigure(); #endif } /// /// Adds a rectangle to this path. /// public void AddRectangle(int x, int y, int width, int height) { AddRectangle(new XRect(x, y, width, height)); } /// /// Adds a rectangle to this path. /// public void AddRectangle(double x, double y, double width, double height) { AddRectangle(new XRect(x, y, width, height)); } // ----- AddRectangles ------------------------------------------------------------------------ #if GDI /// /// Adds a series of rectangles to this path. /// public void AddRectangles(Rectangle[] rects) { int count = rects.Length; for (int idx = 0; idx < count; idx++) AddRectangle(rects[idx]); this.gdipPath.AddRectangles(rects); } #endif #if GDI /// /// Adds a series of rectangles to this path. /// public void AddRectangles(RectangleF[] rects) { int count = rects.Length; for (int idx = 0; idx < count; idx++) AddRectangle(rects[idx]); this.gdipPath.AddRectangles(rects); } #endif /// /// Adds a series of rectangles to this path. /// public void AddRectangles(XRect[] rects) { int count = rects.Length; for (int idx = 0; idx < count; idx++) { #if GDI this.gdipPath.AddRectangle(rects[idx].ToRectangleF()); #endif #if WPF StartFigure(); PathFigure figure = CurrentPathFigure; XRect rect = rects[idx]; figure.StartPoint = new System.Windows.Point(rect.x, rect.y); // figure.Segments.Add(new LineSegment(new System.Windows.Point(rect.x + rect.width, rect.y), true)); // figure.Segments.Add(new LineSegment(new System.Windows.Point(rect.x + rect.width, rect.y + rect.height), true)); // figure.Segments.Add(new LineSegment(new System.Windows.Point(rect.x, rect.y + rect.height), true)); #if !SILVERLIGHT LineSegment lineSegment1 = new LineSegment(new System.Windows.Point(rect.x + rect.width, rect.y), true); LineSegment lineSegment2 = new LineSegment(new System.Windows.Point(rect.x + rect.width, rect.y + rect.height), true); LineSegment lineSegment3 = new LineSegment(new System.Windows.Point(rect.x, rect.y + rect.height), true); #else LineSegment lineSegment1 = new LineSegment(); lineSegment1.Point = new Point(rect.x + rect.width, rect.y); LineSegment lineSegment2 = new LineSegment(); lineSegment2.Point = new Point(rect.x + rect.width, rect.y + rect.height); LineSegment lineSegment3 = new LineSegment(); lineSegment3.Point = new Point(rect.x, rect.y + rect.height); #endif figure.Segments.Add(lineSegment1); figure.Segments.Add(lineSegment2); figure.Segments.Add(lineSegment3); CloseFigure(); #endif } } // ----- AddRoundedRectangle ------------------------------------------------------------------ #if GDI /// /// Adds a rectangle with rounded corners to this path. /// public void AddRoundedRectangle(Rectangle rect, System.Drawing.Size ellipseSize) { AddRoundedRectangle((double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, (double)ellipseSize.Width, (double)ellipseSize.Height); } #endif #if WPF /// /// Adds a rectangle with rounded corners to this path. /// public void AddRoundedRectangle(Rect rect, System.Windows.Size ellipseSize) { AddRoundedRectangle((double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, (double)ellipseSize.Width, (double)ellipseSize.Height); } #endif #if GDI /// /// Adds a rectangle with rounded corners to this path. /// public void AddRoundedRectangle(RectangleF rect, SizeF ellipseSize) { AddRoundedRectangle((double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, (double)ellipseSize.Width, (double)ellipseSize.Height); } #endif #if GDI /// /// Adds a rectangle with rounded corners to this path. /// public void AddRoundedRectangle(XRect rect, SizeF ellipseSize) { AddRoundedRectangle((double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, (double)ellipseSize.Width, (double)ellipseSize.Height); } #endif /// /// Adds a rectangle with rounded corners to this path. /// public void AddRoundedRectangle(int x, int y, int width, int height, int ellipseWidth, int ellipseHeight) { AddRoundedRectangle((double)x, (double)y, (double)width, (double)height, (double)ellipseWidth, (double)ellipseHeight); } /// /// Adds a rectangle with rounded corners to this path. /// public void AddRoundedRectangle(double x, double y, double width, double height, double ellipseWidth, double ellipseHeight) { #if GDI this.gdipPath.AddArc((float)(x + width - ellipseWidth), (float)y, (float)ellipseWidth, (float)ellipseHeight, -90, 90); this.gdipPath.AddArc((float)(x + width - ellipseWidth), (float)(y + height - ellipseHeight), (float)ellipseWidth, (float)ellipseHeight, 0, 90); this.gdipPath.AddArc((float)x, (float)(y + height - ellipseHeight), (float)ellipseWidth, (float)ellipseHeight, 90, 90); this.gdipPath.AddArc((float)x, (float)y, (float)ellipseWidth, (float)ellipseHeight, 180, 90); this.gdipPath.CloseFigure(); #endif #if WPF double ex = ellipseWidth / 2; double ey = ellipseHeight / 2; StartFigure(); PathFigure figure = CurrentPathFigure; figure.StartPoint = new System.Windows.Point(x + ex, y); #if !SILVERLIGHT figure.Segments.Add(new LineSegment(new System.Windows.Point(x + width - ex, y), true)); // TODOWPF XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx figure.Segments.Add(new ArcSegment(new System.Windows.Point(x + width, y + ey), new System.Windows.Size(ex, ey), 0, false, SweepDirection.Clockwise, true)); //figure.Segments.Add(new LineSegment(new System.Windows.Point(x + width, y + ey), true)); figure.Segments.Add(new LineSegment(new System.Windows.Point(x + width, y + height - ey), true)); // TODOWPF figure.Segments.Add(new ArcSegment(new System.Windows.Point(x + width - ex, y + height), new System.Windows.Size(ex, ey), 0, false, SweepDirection.Clockwise, true)); //figure.Segments.Add(new LineSegment(new System.Windows.Point(x + width - ex, y + height), true)); figure.Segments.Add(new LineSegment(new System.Windows.Point(x + ex, y + height), true)); // TODOWPF figure.Segments.Add(new ArcSegment(new System.Windows.Point(x, y + height - ey), new System.Windows.Size(ex, ey), 0, false, SweepDirection.Clockwise, true)); //figure.Segments.Add(new LineSegment(new System.Windows.Point(x, y + height - ey), true)); figure.Segments.Add(new LineSegment(new System.Windows.Point(x, y + ey), true)); // TODOWPF figure.Segments.Add(new ArcSegment(new System.Windows.Point(x + ex, y), new System.Windows.Size(ex, ey), 0, false, SweepDirection.Clockwise, true)); //figure.Segments.Add(new LineSegment(new System.Windows.Point(x + ex, y), true)); #else // AGHACK #endif CloseFigure(); #endif } // ----- AddEllipse --------------------------------------------------------------------------- #if GDI /// /// Adds an ellipse to the current path. /// public void AddEllipse(Rectangle rect) { AddEllipse(rect.X, rect.Y, rect.Width, rect.Height); } #endif #if GDI /// /// Adds an ellipse to the current path. /// public void AddEllipse(RectangleF rect) { AddEllipse(rect.X, rect.Y, rect.Width, rect.Height); } #endif /// /// Adds an ellipse to the current path. /// public void AddEllipse(XRect rect) { AddEllipse(rect.x, rect.y, rect.width, rect.height); } /// /// Adds an ellipse to the current path. /// public void AddEllipse(int x, int y, int width, int height) { AddEllipse((double)x, (double)y, (double)width, (double)height); } /// /// Adds an ellipse to the current path. /// public void AddEllipse(double x, double y, double width, double height) { #if GDI this.gdipPath.AddEllipse((float)x, (float)y, (float)width, (float)height); #endif #if WPF StartFigure(); //this.pathGeometry.AddGeometry(new EllipseGeometry(new Rect(x, y, width, height))); #if !SILVERLIGHT this.pathGeometry.AddGeometry(new EllipseGeometry(new Rect(x, y, width, height))); //EllipseGeometry ellipseGeometry = new EllipseGeometry(new Rect(x, y, width, height)); //this.pa thGeometry..AddGeometry(ellipseGeometry); #else // AGHACK: No AddGeometry in Silverlight version of PathGeometry //EllipseGeometry ellipseGeometry = new EllipseGeometry(); //ellipseGeometry.Center = new Point((x + width) / 2, (y + height) / 2); //ellipseGeometry.RadiusX = width / 2; //ellipseGeometry.RadiusY = height / 2; #endif #endif } // ----- AddPolygon --------------------------------------------------------------------------- #if GDI /// /// Adds a polygon to this path. /// public void AddPolygon(System.Drawing.Point[] points) { this.gdipPath.AddPolygon(points); } #endif #if WPF /// /// Adds a polygon to this path. /// public void AddPolygon(System.Windows.Point[] points) { // TODO: fill mode unclear here StartFigure(); #if !SILVERLIGHT this.pathGeometry.AddGeometry(GeometryHelper.CreatePolygonGeometry(points, XFillMode.Alternate, true)); #else // AGHACK: No AddGeometry in Silverlight version of PathGeometry #endif } #endif #if GDI /// /// Adds a polygon to this path. /// public void AddPolygon(PointF[] points) { this.gdipPath.AddPolygon(points); } #endif /// /// Adds a polygon to this path. /// public void AddPolygon(XPoint[] points) { #if GDI this.gdipPath.AddPolygon(XGraphics.MakePointFArray(points)); #endif #if WPF StartFigure(); #if !SILVERLIGHT this.pathGeometry.AddGeometry(GeometryHelper.CreatePolygonGeometry(XGraphics.MakePointArray(points), XFillMode.Alternate, true)); #else // AGHACK: No AddGeometry in Silverlight version of PathGeometry #endif #endif } // ----- AddPie ------------------------------------------------------------------------------- #if GDI /// /// Adds the outline of a pie shape to this path. /// public void AddPie(Rectangle rect, double startAngle, double sweepAngle) { this.gdipPath.AddPie(rect, (float)startAngle, (float)sweepAngle); } #endif #if GDI /// /// Adds the outline of a pie shape to this path. /// public void AddPie(RectangleF rect, double startAngle, double sweepAngle) { AddPie((double)rect.X, (double)rect.Y, (double)rect.Width, (double)rect.Height, startAngle, sweepAngle); } #endif /// /// Adds the outline of a pie shape to this path. /// public void AddPie(XRect rect, double startAngle, double sweepAngle) { AddPie(rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); } /// /// Adds the outline of a pie shape to this path. /// public void AddPie(int x, int y, int width, int height, double startAngle, double sweepAngle) { AddPie((double)x, (double)y, (double)width, (double)height, startAngle, sweepAngle); } /// /// Adds the outline of a pie shape to this path. /// public void AddPie(double x, double y, double width, double height, double startAngle, double sweepAngle) { #if GDI this.gdipPath.AddPie((float)x, (float)y, (float)width, (float)height, (float)startAngle, (float)sweepAngle); #endif #if WPF #endif } // ----- AddClosedCurve ------------------------------------------------------------------------ #if GDI /// /// Adds a closed curve to this path. /// public void AddClosedCurve(System.Drawing.Point[] points) { AddClosedCurve(XGraphics.MakeXPointArray(points), 0.5); } #endif #if WPF /// /// Adds a closed curve to this path. /// public void AddClosedCurve(System.Windows.Point[] points) { AddClosedCurve(XGraphics.MakeXPointArray(points), 0.5); } #endif #if GDI /// /// Adds a closed curve to this path. /// public void AddClosedCurve(PointF[] points) { AddClosedCurve(XGraphics.MakeXPointArray(points), 0.5); } #endif /// /// Adds a closed curve to this path. /// public void AddClosedCurve(XPoint[] points) { AddClosedCurve(points, 0.5); } #if GDI /// /// Adds a closed curve to this path. /// public void AddClosedCurve(System.Drawing.Point[] points, double tension) { AddClosedCurve(XGraphics.MakeXPointArray(points), tension); } #endif #if WPF /// /// Adds a closed curve to this path. /// public void AddClosedCurve(System.Windows.Point[] points, double tension) { AddClosedCurve(XGraphics.MakeXPointArray(points), tension); } #endif #if GDI /// /// Adds a closed curve to this path. /// public void AddClosedCurve(PointF[] points, double tension) { AddClosedCurve(XGraphics.MakeXPointArray(points), tension); } #endif /// /// Adds a closed curve to this path. /// public void AddClosedCurve(XPoint[] points, double tension) { if (points == null) throw new ArgumentNullException("points"); int count = points.Length; if (count == 0) return; if (count < 2) throw new ArgumentException("Not enough points.", "points"); #if GDI this.gdipPath.AddClosedCurve(XGraphics.MakePointFArray(points), (float)tension); #endif #if WPF tension /= 3; StartFigure(); PathFigure figure = CurrentPathFigure; figure.StartPoint = new System.Windows.Point(points[0].x, points[0].y); if (count == 2) { figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[0], points[0], points[1], points[1], tension)); } else { figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 1], points[0], points[1], points[2], tension)); for (int idx = 1; idx < count - 2; idx++) figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[idx - 1], points[idx], points[idx + 1], points[idx + 2], tension)); figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 3], points[count - 2], points[count - 1], points[0], tension)); figure.Segments.Add(GeometryHelper.CreateCurveSegment(points[count - 2], points[count - 1], points[0], points[1], tension)); } #endif } // ----- AddPath ------------------------------------------------------------------------------ /// /// Adds the specified path to this path. /// public void AddPath(XGraphicsPath path, bool connect) { #if GDI this.gdipPath.AddPath(path.gdipPath, connect); #endif #if WPF #if !SILVERLIGHT this.pathGeometry.AddGeometry(path.pathGeometry); #else // AGHACK: No AddGeometry in Silverlight version of PathGeometry #endif #endif } // ----- AddString ---------------------------------------------------------------------------- #if GDI /// /// Adds a text string to this path. /// public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, System.Drawing.Point origin, XStringFormat format) { AddString(s, family, style, emSize, new XRect(origin.X, origin.Y, 0, 0), format); } #endif #if WPF /// /// Adds a text string to this path. /// public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, System.Windows.Point origin, XStringFormat format) { AddString(s, family, style, emSize, new XPoint(origin), format); } #endif #if GDI /// /// Adds a text string to this path. /// public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, PointF origin, XStringFormat format) { AddString(s, family, style, emSize, new XRect(origin.X, origin.Y, 0, 0), format); } #endif /// /// Adds a text string to this path. /// public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, XPoint origin, XStringFormat format) { try { #if GDI this.gdipPath.AddString(s, family.gdiFamily, (int)style, (float)emSize, origin.ToPointF(), format.RealizeGdiStringFormat()); #endif #if WPF #if !SILVERLIGHT Typeface typeface = FontHelper.CreateTypeface(family.wpfFamily, style); //FormattedText ft = new FormattedText(s, CultureInfo.CurrentCulture, FlowDirection.LeftToRight, typeface, emSize, System.Windows.Media.Brushes.Black); FormattedText formattedText = FontHelper.CreateFormattedText(s, typeface, emSize, System.Windows.Media.Brushes.Black); Geometry geo = formattedText.BuildGeometry(origin); this.pathGeometry.AddGeometry(geo); #else // AGHACK: #endif #endif } catch { } } #if GDI /// /// Adds a text string to this path. /// public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, Rectangle layoutRect, XStringFormat format) { this.gdipPath.AddString(s, family.gdiFamily, (int)style, (float)emSize, layoutRect, format.RealizeGdiStringFormat()); } #endif #if GDI /// /// Adds a text string to this path. /// public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, RectangleF layoutRect, XStringFormat format) { this.gdipPath.AddString(s, family.gdiFamily, (int)style, (float)emSize, layoutRect, format.RealizeGdiStringFormat()); } #endif #if WPF /// /// Adds a text string to this path. /// public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, Rect rect, XStringFormat format) { //this.gdip Path.AddString(s, family.gdiFamily, (int)style, (float)emSize, layoutRect, format.RealizeGdiStringFormat()); AddString(s, family, style, emSize, new XRect(rect), format); } #endif /// /// Adds a text string to this path. /// public void AddString(string s, XFontFamily family, XFontStyle style, double emSize, XRect layoutRect, XStringFormat format) { if (s == null) throw new ArgumentNullException("s"); if (family == null) throw new ArgumentNullException("family"); if (format.LineAlignment == XLineAlignment.BaseLine && layoutRect.Height != 0) throw new InvalidOperationException("DrawString: With XLineAlignment.BaseLine the height of the layout rectangle must be 0."); if (s.Length == 0) return; if (format == null) format = XStringFormats.Default; XFont font = new XFont(family.Name, emSize, style); #if GDI && !WPF RectangleF rc = layoutRect.ToRectangleF(); if (format.LineAlignment == XLineAlignment.BaseLine) { double lineSpace = font.GetHeight(); int cellSpace = font.FontFamily.GetLineSpacing(font.Style); int cellAscent = font.FontFamily.GetCellAscent(font.Style); int cellDescent = font.FontFamily.GetCellDescent(font.Style); double cyAscent = lineSpace * cellAscent / cellSpace; cyAscent = lineSpace * font.cellAscent / font.cellSpace; rc.Offset(0, (float)-cyAscent); } //this.gfx.DrawString(text, font.RealizeGdiFont(), brush.RealizeGdiBrush(), rect, // format != null ? format.RealizeGdiStringFormat() : null); this.gdipPath.AddString(s, family.gdiFamily, (int)style, (float)emSize, rc, format.RealizeGdiStringFormat()); #endif #if WPF && !GDI #if !SILVERLIGHT // Just a first sketch, but currently we do not need it and there is enough to do... double x = layoutRect.X; double y = layoutRect.Y; //double lineSpace = font.GetHeight(this); //double cyAscent = lineSpace * font.cellAscent / font.cellSpace; //double cyDescent = lineSpace * font.cellDescent / font.cellSpace; //double cyAscent = family.GetCellAscent(style) * family.GetLineSpacing(style) / family.getl; //fontlineSpace * font.cellAscent / font.cellSpace; //double cyDescent =family.GetCellDescent(style); // lineSpace * font.cellDescent / font.cellSpace; double lineSpace = font.GetHeight(); double cyAscent = lineSpace * font.cellAscent / font.cellSpace; double cyDescent = lineSpace * font.cellDescent / font.cellSpace; bool bold = (style & XFontStyle.Bold) != 0; bool italic = (style & XFontStyle.Italic) != 0; bool strikeout = (style & XFontStyle.Strikeout) != 0; bool underline = (style & XFontStyle.Underline) != 0; Typeface typeface = FontHelper.CreateTypeface(family.wpfFamily, style); //FormattedText formattedText = new FormattedText(s, CultureInfo.CurrentCulture, FlowDirection.LeftToRight, typeface, emSize, System.Windows.Media.Brushes.Black); FormattedText formattedText = FontHelper.CreateFormattedText(s, typeface, emSize, System.Windows.Media.Brushes.Black); switch (format.Alignment) { case XStringAlignment.Near: // nothing to do, this is the default //formattedText.TextAlignment = TextAlignment.Left; break; case XStringAlignment.Center: x += layoutRect.Width / 2; formattedText.TextAlignment = TextAlignment.Center; break; case XStringAlignment.Far: x += layoutRect.Width; formattedText.TextAlignment = TextAlignment.Right; break; } //if (PageDirection == XPageDirection.Downwards) //{ switch (format.LineAlignment) { case XLineAlignment.Near: //y += cyAscent; break; case XLineAlignment.Center: // TODO use CapHeight. PDFlib also uses 3/4 of ascent y += -formattedText.Baseline + (cyAscent * 2 / 4) + layoutRect.Height / 2; break; case XLineAlignment.Far: y += -formattedText.Baseline - cyDescent + layoutRect.Height; break; case XLineAlignment.BaseLine: y -= formattedText.Baseline; break; } //} //else //{ // // TODOWPF // switch (format.LineAlignment) // { // case XLineAlignment.Near: // //y += cyDescent; // break; // case XLineAlignment.Center: // // TODO use CapHeight. PDFlib also uses 3/4 of ascent // //y += -(cyAscent * 3 / 4) / 2 + rect.Height / 2; // break; // case XLineAlignment.Far: // //y += -cyAscent + rect.Height; // break; // case XLineAlignment.BaseLine: // // nothing to do // break; // } //} //if (bold && !descriptor.IsBoldFace) //{ // // TODO: emulate bold by thicker outline //} //if (italic && !descriptor.IsBoldFace) //{ // // TODO: emulate italic by shearing transformation //} if (underline) { //double underlinePosition = lineSpace * realizedFont.FontDescriptor.descriptor.UnderlinePosition / font.cellSpace; //double underlineThickness = lineSpace * realizedFont.FontDescriptor.descriptor.UnderlineThickness / font.cellSpace; //DrawRectangle(null, brush, x, y - underlinePosition, width, underlineThickness); } if (strikeout) { //double strikeoutPosition = lineSpace * realizedFont.FontDescriptor.descriptor.StrikeoutPosition / font.cellSpace; //double strikeoutSize = lineSpace * realizedFont.FontDescriptor.descriptor.StrikeoutSize / font.cellSpace; //DrawRectangle(null, brush, x, y - strikeoutPosition - strikeoutSize, width, strikeoutSize); } //this.dc.DrawText(formattedText, layoutRectangle.Location.ToPoint()); //this.dc.DrawText(formattedText, new System.Windows.Point(x, y)); Geometry geo = formattedText.BuildGeometry(new Point(x, y)); this.pathGeometry.AddGeometry(geo); #else // AGHACK #endif #endif } // ----- CloseAllFigures ---------------------------------------------------------------------- // TODO? CloseAllFigures //public void CloseAllFigures(); // -------------------------------------------------------------------------------------------- /// /// Closes the current figure and starts a new figure. /// public void CloseFigure() { #if GDI this.gdipPath.CloseFigure(); #endif #if WPF PathFigure figure = CurrentPathFigure; if (figure.Segments.Count != 0) { figure.IsClosed = true; //this.figure = null; // force start of new figure this.startNewFigure = true; } #endif } /// /// Starts a new figure without closing the current figure. /// public void StartFigure() { #if GDI this.gdipPath.StartFigure(); #endif #if WPF PathFigure figure = CurrentPathFigure; if (figure.Segments.Count != 0) { figure = new PathFigure(); this.pathGeometry.Figures.Add(figure); } #endif } // -------------------------------------------------------------------------------------------- /// /// Gets or sets an XFillMode that determines how the interiors of shapes are filled. /// public XFillMode FillMode { get { return this.fillMode; } set { this.fillMode = value; #if GDI this.gdipPath.FillMode = (FillMode)value; #endif #if WPF this.pathGeometry.FillRule = value == XFillMode.Winding ? FillRule.Nonzero : FillRule.EvenOdd; #endif } } XFillMode fillMode; // -------------------------------------------------------------------------------------------- /// /// Converts each curve in this XGraphicsPath into a sequence of connected line segments. /// public void Flatten() { #if GDI this.gdipPath.Flatten(); #endif #if WPF #if !SILVERLIGHT this.pathGeometry = this.pathGeometry.GetFlattenedPathGeometry(); #else // AGHACK #endif #endif } /// /// Converts each curve in this XGraphicsPath into a sequence of connected line segments. /// public void Flatten(XMatrix matrix) { #if GDI this.gdipPath.Flatten(matrix.ToGdiMatrix()); #endif #if WPF #if !SILVERLIGHT this.pathGeometry = this.pathGeometry.GetFlattenedPathGeometry(); this.pathGeometry.Transform = new MatrixTransform(matrix.ToWpfMatrix()); #else // AGHACK #endif #endif } /// /// Converts each curve in this XGraphicsPath into a sequence of connected line segments. /// public void Flatten(XMatrix matrix, double flatness) { #if GDI this.gdipPath.Flatten(matrix.ToGdiMatrix(), (float)flatness); #endif #if WPF #if !SILVERLIGHT this.pathGeometry = this.pathGeometry.GetFlattenedPathGeometry(); // TODO: matrix handling not yet tested if (!matrix.IsIdentity) this.pathGeometry.Transform = new MatrixTransform(matrix.ToWpfMatrix()); #else // AGHACK #endif #endif } // -------------------------------------------------------------------------------------------- /// /// Replaces this path with curves that enclose the area that is filled when this path is drawn /// by the specified pen. /// public void Widen(XPen pen) { #if GDI this.gdipPath.Widen(pen.RealizeGdiPen()); #endif #if WPF #if !SILVERLIGHT this.pathGeometry = this.pathGeometry.GetWidenedPathGeometry(pen.RealizeWpfPen()); #else // AGHACK #endif #endif } /// /// Replaces this path with curves that enclose the area that is filled when this path is drawn /// by the specified pen. /// public void Widen(XPen pen, XMatrix matrix) { #if GDI this.gdipPath.Widen(pen.RealizeGdiPen(), matrix.ToGdiMatrix()); #endif #if WPF #if !SILVERLIGHT this.pathGeometry = this.pathGeometry.GetWidenedPathGeometry(pen.RealizeWpfPen()); #else // AGHACK #endif #endif } /// /// Replaces this path with curves that enclose the area that is filled when this path is drawn /// by the specified pen. /// public void Widen(XPen pen, XMatrix matrix, double flatness) { #if GDI this.gdipPath.Widen(pen.RealizeGdiPen(), matrix.ToGdiMatrix(), (float)flatness); #endif #if WPF #if !SILVERLIGHT this.pathGeometry = this.pathGeometry.GetWidenedPathGeometry(pen.RealizeWpfPen()); #else // AGHACK #endif #endif } /// /// Grants access to internal objects of this class. /// public XGraphicsPathInternals Internals { get { return new XGraphicsPathInternals(this); } } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XImage.cs0000644000175000001440000006142611435766646022221 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.IO; using System.ComponentModel; #if GDI using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; #endif #if WPF using System.Windows; using System.Windows.Media; using System.Windows.Media.Imaging; #endif using PdfSharp; using PdfSharp.Internal; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Advanced; // WPFHACK #pragma warning disable 162 namespace PdfSharp.Drawing { /// /// Defines an object used to draw image files (bmp, png, jpeg, gif) and PDF forms. /// An abstract base class that provides functionality for the Bitmap and Metafile descended classes. /// public class XImage : IDisposable { /// /// Initializes a new instance of the class. /// protected XImage() { } #if GDI /// /// Initializes a new instance of the class from a GDI+ image. /// XImage(Image image) { this.gdiImage = image; #if WPF this.wpfImage = ImageHelper.CreateBitmapSource(image); #endif Initialize(); } #endif #if WPF && !SILVERLIGHT /// /// Initializes a new instance of the class from a WPF image. /// XImage(BitmapSource image) { this.wpfImage = image; Initialize(); } #endif XImage(string path) { path = Path.GetFullPath(path); if (!File.Exists(path)) throw new FileNotFoundException(PSSR.FileNotFound(path), path); this.path = path; //FileStream file = new FileStream(filename, FileMode.Open); //BitsLength = (int)file.Length; //Bits = new byte[BitsLength]; //file.Read(Bits, 0, BitsLength); //file.Close(); #if GDI this.gdiImage = Image.FromFile(path); #endif #if WPF && !SILVERLIGHT //BitmapSource.Create() // BUG: BitmapImage locks the file this.wpfImage = new BitmapImage(new Uri(path)); // AGHACK #endif #if false float vres = this.image.VerticalResolution; float hres = this.image.HorizontalResolution; SizeF size = this.image.PhysicalDimension; int flags = this.image.Flags; Size sz = this.image.Size; GraphicsUnit units = GraphicsUnit.Millimeter; RectangleF rect = this.image.GetBounds(ref units); int width = this.image.Width; #endif Initialize(); } XImage(Stream stream) { // Create a dummy unique path this.path = "*" + Guid.NewGuid().ToString("B"); #if GDI this.gdiImage = Image.FromStream(stream); #endif #if WPF throw new NotImplementedException(); //this.wpfImage = new BitmapImage(new Uri(path)); #endif #if true_ float vres = this.image.VerticalResolution; float hres = this.image.HorizontalResolution; SizeF size = this.image.PhysicalDimension; int flags = this.image.Flags; Size sz = this.image.Size; GraphicsUnit units = GraphicsUnit.Millimeter; RectangleF rect = this.image.GetBounds(ref units); int width = this.image.Width; #endif Initialize(); } #if GDI #if UseGdiObjects /// /// Implicit conversion from Image to XImage. /// public static implicit operator XImage(Image image) { return new XImage(image); } #endif /// /// Conversion from Image to XImage. /// public static XImage FromGdiPlusImage(Image image) { return new XImage(image); } #endif #if WPF && !SILVERLIGHT /// /// Conversion from BitmapSource to XImage. /// public static XImage FromBitmapSource(BitmapSource image) { return new XImage(image); } #endif /// /// Creates an image from the specified file. /// /// The path to a BMP, PNG, GIF, JPEG, TIFF, or PDF file. public static XImage FromFile(string path) { if (PdfReader.TestPdfFile(path) > 0) return new XPdfForm(path); return new XImage(path); } /// /// Tests if a file exist. Supports PDF files with page number suffix. /// /// The path to a BMP, PNG, GIF, JPEG, TIFF, or PDF file. public static bool ExistsFile(string path) { if (PdfReader.TestPdfFile(path) > 0) return true; return File.Exists(path); } void Initialize() { #if GDI if (this.gdiImage != null) { // ImageFormat has no overridden Equals... string guid = this.gdiImage.RawFormat.Guid.ToString("B").ToUpper(); switch (guid) { case "{B96B3CAA-0728-11D3-9D7B-0000F81EF32E}": // memoryBMP case "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}": // bmp case "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}": // png this.format = XImageFormat.Png; break; case "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}": // jpeg this.format = XImageFormat.Jpeg; break; case "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}": // gif this.format = XImageFormat.Gif; break; case "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}": // tiff this.format = XImageFormat.Tiff; break; case "{B96B3CB5-0728-11D3-9D7B-0000F81EF32E}": // icon this.format = XImageFormat.Icon; break; case "{B96B3CAC-0728-11D3-9D7B-0000F81EF32E}": // emf case "{B96B3CAD-0728-11D3-9D7B-0000F81EF32E}": // wmf case "{B96B3CB2-0728-11D3-9D7B-0000F81EF32E}": // exif case "{B96B3CB3-0728-11D3-9D7B-0000F81EF32E}": // photoCD case "{B96B3CB4-0728-11D3-9D7B-0000F81EF32E}": // flashPIX default: throw new InvalidOperationException("Unsupported image format."); } return; } #endif #if WPF #if !SILVERLIGHT if (this.wpfImage != null) { string pixelFormat = this.wpfImage.Format.ToString(); string filename = GetImageFilename(this.wpfImage); // WPF treats all images as images. // We give JPEG images a special treatment. // Test if it's a JPEG: bool isJpeg = IsJpeg; // TestJpeg(filename); if (isJpeg) { this.format = XImageFormat.Jpeg; return; } switch (pixelFormat) { case "Bgr32": case "Bgra32": case "Pbgra32": this.format = XImageFormat.Png; break; //case "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}": // jpeg // this.format = XImageFormat.Jpeg; // break; //case "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}": // gif case "BlackWhite": case "Indexed1": case "Indexed4": case "Indexed8": case "Gray8": this.format = XImageFormat.Gif; break; //case "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}": // tiff // this.format = XImageFormat.Tiff; // break; //case "{B96B3CB5-0728-11D3-9D7B-0000F81EF32E}": // icon // this.format = XImageFormat.Icon; // break; //case "{B96B3CAC-0728-11D3-9D7B-0000F81EF32E}": // emf //case "{B96B3CAD-0728-11D3-9D7B-0000F81EF32E}": // wmf //case "{B96B3CB2-0728-11D3-9D7B-0000F81EF32E}": // exif //case "{B96B3CB3-0728-11D3-9D7B-0000F81EF32E}": // photoCD //case "{B96B3CB4-0728-11D3-9D7B-0000F81EF32E}": // flashPIX default: Debug.Assert(false, "Unknown pixel format: " + pixelFormat); this.format = XImageFormat.Gif; break;// throw new InvalidOperationException("Unsupported image format."); } } #else // AGHACK #endif #endif } #if WPF /// /// Gets the image filename. /// /// The bitmap source. internal static string GetImageFilename(BitmapSource bitmapSource) { string filename = bitmapSource.ToString(); filename = UrlDecodeStringFromStringInternal(filename); if (filename.StartsWith("file:///")) filename = filename.Substring(8); // Remove all 3 slashes! else if (filename.StartsWith("file://")) filename = filename.Substring(5); // Keep 2 slashes (UNC path) return filename; } private static string UrlDecodeStringFromStringInternal(string s/*, Encoding e*/) { int length = s.Length; string result = ""; for (int i = 0; i < length; i++) { char ch = s[i]; if (ch == '+') { ch = ' '; } else if ((ch == '%') && (i < (length - 2))) { if ((s[i + 1] == 'u') && (i < (length - 5))) { int num3 = HexToInt(s[i + 2]); int num4 = HexToInt(s[i + 3]); int num5 = HexToInt(s[i + 4]); int num6 = HexToInt(s[i + 5]); if (((num3 < 0) || (num4 < 0)) || ((num5 < 0) || (num6 < 0))) { goto AddByte; } ch = (char)((((num3 << 12) | (num4 << 8)) | (num5 << 4)) | num6); i += 5; result += ch; continue; } int num7 = HexToInt(s[i + 1]); int num8 = HexToInt(s[i + 2]); if ((num7 >= 0) && (num8 >= 0)) { byte b = (byte)((num7 << 4) | num8); i += 2; result += (char)b; continue; } } AddByte: if ((ch & 0xff80) == 0) { result += ch; } else { result += ch; } } return result; } private static int HexToInt(char h) { if ((h >= '0') && (h <= '9')) { return (h - '0'); } if ((h >= 'a') && (h <= 'f')) { return ((h - 'a') + 10); } if ((h >= 'A') && (h <= 'F')) { return ((h - 'A') + 10); } return -1; } #endif #if WPF /// /// Tests if a file is a JPEG. /// /// The filename. internal static bool TestJpeg(string filename) { byte[] imageBits = null; return ReadJpegFile(filename, 16, ref imageBits); } /// /// Reads the JPEG file. /// /// The filename. /// The maximum count of bytes to be read. /// The bytes read from the file. /// False, if file could not be read or is not a JPEG file. internal static bool ReadJpegFile(string filename, int maxRead, ref byte[] imageBits) { if (File.Exists(filename)) { FileStream fs = null; try { fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); } catch { return false; } if (fs.Length < 16) { fs.Close(); return false; } int len = maxRead == -1 ? (int)fs.Length : maxRead; imageBits = new byte[len]; fs.Read(imageBits, 0, len); fs.Close(); if (imageBits[0] == 0xff && imageBits[1] == 0xd8 && imageBits[2] == 0xff && imageBits[3] == 0xe0 && imageBits[6] == 0x4a && imageBits[7] == 0x46 && imageBits[8] == 0x49 && imageBits[9] == 0x46 && imageBits[10] == 0x0) { return true; } // TODO: Exif: find JFIF header if (imageBits[0] == 0xff && imageBits[1] == 0xd8 && imageBits[2] == 0xff && imageBits[3] == 0xe1 /*&& imageBits[6] == 0x4a && imageBits[7] == 0x46 && imageBits[8] == 0x49 && imageBits[9] == 0x46 && imageBits[10] == 0x0*/) { // Hack: store the file in PDF if extension matches ... string str = filename.ToLower(); if (str.EndsWith(".jpg") || str.EndsWith(".jpeg")) return true; } } return false; } #endif /// /// Under construction /// public void Dispose() { Dispose(true); //GC.SuppressFinalize(this); } /// /// Disposes underlying GDI+ object. /// protected virtual void Dispose(bool disposing) { if (!this.disposed) this.disposed = true; #if GDI if (this.gdiImage != null) { this.gdiImage.Dispose(); this.gdiImage = null; } #endif #if WPF if (wpfImage != null) { wpfImage = null; } #endif } bool disposed; /// /// Gets the width of the image. /// [Obsolete("Use either PixelWidth or PointWidth. Temporarily obsolete because of rearrangements for WPF. Currently same as PixelWidth, but will become PointWidth in future releases of PDFsharp.")] public virtual double Width { get { #if GDI && WPF double gdiWidth = this.gdiImage.Width; double wpfWidth = this.wpfImage.PixelWidth; Debug.Assert(gdiWidth == wpfWidth); return wpfWidth; #endif #if GDI && !WPF return this.gdiImage.Width; #endif #if WPF && !GDI #if !SILVERLIGHT return this.wpfImage.PixelWidth; #else // AGHACK return 100; #endif #endif } } /// /// Gets the height of the image. /// [Obsolete("Use either PixelHeight or PointHeight. Temporarily obsolete because of rearrangements for WPF. Currently same as PixelHeight, but will become PointHeight in future releases of PDFsharp.")] public virtual double Height { get { #if GDI && WPF double gdiHeight = this.gdiImage.Height; double wpfHeight = this.wpfImage.PixelHeight; Debug.Assert(gdiHeight == wpfHeight); return wpfHeight; #endif #if GDI && !WPF return this.gdiImage.Height; #endif #if WPF && !GDI #if !SILVERLIGHT return this.wpfImage.PixelHeight; #else // AGHACK return 100; #endif #endif } } /// /// Gets the width of the image in point. /// public virtual double PointWidth { get { #if GDI && WPF double gdiWidth = this.gdiImage.Width * 72 / this.gdiImage.HorizontalResolution; double wpfWidth = this.wpfImage.Width * 72.0 / 96.0; //Debug.Assert(gdiWidth == wpfWidth); Debug.Assert(DoubleUtil.AreRoughlyEqual(gdiWidth, wpfWidth, 5)); return wpfWidth; #endif #if GDI && !WPF return this.gdiImage.Width * 72 / this.gdiImage.HorizontalResolution; #endif #if WPF && !GDI #if !SILVERLIGHT Debug.Assert(Math.Abs(this.wpfImage.PixelWidth * 72 / this.wpfImage.DpiX - this.wpfImage.Width * 72.0 / 96.0) < 0.001); return this.wpfImage.Width * 72.0 / 96.0; #else // AGHACK return 100; #endif #endif } } /// /// Gets the height of the image in point. /// public virtual double PointHeight { get { #if GDI && WPF double gdiHeight = this.gdiImage.Height * 72 / this.gdiImage.HorizontalResolution; double wpfHeight = this.wpfImage.Height * 72.0 / 96.0; Debug.Assert(DoubleUtil.AreRoughlyEqual(gdiHeight, wpfHeight, 5)); return wpfHeight; #endif #if GDI && !WPF return this.gdiImage.Height * 72 / this.gdiImage.HorizontalResolution; #endif #if WPF || SILVERLIGHT && !GDI #if !SILVERLIGHT Debug.Assert(Math.Abs(this.wpfImage.PixelHeight * 72 / this.wpfImage.DpiY - this.wpfImage.Height * 72.0 / 96.0) < 0.001); return this.wpfImage.Height * 72.0 / 96.0; #else // AGHACK return 100; #endif #endif } } /// /// Gets the width of the image in pixels. /// public virtual int PixelWidth { get { #if GDI && WPF int gdiWidth = this.gdiImage.Width; int wpfWidth = this.wpfImage.PixelWidth; Debug.Assert(gdiWidth == wpfWidth); return wpfWidth; #endif #if GDI && !WPF return this.gdiImage.Width; #endif #if WPF && !GDI #if !SILVERLIGHT return this.wpfImage.PixelWidth; #else // AGHACK return 100; #endif #endif } } /// /// Gets the height of the image in pixels. /// public virtual int PixelHeight { get { #if GDI && WPF int gdiHeight = this.gdiImage.Height; int wpfHeight = this.wpfImage.PixelHeight; Debug.Assert(gdiHeight == wpfHeight); return wpfHeight; #endif #if GDI && !WPF return this.gdiImage.Height; #endif #if WPF && !GDI #if !SILVERLIGHT return this.wpfImage.PixelHeight; #else // AGHACK return 100; #endif #endif } } /// /// Gets the size in point of the image. /// public virtual XSize Size { get { return new XSize(PointWidth, PointHeight); } } /// /// Gets the horizontal resolution of the image. /// public virtual double HorizontalResolution { get { #if GDI && WPF double gdiResolution = this.gdiImage.HorizontalResolution; double wpfResolution = this.wpfImage.PixelWidth * 96.0 / this.wpfImage.Width; Debug.Assert(gdiResolution == wpfResolution); return wpfResolution; #endif #if GDI && !WPF return this.gdiImage.HorizontalResolution; #endif #if WPF && !GDI #if !SILVERLIGHT return this.wpfImage.DpiX; //.PixelWidth * 96.0 / this.wpfImage.Width; #else // AGHACK return 96; #endif #endif } } /// /// Gets the vertical resolution of the image. /// public virtual double VerticalResolution { get { #if GDI && WPF double gdiResolution = this.gdiImage.VerticalResolution; double wpfResolution = this.wpfImage.PixelHeight * 96.0 / this.wpfImage.Height; Debug.Assert(gdiResolution == wpfResolution); return wpfResolution; #endif #if GDI && !WPF return this.gdiImage.VerticalResolution; #endif #if WPF && !GDI #if !SILVERLIGHT return this.wpfImage.DpiY; //.PixelHeight * 96.0 / this.wpfImage.Height; #else // AGHACK return 96; #endif #endif } } /// /// Gets or sets a flag indicating whether image interpolation is to be performed. /// public virtual bool Interpolate { get { return this.interpolate; } set { this.interpolate = value; } } bool interpolate = true; /// /// Gets the format of the image. /// public XImageFormat Format { get { return this.format; } } XImageFormat format; #if WPF /// /// Gets a value indicating whether this image is JPEG. /// /// true if this image is JPEG; otherwise, false. public virtual bool IsJpeg { #if !SILVERLIGHT //get { if (!isJpeg.HasValue) InitializeGdiHelper(); return isJpeg.HasValue ? isJpeg.Value : false; } get { if (!isJpeg.HasValue) InitializeJpegQuickTest(); return isJpeg.HasValue ? isJpeg.Value : false; } //set { isJpeg = value; } #else get { return false; } // AGHACK #endif } private bool? isJpeg; /// /// Gets a value indicating whether this image is cmyk. /// /// true if this image is cmyk; otherwise, false. public virtual bool IsCmyk { #if !SILVERLIGHT get { if (!isCmyk.HasValue) InitializeGdiHelper(); return isCmyk.HasValue ? isCmyk.Value : false; } //set { isCmyk = value; } #else get { return false; } // AGHACK #endif } private bool? isCmyk; #if !SILVERLIGHT /// /// Gets the JPEG memory stream (if IsJpeg returns true). /// /// The memory. public virtual MemoryStream Memory { get { if (!isCmyk.HasValue) InitializeGdiHelper(); return memory; } //set { memory = value; } } MemoryStream memory = null; /// /// Determines if an image is JPEG w/o creating an Image object. /// private void InitializeJpegQuickTest() { isJpeg = TestJpeg(GetImageFilename(wpfImage)); } /// /// Initializes the GDI helper. /// We use GDI+ to detect if image is JPEG. /// If so, we also determine if it's CMYK and we read the image bytes. /// private void InitializeGdiHelper() { if (!isCmyk.HasValue) { try { using (System.Drawing.Image image = new System.Drawing.Bitmap(GetImageFilename(wpfImage))) { string guid = image.RawFormat.Guid.ToString("B").ToUpper(); isJpeg = guid == "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}"; isCmyk = (image.Flags & ((int)System.Drawing.Imaging.ImageFlags.ColorSpaceCmyk | (int)System.Drawing.Imaging.ImageFlags.ColorSpaceYcck)) != 0; if (isJpeg.Value) { memory = new MemoryStream(); image.Save(memory, System.Drawing.Imaging.ImageFormat.Jpeg); if ((int)memory.Length == 0) { memory = null; } } } } catch { } } } #endif #endif #if DEBUG_ // TEST internal void CreateAllImages(string name) { if (this.image != null) { this.image.Save(name + ".bmp", ImageFormat.Bmp); this.image.Save(name + ".emf", ImageFormat.Emf); this.image.Save(name + ".exif", ImageFormat.Exif); this.image.Save(name + ".gif", ImageFormat.Gif); this.image.Save(name + ".ico", ImageFormat.Icon); this.image.Save(name + ".jpg", ImageFormat.Jpeg); this.image.Save(name + ".png", ImageFormat.Png); this.image.Save(name + ".tif", ImageFormat.Tiff); this.image.Save(name + ".wmf", ImageFormat.Wmf); this.image.Save(name + "2.bmp", ImageFormat.MemoryBmp); } } #endif #if GDI internal Image gdiImage; #endif #if WPF internal BitmapSource wpfImage; #endif /// /// If path starts with '*' the image is created from a stream and the path is a GUID. /// internal string path; /// /// Cache PdfImageTable.ImageSelector to speed up finding the right PdfImage /// if this image is used more than once. /// internal PdfImageTable.ImageSelector selector; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XFontMetrics.cs0000644000175000001440000000765311435766646023436 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Drawing { /// /// Collects information of a font. /// public sealed class XFontMetrics { internal XFontMetrics(string name, int unitsPerEm, int ascent, int descent, int leading, int capHeight, int xHeight, int stemV, int stemH, int averageWidth, int maxWidth) { this.name = name; this.unitsPerEm = unitsPerEm; this.ascent = ascent; this.descent = descent; this.leading = leading; this.capHeight = capHeight; this.xHeight = xHeight; this.stemV = stemV; this.stemH = stemH; this.averageWidth = averageWidth; this.maxWidth = maxWidth; } /// /// Gets the font name. /// public string Name { get { return this.name; } } string name; /// /// Gets the ascent value. /// public int UnitsPerEm { get { return this.unitsPerEm; } } int unitsPerEm; /// /// Gets the ascent value. /// public int Ascent { get { return this.ascent; } } int ascent; /// /// Gets the descent value. /// public int Descent { get { return this.descent; } } int descent; /// /// Gets the average width. /// /// The average width. public int AverageWidth { get { return this.averageWidth; } } int averageWidth; /// /// Gets the height of capital letters. /// public int CapHeight { get { return this.capHeight; } } int capHeight; /// /// Gets the leading value. /// public int Leading { get { return this.leading; } } int leading; /// /// Gets the maximum width of a character. /// public int MaxWidth { get { return this.maxWidth; } } int maxWidth; /// /// Gets an internal value. /// public int StemH { get { return this.stemH; } } int stemH; /// /// Gets an internal value. /// public int StemV { get { return this.stemV; } } int stemV; /// /// Gets the height of a character. /// public int XHeight { get { return this.xHeight; } } int xHeight; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XPen.cs0000644000175000001440000002645411435766646021723 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Internal; namespace PdfSharp.Drawing { /// /// Defines an object used to draw lines and curves. /// public sealed class XPen { /// /// Initializes a new instance of the class. /// public XPen(XColor color) : this(color, 1, false) { } /// /// Initializes a new instance of the class. /// public XPen(XColor color, double width) : this(color, width, false) { } internal XPen(XColor color, double width, bool immutable) { this.color = color; this.width = width; this.lineJoin = XLineJoin.Miter; this.lineCap = XLineCap.Flat; this.dashStyle = XDashStyle.Solid; this.dashOffset = 0f; this.immutable = immutable; } /// /// Initializes a new instance of the class. /// public XPen(XPen pen) { this.color = pen.color; this.width = pen.width; this.lineJoin = pen.lineJoin; this.lineCap = pen.lineCap; this.dashStyle = pen.dashStyle; this.dashOffset = pen.dashOffset; this.dashPattern = pen.dashPattern; if (this.dashPattern != null) this.dashPattern = (double[])this.dashPattern.Clone(); } /// /// Clones this instance. /// public XPen Clone() { return new XPen(this); } /// /// Gets or sets the color. /// public XColor Color { get { return this.color; } set { if (this.immutable) throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); this.dirty = this.dirty || this.color != value; this.color = value; } } internal XColor color; /// /// Gets or sets the width. /// public double Width { get { return this.width; } set { if (this.immutable) throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); this.dirty = this.dirty || this.width != value; this.width = value; } } internal double width; /// /// Gets or sets the line join. /// public XLineJoin LineJoin { get { return this.lineJoin; } set { if (this.immutable) throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); this.dirty = this.dirty || this.lineJoin != value; this.lineJoin = value; } } internal XLineJoin lineJoin; /// /// Gets or sets the line cap. /// public XLineCap LineCap { get { return this.lineCap; } set { if (this.immutable) throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); this.dirty = this.dirty || this.lineCap != value; this.lineCap = value; } } internal XLineCap lineCap; /// /// Gets or sets the miter limit. /// public double MiterLimit { get { return this.miterLimit; } set { if (this.immutable) throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); this.dirty = this.dirty || this.miterLimit != value; this.miterLimit = value; } } internal double miterLimit; /// /// Gets or sets the dash style. /// public XDashStyle DashStyle { get { return this.dashStyle; } set { if (this.immutable) throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); this.dirty = this.dirty || this.dashStyle != value; this.dashStyle = value; } } internal XDashStyle dashStyle; /// /// Gets or sets the dash offset. /// public double DashOffset { get { return this.dashOffset; } set { if (this.immutable) throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); this.dirty = this.dirty || this.dashOffset != value; this.dashOffset = value; } } internal double dashOffset; /// /// Gets or sets the dash pattern. /// public double[] DashPattern { get { if (this.dashPattern == null) this.dashPattern = new double[0]; return this.dashPattern; } set { if (this.immutable) throw new ArgumentException(PSSR.CannotChangeImmutableObject("XPen")); int length = value.Length; //if (length == 0) // throw new ArgumentException("Dash pattern array must not be empty."); for (int idx = 0; idx < length; idx++) { if (value[idx] <= 0) throw new ArgumentException("Dash pattern value must greater than zero."); } this.dirty = true; this.dashStyle = XDashStyle.Custom; this.dashPattern = (double[])value.Clone(); } } internal double[] dashPattern; #if GDI #if UseGdiObjects /// /// Implicit conversion from Pen to XPen /// public static implicit operator XPen(Pen pen) { XPen xpen; switch (pen.PenType) { case PenType.SolidColor: xpen = new XPen(pen.Color, pen.Width); xpen.LineJoin = (XLineJoin)pen.LineJoin; xpen.DashStyle = (XDashStyle)pen.DashStyle; xpen.miterLimit = pen.MiterLimit; break; default: throw new NotImplementedException("Pen type not supported by PDFsharp."); } // Bug fixed by drice2@ageone.de if (pen.DashStyle == System.Drawing.Drawing2D.DashStyle.Custom) { int length = pen.DashPattern.Length; double[] pattern = new double[length]; for (int idx = 0; idx < length; idx++) pattern[idx] = pen.DashPattern[idx]; xpen.DashPattern = pattern; xpen.dashOffset = pen.DashOffset; } return xpen; } #endif internal System.Drawing.Pen RealizeGdiPen() { if (this.dirty) { if (this.gdiPen == null) this.gdiPen = new System.Drawing.Pen(this.color.ToGdiColor(), (float)this.width); else { this.gdiPen.Color = this.color.ToGdiColor(); this.gdiPen.Width = (float)this.width; } LineCap lineCap = XConvert.ToLineCap(this.lineCap); this.gdiPen.StartCap = lineCap; this.gdiPen.EndCap = lineCap; this.gdiPen.LineJoin = XConvert.ToLineJoin(this.lineJoin); this.gdiPen.DashOffset = (float)this.dashOffset; if (this.dashStyle == XDashStyle.Custom) { int len = this.dashPattern == null ? 0 : this.dashPattern.Length; float[] pattern = new float[len]; for (int idx = 0; idx < len; idx++) pattern[idx] = (float)this.dashPattern[idx]; this.gdiPen.DashPattern = pattern; } else this.gdiPen.DashStyle = (System.Drawing.Drawing2D.DashStyle)this.dashStyle; } return this.gdiPen; } #endif #if WPF internal System.Windows.Media.Pen RealizeWpfPen() { #if !SILVERLIGHT if (this.dirty || !this.dirty) // TODOWPF: XPen is frozen by design, WPF Pen can change { //if (this.wpfPen == null) this.wpfPen = new System.Windows.Media.Pen(new SolidColorBrush(this.color.ToWpfColor()), this.width); //else //{ // this.wpfPen.Brush = new SolidColorBrush(this.color.ToWpfColor()); // this.wpfPen.Thickness = this.width; //} PenLineCap lineCap = XConvert.ToPenLineCap(this.lineCap); this.wpfPen.StartLineCap = lineCap; this.wpfPen.EndLineCap = lineCap; this.wpfPen.LineJoin = XConvert.ToPenLineJoin(this.lineJoin); if (this.dashStyle == XDashStyle.Custom) { // TODOWPF: does not work in all cases this.wpfPen.DashStyle = new System.Windows.Media.DashStyle(this.dashPattern, this.dashOffset); } else { switch (this.dashStyle) { case XDashStyle.Solid: this.wpfPen.DashStyle = DashStyles.Solid; break; case XDashStyle.Dash: //this.wpfPen.DashStyle = DashStyles.Dash; this.wpfPen.DashStyle = new System.Windows.Media.DashStyle(new double[] { 2, 2 }, 0); break; case XDashStyle.Dot: //this.wpfPen.DashStyle = DashStyles.Dot; this.wpfPen.DashStyle = new System.Windows.Media.DashStyle(new double[] { 0, 2 }, 1.5); break; case XDashStyle.DashDot: //this.wpfPen.DashStyle = DashStyles.DashDot; this.wpfPen.DashStyle = new System.Windows.Media.DashStyle(new double[] { 2, 2, 0, 2 }, 0); break; case XDashStyle.DashDotDot: //this.wpfPen.DashStyle = DashStyles.DashDotDot; this.wpfPen.DashStyle = new System.Windows.Media.DashStyle(new double[] { 2, 2, 0, 2, 0, 2 }, 0); break; } } } #else this.wpfPen = new System.Windows.Media.Pen(new SolidColorBrush(this.color.ToWpfColor()), this.width); #endif return this.wpfPen; } #endif bool dirty = true; bool immutable; #if GDI System.Drawing.Pen gdiPen; #endif #if WPF //&& !SILVERLIGHT System.Windows.Media.Pen wpfPen; #endif } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/InternalGraphicsState.cs0000644000175000001440000001421411435766646025276 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows.Media; #endif namespace PdfSharp.Drawing { // In GDI+ the functions Save/Restore, BeginContainer/EndContainer, Transform, SetClip and ResetClip // can be combined in any order. E.g. you can set a clip region, save the graphics state, empty the // clip region and draw without clipping. Then you can restore to the previous clip region. With PDF // this behavior is hard to implement. To solve this problem I first an automaton that keeps track // of all clipping paths and the current transformation when the clip path was set. The automation // manages a PDF graphics state stack to calculate the desired bahaviour. It also takes into consideration // not to multiply with inverse matrixes when the user sets a new transformation matrix. // After the design works on pager I decided not to implement it because it is much to large-scale. // Instead I lay down some rules how to use the XGraphics class. // // * Before you set a transformation matrix save the graphics state (Save) or begin a new container // (BeginContainer). // // * Instead of resetting the transformation matrix, call Restore or EndContainer. If you reset the // transformation, in PDF must be multiplied with the inverse matrix. That leads to round off errors // because in PDF file only 3 digits are used and Acrobat internally uses fixed point numbers (until // versioin 6 or 7 I think). // // * When no clip path is defined, you can set or intersect a new path. // // * When a clip path is already defined, you can always intersect with a new one (wich leads in general // to a smaller clip region). // // * When a clip path is already defined, you can only reset it to the empty region (ResetClip) when // the graphics state stack is at the same position as it had when the clip path was defined. Otherwise // an error occurs. // // Keeping these rules leads to easy to read code and best results in PDF output. /// /// Represents the internal state of an XGraphics object. /// internal class InternalGraphicsState { public InternalGraphicsState(XGraphics gfx) { this.gfx = gfx; } public InternalGraphicsState(XGraphics gfx, XGraphicsState state) { this.gfx = gfx; this.state = state; state.InternalState = this; //#if GDI // //GdiGraphicsState = state.GdiState; // this.gfx = gfx; // this.state = state; // state.InternalState = this; //#endif //#if WPF // this.gfx = gfx; // this.state = state; // state.InternalState = this; //#endif } public InternalGraphicsState(XGraphics gfx, XGraphicsContainer container) { this.gfx = gfx; container.InternalState = this; //#if GDI // //GdiGraphicsState = container.GdiState; // this.gfx = gfx; // container.InternalState = this; //#endif //#if WPF // this.gfx = gfx; // container.InternalState = this; //#endif } /// /// Gets or sets the current transformation matrix. /// public XMatrix Transform { get { return this.transform; } set { this.transform = value; } } XMatrix transform = new XMatrix(); //XMatrix.Identity; public void Pushed() { #if GDI #endif #if WPF #endif } public void Popped() { this.invalid = true; #if GDI #endif #if WPF if (this.gfx.targetContext == XGraphicTargetContext.WPF) { for (int idx = 0; idx < this.transformPushLevel; idx++) this.gfx.dc.Pop(); this.transformPushLevel = 0; for (int idx = 0; idx < this.geometryPushLevel; idx++) this.gfx.dc.Pop(); this.geometryPushLevel = 0; } #endif } internal bool invalid; #if GDI_ /// /// The GDI+ GraphicsState if contructed from XGraphicsState. /// public GraphicsState GdiGraphicsState; #endif #if WPF public void SetTransform(MatrixTransform transform) { this.gfx.dc.PushTransform(transform); this.transformPushLevel++; } int transformPushLevel; public void SetClip(Geometry geometry) { this.gfx.dc.PushClip(geometry); this.geometryPushLevel++; } int geometryPushLevel; #endif internal XGraphics gfx; internal XGraphicsState state; // /// // /// The GDI+ GraphicsContainer if contructed from XGraphicsContainer. // /// // public GraphicsContainer GdiGraphicsContainer; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XFontStretch.cs0000644000175000001440000000366411435766646023442 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.ComponentModel; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Internal; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; namespace PdfSharp.Drawing { /// /// NYI. Reserved for future extensions of PDFsharp. /// // [DebuggerDisplay("'{Name}', {Size}")] public class XFontStretch { } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/GraphicsStateStack.cs0000644000175000001440000000570511435766646024574 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections.Generic; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows.Media; #endif namespace PdfSharp.Drawing { /// /// Represents a stack of XGraphicsState and XGraphicsContainer objects. /// internal class GraphicsStateStack { public GraphicsStateStack(XGraphics gfx) { this.current = new InternalGraphicsState(gfx); } public int Count { get { return this.stack.Count; } } public void Push(InternalGraphicsState state) { this.stack.Push(state); state.Pushed(); } public int Restore(InternalGraphicsState state) { if (!this.stack.Contains(state)) throw new ArgumentException("State not on stack.", "state"); if (state.invalid) throw new ArgumentException("State already restored.", "state"); int count = 1; InternalGraphicsState top = (InternalGraphicsState)this.stack.Pop(); top.Popped(); while (top != state) { count++; state.invalid = true; top = (InternalGraphicsState)this.stack.Pop(); top.Popped(); } state.invalid = true; return count; } public InternalGraphicsState Current { get { if (this.stack.Count == 0) return this.current; return this.stack.Peek(); } } InternalGraphicsState current; Stack stack = new Stack(); } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XFontFamily.cs0000644000175000001440000002236311435766646023244 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Pdf; using PdfSharp.Fonts.OpenType; // WPFHACK #pragma warning disable 162 namespace PdfSharp.Drawing { /// /// Defines a group of type faces having a similar basic design and certain variations in styles. /// public sealed class XFontFamily { internal XFontFamily() { } #if GDI internal XFontFamily(System.Drawing.FontFamily family) { this.name = family.Name; this.gdiFamily = family; #if WPF this.wpfFamily = new System.Windows.Media.FontFamily(family.Name); #endif } #endif #if WPF internal XFontFamily(System.Windows.Media.FontFamily family) { this.name = family.Source; // HACK int idxHash = this.name.LastIndexOf('#'); if (idxHash > 0) this.name = this.name.Substring(idxHash + 1); this.wpfFamily = family; #if GDI this.gdiFamily = new System.Drawing.FontFamily(family.Source); #endif } #endif //internal FontFamily(); //public FontFamily(GenericFontFamilies genericFamily); //internal FontFamily(IntPtr family); /// /// Initializes a new instance of the class. /// /// The family name of a font. public XFontFamily(string name) { this.name = name; #if GDI this.gdiFamily = new System.Drawing.FontFamily(name); #endif #if WPF this.wpfFamily = new System.Windows.Media.FontFamily(name); #endif } //public FontFamily(string name, FontCollection fontCollection); //public override bool Equals(object obj); /// /// Gets the name of the font family. /// public string Name { get { return this.name; } } readonly string name; /// /// Returns the cell ascent, in design units, of the XFontFamily object of the specified style. /// public int GetCellAscent(XFontStyle style) { #if GDI && !WPF return this.gdiFamily.GetCellAscent((FontStyle)style); #endif #if WPF && !GDI return FontHelper.GetWpfValue(this, style, GWV.GetCellAscent); #endif #if WPF && GDI #if DEBUG int gdiResult = this.gdiFamily.GetCellAscent((FontStyle)style); int wpfResult = FontHelper.GetWpfValue(this, style, GWV.GetCellAscent); Debug.Assert(gdiResult == wpfResult, "GDI+ and WPF provides different values."); #endif return FontHelper.GetWpfValue(this, style, GWV.GetCellAscent); #endif } /// /// Returns the cell descent, in design units, of the XFontFamily object of the specified style. /// public int GetCellDescent(XFontStyle style) { #if GDI && !WPF return this.gdiFamily.GetCellDescent((FontStyle)style); #endif #if WPF && !GDI return FontHelper.GetWpfValue(this, style, GWV.GetCellDescent); #endif #if WPF && GDI #if DEBUG int gdiResult = this.gdiFamily.GetCellDescent((FontStyle)style); int wpfResult = FontHelper.GetWpfValue(this, style, GWV.GetCellDescent); Debug.Assert(gdiResult == wpfResult, "GDI+ and WPF provides different values."); #endif return FontHelper.GetWpfValue(this, style, GWV.GetCellDescent); #endif } /// /// Gets the height, in font design units, of the em square for the specified style. /// public int GetEmHeight(XFontStyle style) { #if GDI && !WPF #if DEBUG int gdiResult = this.gdiFamily.GetEmHeight((FontStyle)style); //int wpfResult = FontHelper.GetWpfValue(this, style, GWV.GetEmHeight); #endif return this.gdiFamily.GetEmHeight((FontStyle)style); #endif #if WPF && !GDI return FontHelper.GetWpfValue(this, style, GWV.GetEmHeight); #endif #if WPF && GDI #if DEBUG int gdiResult = this.gdiFamily.GetEmHeight((FontStyle)style); int wpfResult = FontHelper.GetWpfValue(this, style, GWV.GetEmHeight); Debug.Assert(gdiResult == wpfResult, "GDI+ and WPF provides different values."); #endif return FontHelper.GetWpfValue(this, style, GWV.GetEmHeight); #endif } //public override int GetHashCode(); /// /// Returns the line spacing, in design units, of the FontFamily object of the specified style. /// The line spacing is the vertical distance between the base lines of two consecutive lines of text. /// public int GetLineSpacing(XFontStyle style) { #if GDI && !WPF return this.gdiFamily.GetLineSpacing((FontStyle)style); #endif #if WPF && !GDI return FontHelper.GetWpfValue(this, style, GWV.GetLineSpacing); #endif #if WPF && GDI #if DEBUG int gdiResult = this.gdiFamily.GetLineSpacing((FontStyle)style); int wpfResult = FontHelper.GetWpfValue(this, style, GWV.GetLineSpacing); //Debug.Assert(gdiResult == wpfResult, "GDI+ and WPF provides different values."); #endif return FontHelper.GetWpfValue(this, style, GWV.GetLineSpacing); #endif } //public string GetName(int language); /// /// Indicates whether the specified FontStyle enumeration is available. /// public bool IsStyleAvailable(XFontStyle style) { #if GDI && !WPF return this.gdiFamily.IsStyleAvailable((FontStyle)style); #endif #if WPF && !GDI return FontHelper.IsStyleAvailable(this, style); #endif #if WPF && GDI #if DEBUG bool gdiResult = this.gdiFamily.IsStyleAvailable((FontStyle)style); bool wpfResult = FontHelper.IsStyleAvailable(this, style); // TODOWPF: check when fails Debug.Assert(gdiResult == wpfResult, "GDI+ and WPF provides different values."); #endif return FontHelper.IsStyleAvailable(this, style); #endif } //internal void SetNative(IntPtr native); //public override string ToString(); // //// Properties //private static int CurrentLanguage { get; } /// /// Returns an array that contains all the FontFamily objects associated with the current graphics context. /// public static XFontFamily[] Families { get { #if GDI System.Drawing.FontFamily[] families = System.Drawing.FontFamily.Families; int count = families.Length; XFontFamily[] result = new XFontFamily[count]; for (int idx = 0; idx < count; idx++) result[idx] = new XFontFamily(families[idx]); return result; #endif #if WPF //System.Windows.Media.Fonts.GetFontFamilies( // TODOWPF: not very important return null; #endif } } /// /// Returns an array that contains all the FontFamily objects available for the specified /// graphics context. /// public static XFontFamily[] GetFamilies(XGraphics graphics) { XFontFamily[] result; #if GDI System.Drawing.FontFamily[] families = null; families = System.Drawing.FontFamily.GetFamilies(graphics.gfx); int count = families.Length; result = new XFontFamily[count]; for (int idx = 0; idx < count; idx++) result[idx] = new XFontFamily(families[idx]); #endif #if WPF // TODOWPF: not very important result = null; #endif return result; } //public static FontFamily GenericMonospace { get; } //public static FontFamily GenericSansSerif { get; } //public static FontFamily GenericSerif { get; } //public string Name { get; } #if GDI /// /// GDI+ object. /// internal System.Drawing.FontFamily gdiFamily; #endif #if WPF /// /// WPF object. /// internal System.Windows.Media.FontFamily wpfFamily; #endif } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XPrivateFontCollection.cs0000644000175000001440000002676311435766646025461 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections.Generic; using System.Globalization; using System.ComponentModel; using System.IO; using System.Runtime.InteropServices; #if GDI using System.Drawing; using System.Drawing.Text; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Internal; using PdfSharp.Fonts.OpenType; namespace PdfSharp.Drawing { /// /// Makes fonts that are not installed on the system available within the current application domain. /// public sealed class XPrivateFontCollection : IDisposable { /// /// Initializes a new instance of the class. /// public XPrivateFontCollection() { //// HACK: Use one global PrivateFontCollection in GDI+ //// TODO: Make a list of it //if (s_global != null) // throw new InvalidOperationException("Because of limitations in GDI+ you can only have one instance of XPrivateFontCollection in your application."); } internal static XPrivateFontCollection s_global = new XPrivateFontCollection(); //static XPrivateFontCollection() //{ // // HACK: Use one global PrivateFontCollection in GDI+ // // TODO: Make a list of it // if (global != null) // throw new InvalidOperationException("Because of limitations in GDI+ you can only have one instance of XPrivateFontCollection in your application."); // global = this; //} //internal static XPrivateFontCollection global; /// /// Disposes all fonts from the collection. /// public void Dispose() { #if GDI //privateFonts.Clear(); this.privateFontCollection.Dispose(); this.privateFontCollection = new PrivateFontCollection(); #endif s_global = null; //GC.SuppressFinalize(this); } #if GDI internal static PrivateFontCollection GlobalPrivateFontCollection { get { return s_global != null ? s_global.privateFontCollection : null; } } #endif #if GDI //internal PrivateFontCollection PrivateFontCollection //{ // get { return privateFontCollection; } // set { privateFontCollection = value; } //} // PrivateFontCollection of GDI+ PrivateFontCollection privateFontCollection = new PrivateFontCollection(); #endif /// /// Gets the global font collection. /// public static XPrivateFontCollection Global { get { return s_global; } } /// /// Sets a new global font collection and returns the previous one, or null if no previous one exists. /// public static XPrivateFontCollection SetGlobalFontCollection(XPrivateFontCollection fontCollection) { if (fontCollection==null) throw new ArgumentNullException("fontCollection"); XPrivateFontCollection old = s_global; s_global = fontCollection; return old; } #if GDI /// /// Adds the font data to the font collections. /// public void AddFont(byte[] data, string familyName) { if (String.IsNullOrEmpty(familyName)) throw new ArgumentNullException("familyName"); //if (glyphTypeface == null) // throw new ArgumentNullException("glyphTypeface"); // Add to GDI+ PrivateFontCollection int length = data.Length; // Copy data without unsafe code IntPtr ip = Marshal.AllocCoTaskMem(length); Marshal.Copy(data, 0, ip, length); this.privateFontCollection.AddMemoryFont(ip, length); Marshal.FreeCoTaskMem(ip); //privateFonts.Add(glyphTypeface); } #endif // /// // /// Adds the glyph typeface to this collection. // /// // public void AddGlyphTypeface(XGlyphTypeface glyphTypeface) // { // if (glyphTypeface == null) // throw new ArgumentNullException("glyphTypeface"); //#if GDI // // Add to GDI+ PrivateFontCollection // byte[] data = glyphTypeface.FontData.Data; // int length = data.Length; // // Do it w/o unsafe code (do it like VB programmers do): // IntPtr ip = Marshal.AllocCoTaskMem(length); // Marshal.Copy(data, 0, ip, length); // this.privateFontCollection.AddMemoryFont(ip, length); // Marshal.FreeCoTaskMem(ip); // privateFonts.Add(glyphTypeface); //#endif // } #if GDI /// /// HACK: to be removed. /// //[Obsolete("Just make QBX compile. Will be removed when Private Fonts are working.", false)] public void AddFont(byte[] data, string fontName, bool bold, bool italic) { throw new NotImplementedException("AddFont"); //AddGlyphTypeface(new XGlyphTypeface(data)); } /// /// Adds a font from the specified file to this collection. /// public void AddFont(string filename) { throw new NotImplementedException("AddFont"); //AddGlyphTypeface(new XGlyphTypeface(filename)); } /// /// Adds a font from memory to this collection. /// public void AddFont(byte[] data) { throw new NotImplementedException("AddFont"); //AddGlyphTypeface(new XGlyphTypeface(data)); } #endif #if WPF /// /// Initializes a new instance of the FontFamily class from the specified font family name and an optional base uniform resource identifier (URI) value. /// Sample: Add(new Uri("pack://application:,,,/"), "./myFonts/#FontFamilyName");) /// /// Specifies the base URI that is used to resolve familyName. /// The family name or names that comprise the new FontFamily. Multiple family names should be separated by commas. public void Add(Uri baseUri, string familyName) { // TODO: What means 'Multiple family names should be separated by commas.'? // does not work if (String.IsNullOrEmpty(familyName)) throw new ArgumentNullException("familyName"); if (familyName.Contains(",")) throw new NotImplementedException("Only one family name is supported."); // family name starts right of '#' int idxHash = familyName.IndexOf('#'); if (idxHash < 0) throw new ArgumentException("Family name must contain a '#'. Example './#MyFontFamilyName'", "familyName"); string key = familyName.Substring(idxHash + 1); if (String.IsNullOrEmpty(key)) throw new ArgumentException("familyName has invalid format."); if (this.fontFamilies.ContainsKey(key)) throw new ArgumentException("An entry with the specified family name already exists."); #if !SILVERLIGHT System.Windows.Media.FontFamily fontFamily = new System.Windows.Media.FontFamily(baseUri, familyName); #else System.Windows.Media.FontFamily fontFamily = new System.Windows.Media.FontFamily(familyName); #endif // Check whether font data realy exists #if DEBUG && !SILVERLIGHT ICollection list = fontFamily.GetTypefaces(); foreach (Typeface typeFace in list) { //Debug.WriteLine(String.Format("{0}, {1}, {2}, {3}", typeFace.FaceNames.Values.First(), typeFace.Style, typeFace.Weight, typeFace.Stretch)); GlyphTypeface glyphTypeface; if (!typeFace.TryGetGlyphTypeface(out glyphTypeface)) throw new ArgumentException("Font with the specified family name does not exist."); } #endif this.fontFamilies.Add(key, fontFamily); } #endif #if GDI internal static Font TryFindPrivateFont(string name, double size, FontStyle style) { try { PrivateFontCollection pfc = GlobalPrivateFontCollection; if (pfc == null) return null; foreach (System.Drawing.FontFamily family in pfc.Families) { if (String.Compare(family.Name, name, true) == 0) return new Font(family, (float)size, style, GraphicsUnit.World); } } catch { #if DEBUG #endif } return null; } #endif #if WPF internal static Typeface TryFindTypeface(string name, XFontStyle style, out System.Windows.Media.FontFamily fontFamily) { if (s_global.fontFamilies.TryGetValue(name, out fontFamily)) { Typeface typeface = FontHelper.CreateTypeface(fontFamily, style); return typeface; } return null; } #endif #if GDI___ internal XGlyphTypeface FindFont(string fontName, bool bold, bool italic) { //if (privateFonts != null) { for (int i = 0; i < 3; ++i) { // We make 4 passes. // On second pass, we ignore Italic. // On third pass, we ignore Bold. // On fourth pass, we ignore Bold and Italic foreach (XGlyphTypeface pf in privateFonts) { if (string.Compare(pf.FamilyName, fontName, StringComparison.InvariantCultureIgnoreCase) == 0) { switch (i) { case 0: if (pf.IsBold == bold && pf.IsItalic == italic) return pf; break; case 1: if (pf.IsBold == bold /*&& pf.Italic == italic*/) return pf; break; case 2: if (/*pf.Bold == bold &&*/ pf.IsItalic == italic) return pf; break; case 3: //if (pf.Bold == bold && pf.Italic == italic) return pf; } } } } } return null; } #endif #if GDI //List privateFonts = new List(); #endif #if WPF readonly Dictionary fontFamilies = new Dictionary(StringComparer.InvariantCultureIgnoreCase); #endif } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XMatrix.cs0000644000175000001440000013637311435766646022447 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.ComponentModel; using System.Runtime.InteropServices; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Internal; // ReSharper disable RedundantNameQualifier namespace PdfSharp.Drawing { /// /// Represents a 3-by-3 matrix that represents an affine 2D transformation. /// [DebuggerDisplay("({M11}, {M12}, {M21}, {M22}, {OffsetX}, {OffsetY})")] [Serializable, StructLayout(LayoutKind.Sequential)] //, TypeConverter(typeof(MatrixConverter)), ValueSerializer(typeof(MatrixValueSerializer))] public struct XMatrix : IFormattable { [Flags] internal enum XMatrixTypes { Identity = 0, Translation = 1, Scaling = 2, Unknown = 4 } /// /// Initializes a new instance of the XMatrix struct. /// public XMatrix(double m11, double m12, double m21, double m22, double offsetX, double offsetY) { this.m11 = m11; this.m12 = m12; this.m21 = m21; this.m22 = m22; this.offsetX = offsetX; this.offsetY = offsetY; this.type = XMatrixTypes.Unknown; this.padding = 0; DeriveMatrixType(); } /// /// Gets a value that indicates whether this matrix is an identity matrix. /// public static XMatrix Identity { get { return s_identity; } } /// /// Sets this matrix into an identity matrix. /// public void SetIdentity() { this.type = XMatrixTypes.Identity; } /// /// Fixes a bug that XMatrixTypes.Identity is not handled correctly in some cases. /// // HACK: Fixes a bug that XMatrixTypes.Identity is not handled correctly in some cases. // TODO: Eliminate this function. void InitIdentity() { Debug.Assert(this.type == XMatrixTypes.Identity); this.m11 = 1; this.m22 = 1; Debug.Assert(this.m12 == 0); Debug.Assert(this.m21 == 0); Debug.Assert(this.offsetX == 0); Debug.Assert(this.offsetY == 0); } /// /// Gets a value indicating whether this matrix instance is the identity matrix. /// public bool IsIdentity { get { if (this.type == XMatrixTypes.Identity) return true; if (this.m11 == 1.0 && this.m12 == 0 && this.m21 == 0 && this.m22 == 1.0 && this.offsetX == 0 && this.offsetY == 0) { this.type = XMatrixTypes.Identity; return true; } return false; } } /// /// Gets an array of double values that represents the elements of this matrix. /// [Obsolete("Use GetElements().")] public double[] Elements { get { return GetElements(); } } /// /// Gets an array of double values that represents the elements of this matrix. /// public double[] GetElements() { if (this.type == XMatrixTypes.Identity) return new double[] { 1, 0, 0, 1, 0, 0 }; return new double[] { this.m11, this.m12, this.m21, this.m22, this.offsetX, this.offsetY }; } /// /// Multiplies two matrices. /// public static XMatrix operator *(XMatrix trans1, XMatrix trans2) { MatrixHelper.MultiplyMatrix(ref trans1, ref trans2); return trans1; } /// /// Multiplies two matrices. /// public static XMatrix Multiply(XMatrix trans1, XMatrix trans2) { MatrixHelper.MultiplyMatrix(ref trans1, ref trans2); return trans1; } /// /// Appends the specified matrix to this matrix. /// public void Append(XMatrix matrix) { this *= matrix; } /// /// Prepends the specified matrix to this matrix. /// public void Prepend(XMatrix matrix) { this = matrix * this; } /// /// Appends the specified matrix to this matrix. /// [Obsolete("Use Append.")] public void Multiply(XMatrix matrix) { Append(matrix); } /// /// Prepends the specified matrix to this matrix. /// [Obsolete("Use Prepend.")] public void MultiplyPrepend(XMatrix matrix) { Prepend(matrix); } /// /// Multiplies this matrix with the specified matrix. /// public void Multiply(XMatrix matrix, XMatrixOrder order) { // HACK in Multiply if (this.type == XMatrixTypes.Identity) InitIdentity(); // Must use properties, the fields can be invalid if the matrix is identity matrix. double t11 = M11; double t12 = M12; double t21 = M21; double t22 = M22; double tdx = OffsetX; double tdy = OffsetY; if (order == XMatrixOrder.Append) { this.m11 = t11 * matrix.M11 + t12 * matrix.M21; this.m12 = t11 * matrix.M12 + t12 * matrix.M22; this.m21 = t21 * matrix.M11 + t22 * matrix.M21; this.m22 = t21 * matrix.M12 + t22 * matrix.M22; this.offsetX = tdx * matrix.M11 + tdy * matrix.M21 + matrix.OffsetX; this.offsetY = tdx * matrix.M12 + tdy * matrix.M22 + matrix.OffsetY; } else { this.m11 = t11 * matrix.M11 + t21 * matrix.M12; this.m12 = t12 * matrix.M11 + t22 * matrix.M12; this.m21 = t11 * matrix.M21 + t21 * matrix.M22; this.m22 = t12 * matrix.M21 + t22 * matrix.M22; this.offsetX = t11 * matrix.OffsetX + t21 * matrix.OffsetY + tdx; this.offsetY = t12 * matrix.OffsetX + t22 * matrix.OffsetY + tdy; } DeriveMatrixType(); } /// /// Appends a translation of the specified offsets to this matrix. /// [Obsolete("Use TranslateAppend or TranslatePrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] public void Translate(double offsetX, double offsetY) { throw new InvalidOperationException("Temporarily out of order."); //if (this.type == XMatrixTypes.Identity) //{ // this.SetMatrix(1.0, 0, 0, 1.0, offsetX, offsetY, XMatrixTypes.Translation); //} //else if (this.type == XMatrixTypes.Unknown) //{ // this.offsetX += offsetX; // this.offsetY += offsetY; //} //else //{ // this.offsetX += offsetX; // this.offsetY += offsetY; // this.type |= XMatrixTypes.Translation; //} } /// /// Appends a translation of the specified offsets to this matrix. /// public void TranslateAppend(double offsetX, double offsetY) // TODO: will become default { if (this.type == XMatrixTypes.Identity) { SetMatrix(1, 0, 0, 1, offsetX, offsetY, XMatrixTypes.Translation); } else if (this.type == XMatrixTypes.Unknown) { this.offsetX += offsetX; this.offsetY += offsetY; } else { this.offsetX += offsetX; this.offsetY += offsetY; this.type |= XMatrixTypes.Translation; } } /// /// Prepends a translation of the specified offsets to this matrix. /// public void TranslatePrepend(double offsetX, double offsetY) { this = CreateTranslation(offsetX, offsetY) * this; } /// /// Translates the matrix with the specified offsets. /// public void Translate(double offsetX, double offsetY, XMatrixOrder order) { // HACK in Translate if (this.type == XMatrixTypes.Identity) InitIdentity(); if (order == XMatrixOrder.Append) { this.offsetX += offsetX; this.offsetY += offsetY; } else { this.offsetX += offsetX * this.m11 + offsetY * this.m21; this.offsetY += offsetX * this.m12 + offsetY * this.m22; } DeriveMatrixType(); } /// /// Appends the specified scale vector to this matrix. /// [Obsolete("Use ScaleAppend or ScalePrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] public void Scale(double scaleX, double scaleY) { throw new InvalidOperationException("Temporarily out of order."); //this *= CreateScaling(scaleX, scaleY); } /// /// Appends the specified scale vector to this matrix. /// public void ScaleAppend(double scaleX, double scaleY) // TODO: will become default { this *= CreateScaling(scaleX, scaleY); } /// /// Prepends the specified scale vector to this matrix. /// public void ScalePrepend(double scaleX, double scaleY) { this = CreateScaling(scaleX, scaleY) * this; } /// /// Scales the matrix with the specified scalars. /// public void Scale(double scaleX, double scaleY, XMatrixOrder order) { // HACK in Scale if (this.type == XMatrixTypes.Identity) InitIdentity(); if (order == XMatrixOrder.Append) { this.m11 *= scaleX; this.m12 *= scaleY; this.m21 *= scaleX; this.m22 *= scaleY; this.offsetX *= scaleX; this.offsetY *= scaleY; } else { this.m11 *= scaleX; this.m12 *= scaleX; this.m21 *= scaleY; this.m22 *= scaleY; } DeriveMatrixType(); } /// /// Scales the matrix with the specified scalar. /// [Obsolete("Use ScaleAppend or ScalePrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] public void Scale(double scaleXY) { throw new InvalidOperationException("Temporarily out of order."); //Scale(scaleXY, scaleXY, XMatrixOrder.Prepend); } /// /// Appends the specified scale vector to this matrix. /// public void ScaleAppend(double scaleXY) { Scale(scaleXY, scaleXY, XMatrixOrder.Append); } /// /// Prepends the specified scale vector to this matrix. /// public void ScalePrepend(double scaleXY) { Scale(scaleXY, scaleXY, XMatrixOrder.Prepend); } /// /// Scales the matrix with the specified scalar. /// public void Scale(double scaleXY, XMatrixOrder order) { Scale(scaleXY, scaleXY, order); } /// /// Function is obsolete. /// [Obsolete("Use ScaleAtAppend or ScaleAtPrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] public void ScaleAt(double scaleX, double scaleY, double centerX, double centerY) { throw new InvalidOperationException("Temporarily out of order."); //this *= CreateScaling(scaleX, scaleY, centerX, centerY); } /// /// Apppends the specified scale about the specified point of this matrix. /// public void ScaleAtAppend(double scaleX, double scaleY, double centerX, double centerY) // TODO: will become default { this *= CreateScaling(scaleX, scaleY, centerX, centerY); } /// /// Prepends the specified scale about the specified point of this matrix. /// public void ScaleAtPrepend(double scaleX, double scaleY, double centerX, double centerY) { this = CreateScaling(scaleX, scaleY, centerX, centerY) * this; } /// /// Function is obsolete. /// [Obsolete("Use RotateAppend or RotatePrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] public void Rotate(double angle) { throw new InvalidOperationException("Temporarily out of order."); //angle = angle % 360.0; //this *= CreateRotationRadians(angle * 0.017453292519943295); } /// /// Appends a rotation of the specified angle to this matrix. /// public void RotateAppend(double angle) // TODO: will become default Rotate { angle = angle % 360.0; this *= CreateRotationRadians(angle * 0.017453292519943295); } /// /// Prepends a rotation of the specified angle to this matrix. /// public void RotatePrepend(double angle) { angle = angle % 360.0; this = CreateRotationRadians(angle * 0.017453292519943295) * this; } /// /// Rotates the matrix with the specified angle. /// public void Rotate(double angle, XMatrixOrder order) { // HACK in Rotate if (this.type == XMatrixTypes.Identity) InitIdentity(); angle = angle * Calc.Deg2Rad; double cos = Math.Cos(angle); double sin = Math.Sin(angle); if (order == XMatrixOrder.Append) { double t11 = this.m11; double t12 = this.m12; double t21 = this.m21; double t22 = this.m22; double tdx = this.offsetX; double tdy = this.offsetY; this.m11 = t11 * cos - t12 * sin; this.m12 = t11 * sin + t12 * cos; this.m21 = t21 * cos - t22 * sin; this.m22 = t21 * sin + t22 * cos; this.offsetX = tdx * cos - tdy * sin; this.offsetY = tdx * sin + tdy * cos; } else { double t11 = this.m11; double t12 = this.m12; double t21 = this.m21; double t22 = this.m22; this.m11 = t11 * cos + t21 * sin; this.m12 = t12 * cos + t22 * sin; this.m21 = -t11 * sin + t21 * cos; this.m22 = -t12 * sin + t22 * cos; } DeriveMatrixType(); } /// /// Function is obsolete. /// [Obsolete("Use RotateAtAppend or RotateAtPrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] public void RotateAt(double angle, double centerX, double centerY) { throw new InvalidOperationException("Temporarily out of order."); //angle = angle % 360.0; //this *= CreateRotationRadians(angle * 0.017453292519943295, centerX, centerY); } /// /// Appends a rotation of the specified angle at the specified point to this matrix. /// public void RotateAtAppend(double angle, double centerX, double centerY) // TODO: will become default { angle = angle % 360.0; this *= CreateRotationRadians(angle * 0.017453292519943295, centerX, centerY); } /// /// Prepends a rotation of the specified angle at the specified point to this matrix. /// public void RotateAtPrepend(double angle, double centerX, double centerY) { angle = angle % 360.0; this = CreateRotationRadians(angle * 0.017453292519943295, centerX, centerY) * this; } /// /// Rotates the matrix with the specified angle at the specified point. /// [Obsolete("Use RotateAtAppend or RotateAtPrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] public void RotateAt(double angle, XPoint point) { throw new InvalidOperationException("Temporarily out of order."); //RotateAt(angle, point, XMatrixOrder.Prepend); } /// /// Appends a rotation of the specified angle at the specified point to this matrix. /// public void RotateAtAppend(double angle, XPoint point) { RotateAt(angle, point, XMatrixOrder.Append); } /// /// Prepends a rotation of the specified angle at the specified point to this matrix. /// public void RotateAtPrepend(double angle, XPoint point) { RotateAt(angle, point, XMatrixOrder.Prepend); } /// /// Rotates the matrix with the specified angle at the specified point. /// public void RotateAt(double angle, XPoint point, XMatrixOrder order) { if (order == XMatrixOrder.Append) { angle = angle % 360.0; this *= CreateRotationRadians(angle * 0.017453292519943295, point.x, point.y); //this.Translate(point.X, point.Y, order); //this.Rotate(angle, order); //this.Translate(-point.X, -point.Y, order); } else { angle = angle % 360.0; this = CreateRotationRadians(angle * 0.017453292519943295, point.x, point.y) * this; } DeriveMatrixType(); } /// /// Function is obsolete. /// [Obsolete("Use ShearAppend or ShearPrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] public void Shear(double shearX, double shearY) { throw new InvalidOperationException("Temporarily out of order."); //Shear(shearX, shearY, XMatrixOrder.Prepend); } /// /// Appends a skew of the specified degrees in the x and y dimensions to this matrix. /// public void ShearAppend(double shearX, double shearY) // TODO: will become default { Shear(shearX, shearY, XMatrixOrder.Append); } /// /// Prepends a skew of the specified degrees in the x and y dimensions to this matrix. /// public void ShearPrepend(double shearX, double shearY) { Shear(shearX, shearY, XMatrixOrder.Prepend); } /// /// Shears the matrix with the specified scalars. /// public void Shear(double shearX, double shearY, XMatrixOrder order) { // HACK in Shear if (this.type == XMatrixTypes.Identity) InitIdentity(); double t11 = this.m11; double t12 = this.m12; double t21 = this.m21; double t22 = this.m22; double tdx = this.offsetX; double tdy = this.offsetY; if (order == XMatrixOrder.Append) { this.m11 += shearX * t12; this.m12 += shearY * t11; this.m21 += shearX * t22; this.m22 += shearY * t21; this.offsetX += shearX * tdy; this.offsetY += shearY * tdx; } else { this.m11 += shearY * t21; this.m12 += shearY * t22; this.m21 += shearX * t11; this.m22 += shearX * t12; } DeriveMatrixType(); } /// /// Function is obsolete. /// [Obsolete("Use SkewAppend or SkewPrepend explicitly, because in GDI+ and WPF the defaults are contrary.", true)] public void Skew(double skewX, double skewY) { throw new InvalidOperationException("Temporarily out of order."); //skewX = skewX % 360.0; //skewY = skewY % 360.0; //this *= CreateSkewRadians(skewX * 0.017453292519943295, skewY * 0.017453292519943295); } /// /// Appends a skew of the specified degrees in the x and y dimensions to this matrix. /// public void SkewAppend(double skewX, double skewY) { skewX = skewX % 360.0; skewY = skewY % 360.0; this *= CreateSkewRadians(skewX * 0.017453292519943295, skewY * 0.017453292519943295); } /// /// Prepends a skew of the specified degrees in the x and y dimensions to this matrix. /// public void SkewPrepend(double skewX, double skewY) { skewX = skewX % 360.0; skewY = skewY % 360.0; this = CreateSkewRadians(skewX * 0.017453292519943295, skewY * 0.017453292519943295) * this; } /// /// Transforms the specified point by this matrix and returns the result. /// public XPoint Transform(XPoint point) { XPoint point2 = point; MultiplyPoint(ref point2.x, ref point2.y); return point2; } /// /// Transforms the specified points by this matrix. /// public void Transform(XPoint[] points) { if (points != null) { int count = points.Length; for (int idx = 0; idx < count; idx++) MultiplyPoint(ref points[idx].x, ref points[idx].y); } } /// /// Multiplies all points of the specified array with the this matrix. /// public void TransformPoints(XPoint[] points) { if (points == null) throw new ArgumentNullException("points"); if (IsIdentity) return; int count = points.Length; for (int idx = 0; idx < count; idx++) { double x = points[idx].X; double y = points[idx].Y; points[idx].X = x * this.m11 + y * this.m21 + this.offsetX; points[idx].Y = x * this.m12 + y * this.m22 + this.offsetY; } } #if GDI /// /// Multiplies all points of the specified array with the this matrix. /// public void TransformPoints(System.Drawing.Point[] points) { if (points == null) throw new ArgumentNullException("points"); if (IsIdentity) return; int count = points.Length; for (int idx = 0; idx < count; idx++) { double x = points[idx].X; double y = points[idx].Y; points[idx].X = (int)(x * this.m11 + y * this.m21 + this.offsetX); points[idx].Y = (int)(x * this.m12 + y * this.m22 + this.offsetY); } } #endif #if WPF /// /// Multiplies all points of the specified array with the this matrix. /// public void TransformPoints(System.Windows.Point[] points) { if (points == null) throw new ArgumentNullException("points"); if (IsIdentity) return; int count = points.Length; for (int idx = 0; idx < count; idx++) { double x = points[idx].X; double y = points[idx].Y; points[idx].X = (int)(x * this.m11 + y * this.m21 + this.offsetX); points[idx].Y = (int)(x * this.m12 + y * this.m22 + this.offsetY); } } #endif /// /// Transforms the specified vector by this Matrix and returns the result. /// public XVector Transform(XVector vector) { XVector vector2 = vector; MultiplyVector(ref vector2.x, ref vector2.y); return vector2; } /// /// Transforms the specified vectors by this matrix. /// public void Transform(XVector[] vectors) { if (vectors != null) { int count = vectors.Length; for (int idx = 0; idx < count; idx++) MultiplyVector(ref vectors[idx].x, ref vectors[idx].y); } } #if GDI /// /// Multiplies all vectors of the specified array with the this matrix. The translation elements /// of this matrix (third row) are ignored. /// public void TransformVectors(PointF[] points) { if (points == null) throw new ArgumentNullException("points"); if (IsIdentity) return; int count = points.Length; for (int idx = 0; idx < count; idx++) { double x = points[idx].X; double y = points[idx].Y; points[idx].X = (float)(x * this.m11 + y * this.m21 + this.offsetX); points[idx].Y = (float)(x * this.m12 + y * this.m22 + this.offsetY); } } #endif /// /// Gets the determinant of this matrix. /// public double Determinant { get { switch (this.type) { case XMatrixTypes.Identity: case XMatrixTypes.Translation: return 1.0; case XMatrixTypes.Scaling: case XMatrixTypes.Scaling | XMatrixTypes.Translation: return this.m11 * this.m22; } return (this.m11 * this.m22) - (this.m12 * this.m21); } } /// /// Gets a value that indicates whether this matrix is invertible. /// public bool HasInverse { get { return !DoubleUtil.IsZero(Determinant); } } /// /// Inverts the matrix. /// public void Invert() { double determinant = Determinant; if (DoubleUtil.IsZero(determinant)) throw new InvalidOperationException("NotInvertible"); //SR.Get(SRID.Transform_NotInvertible, new object[0])); switch (this.type) { case XMatrixTypes.Identity: break; case XMatrixTypes.Translation: this.offsetX = -this.offsetX; this.offsetY = -this.offsetY; return; case XMatrixTypes.Scaling: this.m11 = 1.0 / this.m11; this.m22 = 1.0 / this.m22; return; case XMatrixTypes.Scaling | XMatrixTypes.Translation: this.m11 = 1.0 / this.m11; this.m22 = 1.0 / this.m22; this.offsetX = -this.offsetX * this.m11; this.offsetY = -this.offsetY * this.m22; return; default: { double detInvers = 1.0 / determinant; SetMatrix(this.m22 * detInvers, -this.m12 * detInvers, -this.m21 * detInvers, this.m11 * detInvers, (this.m21 * this.offsetY - this.offsetX * this.m22) * detInvers, (this.offsetX * this.m12 - this.m11 * this.offsetY) * detInvers, XMatrixTypes.Unknown); break; } } } /// /// Gets or sets the value of the first row and first column of this matrix. /// public double M11 { get { if (this.type == XMatrixTypes.Identity) return 1.0; return this.m11; } set { if (this.type == XMatrixTypes.Identity) SetMatrix(value, 0, 0, 1, 0, 0, XMatrixTypes.Scaling); else { this.m11 = value; if (this.type != XMatrixTypes.Unknown) this.type |= XMatrixTypes.Scaling; } } } /// /// Gets or sets the value of the first row and second column of this matrix. /// public double M12 { get { if (this.type == XMatrixTypes.Identity) return 0; return this.m12; } set { if (this.type == XMatrixTypes.Identity) SetMatrix(1, value, 0, 1, 0, 0, XMatrixTypes.Unknown); else { this.m12 = value; this.type = XMatrixTypes.Unknown; } } } /// /// Gets or sets the value of the second row and first column of this matrix. /// public double M21 { get { if (this.type == XMatrixTypes.Identity) return 0; return this.m21; } set { if (this.type == XMatrixTypes.Identity) SetMatrix(1, 0, value, 1, 0, 0, XMatrixTypes.Unknown); else { this.m21 = value; this.type = XMatrixTypes.Unknown; } } } /// /// Gets or sets the value of the second row and second column of this matrix. /// public double M22 { get { if (this.type == XMatrixTypes.Identity) return 1.0; return this.m22; } set { if (this.type == XMatrixTypes.Identity) SetMatrix(1, 0, 0, value, 0, 0, XMatrixTypes.Scaling); else { this.m22 = value; if (this.type != XMatrixTypes.Unknown) { this.type |= XMatrixTypes.Scaling; } } } } /// /// Gets or sets the value of the third row and first column of this matrix. /// public double OffsetX { get { if (this.type == XMatrixTypes.Identity) return 0; return this.offsetX; } set { if (this.type == XMatrixTypes.Identity) SetMatrix(1, 0, 0, 1, value, 0, XMatrixTypes.Translation); else { this.offsetX = value; if (this.type != XMatrixTypes.Unknown) this.type |= XMatrixTypes.Translation; } } } /// /// Gets or sets the value of the third row and second column of this matrix. /// public double OffsetY { get { if (this.type == XMatrixTypes.Identity) return 0; return this.offsetY; } set { if (this.type == XMatrixTypes.Identity) SetMatrix(1, 0, 0, 1, 0, value, XMatrixTypes.Translation); else { this.offsetY = value; if (this.type != XMatrixTypes.Unknown) this.type |= XMatrixTypes.Translation; } } } #if GDI /// /// Converts this matrix to a System.Drawing.Drawing2D.Matrix object. /// public System.Drawing.Drawing2D.Matrix ToGdiMatrix() { return new System.Drawing.Drawing2D.Matrix((float)this.m11, (float)this.m12, (float)this.m21, (float)this.m22, (float)this.offsetX, (float)this.offsetY); } /// /// Obsolete, will be deleted. /// [Obsolete("Use ToGdiMatrix.")] public System.Drawing.Drawing2D.Matrix ToGdipMatrix() { return new System.Drawing.Drawing2D.Matrix((float)this.m11, (float)this.m12, (float)this.m21, (float)this.m22, (float)this.offsetX, (float)this.offsetY); } #endif #if WPF /// /// Converts this matrix to a System.Drawing.Drawing2D.Matrix object. /// public System.Windows.Media.Matrix ToWpfMatrix() { return new System.Windows.Media.Matrix(this.m11, this.m12, this.m21, this.m22, this.offsetX, this.offsetY); } #endif #if GDI /// /// Explicitly converts a XMatrix to a Matrix. /// public static explicit operator System.Drawing.Drawing2D.Matrix(XMatrix matrix) { if (matrix.IsIdentity) return new System.Drawing.Drawing2D.Matrix(); return new System.Drawing.Drawing2D.Matrix( (float)matrix.m11, (float)matrix.m12, (float)matrix.m21, (float)matrix.m22, (float)matrix.offsetX, (float)matrix.offsetY); } #endif #if WPF /// /// Explicitly converts an XMatrix to a Matrix. /// public static explicit operator System.Windows.Media.Matrix(XMatrix matrix) { if (matrix.IsIdentity) return new System.Windows.Media.Matrix(); return new System.Windows.Media.Matrix( matrix.m11, matrix.m12, matrix.m21, matrix.m22, matrix.offsetX, matrix.offsetY); } #endif #if GDI /// /// Implicitly converts a Matrix to an XMatrix. /// public static implicit operator XMatrix(System.Drawing.Drawing2D.Matrix matrix) { float[] elements = matrix.Elements; return new XMatrix(elements[0], elements[1], elements[2], elements[3], elements[4], elements[5]); } #endif #if WPF /// /// Implicitly converts a Matrix to an XMatrix. /// public static implicit operator XMatrix(System.Windows.Media.Matrix matrix) { return new XMatrix(matrix.M11, matrix.M12, matrix.M21, matrix.M22, matrix.OffsetX, matrix.OffsetY); } #endif /// /// Determines whether the two matrices are equal. /// public static bool operator ==(XMatrix matrix1, XMatrix matrix2) { if (matrix1.IsDistinguishedIdentity || matrix2.IsDistinguishedIdentity) return (matrix1.IsIdentity == matrix2.IsIdentity); return matrix1.M11 == matrix2.M11 && matrix1.M12 == matrix2.M12 && matrix1.M21 == matrix2.M21 && matrix1.M22 == matrix2.M22 && matrix1.OffsetX == matrix2.OffsetX && matrix1.OffsetY == matrix2.OffsetY; } /// /// Determines whether the two matrices are not equal. /// public static bool operator !=(XMatrix matrix1, XMatrix matrix2) { return !(matrix1 == matrix2); } /// /// Determines whether the two matrices are equal. /// public static bool Equals(XMatrix matrix1, XMatrix matrix2) { if (matrix1.IsDistinguishedIdentity || matrix2.IsDistinguishedIdentity) return matrix1.IsIdentity == matrix2.IsIdentity; return matrix1.M11.Equals(matrix2.M11) && matrix1.M12.Equals(matrix2.M12) && matrix1.M21.Equals(matrix2.M21) && matrix1.M22.Equals(matrix2.M22) && matrix1.OffsetX.Equals(matrix2.OffsetX) && matrix1.OffsetY.Equals(matrix2.OffsetY); } /// /// Determines whether this matrix is equal to the specified object. /// public override bool Equals(object o) { if (o == null || !(o is XMatrix)) return false; XMatrix matrix = (XMatrix)o; return Equals(this, matrix); } /// /// Determines whether this matrix is equal to the specified matrix. /// public bool Equals(XMatrix value) { return Equals(this, value); } /// /// Returns the hash code for this instance. /// public override int GetHashCode() { if (IsDistinguishedIdentity) return 0; return M11.GetHashCode() ^ M12.GetHashCode() ^ M21.GetHashCode() ^ M22.GetHashCode() ^ OffsetX.GetHashCode() ^ OffsetY.GetHashCode(); } /// /// Parses a matrix from a string. /// public static XMatrix Parse(string source) { XMatrix identity; IFormatProvider cultureInfo = CultureInfo.InvariantCulture; //.GetCultureInfo("en-us"); TokenizerHelper helper = new TokenizerHelper(source, cultureInfo); string str = helper.NextTokenRequired(); identity = str == "Identity" ? Identity : new XMatrix(Convert.ToDouble(str, cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo)); helper.LastTokenRequired(); return identity; } /// /// Converts this XMatrix to a human readable string. /// public override string ToString() { return ConvertToString(null, null); } /// /// Converts this XMatrix to a human readable string. /// public string ToString(IFormatProvider provider) { return ConvertToString(null, provider); } /// /// Converts this XMatrix to a human readable string. /// string IFormattable.ToString(string format, IFormatProvider provider) { return ConvertToString(format, provider); } internal string ConvertToString(string format, IFormatProvider provider) { if (IsIdentity) return "Identity"; char numericListSeparator = TokenizerHelper.GetNumericListSeparator(provider); return string.Format(provider, "{1:" + format + "}{0}{2:" + format + "}{0}{3:" + format + "}{0}{4:" + format + "}{0}{5:" + format + "}{0}{6:" + format + "}", new object[] { numericListSeparator, this.m11, this.m12, this.m21, this.m22, this.offsetX, this.offsetY }); } internal void MultiplyVector(ref double x, ref double y) { switch (this.type) { case XMatrixTypes.Identity: case XMatrixTypes.Translation: return; case XMatrixTypes.Scaling: case XMatrixTypes.Scaling | XMatrixTypes.Translation: x *= this.m11; y *= this.m22; return; } double d1 = y * this.m21; double d2 = x * this.m12; x *= this.m11; x += d1; y *= this.m22; y += d2; } internal void MultiplyPoint(ref double x, ref double y) { switch (this.type) { case XMatrixTypes.Identity: return; case XMatrixTypes.Translation: x += this.offsetX; y += this.offsetY; return; case XMatrixTypes.Scaling: x *= this.m11; y *= this.m22; return; case (XMatrixTypes.Scaling | XMatrixTypes.Translation): x *= this.m11; x += this.offsetX; y *= this.m22; y += this.offsetY; return; } double d1 = (y * this.m21) + this.offsetX; double d2 = (x * this.m12) + this.offsetY; x *= this.m11; x += d1; y *= this.m22; y += d2; } internal static XMatrix CreateRotationRadians(double angle) { return CreateRotationRadians(angle, 0, 0); } internal static XMatrix CreateRotationRadians(double angle, double centerX, double centerY) { XMatrix matrix = new XMatrix(); double sin = Math.Sin(angle); double cos = Math.Cos(angle); double offsetX = (centerX * (1.0 - cos)) + (centerY * sin); double offsetY = (centerY * (1.0 - cos)) - (centerX * sin); matrix.SetMatrix(cos, sin, -sin, cos, offsetX, offsetY, XMatrixTypes.Unknown); return matrix; } internal static XMatrix CreateScaling(double scaleX, double scaleY, double centerX, double centerY) { XMatrix matrix = new XMatrix(); matrix.SetMatrix(scaleX, 0, 0, scaleY, centerX - scaleX * centerX, centerY - scaleY * centerY, XMatrixTypes.Scaling | XMatrixTypes.Translation); return matrix; } internal static XMatrix CreateScaling(double scaleX, double scaleY) { XMatrix matrix = new XMatrix(); matrix.SetMatrix(scaleX, 0, 0, scaleY, 0, 0, XMatrixTypes.Scaling); return matrix; } internal static XMatrix CreateSkewRadians(double skewX, double skewY) { XMatrix matrix = new XMatrix(); matrix.SetMatrix(1, Math.Tan(skewY), Math.Tan(skewX), 1, 0, 0, XMatrixTypes.Unknown); return matrix; } internal static XMatrix CreateTranslation(double offsetX, double offsetY) { XMatrix matrix = new XMatrix(); matrix.SetMatrix(1, 0, 0, 1, offsetX, offsetY, XMatrixTypes.Translation); return matrix; } static XMatrix CreateIdentity() { XMatrix matrix = new XMatrix(); matrix.SetMatrix(1, 0, 0, 1.0, 0, 0, XMatrixTypes.Identity); return matrix; } /// /// Sets the matrix. /// // ReSharper disable ParameterHidesMember void SetMatrix(double m11, double m12, double m21, double m22, double offsetX, double offsetY, XMatrixTypes type) // ReSharper restore ParameterHidesMember { this.m11 = m11; this.m12 = m12; this.m21 = m21; this.m22 = m22; this.offsetX = offsetX; this.offsetY = offsetY; this.type = type; } void DeriveMatrixType() { this.type = XMatrixTypes.Identity; if (this.m21 != 0 || this.m12 != 0) { this.type = XMatrixTypes.Unknown; } else { if (this.m11 != 1 || this.m22 != 1) this.type = XMatrixTypes.Scaling; if (this.offsetX != 0 || this.offsetY != 0) this.type |= XMatrixTypes.Translation; if ((this.type & (XMatrixTypes.Scaling | XMatrixTypes.Translation)) == XMatrixTypes.Identity) this.type = XMatrixTypes.Identity; } } private bool IsDistinguishedIdentity { get { return (this.type == XMatrixTypes.Identity); } } static XMatrix() { s_identity = CreateIdentity(); } // Keep the fields private and force using the properties. // This prevents using m11 and m22 by mistake when the matrix is identity. double m11; double m12; double m21; double m22; double offsetX; double offsetY; XMatrixTypes type; int padding; static readonly XMatrix s_identity; /// /// Internal matrix helper. /// internal static class MatrixHelper { // Fast mutiplication taking matrix type into account. Reflectored from WPF. internal static void MultiplyMatrix(ref XMatrix matrix1, ref XMatrix matrix2) { XMatrixTypes type1 = matrix1.type; XMatrixTypes type2 = matrix2.type; if (type2 != XMatrixTypes.Identity) { if (type1 == XMatrixTypes.Identity) matrix1 = matrix2; else if (type2 == XMatrixTypes.Translation) { matrix1.offsetX += matrix2.offsetX; matrix1.offsetY += matrix2.offsetY; if (type1 != XMatrixTypes.Unknown) matrix1.type |= XMatrixTypes.Translation; } else if (type1 == XMatrixTypes.Translation) { double num = matrix1.offsetX; double num2 = matrix1.offsetY; matrix1 = matrix2; matrix1.offsetX = num * matrix2.m11 + num2 * matrix2.m21 + matrix2.offsetX; matrix1.offsetY = num * matrix2.m12 + num2 * matrix2.m22 + matrix2.offsetY; if (type2 == XMatrixTypes.Unknown) matrix1.type = XMatrixTypes.Unknown; else matrix1.type = XMatrixTypes.Scaling | XMatrixTypes.Translation; } else { switch ((((int)type1) << 4) | (int)type2) { case 0x22: matrix1.m11 *= matrix2.m11; matrix1.m22 *= matrix2.m22; return; case 0x23: matrix1.m11 *= matrix2.m11; matrix1.m22 *= matrix2.m22; matrix1.offsetX = matrix2.offsetX; matrix1.offsetY = matrix2.offsetY; matrix1.type = XMatrixTypes.Scaling | XMatrixTypes.Translation; return; case 0x24: case 0x34: case 0x42: case 0x43: case 0x44: matrix1 = new XMatrix( matrix1.m11 * matrix2.m11 + matrix1.m12 * matrix2.m21, matrix1.m11 * matrix2.m12 + matrix1.m12 * matrix2.m22, matrix1.m21 * matrix2.m11 + matrix1.m22 * matrix2.m21, matrix1.m21 * matrix2.m12 + matrix1.m22 * matrix2.m22, matrix1.offsetX * matrix2.m11 + matrix1.offsetY * matrix2.m21 + matrix2.offsetX, matrix1.offsetX * matrix2.m12 + matrix1.offsetY * matrix2.m22 + matrix2.offsetY); return; case 50: matrix1.m11 *= matrix2.m11; matrix1.m22 *= matrix2.m22; matrix1.offsetX *= matrix2.m11; matrix1.offsetY *= matrix2.m22; return; case 0x33: matrix1.m11 *= matrix2.m11; matrix1.m22 *= matrix2.m22; matrix1.offsetX = matrix2.m11 * matrix1.offsetX + matrix2.offsetX; matrix1.offsetY = matrix2.m22 * matrix1.offsetY + matrix2.offsetY; return; } } } } internal static void PrependOffset(ref XMatrix matrix, double offsetX, double offsetY) { if (matrix.type == XMatrixTypes.Identity) { matrix = new XMatrix(1, 0, 0, 1, offsetX, offsetY); matrix.type = XMatrixTypes.Translation; } else { matrix.offsetX += (matrix.m11 * offsetX) + (matrix.m21 * offsetY); matrix.offsetY += (matrix.m12 * offsetX) + (matrix.m22 * offsetY); if (matrix.type != XMatrixTypes.Unknown) matrix.type |= XMatrixTypes.Translation; } } internal static void TransformRect(ref XRect rect, ref XMatrix matrix) { if (!rect.IsEmpty) { XMatrixTypes types = matrix.type; if (types != XMatrixTypes.Identity) { if ((types & XMatrixTypes.Scaling) != XMatrixTypes.Identity) { rect.x *= matrix.m11; rect.y *= matrix.m22; rect.width *= matrix.m11; rect.height *= matrix.m22; if (rect.width < 0) { rect.x += rect.width; rect.width = -rect.width; } if (rect.height < 0) { rect.y += rect.height; rect.height = -rect.height; } } if ((types & XMatrixTypes.Translation) != XMatrixTypes.Identity) { rect.x += matrix.offsetX; rect.y += matrix.offsetY; } if (types == XMatrixTypes.Unknown) { XPoint point = matrix.Transform(rect.TopLeft); XPoint point2 = matrix.Transform(rect.TopRight); XPoint point3 = matrix.Transform(rect.BottomRight); XPoint point4 = matrix.Transform(rect.BottomLeft); rect.x = Math.Min(Math.Min(point.X, point2.X), Math.Min(point3.X, point4.X)); rect.y = Math.Min(Math.Min(point.Y, point2.Y), Math.Min(point3.Y, point4.Y)); rect.width = Math.Max(Math.Max(point.X, point2.X), Math.Max(point3.X, point4.X)) - rect.x; rect.height = Math.Max(Math.Max(point.Y, point2.Y), Math.Max(point3.Y, point4.Y)) - rect.y; } } } } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing/XGraphicsPathInternals.cs0000644000175000001440000000450511435766646025427 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows; using System.Windows.Media; #endif namespace PdfSharp.Drawing { /// /// Provides access to the internal data structures of XGraphicsPath. /// This class prevents the public interface from pollution with internal functions. /// public sealed class XGraphicsPathInternals { internal XGraphicsPathInternals(XGraphicsPath path) { this.path = path; } XGraphicsPath path; #if GDI /// /// Gets the underlying GDI+ path object. /// public GraphicsPath GdiPath { get { return this.path.gdipPath; } } #endif #if WPF /// /// Gets the underlying WPF path geometry object. /// public PathGeometry WpfPath { get { return this.path.pathGeometry; } } #endif } }pdfmod-0.9.1/lib/PdfSharp/Makefile.am0000644000175000001440000003347111450442737017437 0ustar00gabeusers00000000000000 EXTRA_DIST = # Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG ASSEMBLY_COMPILER_COMMAND = $(MCS) ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug "-define:TRACE;GDI;UseGdiObjects" ASSEMBLY = ../../bin/PdfSharp.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = BUILD_DIR = ../../bin PDFSHARP_DLL_MDB_SOURCE=../../bin/PdfSharp.dll.mdb endif if ENABLE_RELEASE ASSEMBLY_COMPILER_COMMAND = $(MCS) ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug "-define:TRACE;GDI;UseGdiObjects" ASSEMBLY = ../../bin/PdfSharp.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = library PROJECT_REFERENCES = BUILD_DIR = ../../bin PDFSHARP_DLL_MDB_SOURCE=../../bin/PdfSharp.dll.mdb endif AL=al2 PROGRAMFILES = \ $(PDFSHARP_DLL_MDB) RESGEN=resgen2 all: $(ASSEMBLY) $(PROGRAMFILES) FILES = \ !internal/Directives.cs \ !internal/TargetContext.cs \ PdfSharp.Drawing.BarCodes/BarCode.cs \ PdfSharp.Drawing.BarCodes/BarCodeRenderInfo.cs \ PdfSharp.Drawing.BarCodes/BcgSR.cs \ PdfSharp.Drawing.BarCodes/Code2of5Interleaved.cs \ PdfSharp.Drawing.BarCodes/Code3of9Standard.cs \ PdfSharp.Drawing.BarCodes/CodeBase.cs \ PdfSharp.Drawing.BarCodes/CodeDataMatrix.cs \ PdfSharp.Drawing.BarCodes/CodeOmr.cs \ PdfSharp.Drawing.BarCodes/DataMatrixImage.cs \ PdfSharp.Drawing.BarCodes/enums/AnchorType.cs \ PdfSharp.Drawing.BarCodes/enums/CodeDirection.cs \ PdfSharp.Drawing.BarCodes/enums/CodeType.cs \ PdfSharp.Drawing.BarCodes/enums/DataMatrixEncoding.cs \ PdfSharp.Drawing.BarCodes/enums/MarkDistance.cs \ PdfSharp.Drawing.BarCodes/enums/TextLocation.cs \ PdfSharp.Drawing.BarCodes/MatrixCode.cs \ PdfSharp.Drawing.BarCodes/OmrData.cs \ PdfSharp.Drawing.BarCodes/ThickThinBarcodeRenderer.cs \ PdfSharp.Drawing/enums/PathStart.cs \ PdfSharp.Drawing/enums/XColorSpace.cs \ PdfSharp.Drawing/enums/XCombineMode.cs \ PdfSharp.Drawing/enums/XDashStyle.cs \ PdfSharp.Drawing/enums/XFillMode.cs \ PdfSharp.Drawing/enums/XFontStyle.cs \ PdfSharp.Drawing/enums/XGraphicRenderTarget.cs \ PdfSharp.Drawing/enums/XGraphicsPathItemType.cs \ PdfSharp.Drawing/enums/XGraphicsPdfPageOptions.cs \ PdfSharp.Drawing/enums/XGraphicsUnit.cs \ PdfSharp.Drawing/enums/XKnownColor.cs \ PdfSharp.Drawing/enums/XLineAlignment.cs \ PdfSharp.Drawing/enums/XLinearGradientMode.cs \ PdfSharp.Drawing/enums/XLineCap.cs \ PdfSharp.Drawing/enums/XLineJoin.cs \ PdfSharp.Drawing/enums/XMatrixOrder.cs \ PdfSharp.Drawing/enums/XPageDirection.cs \ PdfSharp.Drawing/enums/XSmoothingMode.cs \ PdfSharp.Drawing/enums/XStringAlignment.cs \ PdfSharp.Drawing/FontHelper.cs \ PdfSharp.Drawing/GeometryHelper.cs \ PdfSharp.Drawing/GraphicsStateStack.cs \ PdfSharp.Drawing/ImageHelper.cs \ PdfSharp.Drawing/InternalGraphicsState.cs \ PdfSharp.Drawing/IXGraphicsRenderer.cs \ PdfSharp.Drawing.Layout/enums/XParagraphAlignment.cs \ PdfSharp.Drawing.Layout/XTextFormatter.cs \ PdfSharp.Drawing.Pdf/enums/DirtyFlags.cs \ PdfSharp.Drawing.Pdf/enums/StreamMode.cs \ PdfSharp.Drawing/PdfFontOptions.cs \ PdfSharp.Drawing.Pdf/PdfGraphicsState.cs \ PdfSharp.Drawing.Pdf/XGraphicsPdfRenderer.cs \ PdfSharp.Drawing.Rtf/XGraphicsRtfRenderer.cs \ PdfSharp.Drawing.Shapes/Shape.cs \ PdfSharp.Drawing/XBrush.cs \ PdfSharp.Drawing/XBrushes.cs \ PdfSharp.Drawing/XColor.cs \ PdfSharp.Drawing/XColorResourceManager.cs \ PdfSharp.Drawing/XColors.cs \ PdfSharp.Drawing/XConvert.cs \ PdfSharp.Drawing/XFont.cs \ PdfSharp.Drawing/XFontFamily.cs \ PdfSharp.Drawing/XFontMetrics.cs \ PdfSharp.Drawing/XFontStretch.cs \ PdfSharp.Drawing/XFontWeight.cs \ PdfSharp.Drawing/XFontWeights.cs \ PdfSharp.Drawing/XForm.cs \ PdfSharp.Drawing/XGlyphTypeface.cs \ PdfSharp.Drawing/XGraphicsContainer.cs \ PdfSharp.Drawing/XGraphics.cs \ PdfSharp.Drawing/XGraphicsPath.cs \ PdfSharp.Drawing/XGraphicsPathInternals.cs \ PdfSharp.Drawing/XGraphicsPathItem.cs \ PdfSharp.Drawing/XGraphicsState.cs \ PdfSharp.Drawing/XImage.cs \ PdfSharp.Drawing/XImageFormat.cs \ PdfSharp.Drawing/XKnownColorTable.cs \ PdfSharp.Drawing/XLinearGradientBrush.cs \ PdfSharp.Drawing/XMatrix.cs \ PdfSharp.Drawing/XPdfForm.cs \ PdfSharp.Drawing/XPen.cs \ PdfSharp.Drawing/XPens.cs \ PdfSharp.Drawing/XPoint.cs \ PdfSharp.Drawing/XPrivateFontCollection.cs \ PdfSharp.Drawing/XRect.cs \ PdfSharp.Drawing/XSize.cs \ PdfSharp.Drawing/XSolidBrush.cs \ PdfSharp.Drawing/XStringFormat.cs \ PdfSharp.Drawing/XStringFormats.cs \ PdfSharp.Drawing/XTypeFace.cs \ PdfSharp.Drawing/XUnit.cs \ PdfSharp.Drawing/XVector.cs \ PdfSharp/enums/PageOrientation.cs \ PdfSharp/enums/PageSize.cs \ PdfSharp/enums/PSMsgID.cs \ PdfSharp.Fonts/AdobeGlyphList20.cs \ PdfSharp.Fonts/AdobeGlyphListForNewFonts.cs \ PdfSharp.Fonts/CMapInfo.cs \ PdfSharp.Fonts/FontDescriptor.cs \ PdfSharp.Fonts/FontDescriptorStock.cs \ PdfSharp.Fonts/FontWriter.cs \ PdfSharp.Fonts.OpenType/enums/FontTechnology.cs \ PdfSharp.Fonts.OpenType/enums/TableTag.cs \ PdfSharp.Fonts.OpenType/enums/TableTagNames.cs \ PdfSharp.Fonts.OpenType/ExternalHelper.cs \ PdfSharp.Fonts.OpenType/FontData.cs \ PdfSharp.Fonts.OpenType/FontDataStock.cs \ PdfSharp.Fonts.OpenType/GenericFontTable.cs \ PdfSharp.Fonts.OpenType/GlyphDataTable.cs \ PdfSharp.Fonts.OpenType/IndexToLocationTable.cs \ PdfSharp.Fonts.OpenType/IRefFontTable.cs \ PdfSharp.Fonts.OpenType/OpenTypeDescriptor.cs \ PdfSharp.Fonts.OpenType/OpenTypeFontTable.cs \ PdfSharp.Fonts.OpenType/OpenTypeFontWriter.cs \ PdfSharp.Fonts.OpenType/OpenTypeStructures.cs \ PdfSharp.Fonts.OpenType/TableDirectoryEntry.cs \ PdfSharp.Internal/Calc.cs \ PdfSharp.Internal/ColorHelper.cs \ PdfSharp.Internal/DoubleUtil.cs \ PdfSharp.Internal/NativeMethods.cs \ PdfSharp.Internal/TokenizerHelper.cs \ PdfSharp/PageSizeConverter.cs \ PdfSharp.Pdf.AcroForms/enums/PdfAcroFieldFlags.cs \ PdfSharp.Pdf.AcroForms/PdfAcroField.cs \ PdfSharp.Pdf.AcroForms/PdfAcroForm.cs \ PdfSharp.Pdf.AcroForms/PdfButtonField.cs \ PdfSharp.Pdf.AcroForms/PdfCheckBoxField.cs \ PdfSharp.Pdf.AcroForms/PdfChoiceField.cs \ PdfSharp.Pdf.AcroForms/PdfChoiseField.cs \ PdfSharp.Pdf.AcroForms/PdfComboBoxField.cs \ PdfSharp.Pdf.AcroForms/PdfGenericField.cs \ PdfSharp.Pdf.AcroForms/PdfListBoxField.cs \ PdfSharp.Pdf.AcroForms/PdfPushButtonField.cs \ PdfSharp.Pdf.AcroForms/PdfRadioButtonField.cs \ PdfSharp.Pdf.AcroForms/PdfSignatureField.cs \ PdfSharp.Pdf.AcroForms/PdfTextField.cs \ PdfSharp.Pdf.Actions/enums/PdfNamedActionNames.cs \ PdfSharp.Pdf.Actions/PdfAction.cs \ PdfSharp.Pdf.Advanced/IContentStream.cs \ PdfSharp.Pdf.Advanced/PdfCatalog.cs \ PdfSharp.Pdf.Advanced/PdfCIDFont.cs \ PdfSharp.Pdf.Advanced/PdfContent.cs \ PdfSharp.Pdf.Advanced/PdfContents.cs \ PdfSharp.Pdf.Advanced/PdfDictionaryWithContentStream.cs \ PdfSharp.Pdf.Advanced/PdfExtGState.cs \ PdfSharp.Pdf.Advanced/PdfExtGStateTable.cs \ PdfSharp.Pdf.Advanced/PdfFont.cs \ PdfSharp.Pdf.Advanced/PdfFontDescriptor.cs \ PdfSharp.Pdf.Advanced/PdfFontTable.cs \ PdfSharp.Pdf.Advanced/PdfFormXObject.cs \ PdfSharp.Pdf.Advanced/PdfFormXObjectTable.cs \ PdfSharp.Pdf.Advanced/PdfGroupAttributes.cs \ PdfSharp.Pdf.Advanced/PdfImage.cs \ PdfSharp.Pdf.Advanced/PdfImage.FaxEncode.cs \ PdfSharp.Pdf.Advanced/PdfImageTable.cs \ PdfSharp.Pdf.Advanced/PdfImportedObjectTable.cs \ PdfSharp.Pdf.Advanced/PdfInternals.cs \ PdfSharp.Pdf.Advanced/PdfObjectInternals.cs \ PdfSharp.Pdf.Advanced/PdfPageInheritableObjects.cs \ PdfSharp.Pdf.Advanced/PdfReference.cs \ PdfSharp.Pdf.Advanced/PdfResourceMap.cs \ PdfSharp.Pdf.Advanced/PdfResources.cs \ PdfSharp.Pdf.Advanced/PdfResourceTable.cs \ PdfSharp.Pdf.Advanced/PdfShading.cs \ PdfSharp.Pdf.Advanced/PdfShadingPattern.cs \ PdfSharp.Pdf.Advanced/PdfShadingTable.cs \ PdfSharp.Pdf.Advanced/PdfSoftMask.cs \ PdfSharp.Pdf.Advanced/PdfTilingPattern.cs \ PdfSharp.Pdf.Advanced/PdfToUnicodeMap.cs \ PdfSharp.Pdf.Advanced/PdfTrailer.cs \ PdfSharp.Pdf.Advanced/PdfTransparencyGroupAttributes.cs \ PdfSharp.Pdf.Advanced/PdfTrueTypeFont.cs \ PdfSharp.Pdf.Advanced/PdfType0Font.cs \ PdfSharp.Pdf.Advanced/PdfType1Font.cs \ PdfSharp.Pdf.Advanced/PdfXObject.cs \ PdfSharp.Pdf.Annotations/enums/PdfAnnotationFlags.cs \ PdfSharp.Pdf.Annotations/enums/PdfRubberStampAnnotationIcon.cs \ PdfSharp.Pdf.Annotations/enums/PdfTextAnnotationIcon.cs \ PdfSharp.Pdf.Annotations/PdfAnnotation.cs \ PdfSharp.Pdf.Annotations/PdfAnnotations.cs \ PdfSharp.Pdf.Annotations/PdfGenericAnnotation.cs \ PdfSharp.Pdf.Annotations/PdfLinkAnnotation.cs \ PdfSharp.Pdf.Annotations/PdfRubberStampAnnotation.cs \ PdfSharp.Pdf.Annotations/PdfTextAnnotation.cs \ PdfSharp.Pdf.Annotations/PdfWidgetAnnotation.cs \ PdfSharp.Pdf.Content/Chars.cs \ PdfSharp.Pdf.Content/CLexer.cs \ PdfSharp.Pdf.Content/ContentReader.cs \ PdfSharp.Pdf.Content/ContentReaderException.cs \ PdfSharp.Pdf.Content/ContentWriter.cs \ PdfSharp.Pdf.Content/CParser.cs \ PdfSharp.Pdf.Content/enums/Symbol.cs \ PdfSharp.Pdf.Content.Objects/CObjects.cs \ PdfSharp.Pdf.Content.Objects/enum/OpCodeFlags.cs \ PdfSharp.Pdf.Content.Objects/enum/OpCodeName.cs \ PdfSharp.Pdf.Content.Objects/Operators.cs \ PdfSharp.Pdf/EntryInfoAttribute.cs \ PdfSharp.Pdf/enums/DocumentState.cs \ PdfSharp.Pdf/enums/PdfColorMode.cs \ PdfSharp.Pdf/enums/PdfCustomValueCompression.cs \ PdfSharp.Pdf/enums/PdfFontEmbedding.cs \ PdfSharp.Pdf/enums/PdfFontEncoding.cs \ PdfSharp.Pdf/enums/PdfOutlineStyle.cs \ PdfSharp.Pdf/enums/PdfPageLayout.cs \ PdfSharp.Pdf/enums/PdfPageMode.cs \ PdfSharp.Pdf/enums/PdfReadingDirection.cs \ PdfSharp.Pdf/enums/PdfTextStringEncoding.cs \ PdfSharp.Pdf.Filters/ASCII85Decode.cs \ PdfSharp.Pdf.Filters/ASCIIHexDecode.cs \ PdfSharp.Pdf.Filters/Filter.cs \ PdfSharp.Pdf.Filters/Filtering.cs \ PdfSharp.Pdf.Filters/FlateDecode.cs \ PdfSharp.Pdf.Filters/LzwDecode.cs \ PdfSharp.Pdf.Internal/AnsiEncoding.cs \ PdfSharp.Pdf.Internal/ColorSpaceHelper.cs \ PdfSharp.Pdf.Internal/DocEncoding.cs \ PdfSharp.Pdf.Internal/GlobalObjectTable.cs \ PdfSharp.Pdf.Internal/PdfEncoders.cs \ PdfSharp.Pdf.Internal/RawEncoding.cs \ PdfSharp.Pdf.Internal/RawUnicodeEncoding.cs \ PdfSharp.Pdf.Internal/ThreadLocalStorage.cs \ PdfSharp.Pdf.IO/Chars.cs \ PdfSharp.Pdf.IO/enums/PasswordValidity.cs \ PdfSharp.Pdf.IO/enums/PdfDocumentOpenMode.cs \ PdfSharp.Pdf.IO/enums/PdfWriterLayout.cs \ PdfSharp.Pdf.IO/enums/PdfWriterOptions.cs \ PdfSharp.Pdf.IO/enums/Symbol.cs \ PdfSharp.Pdf.IO/Lexer.cs \ PdfSharp.Pdf.IO/Parser.cs \ PdfSharp.Pdf.IO/PdfReader.cs \ PdfSharp.Pdf.IO/PdfReaderException.cs \ PdfSharp.Pdf.IO/PdfWriter.cs \ PdfSharp.Pdf.IO/ShiftStack.cs \ PdfSharp.Pdf/KeysBase.cs \ PdfSharp.Pdf/KeysMeta.cs \ PdfSharp.Pdf/PdfArray.cs \ PdfSharp.Pdf/PdfBoolean.cs \ PdfSharp.Pdf/PdfBooleanObject.cs \ PdfSharp.Pdf/PdfCustomValue.cs \ PdfSharp.Pdf/PdfCustomValues.cs \ PdfSharp.Pdf/PdfDate.cs \ PdfSharp.Pdf/PdfDictionary.cs \ PdfSharp.Pdf/PdfDocument.cs \ PdfSharp.Pdf/PdfDocumentInformation.cs \ PdfSharp.Pdf/PdfDocumentOptions.cs \ PdfSharp.Pdf/PdfDocumentSettings.cs \ PdfSharp.Pdf/PdfInteger.cs \ PdfSharp.Pdf/PdfIntegerObject.cs \ PdfSharp.Pdf/PdfItem.cs \ PdfSharp.Pdf/PdfLiteral.cs \ PdfSharp.Pdf/PdfName.cs \ PdfSharp.Pdf/PdfNameObject.cs \ PdfSharp.Pdf/PdfNull.cs \ PdfSharp.Pdf/PdfNullObject.cs \ PdfSharp.Pdf/PdfNumber.cs \ PdfSharp.Pdf/PdfNumberObject.cs \ PdfSharp.Pdf/PdfObject.cs \ PdfSharp.Pdf/PdfObjectID.cs \ PdfSharp.Pdf/PdfOutline.cs \ PdfSharp.Pdf/PdfPage.cs \ PdfSharp.Pdf/PdfPages.cs \ PdfSharp.Pdf/PdfReal.cs \ PdfSharp.Pdf/PdfRealObject.cs \ PdfSharp.Pdf/PdfRectangle.cs \ PdfSharp.Pdf/PdfReferenceTable.cs \ PdfSharp.Pdf/PdfString.cs \ PdfSharp.Pdf/PdfStringObject.cs \ PdfSharp.Pdf/PdfUInteger.cs \ PdfSharp.Pdf/PdfUIntegerObject.cs \ PdfSharp.Pdf/PdfViewerPreferences.cs \ PdfSharp.Pdf.Printing/PdfFilePrinter.cs \ PdfSharp.Pdf.Security/enums/PdfDocumentSecurity.cs \ PdfSharp.Pdf.Security/enums/PdfUserAccessPermission.cs \ PdfSharp.Pdf.Security/PdfSecurityHandler.cs \ PdfSharp.Pdf.Security/PdfSecuritySettings.cs \ PdfSharp.Pdf.Security/PdfStandardSecurityHandler.cs \ PdfSharp/PdfSharpException.cs \ PdfSharp.Pdf/TrimMargins.cs \ PdfSharp/ProductVersionInfo.cs \ PdfSharp/PSSR.cs \ PdfSharp.SharpZipLib/Checksums/Adler32.cs \ PdfSharp.SharpZipLib/Checksums/CRC32.cs \ PdfSharp.SharpZipLib/Checksums/IChecksum.cs \ PdfSharp.SharpZipLib/SharpZip/SharpZipBaseException.cs \ PdfSharp.SharpZipLib/Zip/Compression/DeflaterConstants.cs \ PdfSharp.SharpZipLib/Zip/Compression/Deflater.cs \ PdfSharp.SharpZipLib/Zip/Compression/DeflaterEngine.cs \ PdfSharp.SharpZipLib/Zip/Compression/DeflaterHuffman.cs \ PdfSharp.SharpZipLib/Zip/Compression/DeflaterPending.cs \ PdfSharp.SharpZipLib/Zip/Compression/Inflater.cs \ PdfSharp.SharpZipLib/Zip/Compression/InflaterDynHeader.cs \ PdfSharp.SharpZipLib/Zip/Compression/InflaterHuffmanTree.cs \ PdfSharp.SharpZipLib/Zip/Compression/PendingBuffer.cs \ PdfSharp.SharpZipLib/Zip/Compression/Streams/DeflaterOutputStream.cs \ PdfSharp.SharpZipLib/Zip/Compression/Streams/InflaterInputStream.cs \ PdfSharp.SharpZipLib/Zip/Compression/Streams/OutputWindow.cs \ PdfSharp.SharpZipLib/Zip/Compression/Streams/StreamManipulator.cs \ PdfSharp/VersionInfo.cs \ PdfSharp.Windows/enums/RenderMode.cs \ PdfSharp.Windows/enums/Zoom.cs \ Properties/AssemblyInfo.cs DATA_FILES = RESOURCES = EXTRAS = REFERENCES = \ System \ System.Core \ System.Data \ System.Drawing \ System.Xml DLL_REFERENCES = CLEANFILES = $(PROGRAMFILES) include $(top_srcdir)/Makefile.include PDFSHARP_DLL_MDB = $(BUILD_DIR)/PdfSharp.dll.mdb $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.IO/0000777000175000001440000000000011533760020020112 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.IO/enums/0000777000175000001440000000000011533760020021241 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.IO/enums/PdfDocumentOpenMode.cs0000644000175000001440000000516311435766646025455 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Pdf.IO { /// /// Determines how a PDF document is opened. /// public enum PdfDocumentOpenMode { /// /// The PDF stream is completely read into memory and can be modified. Pages can be deleted or /// inserted, but it is not possible to extract pages. This mode is useful for modifying an /// existing PDF document. /// Modify, /// /// The PDF stream is opened for importing pages from it. A document opened in this mode cannot /// be modified. /// Import, /// /// The PDF stream is completely read into memory, but cannot be modified. This mode preserves the /// original internal structure of the document and is useful for analyzing existing PDF files. /// ReadOnly, /// /// The PDF stream is partially read for information purposes only. The only valid operation is to /// call the Info property at the imported document. This option is very fast and needs less memory /// and is e.g. useful for browsing information about a collection of PDF documents in a user interface. /// InformationOnly, // TODO: not yet implemented } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.IO/enums/PasswordValidity.cs0000644000175000001440000000347411435766646025131 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Pdf.IO { /// /// Determines the type of the password. /// public enum PasswordValidity { /// /// Password is neither user nor owner password. /// Invalid, /// /// Password is user password. /// UserPassword, /// /// Password is owner password. /// OwnerPassword, } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.IO/enums/PdfWriterLayout.cs0000644000175000001440000000476211435766646024726 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Pdf.IO { /// /// Determines how the PDF output stream is formatted. Even all formats create valid PDF files, /// only Compact or Standard should be used for production purposes. /// public enum PdfWriterLayout { /// /// The PDF stream contains no unnecessary characters. This is default in release build. /// Compact, /// /// The PDF stream contains some superfluous line feeds, but is more readable. /// Standard, /// /// The PDF stream is indented to reflect the nesting levels of the objects. This is useful /// for analyzing PDF files, but increases the size of the file significantly. /// Indented, /// /// The PDF stream is indented to reflect the nesting levels of the objects and contains additional /// information about the PDFsharp objects. Furthermore content streams are not deflated. This /// is useful for debugging purposes only and increases the size of the file significantly. /// Verbose, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.IO/enums/PdfWriterOptions.cs0000644000175000001440000000373411435766646025102 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Pdf.IO { /// /// INTERNAL USE ONLY. /// [Flags] public enum PdfWriterOptions { /// /// If only this flag is specified the result is a regular valid PDF stream. /// Regular = 0x000000, /// /// Omit writing stream data. For debugging purposes only. /// With this option the result is not valid PDF. /// OmitStream = 0x000001, /// /// Omit inflate filter. For debugging purposes only. /// OmitInflation = 0x000002, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.IO/enums/Symbol.cs0000644000175000001440000000344211435766646023061 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Pdf.IO { /// /// Terminal symbols recognized by lexer. /// internal enum Symbol { None, Comment, Null, Integer, UInteger, Real, Boolean, String, HexString, UnicodeString, UnicodeHexString, Name, Keyword, BeginStream, EndStream, BeginArray, EndArray, BeginDictionary, EndDictionary, Obj, EndObj, R, XRef, Trailer, StartXRef, Eof, } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.IO/Lexer.cs0000644000175000001440000006375711435766646021563 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.Diagnostics; using System.Collections; using System.Collections.Generic; using System.Text; using System.IO; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.IO { /// /// Lexical analyzer for PDF files. Technically a PDF file is a stream of bytes. Some chunks /// of bytes represent strings in several encodings. The actual encoding depends on the /// context where the string is used. Therefore the bytes are 'raw encoded' into characters, /// i.e. a character or token read by the lexer has always character values in the range from /// 0 to 255. /// internal class Lexer { /// /// Initializes a new instance of the Lexer class. /// public Lexer(Stream pdfInputStream) { this.pdf = pdfInputStream; this.pdfLength = (int)pdf.Length; this.idxChar = 0; Position = 0; } /// /// Initializes fields after position has changed. /// void Initialize() { this.currChar = (char)this.pdf.ReadByte(); this.nextChar = (char)this.pdf.ReadByte(); this.token = new StringBuilder(); //this.symbol = Symbol.None; } /// /// Gets or sets the position within the PDF stream. /// public int Position { get { return this.idxChar; } set { this.idxChar = value; this.pdf.Position = value; Initialize(); } } /// /// Reads the next token and returns its type. If the token starts with a digit, the parameter /// testReference specifies how to treat it. If it is false, the lexer scans for a single integer. /// If it is true, the lexer checks if the digit is the prefix of a reference. If it is a reference, /// the token is set to the object ID followed by the generation number separated by a blank /// (the 'R' is omitted from the token). /// // /// Indicates whether to test the next token if it is a reference. public Symbol ScanNextToken() { Again: this.token = new StringBuilder(); char ch = MoveToNonWhiteSpace(); switch (ch) { case '%': // Eat comments, the parser doesn't handle them //return this.symbol = ScanComment(); ScanComment(); goto Again; case '/': return this.symbol = ScanName(); //case 'R': // if (Lexer.IsWhiteSpace(this.nextChar)) // { // ScanNextChar(); // return Symbol.R; // } // break; case '+': //TODO is it so easy? case '-': return this.symbol = ScanNumber(); case '(': return this.symbol = ScanLiteralString(); case '[': ScanNextChar(); return this.symbol = Symbol.BeginArray; case ']': ScanNextChar(); return this.symbol = Symbol.EndArray; case '<': if (this.nextChar == '<') { ScanNextChar(); ScanNextChar(); return this.symbol = Symbol.BeginDictionary; } return this.symbol = ScanHexadecimalString(); case '>': if (this.nextChar == '>') { ScanNextChar(); ScanNextChar(); return this.symbol = Symbol.EndDictionary; } Debug.Assert(false, ">???"); break; case '.': return this.symbol = ScanNumber(); } if (Char.IsDigit(ch)) return this.symbol = ScanNumber(); if (Char.IsLetter(ch)) return this.symbol = ScanKeyword(); if (ch == Chars.EOF) return this.symbol = Symbol.Eof; Debug.Assert(false, "not implemented"); return this.symbol = Symbol.None; } ////public Symbol ScanNextToken(bool x) ////{ //// throw new NotImplementedException(); ////} /// /// Reads the raw content of a stream. /// public byte[] ReadStream(int length) { int pos = 0; // Skip new line behind stream if (this.currChar == Chars.CR) { if (this.nextChar == Chars.LF) pos = this.idxChar + 2; else pos = this.idxChar + 1; } else pos = this.idxChar + 1; this.pdf.Position = pos; byte[] bytes = new byte[length]; int read = this.pdf.Read(bytes, 0, length); Debug.Assert(read == length); // synchronize idxChar etc. this.Position = pos + length; return bytes; } /// /// /// public String ReadRawString(int position, int length) { this.pdf.Position = position; byte[] bytes = new byte[length]; this.pdf.Read(bytes, 0, length); return PdfEncoders.RawEncoding.GetString(bytes, 0, bytes.Length); } /// /// Scans a comment line. /// public Symbol ScanComment() { Debug.Assert(this.currChar == Chars.Percent); this.token = new StringBuilder(); while (AppendAndScanNextChar() != Chars.LF) ; // TODO: not correct if (this.token.ToString().StartsWith("%%EOF")) return Symbol.Eof; return this.symbol = Symbol.Comment; } /// /// Scans a name. /// public Symbol ScanName() { Debug.Assert(this.currChar == Chars.Slash); this.token = new StringBuilder(); while (true) { char ch = AppendAndScanNextChar(); if (IsWhiteSpace(ch) || IsDelimiter(ch)) return this.symbol = Symbol.Name; if (ch == '#') { ScanNextChar(); char[] hex = new char[2]; hex[0] = this.currChar; hex[1] = this.nextChar; ScanNextChar(); // TODO Check syntax ch = (char)(ushort)int.Parse(new string(hex), NumberStyles.AllowHexSpecifier); this.currChar = ch; } } } public Symbol ScanNumber() { // I found a PDF file created with Acrobat 7 with this entry // /Checksum 2996984786 // What is this? It is neither an integer nor a real. // I introduced an UInteger... bool period = false; bool sign = false; period.GetType(); sign.GetType(); this.token = new StringBuilder(); char ch = this.currChar; if (ch == '+' || ch == '-') { sign = true; this.token.Append(ch); ch = ScanNextChar(); } while (true) { if (char.IsDigit(ch)) { this.token.Append(ch); } else if (ch == '.') { if (period) throw new PdfReaderException("More than one period in number."); period = true; this.token.Append(ch); } else break; ch = ScanNextChar(); } if (period) return Symbol.Real; long l = Int64.Parse(this.token.ToString(), CultureInfo.InvariantCulture); if (l >= Int32.MinValue && l <= Int32.MaxValue) return Symbol.Integer; if (l > 0 && l <= UInt32.MaxValue) return Symbol.UInteger; throw new PdfReaderException("Number exceeds integer range."); } public Symbol ScanKeyword() { this.token = new StringBuilder(); char ch = this.currChar; // Scan token while (true) { if (char.IsLetter(ch)) { this.token.Append(ch); } else break; ch = ScanNextChar(); } // Check known tokens switch (this.token.ToString()) { case "obj": return this.symbol = Symbol.Obj; case "endobj": return this.symbol = Symbol.EndObj; case "null": return this.symbol = Symbol.Null; case "true": case "false": return this.symbol = Symbol.Boolean; case "R": return this.symbol = Symbol.R; case "stream": return this.symbol = Symbol.BeginStream; case "endstream": return this.symbol = Symbol.EndStream; case "xref": return this.symbol = Symbol.XRef; case "trailer": return this.symbol = Symbol.Trailer; case "startxref": return this.symbol = Symbol.StartXRef; } // Anything else is treated as a keyword. Samples are f or n in iref. return this.symbol = Symbol.Keyword; } public Symbol ScanLiteralString() { Debug.Assert(this.currChar == Chars.ParenLeft); #if DEBUG if (this.idxChar == 0x1b67aa) GetType(); #endif this.token = new StringBuilder(); int parenLevel = 0; char ch = ScanNextChar(); // Test UNICODE string if (ch == '\xFE' && this.nextChar == '\xFF') { // I'm not sure if the code is correct in any case. // ? Can a UNICODE character not start with ')' as hibyte // ? What about \# escape sequences // BUG: The code is not correct. I got a file containing the following sting: // (f\rF`:7.2.5 Acceptable daily intake \(ADI\) and other guideline levels) // It starts as unicode but ends as Ascii. No idea how to parse. #if true //List bytes = new List(); while (true) { SkipChar: switch (ch) { case '(': // is this possible in a Unicode string? parenLevel++; break; case ')': if (parenLevel == 0) { ScanNextChar(); return this.symbol = Symbol.String; } else parenLevel--; break; case '\\': { ch = ScanNextChar(); switch (ch) { case 'n': ch = Chars.LF; break; case 'r': ch = Chars.CR; break; case 't': ch = Chars.HT; break; case 'b': ch = Chars.BS; break; case 'f': ch = Chars.FF; break; case '(': ch = Chars.ParenLeft; break; case ')': ch = Chars.ParenRight; break; case '\\': ch = Chars.BackSlash; break; case Chars.LF: ch = ScanNextChar(); goto SkipChar; default: if (Char.IsDigit(ch)) { // Octal character code Debug.Assert(ch < '8', "Illegal octal digit."); int n = ch - '0'; if (Char.IsDigit(this.nextChar)) { Debug.Assert(this.nextChar < '8', "Illegal octal digit."); n = n * 8 + ScanNextChar() - '0'; if (Char.IsDigit(this.nextChar)) { Debug.Assert(this.nextChar < '8', "Illegal octal digit."); n = n * 8 + ScanNextChar() - '0'; } } ch = (char)n; } else { //TODO Debug.Assert(false, "Not implemented; unknown escape character."); } break; } break; } // TODO ??? //case '#': // Debug.Assert(false, "Not yet implemented"); // break; default: break; } this.token.Append(ch); //chHi = ScanNextChar(); //if (chHi == ')') //{ // ScanNextChar(); // return this.symbol = Symbol.String; //} //chLo = ScanNextChar(); //ch = (char)((int)chHi * 256 + (int)chLo); ch = ScanNextChar(); } #else char chHi, chLo; ScanNextChar(); chHi = ScanNextChar(); if (chHi == ')') { // The empty unicode string... ScanNextChar(); return this.symbol = Symbol.String; } chLo = ScanNextChar(); ch = (char)((int)chHi * 256 + (int)chLo); while (true) { SkipChar: switch (ch) { case '(': parenLevel++; break; case ')': if (parenLevel == 0) { ScanNextChar(); return this.symbol = Symbol.String; } else parenLevel--; break; case '\\': { // TODO: not sure that this is correct... ch = ScanNextChar(); switch (ch) { case 'n': ch = Chars.LF; break; case 'r': ch = Chars.CR; break; case 't': ch = Chars.HT; break; case 'b': ch = Chars.BS; break; case 'f': ch = Chars.FF; break; case '(': ch = Chars.ParenLeft; break; case ')': ch = Chars.ParenRight; break; case '\\': ch = Chars.BackSlash; break; case Chars.LF: ch = ScanNextChar(); goto SkipChar; default: if (Char.IsDigit(ch)) { // Octal character code Debug.Assert(ch < '8', "Illegal octal digit."); int n = ch - '0'; if (Char.IsDigit(this.nextChar)) { Debug.Assert(this.nextChar < '8', "Illegal octal digit."); n = n * 8 + ScanNextChar() - '0'; if (Char.IsDigit(this.nextChar)) { Debug.Assert(this.nextChar < '8', "Illegal octal digit."); n = n * 8 + ScanNextChar() - '0'; } } ch = (char)n; } else { //TODO Debug.Assert(false, "Not implemented; unknown escape character."); } break; } break; } // TODO ??? //case '#': // Debug.Assert(false, "Not yet implemented"); // break; default: break; } this.token.Append(ch); chHi = ScanNextChar(); if (chHi == ')') { ScanNextChar(); return this.symbol = Symbol.String; } chLo = ScanNextChar(); ch = (char)((int)chHi * 256 + (int)chLo); } #endif } else { // 8-bit characters while (true) { SkipChar: switch (ch) { case '(': parenLevel++; break; case ')': if (parenLevel == 0) { ScanNextChar(); return this.symbol = Symbol.String; } else parenLevel--; break; case '\\': { ch = ScanNextChar(); switch (ch) { case 'n': ch = Chars.LF; break; case 'r': ch = Chars.CR; break; case 't': ch = Chars.HT; break; case 'b': ch = Chars.BS; break; case 'f': ch = Chars.FF; break; case '(': ch = Chars.ParenLeft; break; case ')': ch = Chars.ParenRight; break; case '\\': ch = Chars.BackSlash; break; case Chars.LF: ch = ScanNextChar(); goto SkipChar; default: if (char.IsDigit(ch)) { // Octal character code Debug.Assert(ch < '8', "Illegal octal digit."); int n = ch - '0'; if (Char.IsDigit(this.nextChar)) { Debug.Assert(this.nextChar < '8', "Illegal octal digit."); n = n * 8 + ScanNextChar() - '0'; if (Char.IsDigit(this.nextChar)) { Debug.Assert(this.nextChar < '8', "Illegal octal digit."); n = n * 8 + ScanNextChar() - '0'; } } ch = (char)n; } else { //TODO Debug.Assert(false, "Not implemented; unknown escape character."); } break; } break; } // TODO ??? //case '#': // Debug.Assert(false, "Not yet implemented"); // break; default: break; } this.token.Append(ch); ch = ScanNextChar(); } } // Debug.Assert(false, "Must never come here:"); } public Symbol ScanHexadecimalString() { Debug.Assert(this.currChar == Chars.Less); this.token = new StringBuilder(); char[] hex = new char[2]; ScanNextChar(); while (true) { MoveToNonWhiteSpace(); if (this.currChar == '>') { ScanNextChar(); break; } if (char.IsLetterOrDigit(this.currChar)) { hex[0] = char.ToUpper(this.currChar); hex[1] = char.ToUpper(this.nextChar); int ch = int.Parse(new string(hex), NumberStyles.AllowHexSpecifier); this.token.Append(Convert.ToChar(ch)); ScanNextChar(); ScanNextChar(); } } string chars = this.token.ToString(); int count = chars.Length; if (count > 2 && chars[0] == (char)0xFE && chars[1] == (char)0xFF) { Debug.Assert(count % 2 == 0); this.token.Length = 0; for (int idx = 2; idx < count; idx += 2) this.token.Append((char)(chars[idx] * 256 + chars[idx + 1])); } return this.symbol = Symbol.HexString; } /// /// Move current position one character further in PDF stream. /// internal char ScanNextChar() { if (this.pdfLength <= this.idxChar) { this.currChar = Chars.EOF; this.nextChar = Chars.EOF; } else { this.currChar = this.nextChar; this.nextChar = (char)this.pdf.ReadByte(); this.idxChar++; if (this.currChar == Chars.CR) { if (this.nextChar == Chars.LF) { // Treat CR LF as LF this.currChar = this.nextChar; this.nextChar = (char)this.pdf.ReadByte(); this.idxChar++; } else { // Treat single CR as LF this.currChar = Chars.LF; } } } return currChar; } /// /// Resets the current token to the empty string. /// void ClearToken() { this.token.Length = 0; } /// /// Appends current character to the token and reads next one. /// internal char AppendAndScanNextChar() { token.Append(this.currChar); return ScanNextChar(); } /// /// If the current character is not a white space, the function immediately returns it. /// Otherwise the PDF cursor is moved forward to the first non-white space or EOF. /// White spaces are NUL, HT, LF, FF, CR, and SP. /// public char MoveToNonWhiteSpace() { while (this.currChar != Chars.EOF) { switch (this.currChar) { case Chars.NUL: case Chars.HT: case Chars.LF: case Chars.FF: case Chars.CR: case Chars.SP: ScanNextChar(); break; default: return currChar; } } return currChar; } /// /// Gets the current symbol. /// public Symbol Symbol { get { return this.symbol; } set { this.symbol = value; } } /// /// Gets the current token. /// internal string Token { get { return this.token.ToString(); } } /// /// Interprets current token as boolean literal. /// internal bool TokenToBoolean { get { Debug.Assert(this.token.ToString() == "true" || this.token.ToString() == "false"); return this.token.ToString()[0] == 't'; } } /// /// Interprets current token as integer literal. /// internal int TokenToInteger { get { //Debug.Assert(this.token.ToString().IndexOf('.') == -1); return Int32.Parse(this.token.ToString(), CultureInfo.InvariantCulture); } } /// /// Interprets current token as unsigned integer literal. /// internal uint TokenToUInteger { get { //Debug.Assert(this.token.ToString().IndexOf('.') == -1); return UInt32.Parse(this.token.ToString(), CultureInfo.InvariantCulture); } } /// /// Interpret current token as real or integer literal. /// internal double TokenToReal { get { return double.Parse(token.ToString(), CultureInfo.InvariantCulture); } } /// /// Indicates whether the specified character is a PDF white-space character. /// internal static bool IsWhiteSpace(char ch) { switch (ch) { case Chars.NUL: // 0 Null case Chars.HT: // 9 Tab case Chars.LF: // 10 Line feed case Chars.FF: // 12 Form feed case Chars.CR: // 13 Carriage return case Chars.SP: // 32 Space return true; } return false; } /// /// Indicates whether the specified character is a PDF delimiter character. /// internal static bool IsDelimiter(char ch) { switch (ch) { case '(': case ')': case '<': case '>': case '[': case ']': case '{': case '}': case '/': case '%': return true; } return false; } public int PdfLength { get { return this.pdfLength; } } int pdfLength; int idxChar; char currChar; char nextChar; StringBuilder token; Symbol symbol = Symbol.None; private Stream pdf; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.IO/PdfWriter.cs0000644000175000001440000004636711435766646022410 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Security; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.IO { /// /// Represents a writer for generation of PDF streams. /// internal class PdfWriter { public PdfWriter(Stream pdfStream, PdfStandardSecurityHandler securityHandler) { this.stream = pdfStream; this.securityHandler = securityHandler; //System.Xml.XmlTextWriter #if DEBUG layout = PdfWriterLayout.Verbose; #endif } public void Close(bool closeUnderlyingStream) { if (this.stream != null && closeUnderlyingStream) { this.stream.Close(); this.stream = null; } } public void Close() { Close(true); } public int Position { get { return (int)this.stream.Position; } } public PdfWriterLayout Layout { get { return this.layout; } set { this.layout = value; } } PdfWriterLayout layout; public PdfWriterOptions Options { get { return this.options; } set { this.options = value; } } PdfWriterOptions options; // ----------------------------------------------------------- /// /// Writes the specified value to the PDF stream. /// public void Write(bool value) { WriteSeparator(CharCat.Character); WriteRaw(value ? bool.TrueString : bool.FalseString); this.lastCat = CharCat.Character; } /// /// Writes the specified value to the PDF stream. /// public void Write(PdfBoolean value) { WriteSeparator(CharCat.Character); WriteRaw(value.Value ? "true" : "false"); this.lastCat = CharCat.Character; } /// /// Writes the specified value to the PDF stream. /// public void Write(int value) { WriteSeparator(CharCat.Character); WriteRaw(value.ToString()); this.lastCat = CharCat.Character; } /// /// Writes the specified value to the PDF stream. /// public void Write(uint value) { WriteSeparator(CharCat.Character); WriteRaw(value.ToString()); this.lastCat = CharCat.Character; } /// /// Writes the specified value to the PDF stream. /// public void Write(PdfInteger value) { WriteSeparator(CharCat.Character); this.lastCat = CharCat.Character; WriteRaw(value.Value.ToString()); } /// /// Writes the specified value to the PDF stream. /// public void Write(PdfUInteger value) { WriteSeparator(CharCat.Character); this.lastCat = CharCat.Character; WriteRaw(value.Value.ToString()); } /// /// Writes the specified value to the PDF stream. /// public void Write(double value) { WriteSeparator(CharCat.Character); WriteRaw(value.ToString("0.###", CultureInfo.InvariantCulture)); this.lastCat = CharCat.Character; } /// /// Writes the specified value to the PDF stream. /// public void Write(PdfReal value) { WriteSeparator(CharCat.Character); WriteRaw(value.Value.ToString("0.###", CultureInfo.InvariantCulture)); this.lastCat = CharCat.Character; } /// /// Writes the specified value to the PDF stream. /// public void Write(PdfString value) { WriteSeparator(CharCat.Delimiter); #if true PdfStringEncoding encoding = (PdfStringEncoding)(value.Flags & PdfStringFlags.EncodingMask); string pdf; if ((value.Flags & PdfStringFlags.HexLiteral) == 0) pdf = PdfEncoders.ToStringLiteral(value.Value, encoding, SecurityHandler); else pdf = PdfEncoders.ToHexStringLiteral(value.Value, encoding, SecurityHandler); WriteRaw(pdf); #else switch (value.Flags & PdfStringFlags.EncodingMask) { case PdfStringFlags.Undefined: case PdfStringFlags.PDFDocEncoding: if ((value.Flags & PdfStringFlags.HexLiteral) == 0) WriteRaw(PdfEncoders.DocEncode(value.Value, false)); else WriteRaw(PdfEncoders.DocEncodeHex(value.Value, false)); break; case PdfStringFlags.WinAnsiEncoding: throw new NotImplementedException("Unexpected encoding: WinAnsiEncoding"); case PdfStringFlags.Unicode: if ((value.Flags & PdfStringFlags.HexLiteral) == 0) WriteRaw(PdfEncoders.DocEncode(value.Value, true)); else WriteRaw(PdfEncoders.DocEncodeHex(value.Value, true)); break; case PdfStringFlags.StandardEncoding: case PdfStringFlags.MacRomanEncoding: case PdfStringFlags.MacExpertEncoding: default: throw new NotImplementedException("Unexpected encoding"); } #endif this.lastCat = CharCat.Delimiter; } /// /// Writes the specified value to the PDF stream. /// public void Write(PdfName value) { WriteSeparator(CharCat.Delimiter, '/'); string name = value.Value; StringBuilder pdf = new StringBuilder("/"); for (int idx = 1; idx < name.Length; idx++) { char ch = name[idx]; Debug.Assert(ch < 256); if (ch > ' ') switch (ch) { // TODO: is this all? case '%': case '/': case '<': case '>': case '(': case ')': case '#': break; default: pdf.Append(name[idx]); continue; } pdf.AppendFormat("#{0:X2}", (int)name[idx]); } WriteRaw(pdf.ToString()); this.lastCat = CharCat.Character; } public void Write(PdfLiteral value) { WriteSeparator(CharCat.Character); WriteRaw(value.Value); this.lastCat = CharCat.Character; } public void Write(PdfRectangle rect) { WriteSeparator(CharCat.Delimiter, '/'); WriteRaw(PdfEncoders.Format("[{0:0.###} {1:0.###} {2:0.###} {3:0.###}]", rect.X1, rect.Y1, rect.X2, rect.Y2)); this.lastCat = CharCat.Delimiter; } public void Write(PdfReference iref) { WriteSeparator(CharCat.Character); WriteRaw(iref.ToString()); this.lastCat = CharCat.Character; } public void WriteDocString(string text, bool unicode) { WriteSeparator(CharCat.Delimiter); //WriteRaw(PdfEncoders.DocEncode(text, unicode)); byte[] bytes; if (!unicode) bytes = PdfEncoders.DocEncoding.GetBytes(text); else bytes = PdfEncoders.UnicodeEncoding.GetBytes(text); bytes = PdfEncoders.FormatStringLiteral(bytes, unicode, true, false, this.securityHandler); this.Write(bytes); this.lastCat = CharCat.Delimiter; } public void WriteDocString(string text) { WriteSeparator(CharCat.Delimiter); //WriteRaw(PdfEncoders.DocEncode(text, false)); byte[] bytes = PdfEncoders.DocEncoding.GetBytes(text); bytes = PdfEncoders.FormatStringLiteral(bytes, false, false, false, this.securityHandler); this.Write(bytes); this.lastCat = CharCat.Delimiter; } public void WriteDocStringHex(string text) { WriteSeparator(CharCat.Delimiter); //WriteRaw(PdfEncoders.DocEncodeHex(text)); byte[] bytes = PdfEncoders.DocEncoding.GetBytes(text); bytes = PdfEncoders.FormatStringLiteral(bytes, false, false, true, this.securityHandler); this.stream.Write(bytes, 0, bytes.Length); this.lastCat = CharCat.Delimiter; } /// /// Begins a direct or indirect dictionary or array. /// public void WriteBeginObject(PdfObject value) { bool indirect = value.IsIndirect; if (indirect) { WriteObjectAddress(value); if (this.securityHandler != null) this.securityHandler.SetHashKey(value.ObjectID); } this.stack.Add(new StackItem(value)); if (indirect) { if (value is PdfArray) WriteRaw("[\n"); else if (value is PdfDictionary) WriteRaw("<<\n"); this.lastCat = CharCat.NewLine; } else { if (value is PdfArray) { WriteSeparator(CharCat.Delimiter); WriteRaw('['); this.lastCat = CharCat.Delimiter; } else if (value is PdfDictionary) { NewLine(); WriteSeparator(CharCat.Delimiter); WriteRaw("<<\n"); this.lastCat = CharCat.NewLine; } } if (this.layout == PdfWriterLayout.Verbose) IncreaseIndent(); } /// /// Ends a direct or indirect dictionary or array. /// public void WriteEndObject() { int count = this.stack.Count; Debug.Assert(count > 0, "PdfWriter stack underflow."); StackItem stackItem = (StackItem)this.stack[count - 1]; this.stack.RemoveAt(count - 1); PdfObject value = stackItem.Object; bool indirect = value.IsIndirect; if (this.layout == PdfWriterLayout.Verbose) DecreaseIndent(); if (value is PdfArray) { if (indirect) { //WriteRaw("\n"); //WriteIndent(); WriteRaw("\n]\n"); this.lastCat = CharCat.NewLine; } else { WriteRaw("]"); this.lastCat = CharCat.Delimiter; } } else if (value is PdfDictionary) { if (indirect) { if (!stackItem.HasStream) if (this.lastCat == CharCat.NewLine) WriteRaw(">>\n"); else WriteRaw(" >>\n"); } else { Debug.Assert(!stackItem.HasStream, "Direct object with stream??"); WriteSeparator(CharCat.NewLine); WriteRaw(">>\n"); this.lastCat = CharCat.NewLine; } } if (indirect) { NewLine(); WriteRaw("endobj\n"); if (this.layout == PdfWriterLayout.Verbose) this.WriteRaw("%--------------------------------------------------------------------------------------------------\n"); } } /// /// Writes the stream of the specified dictionary. /// public void WriteStream(PdfDictionary value, bool omitStream) { StackItem stackItem = (StackItem)this.stack[this.stack.Count - 1]; Debug.Assert(stackItem.Object is PdfDictionary); Debug.Assert(stackItem.Object.IsIndirect); stackItem.HasStream = true; if (this.lastCat == CharCat.NewLine) WriteRaw(">>\nstream\n"); else WriteRaw(" >>\nstream\n"); if (omitStream) WriteRaw(" ...stream content omitted...\n"); // useful for debugging only else { byte[] bytes = value.Stream.Value; if (bytes.Length != 0) { if (this.securityHandler != null) { bytes = (byte[])bytes.Clone(); bytes = this.securityHandler.EncryptBytes(bytes); } Write(bytes); if (this.lastCat != CharCat.NewLine) WriteRaw('\n'); } } WriteRaw("endstream\n"); } public void WriteRaw(string rawString) { if (rawString == null || rawString.Length == 0) return; //AppendBlank(rawString[0]); byte[] bytes = PdfEncoders.RawEncoding.GetBytes(rawString); this.stream.Write(bytes, 0, bytes.Length); this.lastCat = GetCategory((char)bytes[bytes.Length - 1]); } public void WriteRaw(char ch) { Debug.Assert((int)ch < 256, "Raw character greater than 255 dedected."); //AppendBlank(ch); this.stream.WriteByte((byte)ch); this.lastCat = GetCategory(ch); } public void Write(byte[] bytes) { if (bytes == null || bytes.Length == 0) return; this.stream.Write(bytes, 0, bytes.Length); this.lastCat = GetCategory((char)bytes[bytes.Length - 1]); } void WriteObjectAddress(PdfObject value) { if (this.layout == PdfWriterLayout.Verbose) this.WriteRaw(String.Format("{0} {1} obj % {2}\n", value.ObjectID.ObjectNumber, value.ObjectID.GenerationNumber, value.GetType().FullName)); else this.WriteRaw(String.Format("{0} {1} obj\n", value.ObjectID.ObjectNumber, value.ObjectID.GenerationNumber)); } public void WriteFileHeader(PdfDocument document) { StringBuilder header = new StringBuilder("%PDF-"); int version = document.version; header.Append((version / 10).ToString() + "." + (version % 10).ToString() + "\n%\xD3\xF4\xCC\xE1\n"); WriteRaw(header.ToString()); if (this.layout == PdfWriterLayout.Verbose) { this.WriteRaw(String.Format("% PDFsharp Version {0} (verbose mode)\n", VersionInfo.Version)); // Keep some space for later fix-up. this.commentPosition = (int)this.stream.Position + 2; this.WriteRaw("% \n"); this.WriteRaw("% \n"); this.WriteRaw("% \n"); this.WriteRaw("% \n"); this.WriteRaw("% \n"); this.WriteRaw("%--------------------------------------------------------------------------------------------------\n"); } } public void WriteEof(PdfDocument document, int startxref) { WriteRaw("startxref\n"); WriteRaw(startxref.ToString()); WriteRaw("\n%%EOF\n"); int fileSize = (int)this.stream.Position; if (this.layout == PdfWriterLayout.Verbose) { TimeSpan duration = DateTime.Now - document.creation; this.stream.Position = this.commentPosition; WriteRaw("Creation date: " + document.creation.ToString("G")); this.stream.Position = this.commentPosition + 50; WriteRaw("Creation time: " + duration.TotalSeconds.ToString("0.000", CultureInfo.InvariantCulture) + " seconds"); this.stream.Position = this.commentPosition + 100; WriteRaw("File size: " + fileSize.ToString() + " bytes"); this.stream.Position = this.commentPosition + 150; WriteRaw("Pages: " + document.Pages.Count.ToString()); this.stream.Position = this.commentPosition + 200; WriteRaw("Objects: " + document.irefTable.objectTable.Count.ToString()); } } /// /// Gets or sets the indentation for a new indentation level. /// internal int Indent { get { return this.indent; } set { this.indent = value; } } protected int indent = 2; protected int writeIndent = 0; /// /// Increases indent level. /// void IncreaseIndent() { this.writeIndent += indent; } /// /// Decreases indent level. /// void DecreaseIndent() { this.writeIndent -= indent; } ///// ///// Returns an indent string of blanks. ///// //static string Ind(int _indent) //{ // return new String(' ', _indent); //} /// /// Gets an indent string of current indent. /// string IndentBlanks { get { return new string(' ', this.writeIndent); } } void WriteIndent() { this.WriteRaw(IndentBlanks); } void WriteSeparator(CharCat cat, char ch) { switch (this.lastCat) { case CharCat.NewLine: if (this.layout == PdfWriterLayout.Verbose) WriteIndent(); break; case CharCat.Delimiter: break; case CharCat.Character: if (this.layout == PdfWriterLayout.Verbose) { //if (cat == CharCat.Character || ch == '/') this.stream.WriteByte((byte)' '); } else { if (cat == CharCat.Character) this.stream.WriteByte((byte)' '); } break; } } void WriteSeparator(CharCat cat) { WriteSeparator(cat, '\0'); } public void NewLine() { if (lastCat != CharCat.NewLine) WriteRaw('\n'); } CharCat GetCategory(char ch) { if (Lexer.IsDelimiter(ch)) return CharCat.Delimiter; if (ch == Chars.LF) return CharCat.NewLine; return CharCat.Character; } enum CharCat { NewLine, Character, Delimiter, }; CharCat lastCat; /// /// Gets the underlying stream. /// internal Stream Stream { get { return this.stream; } } Stream stream; internal PdfStandardSecurityHandler SecurityHandler { get { return this.securityHandler; } set { this.securityHandler = value; } } PdfStandardSecurityHandler securityHandler; class StackItem { public StackItem(PdfObject value) { Object = value; } public PdfObject Object; public bool HasStream; } List stack = new List(); int commentPosition; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.IO/PdfReader.cs0000644000175000001440000003440511435766646022324 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Security; using PdfSharp.Pdf.Internal; using PdfSharp.Internal; namespace PdfSharp.Pdf.IO { /// /// Encapsulates the arguments of the PdfPasswordProvider delegate. /// public class PdfPasswordProviderArgs { /// /// Sets the password to open the document with. /// public string Password; /// /// When set to true the PdfReader.Open function returns null indicating that no PdfDocument was created. /// public bool Abort; } /// /// A delegated used by the PdfReader.Open function to retrieve a password if the document is protected. /// public delegate void PdfPasswordProvider(PdfPasswordProviderArgs args); /// /// Represents the functionality for reading PDF documents. /// public static class PdfReader { /// /// Determines whether the file specified by its path is a PDF file by inspecting the first eight /// bytes of the data. If the file header has the form %PDF-x.y the function returns the version /// number as integer (e.g. 14 for PDF 1.4). If the file header is invalid or inaccessible /// for any reason, 0 is returned. The function never throws an exception. /// public static int TestPdfFile(string path) { FileStream stream = null; try { int pageNumber; string realPath = PdfSharp.Drawing.XPdfForm.ExtractPageNumber(path, out pageNumber); if (File.Exists(realPath)) // prevent unwanted exceptions during debugging { stream = new FileStream(realPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); byte[] bytes = new byte[1024]; stream.Read(bytes, 0, 1024); return GetPdfFileVersion(bytes); } } catch { } finally { try { if (stream != null) stream.Close(); } catch { } } return 0; } /// /// Determines whether the specified stream is a PDF file by inspecting the first eight /// bytes of the data. If the data begins with %PDF-x.y the function returns the version /// number as integer (e.g. 14 for PDF 1.4). If the data is invalid or inaccessible /// for any reason, 0 is returned. The function never throws an exception. /// public static int TestPdfFile(Stream stream) { long pos = -1; try { pos = stream.Position; byte[] bytes = new byte[1024]; stream.Read(bytes, 0, 1024); return GetPdfFileVersion(bytes); } catch { } finally { try { if (pos != -1) stream.Position = pos; } catch { } } return 0; } /// /// Determines whether the specified data is a PDF file by inspecting the first eight /// bytes of the data. If the data begins with %PDF-x.y the function returns the version /// number as integer (e.g. 14 for PDF 1.4). If the data is invalid or inaccessible /// for any reason, 0 is returned. The function never throws an exception. /// public static int TestPdfFile(byte[] data) { return GetPdfFileVersion(data); } /// /// Implements scanning the PDF file version. /// internal static int GetPdfFileVersion(byte[] bytes) { #if !SILVERLIGHT try { // Acrobat accepts headers like %!PS-Adobe-N.n PDF-M.m... string header = Encoding.ASCII.GetString(bytes); if (header[0] == '%' || header.IndexOf("%PDF")>=0) { int ich = header.IndexOf("PDF-"); if (ich > 0 && header[ich + 5] == (byte)'.') { char major = header[ich + 4]; char minor = header[ich + 6]; if (major >= '1' && major < '2' && minor >= '0' && minor <= '9') return (major - '0') * 10 + (minor - '0'); } } } catch {} return 0; #else return 50; // AGHACK #endif } /// /// Opens an existing PDF document. /// public static PdfDocument Open(string path, PdfDocumentOpenMode openmode) { return Open(path, null, openmode, null); } /// /// Opens an existing PDF document. /// public static PdfDocument Open(string path, PdfDocumentOpenMode openmode, PdfPasswordProvider provider) { return Open(path, null, openmode, provider); } /// /// Opens an existing PDF document. /// public static PdfDocument Open(string path, string password, PdfDocumentOpenMode openmode) { return Open(path, password, openmode, null); } /// /// Opens an existing PDF document. /// public static PdfDocument Open(string path, string password, PdfDocumentOpenMode openmode, PdfPasswordProvider provider) { PdfDocument document; Stream stream = new FileStream(path, FileMode.Open, FileAccess.Read); try { document = PdfReader.Open(stream, password, openmode, provider); if (document != null) { document.fullPath = Path.GetFullPath(path); } } finally { if (stream != null) stream.Close(); } return document; } /// /// Opens an existing PDF document. /// public static PdfDocument Open(string path) { return Open(path, null, PdfDocumentOpenMode.Modify, null); } /// /// Opens an existing PDF document. /// public static PdfDocument Open(string path, string password) { return Open(path, password, PdfDocumentOpenMode.Modify, null); } /// /// Opens an existing PDF document. /// public static PdfDocument Open(Stream stream, PdfDocumentOpenMode openmode) { return Open(stream, null, openmode); } /// /// Opens an existing PDF document. /// public static PdfDocument Open(Stream stream, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider) { return Open(stream, null, openmode); } /// /// Opens an existing PDF document. /// public static PdfDocument Open(Stream stream, string password, PdfDocumentOpenMode openmode) { return Open(stream, password, openmode, null); } /// /// Opens an existing PDF document. /// public static PdfDocument Open(Stream stream, string password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider) { PdfDocument document = null; try { Lexer lexer = new Lexer(stream); document = new PdfDocument(lexer); document.state |= DocumentState.Imported; document.openMode = openmode; document.fileSize = stream.Length; // Get file version byte[] header = new byte[1024]; stream.Position = 0; stream.Read(header, 0, 1024); document.version = GetPdfFileVersion(header); if (document.version == 0) throw new InvalidOperationException(PSSR.InvalidPdf); // Read all trailers document.irefTable.IsUnderConstruction = true; Parser parser = new Parser(document); document.trailer = parser.ReadTrailer(); document.irefTable.IsUnderConstruction = false; // Is document encrypted? PdfReference xrefEncrypt = document.trailer.Elements[PdfTrailer.Keys.Encrypt] as PdfReference; if (xrefEncrypt != null) { //xrefEncrypt.Value = parser.ReadObject(null, xrefEncrypt.ObjectID, false); PdfObject encrypt = parser.ReadObject(null, xrefEncrypt.ObjectID, false); encrypt.Reference = xrefEncrypt; xrefEncrypt.Value = encrypt; PdfStandardSecurityHandler securityHandler = document.SecurityHandler; TryAgain: PasswordValidity validity = securityHandler.ValidatePassword(password); if (validity == PasswordValidity.Invalid) { if (passwordProvider != null) { PdfPasswordProviderArgs args = new PdfPasswordProviderArgs(); passwordProvider(args); if (args.Abort) return null; password = args.Password; goto TryAgain; } else { if (password == null) throw new PdfReaderException(PSSR.PasswordRequired); else throw new PdfReaderException(PSSR.InvalidPassword); } } else if (validity == PasswordValidity.UserPassword && openmode == PdfDocumentOpenMode.Modify) { if (passwordProvider != null) { PdfPasswordProviderArgs args = new PdfPasswordProviderArgs(); passwordProvider(args); if (args.Abort) return null; password = args.Password; goto TryAgain; } else throw new PdfReaderException(PSSR.OwnerPasswordRequired); } } else { if (password != null) { // Password specified but document is not encrypted. // ignore } } PdfReference[] irefs = document.irefTable.AllReferences; int count = irefs.Length; // Read all indirect objects for (int idx = 0; idx < count; idx++) { PdfReference iref = irefs[idx]; if (iref.Value == null) { try { Debug.Assert(document.irefTable.Contains(iref.ObjectID)); PdfObject pdfObject = parser.ReadObject(null, iref.ObjectID, false); Debug.Assert(pdfObject.Reference == iref); pdfObject.Reference = iref; Debug.Assert(pdfObject.Reference.Value != null, "something got wrong"); } catch (Exception ex) { Debug.WriteLine(ex.Message); } } else { Debug.Assert(document.irefTable.Contains(iref.ObjectID)); iref.GetType(); } // Set maximum object number document.irefTable.maxObjectNumber = Math.Max(document.irefTable.maxObjectNumber, iref.ObjectNumber); } // Encrypt all objects if (xrefEncrypt != null) { document.SecurityHandler.EncryptDocument(); } // Fix references of trailer values and then objects and irefs are consistent. document.trailer.Finish(); #if DEBUG_ // Some tests... PdfReference[] reachables = document.xrefTable.TransitiveClosure(document.trailer); reachables.GetType(); reachables = document.xrefTable.AllXRefs; document.xrefTable.CheckConsistence(); #endif if (openmode == PdfDocumentOpenMode.Modify) { // Create new or change existing document IDs if (document.Internals.SecondDocumentID == "") document.trailer.CreateNewDocumentIDs(); else { byte[] agTemp = Guid.NewGuid().ToByteArray(); document.Internals.SecondDocumentID = PdfEncoders.RawEncoding.GetString(agTemp, 0, agTemp.Length); } // Change modification date document.Info.ModificationDate = DateTime.Now; // Remove all unreachable objects int removed = document.irefTable.Compact(); if (removed != 0) Debug.WriteLine("Number of deleted unreachable objects: " + removed.ToString()); // Force flattening of page tree PdfPages pages = document.Pages; //bool b = document.irefTable.Contains(new PdfObjectID(1108)); //b.GetType(); document.irefTable.CheckConsistence(); document.irefTable.Renumber(); document.irefTable.CheckConsistence(); } } finally { //if (filestream != null) // filestream.Close(); } return document; } /// /// Opens an existing PDF document. /// public static PdfDocument Open(Stream stream) { return PdfReader.Open(stream, PdfDocumentOpenMode.Modify); } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.IO/Parser.cs0000644000175000001440000011676511435766646021736 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Reflection; using System.Text; using System.IO; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Filters; namespace PdfSharp.Pdf.IO { /* Direct and indireckt objects * If a simple object (boolean, integer, number, date, string, rectangle etc.) is referenced indirect, the parser reads this objects immediatly and consumes the indirection. * If a composite object (dictionary, array etc.) is referenced indirect, a PdfReference objects is returned. * If a composite object is a direct object, no PdfReference is created and the object is parsed immediatly. * A refernece to a non existing object is specified as legal, therefor null is returned. */ /// /// Provides the functions to parse PDF documents. /// internal sealed class Parser { PdfDocument document; Lexer lexer; ShiftStack stack; public Parser(PdfDocument document, Stream pdf) { this.document = document; this.lexer = new Lexer(pdf); this.stack = new ShiftStack(); } public Parser(PdfDocument document) { this.document = document; this.lexer = document.lexer; this.stack = new ShiftStack(); } /// /// Sets PDF input stream position to the specified object. /// public int MoveToObject(PdfObjectID objectID) { int position = this.document.irefTable[objectID].Position; return this.lexer.Position = position; } public Symbol Symbol { get { return this.lexer.Symbol; } } /// /// Reads PDF object from input stream. /// /// Either the instance of a derived type or null. If it is null /// an appropriate object is created. /// The address of the object. /// If true, specifies that all indirect objects /// are included recursively. public PdfObject ReadObject(PdfObject pdfObject, PdfObjectID objectID, bool includeReferences) { MoveToObject(objectID); int objectNumber = ReadInteger(); int generationNumber = ReadInteger(); #if DEBUG // The following assertion sometime failed (see below) //Debug.Assert(objectID == new PdfObjectID(objectNumber, generationNumber)); if (objectID != new PdfObjectID(objectNumber, generationNumber)) { // A special kind of bug? Or is this an undocumented PDF feature? // PDF4NET 2.6 provides a sample called 'Unicode', which produces a file 'unicode.pdf' // The iref table of this file contains the following entries: // iref // 0 148 // 0000000000 65535 f // 0000000015 00000 n // 0000000346 00000 n // .... // 0000083236 00000 n // 0000083045 00000 n // 0000083045 00000 n // 0000083045 00000 n // 0000083045 00000 n // 0000080334 00000 n // .... // Object 84, 85, 86, and 87 maps to the same dictionary, but all PDF readers I tested // ignores this mismatch! The following assertion failed about 50 times with this file. #if true_ string message = String.Format("xref entry {0} {1} maps to object {2} {3}.", objectID.ObjectNumber, objectID.GenerationNumber, objectNumber, generationNumber); Debug.Assert(false, message); #endif } #endif // Always use object ID from iref table (see above) objectNumber = objectID.ObjectNumber; generationNumber = objectID.GenerationNumber; #if true_ Debug.WriteLine(String.Format("obj: {0} {1}", objectNumber, generationNumber)); #endif ReadSymbol(Symbol.Obj); bool checkForStream = false; Symbol symbol = ScanNextToken(); switch (symbol) { case Symbol.BeginArray: PdfArray array; if (pdfObject == null) array = new PdfArray(this.document); else array = (PdfArray)pdfObject; //PdfObject.RegisterObject(array, objectID, generation); pdfObject = ReadArray(array, includeReferences); pdfObject.SetObjectID(objectNumber, generationNumber); break; case Symbol.BeginDictionary: PdfDictionary dict; if (pdfObject == null) dict = new PdfDictionary(this.document); else dict = (PdfDictionary)pdfObject; //PdfObject.RegisterObject(dict, objectID, generation); checkForStream = true; pdfObject = ReadDictionary(dict, includeReferences); pdfObject.SetObjectID(objectNumber, generationNumber); break; // Acrobat 6 Professional proudly presents: The Null object! // Even with a one-digit object number an indirect reference x 0 R to this object is // one character larger than the direct use of null. Probable this is the reason why // it is true that Acrobat Web Capture 6.0 creates this object, but obviously never // creates a reference to it! case Symbol.Null: pdfObject = new PdfNullObject(this.document); pdfObject.SetObjectID(objectNumber, generationNumber); ReadSymbol(Symbol.EndObj); return pdfObject; case Symbol.Boolean: pdfObject = new PdfBooleanObject(this.document, string.Compare(this.lexer.Token, Boolean.TrueString, true) == 0); //!!!mod THHO 19.11.09 pdfObject.SetObjectID(objectNumber, generationNumber); ReadSymbol(Symbol.EndObj); return pdfObject; case Symbol.Integer: pdfObject = new PdfIntegerObject(this.document, this.lexer.TokenToInteger); pdfObject.SetObjectID(objectNumber, generationNumber); ReadSymbol(Symbol.EndObj); return pdfObject; case Symbol.UInteger: pdfObject = new PdfUIntegerObject(this.document, this.lexer.TokenToUInteger); pdfObject.SetObjectID(objectNumber, generationNumber); ReadSymbol(Symbol.EndObj); return pdfObject; case Symbol.Real: pdfObject = new PdfRealObject(this.document, this.lexer.TokenToReal); pdfObject.SetObjectID(objectNumber, generationNumber); ReadSymbol(Symbol.EndObj); return pdfObject; case Symbol.String: pdfObject = new PdfStringObject(this.document, this.lexer.Token); pdfObject.SetObjectID(objectNumber, generationNumber); ReadSymbol(Symbol.EndObj); return pdfObject; case Symbol.Name: pdfObject = new PdfNameObject(this.document, this.lexer.Token); pdfObject.SetObjectID(objectNumber, generationNumber); ReadSymbol(Symbol.EndObj); return pdfObject; case Symbol.Keyword: // Should not come here anymore throw new NotImplementedException("Keyword"); default: // Should not come here anymore throw new NotImplementedException("unknown token \"" + symbol + "\""); } symbol = ScanNextToken(); if (symbol == Symbol.BeginStream) { PdfDictionary dict = (PdfDictionary)pdfObject; Debug.Assert(checkForStream, "Unexpected stream..."); int length = GetStreamLength(dict); byte[] bytes = this.lexer.ReadStream(length); #if true_ if (dict.Elements.GetString("/Filter") == "/FlateDecode") { if (dict.Elements["/Subtype"] == null) { try { byte[] decoded = Filtering.FlateDecode.Decode(bytes); if (decoded.Length == 0) goto End; string pageContent = Filtering.FlateDecode.DecodeToString(bytes); if (pageContent.Length > 100) pageContent = pageContent.Substring(pageContent.Length - 100); pageContent.GetType(); bytes = decoded; dict.Elements.Remove("/Filter"); dict.Elements.SetInteger("/Length", bytes.Length); } catch { } } End:; } #endif PdfDictionary.PdfStream stream = new PdfDictionary.PdfStream(bytes, dict); dict.Stream = stream; ReadSymbol(Symbol.EndStream); symbol = ScanNextToken(); } if (symbol != Symbol.EndObj) throw new PdfReaderException(PSSR.UnexpectedToken(this.lexer.Token)); return pdfObject; } //public PdfObject ReadObject(PdfObject obj, bool includeReferences) // HACK solve problem more general int GetStreamLength(PdfDictionary dict) { if (dict.Elements["/F"] != null) throw new NotImplementedException("File streams are not yet implemented."); PdfItem value = dict.Elements["/Length"]; if (value is PdfInteger) return Convert.ToInt32(value); else if (value is PdfReference) { ParserState state = SaveState(); object length = ReadObject(null, ((PdfReference)value).ObjectID, false); RestoreState(state); int l = ((PdfIntegerObject)length).Value; dict.Elements["/Length"] = new PdfInteger(l); return l; } throw new InvalidOperationException("Cannot retrieve stream length."); } public PdfArray ReadArray(PdfArray array, bool includeReferences) { Debug.Assert(Symbol == Symbol.BeginArray); if (array == null) array = new PdfArray(this.document); int sp = this.stack.SP; ParseObject(Symbol.EndArray); int count = this.stack.SP - sp; PdfItem[] items = this.stack.ToArray(sp, count); this.stack.Reduce(count); for (int idx = 0; idx < count; idx++) { PdfItem val = items[idx]; if (includeReferences && val is PdfReference) val = ReadReference((PdfReference)val, includeReferences); array.Elements.Add(val); } return array; } #if DEBUG_ static int ReadDictionaryCounter; #endif internal PdfDictionary ReadDictionary(PdfDictionary dict, bool includeReferences) { Debug.Assert(Symbol == Symbol.BeginDictionary); #if DEBUG_ ReadDictionaryCounter++; Debug.WriteLine(ReadDictionaryCounter.ToString()); if (ReadDictionaryCounter == 101) GetType(); #endif if (dict == null) dict = new PdfDictionary(this.document); DictionaryMeta meta = dict.Meta; int sp = this.stack.SP; ParseObject(Symbol.EndDictionary); int count = this.stack.SP - sp; Debug.Assert(count % 2 == 0); PdfItem[] items = this.stack.ToArray(sp, count); this.stack.Reduce(count); for (int idx = 0; idx < count; idx += 2) { PdfItem val = items[idx]; if (!(val is PdfName)) throw new PdfReaderException("name expected"); string key = ((PdfName)val).ToString(); #if DEBUG_ if (key == "/ID") { GetType(); char x = ((PdfString)(((PdfArray)items[idx + 1]).Elements[0])).Value[0]; x.GetType(); } #endif val = items[idx + 1]; if (includeReferences && val is PdfReference) val = ReadReference((PdfReference)val, includeReferences); dict.Elements[key] = val; } return dict; } #if DEBUG_ static int ParseObjectCounter; #endif /// /// Parses whatever comes until the specified stop symbol is reached. /// void ParseObject(Symbol stop) { #if DEBUG_ ParseObjectCounter++; Debug.WriteLine(ParseObjectCounter.ToString()); if (ParseObjectCounter == 178) GetType(); #endif Symbol symbol; while ((symbol = ScanNextToken()) != Symbol.Eof) { if (symbol == stop) return; switch (symbol) { case Symbol.Comment: // ignore comments break; case Symbol.Null: this.stack.Shift(PdfNull.Value); break; case Symbol.Boolean: this.stack.Shift(new PdfBoolean(this.lexer.TokenToBoolean)); break; case Symbol.Integer: this.stack.Shift(new PdfInteger(this.lexer.TokenToInteger)); break; case Symbol.UInteger: this.stack.Shift(new PdfUInteger(this.lexer.TokenToUInteger)); break; case Symbol.Real: this.stack.Shift(new PdfReal(this.lexer.TokenToReal)); break; case Symbol.String: //this.stack.Shift(new PdfString(this.lexer.Token, PdfStringFlags.PDFDocEncoding)); this.stack.Shift(new PdfString(this.lexer.Token, PdfStringFlags.RawEncoding)); break; case Symbol.UnicodeString: this.stack.Shift(new PdfString(this.lexer.Token, PdfStringFlags.Unicode)); break; case Symbol.HexString: this.stack.Shift(new PdfString(this.lexer.Token, PdfStringFlags.HexLiteral)); break; case Symbol.UnicodeHexString: this.stack.Shift(new PdfString(this.lexer.Token, PdfStringFlags.Unicode | PdfStringFlags.HexLiteral)); break; case Symbol.Name: this.stack.Shift(new PdfName(this.lexer.Token)); break; case Symbol.R: { Debug.Assert(this.stack.GetItem(-1) is PdfInteger && this.stack.GetItem(-2) is PdfInteger); PdfObjectID objectID = new PdfObjectID(this.stack.GetInteger(-2), this.stack.GetInteger(-1)); PdfReference iref = this.document.irefTable[objectID]; if (iref == null) { // If a document has more than one PdfXRefTable it is possible that the first trailer has // indirect references to objects whos iref entry is not yet read in. if (this.document.irefTable.IsUnderConstruction) { // XRefTable not complete when trailer is read. Create temporary irefs that are // removed later in PdfTrailer.FixXRefs. iref = new PdfReference(objectID, 0); this.stack.Reduce(iref, 2); break; } // PDF Reference section 3.2.9: // An indirect reference to an undefined object is not an error; // it is simply treated as a reference to the null object. this.stack.Reduce(PdfNull.Value, 2); // Let's see what null objects are good for... //Debug.Assert(false, "Null object detected!"); //this.stack.Reduce(PdfNull.Value, 2); } else this.stack.Reduce(iref, 2); break; } case Symbol.BeginArray: PdfArray array = new PdfArray(this.document); ReadArray(array, false); this.stack.Shift(array); break; case Symbol.BeginDictionary: PdfDictionary dict = new PdfDictionary(this.document); ReadDictionary(dict, false); this.stack.Shift(dict); break; case Symbol.BeginStream: throw new NotImplementedException(); default: string error = this.lexer.Token; Debug.Assert(false, "Unexpected: " + error); break; } } throw new PdfReaderException("Unexpected end of file."); } Symbol ScanNextToken() { return this.lexer.ScanNextToken(); } //protected Symbol ScanNextToken(bool testReference) //{ // return this.lexer.ScanNextToken(testReference); //} Symbol ScanNextToken(out string token) { Symbol symbol = this.lexer.ScanNextToken(); token = this.lexer.Token; return symbol; } //protected Symbol ScanNextToken(out string token, bool testReference) //{ // Symbol symbol = this.lexer.ScanNextToken(testReference); // token = this.lexer.Token; // return symbol; //} // internal object ReadObject(int position) // { // this.lexer.Position = position; // return ReadObject(false); // } // // internal virtual object ReadObject(bool directObject) // { // throw new InvalidOperationException("PdfParser.ReadObject() base class called"); // } /// /// Reads the object ID and the generation and sets it into the specified object. /// void ReadObjectID(PdfObject obj) { int objectNubmer = ReadInteger(); int generationNumber = ReadInteger(); ReadSymbol(Symbol.Obj); if (obj != null) obj.SetObjectID(objectNubmer, generationNumber); } PdfItem ReadReference(PdfReference iref, bool includeReferences) { throw new NotImplementedException("ReadReference"); } /// /// Reads the next symbol that must be the specified one. /// Symbol ReadSymbol(Symbol symbol) { Symbol current = this.lexer.ScanNextToken(); if (symbol != current) throw new PdfReaderException(PSSR.UnexpectedToken(this.lexer.Token)); return current; } /// /// Reads the next token that must be the specified one. /// Symbol ReadToken(string token) { Symbol current = this.lexer.ScanNextToken(); if (token != this.lexer.Token) throw new PdfReaderException(PSSR.UnexpectedToken(this.lexer.Token)); return current; } /// /// Reads a name from the PDF data stream. The preceding slash is part of the result string. /// string ReadName() { string name; Symbol symbol = ScanNextToken(out name); if (symbol != Symbol.Name) throw new PdfReaderException(PSSR.UnexpectedToken(name)); return name; } /* /// /// Reads a string immediately or (optionally) indirectly from the PDF data stream. /// protected string ReadString(bool canBeIndirect) { Symbol symbol = Symbol.None; //this.lexer.ScanNextToken(canBeIndirect); if (symbol == Symbol.String || symbol == Symbol.HexString) return this.lexer.Token; else if (symbol == Symbol.R) { int position = this.lexer.Position; MoveToObject(this.lexer.Token); ReadObjectID(null); string s = ReadString(); ReadSymbol(Symbol.EndObj); this.lexer.Position = position; return s; } throw new PdfReaderException(PSSR.UnexpectedToken(this.lexer.Token)); } protected string ReadString() { return ReadString(false); } /// /// Reads a string immediately or (optionally) indirectly from the PDF data stream. /// protected bool ReadBoolean(bool canBeIndirect) { Symbol symbol = this.lexer.ScanNextToken(canBeIndirect); if (symbol == Symbol.Boolean) return this.lexer.TokenToBoolean; else if (symbol == Symbol.R) { int position = this.lexer.Position; MoveToObject(this.lexer.Token); ReadObjectID(null); bool b = ReadBoolean(); ReadSymbol(Symbol.EndObj); this.lexer.Position = position; return b; } throw new PdfReaderException(PSSR.UnexpectedToken(this.lexer.Token)); } protected bool ReadBoolean() { return ReadBoolean(false); } */ /// /// Reads an integer value directly from the PDF data stream. /// int ReadInteger(bool canBeIndirect) { Symbol symbol = this.lexer.ScanNextToken(); if (symbol == Symbol.Integer) return this.lexer.TokenToInteger; else if (symbol == Symbol.R) { int position = this.lexer.Position; // MoveToObject(this.lexer.Token); ReadObjectID(null); int n = ReadInteger(); ReadSymbol(Symbol.EndObj); this.lexer.Position = position; return n; } throw new PdfReaderException(PSSR.UnexpectedToken(this.lexer.Token)); } int ReadInteger() { return ReadInteger(false); } // /// // /// Reads a real value directly or (optionally) indirectly from the PDF data stream. // /// // double ReadReal(bool canBeIndirect) // { // Symbol symbol = this.lexer.ScanNextToken(canBeIndirect); // if (symbol == Symbol.Real || symbol == Symbol.Integer) // return this.lexer.TokenToReal; // else if (symbol == Symbol.R) // { // int position = this.lexer.Position; //// MoveToObject(this.lexer.Token); // ReadObjectID(null); // double f = ReadReal(); // ReadSymbol(Symbol.EndObj); // this.lexer.Position = position; // return f; // } // throw new PdfReaderException(PSSR.UnexpectedToken(this.lexer.Token)); // } // // double ReadReal() // { // return ReadReal(false); // } // /// // /// Reads an object from the PDF input stream. If the object has a specialized parser, it it used. // /// // public static PdfObject ReadObject(PdfObject pdfObject, PdfObjectID objectID) // { // if (pdfObject == null) // throw new ArgumentNullException("pdfObject"); // if (pdfObject.Document == null) // throw new ArgumentException(PSSR.OwningDocumentRequired, "pdfObject"); // // Type type = pdfObject.GetType(); // PdfParser parser = CreateParser(pdfObject.Document, type); // return parser.ReadObject(pdfObject, objectID, false); // } /// /// Reads an object from the PDF input stream using the default parser. /// public static PdfObject ReadObject(PdfDocument owner, PdfObjectID objectID) { if (owner == null) throw new ArgumentNullException("owner"); Parser parser = new Parser(owner); return parser.ReadObject(null, objectID, false); } /// /// Reads the iref table and the trailer dictionary. /// internal PdfTrailer ReadTrailer() { //Symbol symbol; //string token; //int xrefOffset = 0; int length = lexer.PdfLength; #if true string trail = this.lexer.ReadRawString(length - 131, 130); //lexer.Pdf.Substring(length - 30); int idx = trail.IndexOf("startxref"); this.lexer.Position = length - 131 + idx; #else string trail = this.lexer.ReadRawString(length - 31, 30); //lexer.Pdf.Substring(length - 30); int idx = trail.IndexOf("startxref"); this.lexer.Position = length - 31 + idx; #endif ReadSymbol(Symbol.StartXRef); this.lexer.Position = ReadInteger(); // Read all trailers PdfTrailer trailer; while (true) { trailer = ReadXRefTableAndTrailer(this.document.irefTable); // 1st trailer seems to be the best.. if (this.document.trailer == null) this.document.trailer = trailer; int prev = trailer.Elements.GetInteger(PdfTrailer.Keys.Prev); if (prev == 0) break; //if (prev > this.lexer.PdfLength) // break; this.lexer.Position = prev; } return this.document.trailer; } /// /// /// PdfTrailer ReadXRefTableAndTrailer(PdfReferenceTable xrefTable) { Debug.Assert(xrefTable != null); Symbol symbol = ScanNextToken(); // Is it an xref stream? if (symbol == Symbol.Integer) throw new PdfReaderException(PSSR.CannotHandleXRefStreams); // TODO: It is very high on the todo list, but still undone Debug.Assert(symbol == Symbol.XRef); while (true) { symbol = ScanNextToken(); if (symbol == Symbol.Integer) { int start = this.lexer.TokenToInteger; int length = ReadInteger(); for (int id = start; id < start + length; id++) { int position = ReadInteger(); int generation = ReadInteger(); ReadSymbol(Symbol.Keyword); string token = lexer.Token; // Skip start entry if (id == 0) continue; // Skip unused entries. if (token != "n") continue; // Even it is restricted, an object can exists in more than one subsection. // (PDF Reference Implementation Notes 15). PdfObjectID objectID = new PdfObjectID(id, generation); // Ignore the latter one if (xrefTable.Contains(objectID)) continue; xrefTable.Add(new PdfReference(objectID, position)); } } else if (symbol == Symbol.Trailer) { ReadSymbol(Symbol.BeginDictionary); PdfTrailer trailer = new PdfTrailer(this.document); this.ReadDictionary(trailer, false); return trailer; } else throw new PdfReaderException(PSSR.UnexpectedToken(this.lexer.Token)); } } /// /// Parses a PDF date string. /// internal static DateTime ParseDateTime(string date, DateTime errorValue) { DateTime datetime = errorValue; try { if (date.StartsWith("D:")) { // Format is // D:YYYYMMDDHHmmSSOHH'mm' // ^2 ^10 ^16 ^20 int length = date.Length; int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0, hh = 0, mm = 0; char o = 'Z'; if (length >= 10) { year = Int32.Parse(date.Substring(2, 4)); month = Int32.Parse(date.Substring(6, 2)); day = Int32.Parse(date.Substring(8, 2)); if (length >= 16) { hour = Int32.Parse(date.Substring(10, 2)); minute = Int32.Parse(date.Substring(12, 2)); second = Int32.Parse(date.Substring(14, 2)); if (length >= 23) { if ((o = date[16]) != 'Z') { hh = Int32.Parse(date.Substring(17, 2)); mm = Int32.Parse(date.Substring(20, 2)); } } } } datetime = new DateTime(year, month, day, hour, minute, second); if (o != 'Z') { TimeSpan ts = new TimeSpan(hh, mm, 0); if (o == '+') datetime.Add(ts); else datetime.Subtract(ts); } } else { // Some libraries use plain English format. datetime = DateTime.Parse(date); } } catch { } return datetime; } // /// // /// Creates a parser for the specified PDF object type. A PDF object can define a specialized // /// parser in the optional PdfObjectInfoAttribute. If no parser is specified, the default // /// Parser object is returned. // /// // public static Parser CreateParser(PdfDocument document, Type pdfObjectType) // { // // TODO: ParserFactory // object[] attribs = null; //pdfObjectType.GetCustomAttributes(typeof(PdfObjectInfoAttribute), false); // if (attribs.Length == 1) // { // PdfObjectInfoAttribute attrib = null; //(PdfObjectInfoAttribute)attribs[0]; // Type parserType = attrib.Parser; // if (parserType != null) // { // ConstructorInfo ctorInfo = parserType.GetConstructor( // BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, // new Type[]{typeof(PdfDocument)}, null); // Parser parser = (Parser)ctorInfo.Invoke(new object[]{document}); // Debug.Assert(parser != null, "Creation of parser failed."); // return parser; // } // } // return new Parser(document); // } /* /// /// Reads a date value directly or (optionally) indirectly from the PDF data stream. /// protected DateTime ReadDate(bool canBeIndirect) { Symbol symbol = this.lexer.ScanNextToken(canBeIndirect); if (symbol == Symbol.String) { // D:YYYYMMDDHHmmSSOHH'mm' // ^2 ^10 ^16 ^20 string date = this.lexer.Token; int length = date.Length; int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0, hh = 0, mm = 0; char o = 'Z'; if (length >= 10) { year = Int32.Parse(date.Substring(2, 4)); month = Int32.Parse(date.Substring(6, 2)); day = Int32.Parse(date.Substring(8, 2)); if (length >= 16) { hour = Int32.Parse(date.Substring(10, 2)); minute = Int32.Parse(date.Substring(12, 2)); second = Int32.Parse(date.Substring(14, 2)); if (length >= 23) { if ((o = date[16]) != 'Z') { hh = Int32.Parse(date.Substring(17, 2)); mm = Int32.Parse(date.Substring(20, 2)); } } } } DateTime datetime = new DateTime(year, month, day, hour, minute, second); if (o != 'Z') { TimeSpan ts = new TimeSpan(hh, mm, 0); if (o == '+') datetime.Add(ts); else datetime.Subtract(ts); } return datetime; } else if (symbol == Symbol.R) { int position = this.lexer.Position; MoveToObject(this.lexer.Token); ReadObjectID(null); DateTime d = ReadDate(); ReadSymbol(Symbol.EndObj); this.lexer.Position = position; return d; } throw new PdfReaderException(PSSR.UnexpectedToken(this.lexer.Token)); } protected DateTime ReadDate() { return ReadDate(false); } /// /// Reads a PdfRectangle value directly or (optionally) indirectly from the PDF data stream. /// protected PdfRectangle ReadRectangle(bool canBeIndirect) { Symbol symbol = this.lexer.ScanNextToken(canBeIndirect); if (symbol == Symbol.BeginArray) { PdfRectangle rect = new PdfRectangle(); rect.X1 = ReadReal(); rect.Y1 = ReadReal(); rect.X2 = ReadReal(); rect.Y2 = ReadReal(); ReadSymbol(Symbol.EndArray); return rect; } else if (symbol == Symbol.R) { int position = this.lexer.Position; MoveToObject(this.lexer.Token); ReadObjectID(null); PdfRectangle rect = ReadRectangle(); ReadSymbol(Symbol.EndObj); this.lexer.Position = position; return rect; } throw new PdfReaderException(PSSR.UnexpectedToken(this.lexer.Token)); } /// /// Short cut for ReadRectangle(false). /// protected PdfRectangle ReadRectangle() { return ReadRectangle(false); } /// /// Reads a generic dictionary. /// protected PdfDictionary ReadDictionary(bool canBeIndirect) { // Just read over dictionary PdfDictionary dictionary = new PdfDictionary(); Symbol symbol = this.lexer.ScanNextToken(canBeIndirect); if (symbol == Symbol.BeginDictionary) { int nestingLevel = 0; symbol = ScanNextToken(); while (symbol != Symbol.Eof) { switch (symbol) { case Symbol.BeginDictionary: nestingLevel++; break; case Symbol.EndDictionary: if (nestingLevel == 0) return dictionary; else nestingLevel--; break; } symbol = ScanNextToken(); } Debug.Assert(false, "Must not come here"); return dictionary; } else if (symbol == Symbol.R) { return dictionary; } throw new PdfReaderException(PSSR.UnexpectedToken(this.lexer.Token)); } /// /// Short cut for ReadDictionary(false). /// protected PdfDictionary ReadDictionary() { return ReadDictionary(false); } /// /// Reads a generic array. /// protected PdfArray ReadArray(bool canBeIndirect) { // Just read over array PdfArray array = new PdfArray(); Symbol symbol = this.lexer.ScanNextToken(canBeIndirect); if (symbol == Symbol.BeginArray) { int nestingLevel = 0; symbol = ScanNextToken(); while (symbol != Symbol.Eof) { switch (symbol) { case Symbol.BeginArray: nestingLevel++; break; case Symbol.EndArray: if (nestingLevel == 0) return array; else nestingLevel--; break; } symbol = ScanNextToken(); } Debug.Assert(false, "Must not come here"); return array; } else if (symbol == Symbol.R) { return array; } throw new PdfReaderException(PSSR.UnexpectedToken(this.lexer.Token)); } protected PdfArray ReadArray() { return ReadArray(false); } protected object ReadGeneric(KeysMeta meta, string token) { KeyDescriptor descriptor = meta[token]; Debug.Assert(descriptor != null); object result = null; switch (descriptor.KeyType & KeyType.TypeMask) { case KeyType.Name: result = ReadName(); break; case KeyType.String: result = ReadString(descriptor.CanBeIndirect); break; case KeyType.Boolean: result = ReadBoolean(descriptor.CanBeIndirect); break; case KeyType.Integer: result = ReadInteger(descriptor.CanBeIndirect); break; case KeyType.Real: result = ReadReal(descriptor.CanBeIndirect); break; case KeyType.Date: result = ReadDate(descriptor.CanBeIndirect); break; case KeyType.Rectangle: result = ReadRectangle(descriptor.CanBeIndirect); break; case KeyType.Array: result = ReadArray(descriptor.CanBeIndirect); break; case KeyType.Dictionary: result = ReadDictionary(descriptor.CanBeIndirect); break; case KeyType.Stream: break; case KeyType.NumberTree: throw new NotImplementedException("KeyType.NumberTree"); case KeyType.NameOrArray: char ch = this.lexer.MoveToNonWhiteSpace(); if (ch == '/') result = ReadName(); else if (ch == '[') result = ReadArray(); else throw new NotImplementedException("KeyType.NameOrArray"); break; case KeyType.ArrayOrDictionary: throw new NotImplementedException("KeyType.ArrayOrDictionary"); } //Debug.Assert(false, "ReadGeneric"); return result; } // /// // /// Gets the current symbol from the lexer. // /// // protected Symbol Symbol // { // get {return lexer.Symbol;} // } // // /// // /// Gets the current token from the lexer. // /// // protected string Token // { // get {return lexer.Token.ToString();} // } public static object Read(PdfObject o, string key) { return null; } */ ParserState SaveState() { ParserState state = new ParserState(); state.Position = this.lexer.Position; state.Symbol = this.lexer.Symbol; return state; } void RestoreState(ParserState state) { this.lexer.Position = state.Position; this.lexer.Symbol = state.Symbol; } class ParserState { public int Position; public Symbol Symbol; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.IO/PdfReaderException.cs0000644000175000001440000000447011435766646024202 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Pdf.IO { /// /// Exception thrown by PdfReader. /// public class PdfReaderException : PdfSharpException { /// /// Initializes a new instance of the class. /// public PdfReaderException() { } /// /// Initializes a new instance of the class. /// /// The message. public PdfReaderException(string message) : base(message) { } /// /// Initializes a new instance of the class. /// /// The message. /// The inner exception. public PdfReaderException(string message, Exception innerException) : base(message, innerException) { } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.IO/ShiftStack.cs0000644000175000001440000001106011435766646022523 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Pdf; namespace PdfSharp.Pdf.IO { /// /// Represents the stack for the shift-reduce parser. It seems that it is only needed for /// reduction of indirect references. /// internal class ShiftStack { // TODO: make Lexer.PeekChars(20) and scan for 'R' to detect indirect references public ShiftStack() { this.items = new List(); } public PdfItem[] ToArray(int start, int length) { PdfItem[] items = new PdfItem[length]; for (int i = 0, j = start; i < length; i++, j++) items[i] = (PdfItem)this.items[j]; return items; } /// /// Gets the stack pointer index. /// public int SP { get {return this.sp;} } /// /// Gets the value at the specified index. Valid index is in range 0 up to sp-1. /// public PdfItem this[int index] { get { if (index >= this.sp) throw new ArgumentOutOfRangeException("index", index, "Value greater than stack index."); return (PdfItem)this.items[index]; } } /// /// Gets an item relative to the current stack pointer. The index must be a negative value (-1, -2, etc.). /// public PdfItem GetItem(int relativeIndex) { if (relativeIndex >= 0 || -relativeIndex > this.sp) throw new ArgumentOutOfRangeException("index", relativeIndex, "Value out of stack range."); return (PdfItem)this.items[this.sp + relativeIndex]; } /// /// Gets an item relative to the current stack pointer. The index must be a negative value (-1, -2, etc.). /// public int GetInteger(int relativeIndex) { if (relativeIndex >= 0 || -relativeIndex > this.sp) throw new ArgumentOutOfRangeException("index", relativeIndex, "Value out of stack range."); return ((PdfInteger)this.items[this.sp + relativeIndex]).Value; } /// /// Pushes the specified item onto the stack. /// public void Shift(PdfItem item) { Debug.Assert(item != null); this.items.Add(item); this.sp++; } /// /// Replaces the last 'count' items with the specified item. /// public void Reduce(int count) { if (count > this.sp) throw new ArgumentException("count causes stack underflow."); this.items.RemoveRange(this.sp - count, count); this.sp -= count; } /// /// Replaces the last 'count' items with the specified item. /// public void Reduce(PdfItem item, int count) { Debug.Assert(item != null); Reduce(count); this.items.Add(item); this.sp++; } /// /// The stack pointer index. Points to the next free item. /// int sp; /// /// An array representing the stack. /// List items; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.IO/Chars.cs0000644000175000001440000000667111435766646021534 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Pdf.IO { /// /// Character table by name. /// internal sealed class Chars { // ReSharper disable InconsistentNaming public const char EOF = (char)65535; //unchecked((char)(-1)); public const char NUL = '\0'; // EOF public const char CR = '\x0D'; // ignored by lexer public const char LF = '\x0A'; // Line feed public const char BEL = '\a'; // Bell public const char BS = '\b'; // Backspace public const char FF = '\f'; // Form feed public const char HT = '\t'; // Horizontal tab public const char VT = '\v'; // Vertical tab public const char NonBreakableSpace = (char)160; // char(160) // The following names come from "PDF Reference Third Edition" // Appendix D.1, Latin Character Set and Encoding public const char SP = ' '; public const char QuoteDbl = '"'; public const char QuoteSingle = '\''; public const char ParenLeft = '('; public const char ParenRight = ')'; public const char BraceLeft = '{'; public const char BraceRight = '}'; public const char BracketLeft = '['; public const char BracketRight = ']'; public const char Less = '<'; public const char Greater = '>'; public const char Equal = '='; public const char Period = '.'; public const char Semicolon = ';'; public const char Colon = ':'; public const char Slash = '/'; public const char Bar = '|'; public const char BackSlash = '\\'; public const char Percent = '%'; public const char Dollar = '$'; public const char At = '@'; public const char NumberSign = '#'; public const char Question = '?'; public const char Hyphen = '-'; // char(45) public const char SoftHyphen = ''; // char(173) public const char Currency = ''; // ReSharper restore InconsistentNaming } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Internal/0000777000175000001440000000000011533760020021357 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Internal/AnsiEncoding.cs0000644000175000001440000001613611435766646024277 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Text; namespace PdfSharp.Pdf.Internal { /// /// An encoder for PDF AnsiEncoding. /// internal sealed class AnsiEncoding : Encoding { public AnsiEncoding() { } public override int GetByteCount(char[] chars, int index, int count) { return PdfEncoders.WinAnsiEncoding.GetByteCount(chars, index, count); } public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { byte[] ansi = PdfEncoders.WinAnsiEncoding.GetBytes(chars, charIndex, charCount); //for (int idx = 0, count = ansi.Length; count > 0; idx++, byteIndex++, count--) // bytes[byteIndex] = AnsiToUnicode[ansi[idx]]; return ansi.Length; } public override int GetCharCount(byte[] bytes, int index, int count) { //return PdfEncoders.WinAnsiEncoding.GetCharCount(bytes, index, count); Debug.Assert(PdfEncoders.WinAnsiEncoding.GetCharCount(bytes, index, count) == count); return count; } public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { throw new NotImplementedException("GetChars"); //for (; byteCount > 0; byteIndex++, charIndex++, byteCount--) // chars[charIndex] = '\ubytes[byteIndex]; //return byteCount; } public override int GetMaxByteCount(int charCount) { return charCount; } public override int GetMaxCharCount(int byteCount) { return byteCount; } /// /// Indicates whether the specified Unicode character is available in the ANSI code page 1252. /// public static bool IsAnsi1252Char(char ch) { if (ch < '\u00FF') // HACK? return true; switch (ch) { case '\u20AC': case '\u0081': case '\u201A': case '\u0192': case '\u201E': case '\u2026': case '\u2020': case '\u2021': case '\u02C6': case '\u2030': case '\u0160': case '\u2039': case '\u0152': case '\u008D': case '\u017D': case '\u008F': case '\u0090': case '\u2018': case '\u2019': case '\u201C': case '\u201D': case '\u2022': case '\u2013': case '\u2014': case '\u02DC': case '\u2122': case '\u0161': case '\u203A': case '\u0153': case '\u009D': case '\u017E': case '\u0178': return true; } return false; } /// /// Converts WinAnsi to Unicode characters. /// static char[] AnsiToUnicode = new char[256] { // 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F /* 00 */ '\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005', '\u0006', '\u0007', '\u0008', '\u0009', '\u000A', '\u000B', '\u000C', '\u000D', '\u000E', '\u000F', /* 10 */ '\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017', '\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F', /* 20 */ '\u0020', '\u0021', '\u0022', '\u0023', '\u0024', '\u0025', '\u0026', '\u0027', '\u0028', '\u0029', '\u002A', '\u002B', '\u002C', '\u002D', '\u002E', '\u002F', /* 30 */ '\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037', '\u0038', '\u0039', '\u003A', '\u003B', '\u003C', '\u003D', '\u003E', '\u003F', /* 40 */ '\u0040', '\u0041', '\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047', '\u0048', '\u0049', '\u004A', '\u004B', '\u004C', '\u004D', '\u004E', '\u004F', /* 50 */ '\u0050', '\u0051', '\u0052', '\u0053', '\u0054', '\u0055', '\u0056', '\u0057', '\u0058', '\u0059', '\u005A', '\u005B', '\u005C', '\u005D', '\u005E', '\u005F', /* 60 */ '\u0060', '\u0061', '\u0062', '\u0063', '\u0064', '\u0065', '\u0066', '\u0067', '\u0068', '\u0069', '\u006A', '\u006B', '\u006C', '\u006D', '\u006E', '\u006F', /* 70 */ '\u0070', '\u0071', '\u0072', '\u0073', '\u0074', '\u0075', '\u0076', '\u0077', '\u0078', '\u0079', '\u007A', '\u007B', '\u007C', '\u007D', '\u007E', '\u007F', /* 80 */ '\u20AC', '\u0081', '\u201A', '\u0192', '\u201E', '\u2026', '\u2020', '\u2021', '\u02C6', '\u2030', '\u0160', '\u2039', '\u0152', '\u008D', '\u017D', '\u008F', /* 90 */ '\u0090', '\u2018', '\u2019', '\u201C', '\u201D', '\u2022', '\u2013', '\u2014', '\u02DC', '\u2122', '\u0161', '\u203A', '\u0153', '\u009D', '\u017E', '\u0178', /* A0 */ '\u00A0', '\u00A1', '\u00A2', '\u00A3', '\u00A4', '\u00A5', '\u00A6', '\u00A7', '\u00A8', '\u00A9', '\u00AA', '\u00AB', '\u00AC', '\u00AD', '\u00AE', '\u00AF', /* B0 */ '\u00B0', '\u00B1', '\u00B2', '\u00B3', '\u00B4', '\u00B5', '\u00B6', '\u00B7', '\u00B8', '\u00B9', '\u00BA', '\u00BB', '\u00BC', '\u00BD', '\u00BE', '\u00BF', /* C0 */ '\u00C0', '\u00C1', '\u00C2', '\u00C3', '\u00C4', '\u00C5', '\u00C6', '\u00C7', '\u00C8', '\u00C9', '\u00CA', '\u00CB', '\u00CC', '\u00CD', '\u00CE', '\u00CF', /* D0 */ '\u00D0', '\u00D1', '\u00D2', '\u00D3', '\u00D4', '\u00D5', '\u00D6', '\u00D7', '\u00D8', '\u00D9', '\u00DA', '\u00DB', '\u00DC', '\u00DD', '\u00DE', '\u00DF', /* E0 */ '\u00E0', '\u00E1', '\u00E2', '\u00E3', '\u00E4', '\u00E5', '\u00E6', '\u00E7', '\u00E8', '\u00E9', '\u00EA', '\u00EB', '\u00EC', '\u00ED', '\u00EE', '\u00EF', /* F0 */ '\u00F0', '\u00F1', '\u00F2', '\u00F3', '\u00F4', '\u00F5', '\u00F6', '\u00F7', '\u00F8', '\u00F9', '\u00FA', '\u00FB', '\u00FC', '\u00FD', '\u00FE', '\u00FF', }; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Internal/ColorSpaceHelper.cs0000644000175000001440000000634411435766646025130 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Text; using PdfSharp.Drawing; namespace PdfSharp.Pdf.Internal { /// /// Helper functions for RGB and CMYK colors. /// static class ColorSpaceHelper { /// /// Checks whether a color mode and a color match. /// public static XColor EnsureColorMode(PdfColorMode colorMode, XColor color) { #if true if (colorMode == PdfColorMode.Rgb && color.ColorSpace != XColorSpace.Rgb) return XColor.FromArgb((int)(color.A * 255), color.R, color.G, color.B); if (colorMode == PdfColorMode.Cmyk && color.ColorSpace != XColorSpace.Cmyk) return XColor.FromCmyk(color.A, color.C, color.M, color.Y, color.K); return color; #else if (colorMode == PdfColorMode.Rgb && color.ColorSpace != XColorSpace.Rgb) throw new InvalidOperationException(PSSR.InappropriateColorSpace(colorMode, color.ColorSpace)); if (colorMode == PdfColorMode.Cmyk && color.ColorSpace != XColorSpace.Cmyk) throw new InvalidOperationException(PSSR.InappropriateColorSpace(colorMode, color.ColorSpace)); #endif } /// /// Checks whether the color mode of a document and a color match. /// public static XColor EnsureColorMode(PdfDocument document, XColor color) { if (document == null) throw new ArgumentNullException("document"); return EnsureColorMode(document.Options.ColorMode, color); } /// /// Determines whether two colors are equal referring to their CMYK color values. /// public static bool IsEqualCmyk(XColor x, XColor y) { if (x.ColorSpace != XColorSpace.Cmyk || y.ColorSpace != XColorSpace.Cmyk) return false; return x.C == y.C && x.M == y.M && x.Y == y.Y && x.K == y.K; } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Internal/PdfEncoders.cs0000644000175000001440000005066011435766646024132 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Globalization; using System.Text; using PdfSharp.Drawing; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf.Security; namespace PdfSharp.Pdf.Internal { /// /// Groups a set of static encoding helper functions. /// internal static class PdfEncoders { // static char InvalidChar = '?'; //[Obsolete] //public static void WriteAnsi(Stream stream, string text) //{ // stream.Write(PdfEncoders.WinAnsiEncoding.GetBytes(text), 0, text.Length); //} /// /// Gets the raw encoding. /// public static Encoding RawEncoding { get { if (PdfEncoders.rawEncoding == null) PdfEncoders.rawEncoding = new RawEncoding(); return PdfEncoders.rawEncoding; } } static Encoding rawEncoding; /// /// Gets the raw Unicode encoding. /// public static Encoding RawUnicodeEncoding { get { if (PdfEncoders.rawUnicodeEncoding == null) PdfEncoders.rawUnicodeEncoding = new RawUnicodeEncoding(); return PdfEncoders.rawUnicodeEncoding; } } static Encoding rawUnicodeEncoding; /// /// Gets the Windows 1252 (ANSI) encoding. /// public static Encoding WinAnsiEncoding { get { if (PdfEncoders.winAnsiEncoding == null) PdfEncoders.winAnsiEncoding = #if !SILVERLIGHT Encoding.GetEncoding(1252); #else Encoding.GetEncoding("utf-8"); // AGHACK #endif return PdfEncoders.winAnsiEncoding; } } static Encoding winAnsiEncoding; /// /// Gets the PDF DocEncoding encoding. /// public static Encoding DocEncoding { get { if (PdfEncoders.docEncoding == null) PdfEncoders.docEncoding = new DocEncoding(); return PdfEncoders.docEncoding; } } static Encoding docEncoding; /// /// Gets the UNICODE little-endian encoding. /// public static Encoding UnicodeEncoding { get { if (PdfEncoders.unicodeEncoding == null) PdfEncoders.unicodeEncoding = Encoding.Unicode; return PdfEncoders.unicodeEncoding; } } static Encoding unicodeEncoding; ///// ///// Encodes a string from a byte array. Each character gets the code of the corresponding byte. ///// //public static string RawString(byte[] bytes, int offset, int length) //{ // char[] chars = new char[length]; // for (int idx = offset, ch = 0; idx < offset + length; idx++, ch++) // chars[ch] = (char)bytes[idx]; // return new string(chars, 0, length); //} // //public static string RawString(byte[] bytes) //{ // return RawString(bytes, 0, bytes.Length); //} #if false public static string EncodeAsLiteral(string text, bool unicode) { if (text == null || text == "") return "<>"; StringBuilder pdf = new StringBuilder(""); if (!unicode) { byte[] bytes = WinAnsiEncoding.GetBytes(text); int count = bytes.Length; pdf.Append("("); for (int idx = 0; idx < count; idx++) { char ch = (char)bytes[idx]; if (ch < 32) { switch (ch) { case '\n': pdf.Append("\\n"); break; case '\r': pdf.Append("\\r"); break; case '\t': pdf.Append("\\t"); break; case '\f': pdf.Append("\\f"); break; default: pdf.Append(PdfEncoders.InvalidChar); // TODO break; } } else { switch (ch) { case '(': pdf.Append("\\("); break; case ')': pdf.Append("\\)"); break; case '\\': pdf.Append("\\\\"); break; default: pdf.Append(ch); break; } } } pdf.Append(')'); } else { pdf.Append("<"); byte[] bytes = UnicodeEncoding.GetBytes(text); int count = bytes.Length; for (int idx = 0; idx < count; idx += 2) { pdf.AppendFormat("{0:X2}{1:X2}", bytes[idx + 1], bytes[idx]); if (idx != 0 && (idx % 48) == 0) pdf.Append("\n"); } pdf.Append(">"); } return pdf.ToString(); } #endif //public static string EncodeAsLiteral(string text) //{ // return EncodeAsLiteral(text, false); //} /// /// Converts a raw string into a raw string literal, possibly encrypted. /// public static string ToStringLiteral(string text, PdfStringEncoding encoding, PdfStandardSecurityHandler securityHandler) { if (String.IsNullOrEmpty(text)) return "()"; byte[] bytes; switch (encoding) { case PdfStringEncoding.RawEncoding: bytes = RawEncoding.GetBytes(text); break; case PdfStringEncoding.WinAnsiEncoding: bytes = WinAnsiEncoding.GetBytes(text); break; case PdfStringEncoding.PDFDocEncoding: bytes = DocEncoding.GetBytes(text); break; case PdfStringEncoding.Unicode: bytes = UnicodeEncoding.GetBytes(text); break; default: throw new NotImplementedException(encoding.ToString()); } byte[] temp = FormatStringLiteral(bytes, encoding == PdfStringEncoding.Unicode, true, false, securityHandler); return RawEncoding.GetString(temp, 0, temp.Length); } /// /// Converts a raw string into a raw string literal, possibly encrypted. /// public static string ToStringLiteral(byte[] bytes, bool unicode, PdfStandardSecurityHandler securityHandler) { if (bytes == null || bytes.Length == 0) return "()"; byte[] temp = FormatStringLiteral(bytes, unicode, true, false, securityHandler); return RawEncoding.GetString(temp, 0, temp.Length); } /// /// Converts a raw string into a raw hexadecimal string literal, possibly encrypted. /// public static string ToHexStringLiteral(string text, PdfStringEncoding encoding, PdfStandardSecurityHandler securityHandler) { if (String.IsNullOrEmpty(text)) return "<>"; byte[] bytes; switch (encoding) { case PdfStringEncoding.RawEncoding: bytes = RawEncoding.GetBytes(text); break; case PdfStringEncoding.WinAnsiEncoding: bytes = WinAnsiEncoding.GetBytes(text); break; case PdfStringEncoding.PDFDocEncoding: bytes = DocEncoding.GetBytes(text); break; case PdfStringEncoding.Unicode: bytes = UnicodeEncoding.GetBytes(text); break; default: throw new NotImplementedException(encoding.ToString()); } byte[] agTemp = FormatStringLiteral(bytes, encoding == PdfStringEncoding.Unicode, true, true, securityHandler); return RawEncoding.GetString(agTemp, 0, agTemp.Length); } /// /// Converts a raw string into a raw hexadecimal string literal, possibly encrypted. /// public static string ToHexStringLiteral(byte[] bytes, bool unicode, PdfStandardSecurityHandler securityHandler) { if (bytes == null || bytes.Length == 0) return "<>"; byte[] agTemp = FormatStringLiteral(bytes, unicode, true, true, securityHandler); return RawEncoding.GetString(agTemp, 0, agTemp.Length); } /// /// Converts the specified byte array into a byte array representing a string literal. /// /// The bytes of the string. /// Indicates whether one or two bytes are one character. /// Indicates whether to use Unicode prefix. /// Indicates whether to create a hexadecimal string literal. /// Encrypts the bytes if specified. /// The PDF bytes. public static byte[] FormatStringLiteral(byte[] bytes, bool unicode, bool prefix, bool hex, PdfStandardSecurityHandler securityHandler) { if (bytes == null || bytes.Length == 0) return hex ? new byte[] { (byte)'<', (byte)'>' } : new byte[] { (byte)'(', (byte)')' }; Debug.Assert(!unicode || bytes.Length % 2 == 0, "Odd number of bytes in Unicode string."); bool encrypted = false; if (securityHandler != null) { bytes = (byte[])bytes.Clone(); bytes = securityHandler.EncryptBytes(bytes); encrypted = true; } int count = bytes.Length; StringBuilder pdf = new StringBuilder(); if (!unicode) { if (!hex) { pdf.Append("("); for (int idx = 0; idx < count; idx++) { char ch = (char)bytes[idx]; if (ch < 32) { switch (ch) { case '\n': pdf.Append("\\n"); break; case '\r': pdf.Append("\\r"); break; case '\t': pdf.Append("\\t"); break; case '\b': pdf.Append("\\b"); break; // currups encrypted text //case '\f': // pdf.Append("\\f"); // break; default: // Don't escape chararchters less than 32 if the string is encrypted, because it is // unreadable anyway. encrypted = true; if (!encrypted) { pdf.Append("\\0"); pdf.Append((char)(ch % 8 + '0')); pdf.Append((char)(ch / 8 + '0')); } else pdf.Append(ch); break; } } else { switch (ch) { case '(': pdf.Append("\\("); break; case ')': pdf.Append("\\)"); break; case '\\': pdf.Append("\\\\"); break; default: pdf.Append(ch); break; } } } pdf.Append(')'); } else { pdf.Append('<'); for (int idx = 0; idx < count; idx++) pdf.AppendFormat("{0:X2}", bytes[idx]); pdf.Append('>'); } } else { Hex: if (hex) { if (prefix) pdf.Append(""); } else { // TODO non hex literals... not sure how to treat linefeeds, '(', '\' etc. hex = true; goto Hex; } } return RawEncoding.GetBytes(pdf.ToString()); } /// /// Converts WinAnsi to DocEncode characters. Incomplete, just maps and some other characters. /// static byte[] docencode_______ = new byte[256] { // TODO: 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, 0xA0, 0x7F, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x8A, 0x8C, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, }; //public static string DocEncode(string text, bool unicode)//, PdfStandardSecurityHandler securityHandler) //{ // if (text == null || text == "") // return "()"; // // int length = text.Length; // StringBuilder encoded = new StringBuilder(2 * length); // if (!unicode) // { // byte[] bytes = PdfEncoders.WinAnsiEncoding.GetBytes(text); // encoded.Append('('); // for (int idx = 0; idx < length; idx++) // { // char ch = (char)bytes[idx]; // if (ch > 255) // { // //TODO unicode? // encoded.Append(PdfEncoders.InvalidChar); // //encoded.Append(ch); // continue; // } // ch = (char)docencode[(int)ch]; // if (ch < 32) // { // switch (ch) // { // case '\n': // encoded.Append("\\n"); // break; // // case '\r': // encoded.Append("\\r"); // break; // // case '\t': // encoded.Append("\\t"); // break; // // case '\f': // encoded.Append("\\f"); // break; // // default: // encoded.Append(PdfEncoders.InvalidChar); // TODO // break; // } // } // else // { // switch (ch) // { // case '(': // encoded.Append("\\("); // break; // // case ')': // encoded.Append("\\)"); // break; // // case '\\': // encoded.Append("\\\\"); // break; // // default: // encoded.Append(ch); // break; // } // } // } // encoded.Append(')'); // } // else // { // encoded.Append("'); // } // return encoded.ToString(); //} //public static string DocEncode(string text) //{ // return DocEncode(text, false); //} ///// ///// Encodes a hexadecimal doc-encoded string literal. ///// //public static string DocEncodeHex(string text, bool unicode) //{ // if (text == null || text == "") // return "<>"; // // int length = text.Length; // StringBuilder encoded = new StringBuilder(3 * length); // if (!unicode) // { // byte[] bytes = PdfEncoders.WinAnsiEncoding.GetBytes(text); // encoded.Append('<'); // for (int idx = 0; idx < length; idx++) // encoded.AppendFormat("{0:X2}", docencode[bytes[idx]]); // encoded.Append('>'); // } // else // { // encoded.Append("'); // } // return encoded.ToString(); //} //public static string DocEncodeHex(string text) //{ // return DocEncodeHex(text, false); //} /// /// ...because I always forget CultureInfo.InvariantCulture and wonder why Acrobat /// cannot understand my German decimal separator... /// public static string Format(string format, params object[] args) { return String.Format(CultureInfo.InvariantCulture, format, args); } /// /// Converts a float into a string with up to 3 decimal digits and a decimal point. /// public static string ToString(double val) { return val.ToString("0.###", CultureInfo.InvariantCulture); } /// /// Converts an XColor into a string with up to 3 decimal digits and a decimal point. /// public static string ToString(XColor color, PdfColorMode colorMode) { // If not defined let color decide if (colorMode == PdfColorMode.Undefined) colorMode = color.ColorSpace == XColorSpace.Cmyk ? PdfColorMode.Cmyk : PdfColorMode.Rgb; switch (colorMode) { case PdfColorMode.Cmyk: return String.Format(CultureInfo.InvariantCulture, "{0:0.###} {1:0.###} {2:0.###} {3:0.###}", color.C, color.M, color.Y, color.K); default: return String.Format(CultureInfo.InvariantCulture, "{0:0.###} {1:0.###} {2:0.###}", color.R / 255.0, color.G / 255.0, color.B / 255.0); } } /// /// Converts an XMatrix into a string with up to 3 decimal digits and a decimal point. /// public static string ToString(XMatrix matrix) { return String.Format(CultureInfo.InvariantCulture, "{0:0.###} {1:0.###} {2:0.###} {3:0.###} {4:0.###} {5:0.###}", matrix.M11, matrix.M12, matrix.M21, matrix.M22, matrix.OffsetX, matrix.OffsetY); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Internal/RawEncoding.cs0000644000175000001440000000565111435766646024136 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Text; namespace PdfSharp.Pdf.Internal { /// /// An encoder for raw strings. The raw encoding is simply the identity relation between /// charachters and bytes. PDFsharp internally works with raw encoded strings instead of /// byte arrays because strings are much more handy than byte arrays. /// internal sealed class RawEncoding : Encoding { public RawEncoding() { } public override int GetByteCount(char[] chars, int index, int count) { return count; } public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { for (int count = charCount; count > 0; charIndex++, byteIndex++, count--) { Debug.Assert((uint)chars[charIndex] < 256, "Raw string contains invalid character with a value > 255."); bytes[byteIndex] = (byte)chars[charIndex]; } return charCount; } public override int GetCharCount(byte[] bytes, int index, int count) { return count; } public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { for (int count = byteCount; count > 0; byteIndex++, charIndex++, count--) chars[charIndex] = (char)bytes[byteIndex]; return byteCount; } public override int GetMaxByteCount(int charCount) { return charCount; } public override int GetMaxCharCount(int byteCount) { return byteCount; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Internal/GlobalObjectTable.cs0000644000175000001440000001072011435766646025226 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf.Internal { /// /// Provides a thread-local cache for large objects. /// internal class GlobalObjectTable { public GlobalObjectTable() { } public void AttatchDocument(PdfDocument.DocumentHandle handle) { lock (this.documentHandles) { this.documentHandles.Add(handle); } //WeakReference weakRef = new WeakReference(document); //lock (this.documents) //{ // this.documents.Add(weakRef); //} } public void DetatchDocument(PdfDocument.DocumentHandle handle) { lock (this.documentHandles) { // Notify other documents about detach int count = this.documentHandles.Count; for (int idx = 0; idx < count; idx++) { if (((PdfDocument.DocumentHandle)this.documentHandles[idx]).IsAlive) { PdfDocument target = ((PdfDocument.DocumentHandle)this.documentHandles[idx]).Target; if (target != null) target.OnExternalDocumentFinalized(handle); } } // Clean up table for (int idx = 0; idx < this.documentHandles.Count; idx++) { PdfDocument target = ((PdfDocument.DocumentHandle)this.documentHandles[idx]).Target; if (target == null) { this.documentHandles.RemoveAt(idx); idx--; } } } //lock (this.documents) //{ // int index = IndexOf(document); // if (index != -1) // { // this.documents.RemoveAt(index); // int count = this.documents.Count; // for (int idx = 0; idx < count; idx++) // { // PdfDocument target = ((WeakReference)this.documents[idx]).Target as PdfDocument; // if (target != null) // target.OnExternalDocumentFinalized(document); // } // for (int idx = 0; idx < this.documents.Count; idx++) // { // PdfDocument target = ((WeakReference)this.documents[idx]).Target as PdfDocument; // if (target == null) // { // this.documents.RemoveAt(idx); // idx--; // } // } // } //} } //int IndexOf(PdfDocument.Handle handle) //{ // int count = this.documents.Count; // for (int idx = 0; idx < count; idx++) // { // if ((PdfDocument.Handle)this.documents[idx] == handle) // return idx; // //if (Object.ReferenceEquals(((WeakReference)this.documents[idx]).Target, document)) // // return idx; // } // return -1; //} /// /// Array of handles to all documents. /// List documentHandles = new List(); } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Internal/RawUnicodeEncoding.cs0000644000175000001440000000532711435766646025445 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Text; namespace PdfSharp.Pdf.Internal { /// /// An encoder for Unicode strings. /// internal sealed class RawUnicodeEncoding : Encoding { public RawUnicodeEncoding() { } public override int GetByteCount(char[] chars, int index, int count) { return 2 * count; } public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { for (int count = charCount; count > 0; charIndex++, count--) { char ch = chars[charIndex]; bytes[byteIndex++] = (byte)(ch >> 8); bytes[byteIndex++] = (byte)ch; } return charCount * 2; } public override int GetCharCount(byte[] bytes, int index, int count) { return count / 2; } public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { for (int count = byteCount; count > 0; byteIndex += 2, charIndex++, count--) { chars[charIndex] = (char)((int)bytes[byteIndex] << 8 + (int)bytes[byteIndex + 1]); } return byteCount; } public override int GetMaxByteCount(int charCount) { return charCount * 2; } public override int GetMaxCharCount(int byteCount) { return byteCount / 2; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Internal/DocEncoding.cs0000644000175000001440000001603611435766646024111 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Text; namespace PdfSharp.Pdf.Internal { /// /// An encoder for PDF DocEncoding. /// internal sealed class DocEncoding : Encoding { public DocEncoding() { } public override int GetByteCount(char[] chars, int index, int count) { return PdfEncoders.WinAnsiEncoding.GetByteCount(chars, index, count); } public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { byte[] ansi = PdfEncoders.WinAnsiEncoding.GetBytes(chars, charIndex, charCount); for (int idx = 0, count = ansi.Length; count > 0; idx++, byteIndex++, count--) bytes[byteIndex] = AnsiToDoc[ansi[idx]]; return ansi.Length; } public override int GetCharCount(byte[] bytes, int index, int count) { //return PdfEncoders.WinAnsiEncoding.GetCharCount(bytes, index, count); Debug.Assert(PdfEncoders.WinAnsiEncoding.GetCharCount(bytes, index, count) == count); return count; } public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { throw new NotImplementedException("GetChars"); //for (; byteCount > 0; byteIndex++, charIndex++, byteCount--) // chars[charIndex] = (char)bytes[byteIndex]; //return byteCount; } public override int GetMaxByteCount(int charCount) { return charCount; } public override int GetMaxCharCount(int byteCount) { return byteCount; } /// /// Converts WinAnsi to DocEncode characters. Incomplete, just maps and some other characters. /// static byte[] AnsiToDoc = new byte[256] { // TODO: verify 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, 0xA0, 0x7F, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x8A, 0x8C, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, 0x20, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, }; // TODO: use this table static char[] PdfDocToUnicode = new char[] { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0A', '\x0B', '\x0C', '\x0D', '\x0E', '\x0F', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1A', '\x1B', '\x1C', '\x1D', '\x1E', '\x1F', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2A', '\x2B', '\x2C', '\x2D', '\x2E', '\x2F', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3A', '\x3B', '\x3C', '\x3D', '\x3E', '\x3F', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4A', '\x4B', '\x4C', '\x4D', '\x4E', '\x4F', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5A', '\x5B', '\x5C', '\x5D', '\x5E', '\x5F', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6A', '\x6B', '\x6C', '\x6D', '\x6E', '\x6F', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7A', '\x7B', '\x7C', '\x7D', '\x7E', '\x7F', '\x2022', '\x2020', '\x2021', '\x2026', '\x2014', '\x2013', '\x0192', '\x2044', '\x2039', '\x203A', '\x2212', '\x2030', '\x201E', '\x201C', '\x201D', '\x2018', '\x2019', '\x201A', '\x2122', '\xFB01', '\xFB02', '\x0141', '\x0152', '\x0160', '\x0178', '\x017D', '\x0131', '\x0142', '\x0153', '\x0161', '\x017E', '\xFFFD', '\x20AC', '\xA1', '\xA2', '\xA3', '\xA4', '\xA5', '\xA6', '\xA7', '\xA8', '\xA9', '\xAA', '\xAB', '\xAC', '\xAD', '\xAE', '\xAF', '\xB0', '\xB1', '\xB2', '\xB3', '\xB4', '\xB5', '\xB6', '\xB7', '\xB8', '\xB9', '\xBA', '\xBB', '\xBC', '\xBD', '\xBE', '\xBF', '\xC0', '\xC1', '\xC2', '\xC3', '\xC4', '\xC5', '\xC6', '\xC7', '\xC8', '\xC9', '\xCA', '\xCB', '\xCC', '\xCD', '\xCE', '\xCF', '\xD0', '\xD1', '\xD2', '\xD3', '\xD4', '\xD5', '\xD6', '\xD7', '\xD8', '\xD9', '\xDA', '\xDB', '\xDC', '\xDD', '\xDE', '\xDF', '\xE0', '\xE1', '\xE2', '\xE3', '\xE4', '\xE5', '\xE6', '\xE7', '\xE8', '\xE9', '\xEA', '\xEB', '\xEC', '\xED', '\xEE', '\xEF', '\xF0', '\xF1', '\xF2', '\xF3', '\xF4', '\xF5', '\xF6', '\xF7', '\xF8', '\xF9', '\xFA', '\xFB', '\xFC', '\xFD', '\xFE', '\xFF', }; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Internal/ThreadLocalStorage.cs0000644000175000001440000001006411435766646025437 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using System.Globalization; using System.Text; using System.IO; using PdfSharp.Internal; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.IO; namespace PdfSharp.Pdf.Internal { /// /// Provides a thread-local cache for large objects. /// internal class ThreadLocalStorage { public ThreadLocalStorage() { this.importedDocuments = new Dictionary(StringComparer.InvariantCultureIgnoreCase); } public void AddDocument(string path, PdfDocument document) { this.importedDocuments.Add(path, document.Handle); } public void RemoveDocument(string path) { this.importedDocuments.Remove(path); } public PdfDocument GetDocument(string path) { Debug.Assert(path.StartsWith("*") || Path.IsPathRooted(path), "Path must be full qualified."); PdfDocument document = null; PdfDocument.DocumentHandle handle; if (this.importedDocuments.TryGetValue(path, out handle)) { document = handle.Target; if (document == null) RemoveDocument(path); } if (document == null) { document = PdfReader.Open(path, PdfDocumentOpenMode.Import); this.importedDocuments.Add(path, document.Handle); } return document; } public PdfDocument[] Documents { get { List list = new List(); foreach (PdfDocument.DocumentHandle handle in this.importedDocuments.Values) { if (handle.IsAlive) list.Add(handle.Target); } return list.ToArray(); } } public void DetachDocument(PdfDocument.DocumentHandle handle) { if (handle.IsAlive) { foreach (String path in this.importedDocuments.Keys) { if (this.importedDocuments[path] == handle) { this.importedDocuments.Remove(path); break; } } } // Clean table bool itemRemoved = true; while (itemRemoved) { itemRemoved = false; foreach (String path in this.importedDocuments.Keys) { if (!this.importedDocuments[path].IsAlive) { this.importedDocuments.Remove(path); itemRemoved = true; break; } } } } /// /// Maps path to document handle. /// readonly Dictionary importedDocuments; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/0000777000175000001440000000000011533760020021262 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/SharpZip/0000777000175000001440000000000011533760020023022 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/SharpZip/SharpZipBaseException.cs0000644000175000001440000000575311435763706027610 0ustar00gabeusers00000000000000// SharpZipBaseException.cs // // Copyright 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace PdfSharp.SharpZipLib { /// /// SharpZipBaseException is the base exception class for the SharpZipLibrary. /// All library exceptions are derived from this. /// internal class SharpZipBaseException : ApplicationException { /// /// Initializes a new instance of the SharpZipLibraryException class. /// public SharpZipBaseException() { } /// /// Initializes a new instance of the SharpZipLibraryException class with a specified error message. /// public SharpZipBaseException(string msg) : base(msg) { } /// /// Initializes a new instance of the SharpZipLibraryException class with a specified /// error message and a reference to the inner exception that is the cause of this exception. /// /// Error message string /// The inner exception public SharpZipBaseException(string message, Exception innerException) : base(message, innerException) { } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Checksums/0000777000175000001440000000000011533760020023207 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Checksums/CRC32.cs0000644000175000001440000002131311435763706024325 0ustar00gabeusers00000000000000// CRC32.cs - Computes CRC32 data checksum of a data stream // Copyright (C) 2001 Mike Krueger // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace PdfSharp.SharpZipLib.Checksums { /// /// Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: /// x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. /// /// Polynomials over GF(2) are represented in binary, one bit per coefficient, /// with the lowest powers in the most significant bit. Then adding polynomials /// is just exclusive-or, and multiplying a polynomial by x is a right shift by /// one. If we call the above polynomial p, and represent a byte as the /// polynomial q, also with the lowest power in the most significant bit (so the /// byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, /// where a mod b means the remainder after dividing a by b. /// /// This calculation is done using the shift-register method of multiplying and /// taking the remainder. The register is initialized to zero, and for each /// incoming bit, x^32 is added mod p to the register if the bit is a one (where /// x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by /// x (which is shifting right by one and adding x^32 mod p if the bit shifted /// out is a one). We start with the highest power (least significant bit) of /// q and repeat for all eight bits of q. /// /// The table is simply the CRC of all possible eight bit values. This is all /// the information needed to generate CRC's on data a byte at a time for all /// combinations of CRC register values and incoming bytes. /// internal sealed class Crc32 : IChecksum { readonly static uint CrcSeed = 0xFFFFFFFF; readonly static uint[] CrcTable = new uint[] { 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D }; internal static uint ComputeCrc32(uint oldCrc, byte bval) { return (uint)(Crc32.CrcTable[(oldCrc ^ bval) & 0xFF] ^ (oldCrc >> 8)); } /// /// The crc data checksum so far. /// uint crc = 0; /// /// Returns the CRC32 data checksum computed so far. /// public long Value { get { return (long)crc; } set { crc = (uint)value; } } /// /// Resets the CRC32 data checksum as if no update was ever called. /// public void Reset() { crc = 0; } /// /// Updates the checksum with the int bval. /// /// /// the byte is taken as the lower 8 bits of bval /// public void Update(int bval) { crc ^= CrcSeed; crc = CrcTable[(crc ^ bval) & 0xFF] ^ (crc >> 8); crc ^= CrcSeed; } /// /// Updates the checksum with the bytes taken from the array. /// /// /// buffer an array of bytes /// public void Update(byte[] buffer) { Update(buffer, 0, buffer.Length); } /// /// Adds the byte array to the data checksum. /// /// /// the buffer which contains the data /// /// /// the offset in the buffer where the data starts /// /// /// the length of the data /// public void Update(byte[] buf, int off, int len) { if (buf == null) { throw new ArgumentNullException("buf"); } if (off < 0 || len < 0 || off + len > buf.Length) { throw new ArgumentOutOfRangeException(); } crc ^= CrcSeed; while (--len >= 0) { crc = CrcTable[(crc ^ buf[off++]) & 0xFF] ^ (crc >> 8); } crc ^= CrcSeed; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Checksums/Adler32.cs0000644000175000001440000001620611435766646024760 0ustar00gabeusers00000000000000// Adler32.cs - Computes Adler32 data checksum of a data stream // Copyright (C) 2001 Mike Krueger // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace PdfSharp.SharpZipLib.Checksums { /// /// Computes Adler32 checksum for a stream of data. An Adler32 /// checksum is not as reliable as a CRC32 checksum, but a lot faster to /// compute. /// /// The specification for Adler32 may be found in RFC 1950. /// ZLIB Compressed Data Format Specification version 3.3) /// /// /// From that document: /// /// "ADLER32 (Adler-32 checksum) /// This contains a checksum value of the uncompressed data /// (excluding any dictionary data) computed according to Adler-32 /// algorithm. This algorithm is a 32-bit extension and improvement /// of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073 /// standard. /// /// Adler-32 is composed of two sums accumulated per byte: s1 is /// the sum of all bytes, s2 is the sum of all s1 values. Both sums /// are done modulo 65521. s1 is initialized to 1, s2 to zero. The /// Adler-32 checksum is stored as s2*65536 + s1 in most- /// significant-byte first (network) order." /// /// "8.2. The Adler-32 algorithm /// /// The Adler-32 algorithm is much faster than the CRC32 algorithm yet /// still provides an extremely low probability of undetected errors. /// /// The modulo on unsigned long accumulators can be delayed for 5552 /// bytes, so the modulo operation time is negligible. If the bytes /// are a, b, c, the second sum is 3a + 2b + c + 3, and so is position /// and order sensitive, unlike the first sum, which is just a /// checksum. That 65521 is prime is important to avoid a possible /// large class of two-byte errors that leave the check unchanged. /// (The Fletcher checksum uses 255, which is not prime and which also /// makes the Fletcher check insensitive to single byte changes 0 - /// 255.) /// /// The sum s1 is initialized to 1 instead of zero to make the length /// of the sequence part of s2, so that the length does not have to be /// checked separately. (Any sequence of zeroes has a Fletcher /// checksum of zero.)" /// /// /// internal sealed class Adler32 : IChecksum { /// /// largest prime smaller than 65536 /// readonly static uint BASE = 65521; uint checksum; /// /// Returns the Adler32 data checksum computed so far. /// public long Value { get { return checksum; } } /// /// Creates a new instance of the Adler32 class. /// The checksum starts off with a value of 1. /// public Adler32() { Reset(); } /// /// Resets the Adler32 checksum to the initial value. /// public void Reset() { checksum = 1; //Initialize to 1 } /// /// Updates the checksum with the byte b. /// /// /// the data value to add. The high byte of the int is ignored. /// public void Update(int bval) { //We could make a length 1 byte array and call update again, but I //would rather not have that overhead uint s1 = checksum & 0xFFFF; uint s2 = checksum >> 16; s1 = (s1 + ((uint)bval & 0xFF)) % BASE; s2 = (s1 + s2) % BASE; checksum = (s2 << 16) + s1; } /// /// Updates the checksum with the bytes taken from the array. /// /// /// buffer an array of bytes /// public void Update(byte[] buffer) { Update(buffer, 0, buffer.Length); } /// /// Updates the checksum with the bytes taken from the array. /// /// /// an array of bytes /// /// /// the start of the data used for this update /// /// /// the number of bytes to use for this update /// public void Update(byte[] buf, int off, int len) { if (buf == null) { throw new ArgumentNullException("buf"); } if (off < 0 || len < 0 || off + len > buf.Length) { throw new ArgumentOutOfRangeException(); } //(By Per Bothner) uint s1 = checksum & 0xFFFF; uint s2 = checksum >> 16; while (len > 0) { // We can defer the modulo operation: // s1 maximally grows from 65521 to 65521 + 255 * 3800 // s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31 int n = 3800; if (n > len) { n = len; } len -= n; while (--n >= 0) { s1 = s1 + (uint)(buf[off++] & 0xFF); s2 = s2 + s1; } s1 %= BASE; s2 %= BASE; } checksum = (s2 << 16) | s1; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Checksums/IChecksum.cs0000644000175000001440000000666711435763706025443 0ustar00gabeusers00000000000000// IChecksum.cs - Interface to compute a data checksum // Copyright (C) 2001 Mike Krueger // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. namespace PdfSharp.SharpZipLib.Checksums { /// /// Interface to compute a data checksum used by checked input/output streams. /// A data checksum can be updated by one byte or with a byte array. After each /// update the value of the current checksum can be returned by calling /// getValue. The complete checksum object can also be reset /// so it can be used again with new data. /// internal interface IChecksum { /// /// Returns the data checksum computed so far. /// long Value { get; } /// /// Resets the data checksum as if no update was ever called. /// void Reset(); /// /// Adds one byte to the data checksum. /// /// /// the data value to add. The high byte of the int is ignored. /// void Update(int bval); /// /// Updates the data checksum with the bytes taken from the array. /// /// /// buffer an array of bytes /// void Update(byte[] buffer); /// /// Adds the byte array to the data checksum. /// /// /// the buffer which contains the data /// /// /// the offset in the buffer where the data starts /// /// /// the length of the data /// void Update(byte[] buf, int off, int len); } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/0000777000175000001440000000000011533760020022024 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/Compression/0000777000175000001440000000000011533760020024325 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/Compression/InflaterHuffmanTree.cs0000644000175000001440000001535611435766646030600 0ustar00gabeusers00000000000000// InflaterHuffmanTree.cs // Copyright (C) 2001 Mike Krueger // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; using PdfSharp.SharpZipLib.Zip.Compression.Streams; namespace PdfSharp.SharpZipLib.Zip.Compression { /// /// Huffman tree used for inflation /// internal class InflaterHuffmanTree { static int MAX_BITLEN = 15; short[] tree; /// /// Literal length tree /// public static InflaterHuffmanTree defLitLenTree; /// /// Distance tree /// public static InflaterHuffmanTree defDistTree; static InflaterHuffmanTree() { try { byte[] codeLengths = new byte[288]; int i = 0; while (i < 144) { codeLengths[i++] = 8; } while (i < 256) { codeLengths[i++] = 9; } while (i < 280) { codeLengths[i++] = 7; } while (i < 288) { codeLengths[i++] = 8; } defLitLenTree = new InflaterHuffmanTree(codeLengths); codeLengths = new byte[32]; i = 0; while (i < 32) { codeLengths[i++] = 5; } defDistTree = new InflaterHuffmanTree(codeLengths); } catch (Exception) { throw new SharpZipBaseException("InflaterHuffmanTree: static tree length illegal"); } } /// /// Constructs a Huffman tree from the array of code lengths. /// /// /// the array of code lengths /// public InflaterHuffmanTree(byte[] codeLengths) { BuildTree(codeLengths); } void BuildTree(byte[] codeLengths) { int[] blCount = new int[MAX_BITLEN + 1]; int[] nextCode = new int[MAX_BITLEN + 1]; for (int i = 0; i < codeLengths.Length; i++) { int bits = codeLengths[i]; if (bits > 0) { blCount[bits]++; } } int code = 0; int treeSize = 512; for (int bits = 1; bits <= MAX_BITLEN; bits++) { nextCode[bits] = code; code += blCount[bits] << (16 - bits); if (bits >= 10) { /* We need an extra table for bit lengths >= 10. */ int start = nextCode[bits] & 0x1ff80; int end = code & 0x1ff80; treeSize += (end - start) >> (16 - bits); } } /* -jr comment this out! doesn't work for dynamic trees and pkzip 2.04g if (code != 65536) { throw new SharpZipBaseException("Code lengths don't add up properly."); } */ /* Now create and fill the extra tables from longest to shortest * bit len. This way the sub trees will be aligned. */ tree = new short[treeSize]; int treePtr = 512; for (int bits = MAX_BITLEN; bits >= 10; bits--) { int end = code & 0x1ff80; code -= blCount[bits] << (16 - bits); int start = code & 0x1ff80; for (int i = start; i < end; i += 1 << 7) { tree[DeflaterHuffman.BitReverse(i)] = (short) ((-treePtr << 4) | bits); treePtr += 1 << (bits-9); } } for (int i = 0; i < codeLengths.Length; i++) { int bits = codeLengths[i]; if (bits == 0) { continue; } code = nextCode[bits]; int revcode = DeflaterHuffman.BitReverse(code); if (bits <= 9) { do { tree[revcode] = (short) ((i << 4) | bits); revcode += 1 << bits; } while (revcode < 512); } else { int subTree = tree[revcode & 511]; int treeLen = 1 << (subTree & 15); subTree = -(subTree >> 4); do { tree[subTree | (revcode >> 9)] = (short) ((i << 4) | bits); revcode += 1 << bits; } while (revcode < treeLen); } nextCode[bits] = code + (1 << (16 - bits)); } } /// /// Reads the next symbol from input. The symbol is encoded using the /// huffman tree. /// /// /// input the input source. /// /// /// the next symbol, or -1 if not enough input is available. /// public int GetSymbol(StreamManipulator input) { int lookahead, symbol; if ((lookahead = input.PeekBits(9)) >= 0) { if ((symbol = tree[lookahead]) >= 0) { input.DropBits(symbol & 15); return symbol >> 4; } int subtree = -(symbol >> 4); int bitlen = symbol & 15; if ((lookahead = input.PeekBits(bitlen)) >= 0) { symbol = tree[subtree | (lookahead >> 9)]; input.DropBits(symbol & 15); return symbol >> 4; } else { int bits = input.AvailableBits; lookahead = input.PeekBits(bits); symbol = tree[subtree | (lookahead >> 9)]; if ((symbol & 15) <= bits) { input.DropBits(symbol & 15); return symbol >> 4; } else { return -1; } } } else { int bits = input.AvailableBits; lookahead = input.PeekBits(bits); symbol = tree[lookahead]; if (symbol >= 0 && (symbol & 15) <= bits) { input.DropBits(symbol & 15); return symbol >> 4; } else { return -1; } } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/Compression/Inflater.cs0000644000175000001440000006405211435766646026450 0ustar00gabeusers00000000000000// Inflater.cs // // Copyright (C) 2001 Mike Krueger // Copyright (C) 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; using PdfSharp.SharpZipLib.Checksums; using PdfSharp.SharpZipLib.Zip.Compression.Streams; namespace PdfSharp.SharpZipLib.Zip.Compression { /// /// Inflater is used to decompress data that has been compressed according /// to the "deflate" standard described in rfc1951. /// /// By default Zlib (rfc1950) headers and footers are expected in the input. /// You can use constructor public Inflater(bool noHeader) passing true /// if there is no Zlib header information /// /// The usage is as following. First you have to set some input with /// setInput(), then inflate() it. If inflate doesn't /// inflate any bytes there may be three reasons: ///
    ///
  • needsInput() returns true because the input buffer is empty. /// You have to provide more input with setInput(). /// NOTE: needsInput() also returns true when, the stream is finished. ///
  • ///
  • needsDictionary() returns true, you have to provide a preset /// dictionary with setDictionary().
  • ///
  • finished() returns true, the inflater has finished.
  • ///
/// Once the first output byte is produced, a dictionary will not be /// needed at a later stage. /// /// Authors of the original java version: John Leuner, Jochen Hoenicke ///
internal class Inflater { /// /// Copy lengths for literal codes 257..285 /// static int[] CPLENS = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 }; /// /// Extra bits for literal codes 257..285 /// static int[] CPLEXT = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 }; /// /// Copy offsets for distance codes 0..29 /// static int[] CPDIST = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 }; /// /// Extra bits for distance codes /// static int[] CPDEXT = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 }; /// /// These are the possible states for an inflater /// const int DECODE_HEADER = 0; const int DECODE_DICT = 1; const int DECODE_BLOCKS = 2; const int DECODE_STORED_LEN1 = 3; const int DECODE_STORED_LEN2 = 4; const int DECODE_STORED = 5; const int DECODE_DYN_HEADER = 6; const int DECODE_HUFFMAN = 7; const int DECODE_HUFFMAN_LENBITS = 8; const int DECODE_HUFFMAN_DIST = 9; const int DECODE_HUFFMAN_DISTBITS = 10; const int DECODE_CHKSUM = 11; const int FINISHED = 12; /// /// This variable contains the current state. /// int mode; /// /// The adler checksum of the dictionary or of the decompressed /// stream, as it is written in the header resp. footer of the /// compressed stream. /// Only valid if mode is DECODE_DICT or DECODE_CHKSUM. /// int readAdler; /// /// The number of bits needed to complete the current state. This /// is valid, if mode is DECODE_DICT, DECODE_CHKSUM, /// DECODE_HUFFMAN_LENBITS or DECODE_HUFFMAN_DISTBITS. /// int neededBits; int repLength; int repDist; int uncomprLen; /// /// True, if the last block flag was set in the last block of the /// inflated stream. This means that the stream ends after the /// current block. /// bool isLastBlock; /// /// The total number of inflated bytes. /// int totalOut; /// /// The total number of bytes set with setInput(). This is not the /// value returned by the TotalIn property, since this also includes the /// unprocessed input. /// int totalIn; /// /// This variable stores the noHeader flag that was given to the constructor. /// True means, that the inflated stream doesn't contain a Zlib header or /// footer. /// bool noHeader; StreamManipulator input; OutputWindow outputWindow; InflaterDynHeader dynHeader; InflaterHuffmanTree litlenTree, distTree; Adler32 adler; /// /// Creates a new inflater or RFC1951 decompressor /// RFC1950/Zlib headers and footers will be expected in the input data /// public Inflater() : this(false) { } /// /// Creates a new inflater. /// /// /// True if no RFC1950/Zlib header and footer fields are expected in the input data /// /// This is used for GZIPed/Zipped input. /// /// For compatibility with /// Sun JDK you should provide one byte of input more than needed in /// this case. /// public Inflater(bool noHeader) { this.noHeader = noHeader; this.adler = new Adler32(); input = new StreamManipulator(); outputWindow = new OutputWindow(); mode = noHeader ? DECODE_BLOCKS : DECODE_HEADER; } /// /// Resets the inflater so that a new stream can be decompressed. All /// pending input and output will be discarded. /// public void Reset() { mode = noHeader ? DECODE_BLOCKS : DECODE_HEADER; totalIn = totalOut = 0; input.Reset(); outputWindow.Reset(); dynHeader = null; litlenTree = null; distTree = null; isLastBlock = false; adler.Reset(); } /// /// Decodes a zlib/RFC1950 header. /// /// /// False if more input is needed. /// /// /// The header is invalid. /// private bool DecodeHeader() { int header = input.PeekBits(16); if (header < 0) { return false; } input.DropBits(16); /* The header is written in "wrong" byte order */ header = ((header << 8) | (header >> 8)) & 0xffff; if (header % 31 != 0) { throw new SharpZipBaseException("Header checksum illegal"); } if ((header & 0x0f00) != (Deflater.DEFLATED << 8)) { throw new SharpZipBaseException("Compression Method unknown"); } /* Maximum size of the backwards window in bits. * We currently ignore this, but we could use it to make the * inflater window more space efficient. On the other hand the * full window (15 bits) is needed most times, anyway. int max_wbits = ((header & 0x7000) >> 12) + 8; */ if ((header & 0x0020) == 0) { // Dictionary flag? mode = DECODE_BLOCKS; } else { mode = DECODE_DICT; neededBits = 32; } return true; } /// /// Decodes the dictionary checksum after the deflate header. /// /// /// False if more input is needed. /// private bool DecodeDict() { while (neededBits > 0) { int dictByte = input.PeekBits(8); if (dictByte < 0) { return false; } input.DropBits(8); readAdler = (readAdler << 8) | dictByte; neededBits -= 8; } return false; } /// /// Decodes the huffman encoded symbols in the input stream. /// /// /// false if more input is needed, true if output window is /// full or the current block ends. /// /// /// if deflated stream is invalid. /// private bool DecodeHuffman() { int free = outputWindow.GetFreeSpace(); while (free >= 258) { int symbol; switch (mode) { case DECODE_HUFFMAN: /* This is the inner loop so it is optimized a bit */ while (((symbol = litlenTree.GetSymbol(input)) & ~0xff) == 0) { outputWindow.Write(symbol); if (--free < 258) { return true; } } if (symbol < 257) { if (symbol < 0) { return false; } else { /* symbol == 256: end of block */ distTree = null; litlenTree = null; mode = DECODE_BLOCKS; return true; } } try { repLength = CPLENS[symbol - 257]; neededBits = CPLEXT[symbol - 257]; } catch (Exception) { throw new SharpZipBaseException("Illegal rep length code"); } goto case DECODE_HUFFMAN_LENBITS; /* fall through */ case DECODE_HUFFMAN_LENBITS: if (neededBits > 0) { mode = DECODE_HUFFMAN_LENBITS; int i = input.PeekBits(neededBits); if (i < 0) { return false; } input.DropBits(neededBits); repLength += i; } mode = DECODE_HUFFMAN_DIST; goto case DECODE_HUFFMAN_DIST;/* fall through */ case DECODE_HUFFMAN_DIST: symbol = distTree.GetSymbol(input); if (symbol < 0) { return false; } try { repDist = CPDIST[symbol]; neededBits = CPDEXT[symbol]; } catch (Exception) { throw new SharpZipBaseException("Illegal rep dist code"); } goto case DECODE_HUFFMAN_DISTBITS;/* fall through */ case DECODE_HUFFMAN_DISTBITS: if (neededBits > 0) { mode = DECODE_HUFFMAN_DISTBITS; int i = input.PeekBits(neededBits); if (i < 0) { return false; } input.DropBits(neededBits); repDist += i; } outputWindow.Repeat(repLength, repDist); free -= repLength; mode = DECODE_HUFFMAN; break; default: throw new SharpZipBaseException("Inflater unknown mode"); } } return true; } /// /// Decodes the adler checksum after the deflate stream. /// /// /// false if more input is needed. /// /// /// If checksum doesn't match. /// private bool DecodeChksum() { while (neededBits > 0) { int chkByte = input.PeekBits(8); if (chkByte < 0) { return false; } input.DropBits(8); readAdler = (readAdler << 8) | chkByte; neededBits -= 8; } if ((int)adler.Value != readAdler) { throw new SharpZipBaseException("Adler chksum doesn't match: " + (int)adler.Value + " vs. " + readAdler); } mode = FINISHED; return false; } /// /// Decodes the deflated stream. /// /// /// false if more input is needed, or if finished. /// /// /// if deflated stream is invalid. /// private bool Decode() { switch (mode) { case DECODE_HEADER: return DecodeHeader(); case DECODE_DICT: return DecodeDict(); case DECODE_CHKSUM: return DecodeChksum(); case DECODE_BLOCKS: if (isLastBlock) { if (noHeader) { mode = FINISHED; return false; } else { input.SkipToByteBoundary(); neededBits = 32; mode = DECODE_CHKSUM; return true; } } int type = input.PeekBits(3); if (type < 0) { return false; } input.DropBits(3); if ((type & 1) != 0) { isLastBlock = true; } switch (type >> 1) { case DeflaterConstants.STORED_BLOCK: input.SkipToByteBoundary(); mode = DECODE_STORED_LEN1; break; case DeflaterConstants.STATIC_TREES: litlenTree = InflaterHuffmanTree.defLitLenTree; distTree = InflaterHuffmanTree.defDistTree; mode = DECODE_HUFFMAN; break; case DeflaterConstants.DYN_TREES: dynHeader = new InflaterDynHeader(); mode = DECODE_DYN_HEADER; break; default: throw new SharpZipBaseException("Unknown block type " + type); } return true; case DECODE_STORED_LEN1: { if ((uncomprLen = input.PeekBits(16)) < 0) { return false; } input.DropBits(16); mode = DECODE_STORED_LEN2; } goto case DECODE_STORED_LEN2; /* fall through */ case DECODE_STORED_LEN2: { int nlen = input.PeekBits(16); if (nlen < 0) { return false; } input.DropBits(16); if (nlen != (uncomprLen ^ 0xffff)) { throw new SharpZipBaseException("broken uncompressed block"); } mode = DECODE_STORED; } goto case DECODE_STORED;/* fall through */ case DECODE_STORED: { int more = outputWindow.CopyStored(input, uncomprLen); uncomprLen -= more; if (uncomprLen == 0) { mode = DECODE_BLOCKS; return true; } return !input.IsNeedingInput; } case DECODE_DYN_HEADER: if (!dynHeader.Decode(input)) { return false; } litlenTree = dynHeader.BuildLitLenTree(); distTree = dynHeader.BuildDistTree(); mode = DECODE_HUFFMAN; goto case DECODE_HUFFMAN; /* fall through */ case DECODE_HUFFMAN: case DECODE_HUFFMAN_LENBITS: case DECODE_HUFFMAN_DIST: case DECODE_HUFFMAN_DISTBITS: return DecodeHuffman(); case FINISHED: return false; default: throw new SharpZipBaseException("Inflater.Decode unknown mode"); } } /// /// Sets the preset dictionary. This should only be called, if /// needsDictionary() returns true and it should set the same /// dictionary, that was used for deflating. The getAdler() /// function returns the checksum of the dictionary needed. /// /// /// The dictionary. /// public void SetDictionary(byte[] buffer) { SetDictionary(buffer, 0, buffer.Length); } /// /// Sets the preset dictionary. This should only be called, if /// needsDictionary() returns true and it should set the same /// dictionary, that was used for deflating. The getAdler() /// function returns the checksum of the dictionary needed. /// /// /// The dictionary. /// /// /// The offset into buffer where the dictionary starts. /// /// /// The length of the dictionary. /// /// /// No dictionary is needed. /// /// /// The adler checksum for the buffer is invalid /// public void SetDictionary(byte[] buffer, int offset, int len) { if (!IsNeedingDictionary) { throw new InvalidOperationException(); } adler.Update(buffer, offset, len); if ((int)adler.Value != readAdler) { throw new SharpZipBaseException("Wrong adler checksum"); } adler.Reset(); outputWindow.CopyDict(buffer, offset, len); mode = DECODE_BLOCKS; } /// /// Sets the input. This should only be called, if needsInput() /// returns true. /// /// /// the input. /// public void SetInput(byte[] buf) { SetInput(buf, 0, buf.Length); } /// /// Sets the input. This should only be called, if needsInput() /// returns true. /// /// /// The source of input data /// /// /// The offset into buffer where the input starts. /// /// /// The number of bytes of input to use. /// /// /// No input is needed. /// /// /// The off and/or len are wrong. /// public void SetInput(byte[] buffer, int offset, int length) { input.SetInput(buffer, offset, length); totalIn += length; } /// /// Inflates the compressed stream to the output buffer. If this /// returns 0, you should check, whether needsDictionary(), /// needsInput() or finished() returns true, to determine why no /// further output is produced. /// /// /// the output buffer. /// /// /// the number of bytes written to the buffer, 0 if no further /// output can be produced. /// /// /// if buf has length 0. /// /// /// if deflated stream is invalid. /// public int Inflate(byte[] buf) { return Inflate(buf, 0, buf.Length); } /// /// Inflates the compressed stream to the output buffer. If this /// returns 0, you should check, whether needsDictionary(), /// needsInput() or finished() returns true, to determine why no /// further output is produced. /// /// /// the output buffer. /// /// /// the offset into buffer where the output should start. /// /// /// the maximum length of the output. /// /// /// the number of bytes written to the buffer, 0 if no further output can be produced. /// /// /// if len is <= 0. /// /// /// if the offset and/or len are wrong. /// /// /// if deflated stream is invalid. /// public int Inflate(byte[] buf, int offset, int len) { if (len < 0) { throw new ArgumentOutOfRangeException("len < 0"); } // Special case: len may be zero if (len == 0) { if (IsFinished == false) {// -jr- 08-Nov-2003 INFLATE_BUG fix.. Decode(); } return 0; } /* // Check for correct buff, off, len triple if (off < 0 || off + len >= buf.Length) { throw new ArgumentException("off/len outside buf bounds"); } */ int count = 0; int more; do { if (mode != DECODE_CHKSUM) { /* Don't give away any output, if we are waiting for the * checksum in the input stream. * * With this trick we have always: * needsInput() and not finished() * implies more output can be produced. */ more = outputWindow.CopyOutput(buf, offset, len); adler.Update(buf, offset, more); offset += more; count += more; totalOut += more; len -= more; if (len == 0) { return count; } } } while (Decode() || (outputWindow.GetAvailable() > 0 && mode != DECODE_CHKSUM)); return count; } /// /// Returns true, if the input buffer is empty. /// You should then call setInput(). /// NOTE: This method also returns true when the stream is finished. /// public bool IsNeedingInput { get { return input.IsNeedingInput; } } /// /// Returns true, if a preset dictionary is needed to inflate the input. /// public bool IsNeedingDictionary { get { return mode == DECODE_DICT && neededBits == 0; } } /// /// Returns true, if the inflater has finished. This means, that no /// input is needed and no output can be produced. /// public bool IsFinished { get { return mode == FINISHED && outputWindow.GetAvailable() == 0; } } /// /// Gets the adler checksum. This is either the checksum of all /// uncompressed bytes returned by inflate(), or if needsDictionary() /// returns true (and thus no output was yet produced) this is the /// adler checksum of the expected dictionary. /// /// /// the adler checksum. /// public int Adler { get { return IsNeedingDictionary ? readAdler : (int)adler.Value; } } /// /// Gets the total number of output bytes returned by inflate(). /// /// /// the total number of output bytes. /// public int TotalOut { get { return totalOut; } } /// /// Gets the total number of processed compressed input bytes. /// /// /// The total number of bytes of processed input bytes. /// public int TotalIn { get { return totalIn - RemainingInput; } } #if TEST_HAK /// /// -jr test hak trying to figure out a bug /// public int UnseenInput { get { return totalIn - ((input.AvailableBits + 7) >> 3); } } /// /// -jr test hak trying to figure out a bug /// public int PlainTotalIn { get { return totalIn; } } #endif /// /// Gets the number of unprocessed input bytes. Useful, if the end of the /// stream is reached and you want to further process the bytes after /// the deflate stream. /// /// /// The number of bytes of the input which have not been processed. /// public int RemainingInput { get { return input.AvailableBytes; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/Compression/Deflater.cs0000644000175000001440000004557011435766646026436 0ustar00gabeusers00000000000000// Deflater.cs // // Copyright (C) 2001 Mike Krueger // Copyright (C) 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace PdfSharp.SharpZipLib.Zip.Compression { /// /// This is the Deflater class. The deflater class compresses input /// with the deflate algorithm described in RFC 1951. It has several /// compression levels and three different strategies described below. /// /// This class is not thread safe. This is inherent in the API, due /// to the split of deflate and setInput. /// /// Author of the original java version: Jochen Hoenicke /// internal class Deflater { /// /// The best and slowest compression level. This tries to find very /// long and distant string repetitions. /// public static int BEST_COMPRESSION = 9; /// /// The worst but fastest compression level. /// public static int BEST_SPEED = 1; /// /// The default compression level. /// public static int DEFAULT_COMPRESSION = -1; /// /// This level won't compress at all but output uncompressed blocks. /// public static int NO_COMPRESSION = 0; /// /// The compression method. This is the only method supported so far. /// There is no need to use this constant at all. /// public static int DEFLATED = 8; /* * The Deflater can do the following state transitions: * * (1) -> INIT_STATE ----> INIT_FINISHING_STATE ---. * / | (2) (5) | * / v (5) | * (3)| SETDICT_STATE ---> SETDICT_FINISHING_STATE |(3) * \ | (3) | ,-------' * | | | (3) / * v v (5) v v * (1) -> BUSY_STATE ----> FINISHING_STATE * | (6) * v * FINISHED_STATE * \_____________________________________/ * | (7) * v * CLOSED_STATE * * (1) If we should produce a header we start in INIT_STATE, otherwise * we start in BUSY_STATE. * (2) A dictionary may be set only when we are in INIT_STATE, then * we change the state as indicated. * (3) Whether a dictionary is set or not, on the first call of deflate * we change to BUSY_STATE. * (4) -- intentionally left blank -- :) * (5) FINISHING_STATE is entered, when flush() is called to indicate that * there is no more INPUT. There are also states indicating, that * the header wasn't written yet. * (6) FINISHED_STATE is entered, when everything has been flushed to the * internal pending output buffer. * (7) At any time (7) * */ private static int IS_SETDICT = 0x01; private static int IS_FLUSHING = 0x04; private static int IS_FINISHING = 0x08; private static int INIT_STATE = 0x00; private static int SETDICT_STATE = 0x01; // private static int INIT_FINISHING_STATE = 0x08; // private static int SETDICT_FINISHING_STATE = 0x09; private static int BUSY_STATE = 0x10; private static int FLUSHING_STATE = 0x14; private static int FINISHING_STATE = 0x1c; private static int FINISHED_STATE = 0x1e; private static int CLOSED_STATE = 0x7f; /// /// Compression level. /// private int level; /// /// If true no Zlib/RFC1950 headers or footers are generated /// private bool noZlibHeaderOrFooter; /// /// The current state. /// private int state; /// /// The total bytes of output written. /// private long totalOut; /// /// The pending output. /// private DeflaterPending pending; /// /// The deflater engine. /// private DeflaterEngine engine; /// /// Creates a new deflater with default compression level. /// public Deflater() : this(DEFAULT_COMPRESSION, false) { } /// /// Creates a new deflater with given compression level. /// /// /// the compression level, a value between NO_COMPRESSION /// and BEST_COMPRESSION, or DEFAULT_COMPRESSION. /// /// if lvl is out of range. public Deflater(int lvl) : this(lvl, false) { } /// /// Creates a new deflater with given compression level. /// /// /// the compression level, a value between NO_COMPRESSION /// and BEST_COMPRESSION. /// /// /// true, if we should suppress the Zlib/RFC1950 header at the /// beginning and the adler checksum at the end of the output. This is /// useful for the GZIP/PKZIP formats. /// /// if lvl is out of range. public Deflater(int level, bool noZlibHeaderOrFooter) { if (level == DEFAULT_COMPRESSION) { level = 6; } else if (level < NO_COMPRESSION || level > BEST_COMPRESSION) { throw new ArgumentOutOfRangeException("level"); } pending = new DeflaterPending(); engine = new DeflaterEngine(pending); this.noZlibHeaderOrFooter = noZlibHeaderOrFooter; SetStrategy(DeflateStrategy.Default); SetLevel(level); Reset(); } /// /// Resets the deflater. The deflater acts afterwards as if it was /// just created with the same compression level and strategy as it /// had before. /// public void Reset() { state = (noZlibHeaderOrFooter ? BUSY_STATE : INIT_STATE); totalOut = 0; pending.Reset(); engine.Reset(); } /// /// Gets the current adler checksum of the data that was processed so far. /// public int Adler { get { return engine.Adler; } } /// /// Gets the number of input bytes processed so far. /// public int TotalIn { get { return engine.TotalIn; } } /// /// Gets the number of output bytes so far. /// public long TotalOut { get { return totalOut; } } /// /// Flushes the current input block. Further calls to deflate() will /// produce enough output to inflate everything in the current input /// block. This is not part of Sun's JDK so I have made it package /// private. It is used by DeflaterOutputStream to implement /// flush(). /// public void Flush() { state |= IS_FLUSHING; } /// /// Finishes the deflater with the current input block. It is an error /// to give more input after this method was called. This method must /// be called to force all bytes to be flushed. /// public void Finish() { state |= IS_FLUSHING | IS_FINISHING; } /// /// Returns true if the stream was finished and no more output bytes /// are available. /// public bool IsFinished { get { return state == FINISHED_STATE && pending.IsFlushed; } } /// /// Returns true, if the input buffer is empty. /// You should then call setInput(). /// NOTE: This method can also return true when the stream /// was finished. /// public bool IsNeedingInput { get { return engine.NeedsInput(); } } /// /// Sets the data which should be compressed next. This should be only /// called when needsInput indicates that more input is needed. /// If you call setInput when needsInput() returns false, the /// previous input that is still pending will be thrown away. /// The given byte array should not be changed, before needsInput() returns /// true again. /// This call is equivalent to setInput(input, 0, input.length). /// /// /// the buffer containing the input data. /// /// /// if the buffer was finished() or ended(). /// public void SetInput(byte[] input) { SetInput(input, 0, input.Length); } /// /// Sets the data which should be compressed next. This should be /// only called when needsInput indicates that more input is needed. /// The given byte array should not be changed, before needsInput() returns /// true again. /// /// /// the buffer containing the input data. /// /// /// the start of the data. /// /// /// the length of the data. /// /// /// if the buffer was finished() or ended() or if previous input is still pending. /// public void SetInput(byte[] input, int off, int len) { if ((state & IS_FINISHING) != 0) { throw new InvalidOperationException("finish()/end() already called"); } engine.SetInput(input, off, len); } /// /// Sets the compression level. There is no guarantee of the exact /// position of the change, but if you call this when needsInput is /// true the change of compression level will occur somewhere near /// before the end of the so far given input. /// /// /// the new compression level. /// public void SetLevel(int lvl) { if (lvl == DEFAULT_COMPRESSION) { lvl = 6; } else if (lvl < NO_COMPRESSION || lvl > BEST_COMPRESSION) { throw new ArgumentOutOfRangeException("lvl"); } if (level != lvl) { level = lvl; engine.SetLevel(lvl); } } /// /// Get current compression level /// /// Returns the current compression level public int GetLevel() { return level; } /// /// Sets the compression strategy. Strategy is one of /// DEFAULT_STRATEGY, HUFFMAN_ONLY and FILTERED. For the exact /// position where the strategy is changed, the same as for /// setLevel() applies. /// /// /// The new compression strategy. /// public void SetStrategy(DeflateStrategy strategy) { engine.Strategy = strategy; } /// /// Deflates the current input block with to the given array. /// /// /// The buffer where compressed data is stored /// /// /// The number of compressed bytes added to the output, or 0 if either /// needsInput() or finished() returns true or length is zero. /// public int Deflate(byte[] output) { return Deflate(output, 0, output.Length); } /// /// Deflates the current input block to the given array. /// /// /// Buffer to store the compressed data. /// /// /// Offset into the output array. /// /// /// The maximum number of bytes that may be stored. /// /// /// The number of compressed bytes added to the output, or 0 if either /// needsInput() or finished() returns true or length is zero. /// /// /// If end() was previously called. /// /// /// If offset and/or length don't match the array length. /// public int Deflate(byte[] output, int offset, int length) { int origLength = length; if (state == CLOSED_STATE) { throw new InvalidOperationException("Deflater closed"); } if (state < BUSY_STATE) { /* output header */ int header = (DEFLATED + ((DeflaterConstants.MAX_WBITS - 8) << 4)) << 8; int level_flags = (level - 1) >> 1; if (level_flags < 0 || level_flags > 3) { level_flags = 3; } header |= level_flags << 6; if ((state & IS_SETDICT) != 0) { /* Dictionary was set */ header |= DeflaterConstants.PRESET_DICT; } header += 31 - (header % 31); pending.WriteShortMSB(header); if ((state & IS_SETDICT) != 0) { int chksum = engine.Adler; engine.ResetAdler(); pending.WriteShortMSB(chksum >> 16); pending.WriteShortMSB(chksum & 0xffff); } state = BUSY_STATE | (state & (IS_FLUSHING | IS_FINISHING)); } for (; ; ) { int count = pending.Flush(output, offset, length); offset += count; totalOut += count; length -= count; if (length == 0 || state == FINISHED_STATE) { break; } if (!engine.Deflate((state & IS_FLUSHING) != 0, (state & IS_FINISHING) != 0)) { if (state == BUSY_STATE) { /* We need more input now */ return origLength - length; } else if (state == FLUSHING_STATE) { if (level != NO_COMPRESSION) { /* We have to supply some lookahead. 8 bit lookahead * is needed by the zlib inflater, and we must fill * the next byte, so that all bits are flushed. */ int neededbits = 8 + ((-pending.BitCount) & 7); while (neededbits > 0) { /* write a static tree block consisting solely of * an EOF: */ pending.WriteBits(2, 10); neededbits -= 10; } } state = BUSY_STATE; } else if (state == FINISHING_STATE) { pending.AlignToByte(); // Compressed data is complete. Write footer information if required. if (!noZlibHeaderOrFooter) { int adler = engine.Adler; pending.WriteShortMSB(adler >> 16); pending.WriteShortMSB(adler & 0xffff); } state = FINISHED_STATE; } } } return origLength - length; } /// /// Sets the dictionary which should be used in the deflate process. /// This call is equivalent to setDictionary(dict, 0, dict.Length). /// /// /// the dictionary. /// /// /// if setInput () or deflate () were already called or another dictionary was already set. /// public void SetDictionary(byte[] dict) { SetDictionary(dict, 0, dict.Length); } /// /// Sets the dictionary which should be used in the deflate process. /// The dictionary is a byte array containing strings that are /// likely to occur in the data which should be compressed. The /// dictionary is not stored in the compressed output, only a /// checksum. To decompress the output you need to supply the same /// dictionary again. /// /// /// The dictionary data /// /// /// An offset into the dictionary. /// /// /// The length of the dictionary data to use /// /// /// If setInput () or deflate () were already called or another dictionary was already set. /// public void SetDictionary(byte[] dict, int offset, int length) { if (state != INIT_STATE) { throw new InvalidOperationException(); } state = SETDICT_STATE; engine.SetDictionary(dict, offset, length); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/Compression/DeflaterConstants.cs0000644000175000001440000001365011435763706030317 0ustar00gabeusers00000000000000// DeflaterConstants.cs // // Copyright (C) 2001 Mike Krueger // Copyright (C) 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace PdfSharp.SharpZipLib.Zip.Compression { /// /// This class contains constants used for deflation. /// internal class DeflaterConstants { /// /// Set to true to enable debugging /// public static bool DEBUGGING { // Prevent warning 'CS0162: Unreachable code detected' when referencing DEBUGGING get { return false; } } /// /// Written to Zip file to identify a stored block /// public const int STORED_BLOCK = 0; /// /// Identifies static tree in Zip file /// public const int STATIC_TREES = 1; /// /// Identifies dynamic tree in Zip file /// public const int DYN_TREES = 2; /// /// Header flag indicating a preset dictionary for deflation /// public const int PRESET_DICT = 0x20; /// /// Sets internal buffer sizes for Huffman encoding /// public const int DEFAULT_MEM_LEVEL = 8; /// /// Internal compression engine constant /// public const int MAX_MATCH = 258; /// /// Internal compression engine constant /// public const int MIN_MATCH = 3; /// /// Internal compression engine constant /// public const int MAX_WBITS = 15; /// /// Internal compression engine constant /// public const int WSIZE = 1 << MAX_WBITS; /// /// Internal compression engine constant /// public const int WMASK = WSIZE - 1; /// /// Internal compression engine constant /// public const int HASH_BITS = DEFAULT_MEM_LEVEL + 7; /// /// Internal compression engine constant /// public const int HASH_SIZE = 1 << HASH_BITS; /// /// Internal compression engine constant /// public const int HASH_MASK = HASH_SIZE - 1; /// /// Internal compression engine constant /// public const int HASH_SHIFT = (HASH_BITS + MIN_MATCH - 1) / MIN_MATCH; /// /// Internal compression engine constant /// public const int MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; /// /// Internal compression engine constant /// public const int MAX_DIST = WSIZE - MIN_LOOKAHEAD; /// /// Internal compression engine constant /// public const int PENDING_BUF_SIZE = 1 << (DEFAULT_MEM_LEVEL + 8); /// /// Internal compression engine constant /// public static int MAX_BLOCK_SIZE = Math.Min(65535, PENDING_BUF_SIZE - 5); /// /// Internal compression engine constant /// public const int DEFLATE_STORED = 0; /// /// Internal compression engine constant /// public const int DEFLATE_FAST = 1; /// /// Internal compression engine constant /// public const int DEFLATE_SLOW = 2; /// /// Internal compression engine constant /// public static int[] GOOD_LENGTH = { 0, 4, 4, 4, 4, 8, 8, 8, 32, 32 }; /// /// Internal compression engine constant /// public static int[] MAX_LAZY = { 0, 4, 5, 6, 4, 16, 16, 32, 128, 258 }; /// /// Internal compression engine constant /// public static int[] NICE_LENGTH = { 0, 8, 16, 32, 16, 32, 128, 128, 258, 258 }; /// /// Internal compression engine constant /// public static int[] MAX_CHAIN = { 0, 4, 8, 32, 16, 32, 128, 256, 1024, 4096 }; /// /// Internal compression engine constant /// public static int[] COMPR_FUNC = { 0, 1, 1, 1, 1, 2, 2, 2, 2, 2 }; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/Compression/DeflaterEngine.cs0000644000175000001440000004743611435763706027561 0ustar00gabeusers00000000000000// DeflaterEngine.cs // // Copyright (C) 2001 Mike Krueger // Copyright (C) 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; using PdfSharp.SharpZipLib.Checksums; namespace PdfSharp.SharpZipLib.Zip.Compression { /// /// Strategies for deflater /// internal enum DeflateStrategy { /// /// The default strategy /// Default = 0, /// /// This strategy will only allow longer string repetitions. It is /// useful for random data with a small character set. /// Filtered = 1, /// /// This strategy will not look for string repetitions at all. It /// only encodes with Huffman trees (which means, that more common /// characters get a smaller encoding. /// HuffmanOnly = 2 } /// /// Low level compression engine for deflate algorithm which uses a 32K sliding window /// with secondary compression from Huffman/Shannon-Fano codes. /// internal class DeflaterEngine : DeflaterConstants { static int TOO_FAR = 4096; int ins_h; short[] head; short[] prev; int matchStart, matchLen; bool prevAvailable; int blockStart; int strstart, lookahead; byte[] window; DeflateStrategy strategy; int max_chain, max_lazy, niceLength, goodLength; /// /// The current compression function. /// int comprFunc; /// /// The input data for compression. /// byte[] inputBuf; /// /// The total bytes of input read. /// int totalIn; /// /// The offset into inputBuf, where input data starts. /// int inputOff; /// /// The end offset of the input data. /// int inputEnd; DeflaterPending pending; DeflaterHuffman huffman; /// /// The adler checksum /// Adler32 adler; /// /// Construct instance with pending buffer /// /// /// Pending buffer to use /// > public DeflaterEngine(DeflaterPending pending) { this.pending = pending; huffman = new DeflaterHuffman(pending); adler = new Adler32(); window = new byte[2 * WSIZE]; head = new short[HASH_SIZE]; prev = new short[WSIZE]; /* We start at index 1, to avoid an implementation deficiency, that * we cannot build a repeat pattern at index 0. */ blockStart = strstart = 1; } /// /// Reset internal state /// public void Reset() { huffman.Reset(); adler.Reset(); blockStart = strstart = 1; lookahead = 0; totalIn = 0; prevAvailable = false; matchLen = MIN_MATCH - 1; for (int i = 0; i < HASH_SIZE; i++) { head[i] = 0; } for (int i = 0; i < WSIZE; i++) { prev[i] = 0; } } /// /// Reset Adler checksum /// public void ResetAdler() { adler.Reset(); } /// /// Get current value of Adler checksum /// public int Adler { get { return (int)adler.Value; } } /// /// Total data processed /// public int TotalIn { get { return totalIn; } } /// /// Get/set the deflate strategy /// public DeflateStrategy Strategy { get { return strategy; } set { strategy = value; } } /// /// Set the deflate level (0-9) /// public void SetLevel(int lvl) { goodLength = DeflaterConstants.GOOD_LENGTH[lvl]; max_lazy = DeflaterConstants.MAX_LAZY[lvl]; niceLength = DeflaterConstants.NICE_LENGTH[lvl]; max_chain = DeflaterConstants.MAX_CHAIN[lvl]; if (DeflaterConstants.COMPR_FUNC[lvl] != comprFunc) { // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("Change from " + comprFunc + " to " // + DeflaterConstants.COMPR_FUNC[lvl]); // } switch (comprFunc) { case DEFLATE_STORED: if (strstart > blockStart) { huffman.FlushStoredBlock(window, blockStart, strstart - blockStart, false); blockStart = strstart; } UpdateHash(); break; case DEFLATE_FAST: if (strstart > blockStart) { huffman.FlushBlock(window, blockStart, strstart - blockStart, false); blockStart = strstart; } break; case DEFLATE_SLOW: if (prevAvailable) { huffman.TallyLit(window[strstart-1] & 0xff); } if (strstart > blockStart) { huffman.FlushBlock(window, blockStart, strstart - blockStart, false); blockStart = strstart; } prevAvailable = false; matchLen = MIN_MATCH - 1; break; } comprFunc = COMPR_FUNC[lvl]; } } void UpdateHash() { // if (DEBUGGING) { // //Console.WriteLine("updateHash: "+strstart); // } ins_h = (window[strstart] << HASH_SHIFT) ^ window[strstart + 1]; } int InsertString() { short match; int hash = ((ins_h << HASH_SHIFT) ^ window[strstart + (MIN_MATCH -1)]) & HASH_MASK; // if (DEBUGGING) { // if (hash != (((window[strstart] << (2*HASH_SHIFT)) ^ // (window[strstart + 1] << HASH_SHIFT) ^ // (window[strstart + 2])) & HASH_MASK)) { // throw new SharpZipBaseException("hash inconsistent: " + hash + "/" // +window[strstart] + "," // +window[strstart+1] + "," // +window[strstart+2] + "," + HASH_SHIFT); // } // } prev[strstart & WMASK] = match = head[hash]; head[hash] = (short)strstart; ins_h = hash; return match & 0xffff; } void SlideWindow() { Array.Copy(window, WSIZE, window, 0, WSIZE); matchStart -= WSIZE; strstart -= WSIZE; blockStart -= WSIZE; /* Slide the hash table (could be avoided with 32 bit values * at the expense of memory usage). */ for (int i = 0; i < HASH_SIZE; ++i) { int m = head[i] & 0xffff; head[i] = (short)(m >= WSIZE ? (m - WSIZE) : 0); } /* Slide the prev table. */ for (int i = 0; i < WSIZE; i++) { int m = prev[i] & 0xffff; prev[i] = (short)(m >= WSIZE ? (m - WSIZE) : 0); } } /// /// Fill the window /// public void FillWindow() { /* If the window is almost full and there is insufficient lookahead, * move the upper half to the lower one to make room in the upper half. */ if (strstart >= WSIZE + MAX_DIST) { SlideWindow(); } /* If there is not enough lookahead, but still some input left, * read in the input */ while (lookahead < DeflaterConstants.MIN_LOOKAHEAD && inputOff < inputEnd) { int more = 2 * WSIZE - lookahead - strstart; if (more > inputEnd - inputOff) { more = inputEnd - inputOff; } System.Array.Copy(inputBuf, inputOff, window, strstart + lookahead, more); adler.Update(inputBuf, inputOff, more); inputOff += more; totalIn += more; lookahead += more; } if (lookahead >= MIN_MATCH) { UpdateHash(); } } bool FindLongestMatch(int curMatch) { int chainLength = this.max_chain; int niceLength = this.niceLength; short[] prev = this.prev; int scan = this.strstart; int match; int best_end = this.strstart + matchLen; int best_len = Math.Max(matchLen, MIN_MATCH - 1); int limit = Math.Max(strstart - MAX_DIST, 0); int strend = strstart + MAX_MATCH - 1; byte scan_end1 = window[best_end - 1]; byte scan_end = window[best_end]; /* Do not waste too much time if we already have a good match: */ if (best_len >= this.goodLength) { chainLength >>= 2; } /* Do not look for matches beyond the end of the input. This is necessary * to make deflate deterministic. */ if (niceLength > lookahead) { niceLength = lookahead; } if (DeflaterConstants.DEBUGGING && strstart > 2 * WSIZE - MIN_LOOKAHEAD) { throw new InvalidOperationException("need lookahead"); } do { if (DeflaterConstants.DEBUGGING && curMatch >= strstart) { throw new InvalidOperationException("future match"); } if (window[curMatch + best_len] != scan_end || window[curMatch + best_len - 1] != scan_end1 || window[curMatch] != window[scan] || window[curMatch + 1] != window[scan + 1]) { continue; } match = curMatch + 2; scan += 2; /* We check for insufficient lookahead only every 8th comparison; * the 256th check will be made at strstart + 258. */ while (window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && window[++scan] == window[++match] && scan < strend) ; if (scan > best_end) { // if (DeflaterConstants.DEBUGGING && ins_h == 0) // System.err.println("Found match: "+curMatch+"-"+(scan-strstart)); matchStart = curMatch; best_end = scan; best_len = scan - strstart; if (best_len >= niceLength) { break; } scan_end1 = window[best_end - 1]; scan_end = window[best_end]; } scan = strstart; } while ((curMatch = (prev[curMatch & WMASK] & 0xffff)) > limit && --chainLength != 0); matchLen = Math.Min(best_len, lookahead); return matchLen >= MIN_MATCH; } /// /// Set compression dictionary /// public void SetDictionary(byte[] buffer, int offset, int length) { if (DeflaterConstants.DEBUGGING && strstart != 1) { throw new InvalidOperationException("strstart not 1"); } adler.Update(buffer, offset, length); if (length < MIN_MATCH) { return; } if (length > MAX_DIST) { offset += length - MAX_DIST; length = MAX_DIST; } System.Array.Copy(buffer, offset, window, strstart, length); UpdateHash(); --length; while (--length > 0) { InsertString(); strstart++; } strstart += 2; blockStart = strstart; } bool DeflateStored(bool flush, bool finish) { if (!flush && lookahead == 0) { return false; } strstart += lookahead; lookahead = 0; int storedLen = strstart - blockStart; if ((storedLen >= DeflaterConstants.MAX_BLOCK_SIZE) || /* Block is full */ (blockStart < WSIZE && storedLen >= MAX_DIST) || /* Block may move out of window */ flush) { bool lastBlock = finish; if (storedLen > DeflaterConstants.MAX_BLOCK_SIZE) { storedLen = DeflaterConstants.MAX_BLOCK_SIZE; lastBlock = false; } // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("storedBlock["+storedLen+","+lastBlock+"]"); // } huffman.FlushStoredBlock(window, blockStart, storedLen, lastBlock); blockStart += storedLen; return !lastBlock; } return true; } private bool DeflateFast(bool flush, bool finish) { if (lookahead < MIN_LOOKAHEAD && !flush) { return false; } while (lookahead >= MIN_LOOKAHEAD || flush) { if (lookahead == 0) { /* We are flushing everything */ huffman.FlushBlock(window, blockStart, strstart - blockStart, finish); blockStart = strstart; return false; } if (strstart > 2 * WSIZE - MIN_LOOKAHEAD) { /* slide window, as findLongestMatch needs this. * This should only happen when flushing and the window * is almost full. */ SlideWindow(); } int hashHead; if (lookahead >= MIN_MATCH && (hashHead = InsertString()) != 0 && strategy != DeflateStrategy.HuffmanOnly && strstart - hashHead <= MAX_DIST && FindLongestMatch(hashHead)) { /* longestMatch sets matchStart and matchLen */ // if (DeflaterConstants.DEBUGGING) { // for (int i = 0 ; i < matchLen; i++) { // if (window[strstart+i] != window[matchStart + i]) { // throw new SharpZipBaseException(); // } // } // } // -jr- Hak hak hak this stops problems with fast/low compression and index out of range if (huffman.TallyDist(strstart - matchStart, matchLen)) { bool lastBlock = finish && lookahead == 0; huffman.FlushBlock(window, blockStart, strstart - blockStart, lastBlock); blockStart = strstart; } lookahead -= matchLen; if (matchLen <= max_lazy && lookahead >= MIN_MATCH) { while (--matchLen > 0) { ++strstart; InsertString(); } ++strstart; } else { strstart += matchLen; if (lookahead >= MIN_MATCH - 1) { UpdateHash(); } } matchLen = MIN_MATCH - 1; continue; } else { /* No match found */ huffman.TallyLit(window[strstart] & 0xff); ++strstart; --lookahead; } if (huffman.IsFull()) { bool lastBlock = finish && lookahead == 0; huffman.FlushBlock(window, blockStart, strstart - blockStart, lastBlock); blockStart = strstart; return !lastBlock; } } return true; } bool DeflateSlow(bool flush, bool finish) { if (lookahead < MIN_LOOKAHEAD && !flush) { return false; } while (lookahead >= MIN_LOOKAHEAD || flush) { if (lookahead == 0) { if (prevAvailable) { huffman.TallyLit(window[strstart-1] & 0xff); } prevAvailable = false; /* We are flushing everything */ if (DeflaterConstants.DEBUGGING && !flush) { throw new SharpZipBaseException("Not flushing, but no lookahead"); } huffman.FlushBlock(window, blockStart, strstart - blockStart, finish); blockStart = strstart; return false; } if (strstart >= 2 * WSIZE - MIN_LOOKAHEAD) { /* slide window, as findLongestMatch need this. * This should only happen when flushing and the window * is almost full. */ SlideWindow(); } int prevMatch = matchStart; int prevLen = matchLen; if (lookahead >= MIN_MATCH) { int hashHead = InsertString(); if (strategy != DeflateStrategy.HuffmanOnly && hashHead != 0 && strstart - hashHead <= MAX_DIST && FindLongestMatch(hashHead)) { /* longestMatch sets matchStart and matchLen */ /* Discard match if too small and too far away */ if (matchLen <= 5 && (strategy == DeflateStrategy.Filtered || (matchLen == MIN_MATCH && strstart - matchStart > TOO_FAR))) { matchLen = MIN_MATCH - 1; } } } /* previous match was better */ if (prevLen >= MIN_MATCH && matchLen <= prevLen) { // if (DeflaterConstants.DEBUGGING) { // for (int i = 0 ; i < matchLen; i++) { // if (window[strstart-1+i] != window[prevMatch + i]) // throw new SharpZipBaseException(); // } // } huffman.TallyDist(strstart - 1 - prevMatch, prevLen); prevLen -= 2; do { strstart++; lookahead--; if (lookahead >= MIN_MATCH) { InsertString(); } } while (--prevLen > 0); strstart ++; lookahead--; prevAvailable = false; matchLen = MIN_MATCH - 1; } else { if (prevAvailable) { huffman.TallyLit(window[strstart-1] & 0xff); } prevAvailable = true; strstart++; lookahead--; } if (huffman.IsFull()) { int len = strstart - blockStart; if (prevAvailable) { len--; } bool lastBlock = (finish && lookahead == 0 && !prevAvailable); huffman.FlushBlock(window, blockStart, len, lastBlock); blockStart += len; return !lastBlock; } } return true; } /// /// Deflate drives actual compression of data /// public bool Deflate(bool flush, bool finish) { bool progress; do { FillWindow(); bool canFlush = flush && inputOff == inputEnd; // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("window: ["+blockStart+","+strstart+"," // +lookahead+"], "+comprFunc+","+canFlush); // } switch (comprFunc) { case DEFLATE_STORED: progress = DeflateStored(canFlush, finish); break; case DEFLATE_FAST: progress = DeflateFast(canFlush, finish); break; case DEFLATE_SLOW: progress = DeflateSlow(canFlush, finish); break; default: throw new InvalidOperationException("unknown comprFunc"); } } while (pending.IsFlushed && progress); /* repeat while we have no pending output and progress was made */ return progress; } /// Sets input data to be deflated. Should only be called when NeedsInput() /// returns true public void SetInput(byte[] buf, int off, int len) { if (inputOff < inputEnd) { throw new InvalidOperationException("Old input was not completely processed"); } int end = off + len; /* We want to throw an ArrayIndexOutOfBoundsException early. The * check is very tricky: it also handles integer wrap around. */ if (0 > off || off > end || end > buf.Length) { throw new ArgumentOutOfRangeException(); } inputBuf = buf; inputOff = off; inputEnd = end; } /// /// Return true if input is needed via SetInput /// public bool NeedsInput() { return inputEnd == inputOff; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/Compression/DeflaterPending.cs0000644000175000001440000000456411435766646027741 0ustar00gabeusers00000000000000// DeflaterPending.cs // // Copyright (C) 2001 Mike Krueger // Copyright (C) 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. namespace PdfSharp.SharpZipLib.Zip.Compression { /// /// This class stores the pending output of the Deflater. /// /// Author of the original java version: Jochen Hoenicke /// internal class DeflaterPending : PendingBuffer { /// /// Construct instance with default buffer size /// public DeflaterPending() : base(DeflaterConstants.PENDING_BUF_SIZE) { } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/Compression/DeflaterHuffman.cs0000644000175000001440000007003711435766646027737 0ustar00gabeusers00000000000000// DeflaterHuffman.cs // // Copyright (C) 2001 Mike Krueger // Copyright (C) 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace PdfSharp.SharpZipLib.Zip.Compression { /// /// This is the DeflaterHuffman class. /// /// This class is not thread safe. This is inherent in the API, due /// to the split of deflate and setInput. /// /// Author of the original java version: Jochen Hoenicke /// internal class DeflaterHuffman { static int BUFSIZE = 1 << (DeflaterConstants.DEFAULT_MEM_LEVEL + 6); static int LITERAL_NUM = 286; static int DIST_NUM = 30; static int BITLEN_NUM = 19; static int REP_3_6 = 16; static int REP_3_10 = 17; static int REP_11_138 = 18; static int EOF_SYMBOL = 256; static int[] BL_ORDER = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; static byte[] bit4Reverse = { 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 }; /// /// Not documented /// internal class Tree { /// /// Not documented /// public short[] freqs; /// /// Not documented /// public byte[] length; /// /// Not documented /// public int minNumCodes; /// /// Not documented /// public int numCodes; short[] codes; int[] bl_counts; int maxLength; DeflaterHuffman dh; /// /// Not documented /// public Tree(DeflaterHuffman dh, int elems, int minCodes, int maxLength) { this.dh = dh; this.minNumCodes = minCodes; this.maxLength = maxLength; freqs = new short[elems]; bl_counts = new int[maxLength]; } /// /// Resets the internal state of the tree /// public void Reset() { for (int i = 0; i < freqs.Length; i++) { freqs[i] = 0; } codes = null; length = null; } /// /// Not documented /// public void WriteSymbol(int code) { // if (DeflaterConstants.DEBUGGING) { // freqs[code]--; // // Console.Write("writeSymbol("+freqs.length+","+code+"): "); // } dh.pending.WriteBits(codes[code] & 0xffff, length[code]); } /// /// Check that at least one frequency is non-zero /// /// /// No frequencies are non-zero /// public void CheckEmpty() { bool empty = true; for (int i = 0; i < freqs.Length; i++) { if (freqs[i] != 0) { //Console.WriteLine("freqs[" + i + "] == " + freqs[i]); empty = false; } } if (!empty) { throw new SharpZipBaseException("!Empty"); } //Console.WriteLine("checkEmpty suceeded!"); } /// /// Set static codes and length /// /// new codes /// length for new codes public void SetStaticCodes(short[] stCodes, byte[] stLength) { codes = stCodes; length = stLength; } /// /// Build dynamic codes and lengths /// public void BuildCodes() { int numSymbols = freqs.Length; int[] nextCode = new int[maxLength]; int code = 0; codes = new short[freqs.Length]; // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("buildCodes: "+freqs.Length); // } for (int bits = 0; bits < maxLength; bits++) { nextCode[bits] = code; code += bl_counts[bits] << (15 - bits); // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("bits: " + ( bits + 1) + " count: " + bl_counts[bits] // +" nextCode: "+code); // } } if (DeflaterConstants.DEBUGGING && code != 65536) { throw new SharpZipBaseException("Inconsistent bl_counts!"); } for (int i = 0; i < numCodes; i++) { int bits = length[i]; if (bits > 0) { // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("codes["+i+"] = rev(" + nextCode[bits-1]+"), // +bits); // } codes[i] = BitReverse(nextCode[bits - 1]); nextCode[bits - 1] += 1 << (16 - bits); } } } void BuildLength(int[] childs) { this.length = new byte[freqs.Length]; int numNodes = childs.Length / 2; int numLeafs = (numNodes + 1) / 2; int overflow = 0; for (int i = 0; i < maxLength; i++) { bl_counts[i] = 0; } /* First calculate optimal bit lengths */ int[] lengths = new int[numNodes]; lengths[numNodes - 1] = 0; for (int i = numNodes - 1; i >= 0; i--) { if (childs[2 * i + 1] != -1) { int bitLength = lengths[i] + 1; if (bitLength > maxLength) { bitLength = maxLength; overflow++; } lengths[childs[2 * i]] = lengths[childs[2 * i + 1]] = bitLength; } else { /* A leaf node */ int bitLength = lengths[i]; bl_counts[bitLength - 1]++; this.length[childs[2 * i]] = (byte)lengths[i]; } } // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("Tree "+freqs.Length+" lengths:"); // for (int i=0; i < numLeafs; i++) { // //Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]] // + " len: "+length[childs[2*i]]); // } // } if (overflow == 0) { return; } int incrBitLen = maxLength - 1; do { /* Find the first bit length which could increase: */ while (bl_counts[--incrBitLen] == 0) ; /* Move this node one down and remove a corresponding * amount of overflow nodes. */ do { bl_counts[incrBitLen]--; bl_counts[++incrBitLen]++; overflow -= 1 << (maxLength - 1 - incrBitLen); } while (overflow > 0 && incrBitLen < maxLength - 1); } while (overflow > 0); /* We may have overshot above. Move some nodes from maxLength to * maxLength-1 in that case. */ bl_counts[maxLength - 1] += overflow; bl_counts[maxLength - 2] -= overflow; /* Now recompute all bit lengths, scanning in increasing * frequency. It is simpler to reconstruct all lengths instead of * fixing only the wrong ones. This idea is taken from 'ar' * written by Haruhiko Okumura. * * The nodes were inserted with decreasing frequency into the childs * array. */ int nodePtr = 2 * numLeafs; for (int bits = maxLength; bits != 0; bits--) { int n = bl_counts[bits - 1]; while (n > 0) { int childPtr = 2 * childs[nodePtr++]; if (childs[childPtr + 1] == -1) { /* We found another leaf */ length[childs[childPtr]] = (byte)bits; n--; } } } // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("*** After overflow elimination. ***"); // for (int i=0; i < numLeafs; i++) { // //Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]] // + " len: "+length[childs[2*i]]); // } // } } /// /// Not documented /// public void BuildTree() { int numSymbols = freqs.Length; /* heap is a priority queue, sorted by frequency, least frequent * nodes first. The heap is a binary tree, with the property, that * the parent node is smaller than both child nodes. This assures * that the smallest node is the first parent. * * The binary tree is encoded in an array: 0 is root node and * the nodes 2*n+1, 2*n+2 are the child nodes of node n. */ int[] heap = new int[numSymbols]; int heapLen = 0; int maxCode = 0; for (int n = 0; n < numSymbols; n++) { int freq = freqs[n]; if (freq != 0) { /* Insert n into heap */ int pos = heapLen++; int ppos; while (pos > 0 && freqs[heap[ppos = (pos - 1) / 2]] > freq) { heap[pos] = heap[ppos]; pos = ppos; } heap[pos] = n; maxCode = n; } } /* We could encode a single literal with 0 bits but then we * don't see the literals. Therefore we force at least two * literals to avoid this case. We don't care about order in * this case, both literals get a 1 bit code. */ while (heapLen < 2) { int node = maxCode < 2 ? ++maxCode : 0; heap[heapLen++] = node; } numCodes = Math.Max(maxCode + 1, minNumCodes); int numLeafs = heapLen; int[] childs = new int[4 * heapLen - 2]; int[] values = new int[2 * heapLen - 1]; int numNodes = numLeafs; for (int i = 0; i < heapLen; i++) { int node = heap[i]; childs[2 * i] = node; childs[2 * i + 1] = -1; values[i] = freqs[node] << 8; heap[i] = i; } /* Construct the Huffman tree by repeatedly combining the least two * frequent nodes. */ do { int first = heap[0]; int last = heap[--heapLen]; /* Propagate the hole to the leafs of the heap */ int ppos = 0; int path = 1; while (path < heapLen) { if (path + 1 < heapLen && values[heap[path]] > values[heap[path + 1]]) { path++; } heap[ppos] = heap[path]; ppos = path; path = path * 2 + 1; } /* Now propagate the last element down along path. Normally * it shouldn't go too deep. */ int lastVal = values[last]; while ((path = ppos) > 0 && values[heap[ppos = (path - 1) / 2]] > lastVal) { heap[path] = heap[ppos]; } heap[path] = last; int second = heap[0]; /* Create a new node father of first and second */ last = numNodes++; childs[2 * last] = first; childs[2 * last + 1] = second; int mindepth = Math.Min(values[first] & 0xff, values[second] & 0xff); values[last] = lastVal = values[first] + values[second] - mindepth + 1; /* Again, propagate the hole to the leafs */ ppos = 0; path = 1; while (path < heapLen) { if (path + 1 < heapLen && values[heap[path]] > values[heap[path + 1]]) { path++; } heap[ppos] = heap[path]; ppos = path; path = ppos * 2 + 1; } /* Now propagate the new element down along path */ while ((path = ppos) > 0 && values[heap[ppos = (path - 1) / 2]] > lastVal) { heap[path] = heap[ppos]; } heap[path] = last; } while (heapLen > 1); if (heap[0] != childs.Length / 2 - 1) { throw new SharpZipBaseException("Heap invariant violated"); } BuildLength(childs); } /// /// Get encoded length /// /// Encoded length, the sum of frequencies * lengths public int GetEncodedLength() { int len = 0; for (int i = 0; i < freqs.Length; i++) { len += freqs[i] * length[i]; } return len; } /// /// Not documented /// public void CalcBLFreq(Tree blTree) { int max_count; /* max repeat count */ int min_count; /* min repeat count */ int count; /* repeat count of the current code */ int curlen = -1; /* length of current code */ int i = 0; while (i < numCodes) { count = 1; int nextlen = length[i]; if (nextlen == 0) { max_count = 138; min_count = 3; } else { max_count = 6; min_count = 3; if (curlen != nextlen) { blTree.freqs[nextlen]++; count = 0; } } curlen = nextlen; i++; while (i < numCodes && curlen == length[i]) { i++; if (++count >= max_count) { break; } } if (count < min_count) { blTree.freqs[curlen] += (short)count; } else if (curlen != 0) { blTree.freqs[REP_3_6]++; } else if (count <= 10) { blTree.freqs[REP_3_10]++; } else { blTree.freqs[REP_11_138]++; } } } /// /// Write tree values /// /// Tree to write public void WriteTree(Tree blTree) { int max_count; /* max repeat count */ int min_count; /* min repeat count */ int count; /* repeat count of the current code */ int curlen = -1; /* length of current code */ int i = 0; while (i < numCodes) { count = 1; int nextlen = length[i]; if (nextlen == 0) { max_count = 138; min_count = 3; } else { max_count = 6; min_count = 3; if (curlen != nextlen) { blTree.WriteSymbol(nextlen); count = 0; } } curlen = nextlen; i++; while (i < numCodes && curlen == length[i]) { i++; if (++count >= max_count) { break; } } if (count < min_count) { while (count-- > 0) { blTree.WriteSymbol(curlen); } } else if (curlen != 0) { blTree.WriteSymbol(REP_3_6); dh.pending.WriteBits(count - 3, 2); } else if (count <= 10) { blTree.WriteSymbol(REP_3_10); dh.pending.WriteBits(count - 3, 3); } else { blTree.WriteSymbol(REP_11_138); dh.pending.WriteBits(count - 11, 7); } } } } /// /// Pending buffer to use /// public DeflaterPending pending; Tree literalTree, distTree, blTree; short[] d_buf; byte[] l_buf; int last_lit; int extra_bits; static short[] staticLCodes; static byte[] staticLLength; static short[] staticDCodes; static byte[] staticDLength; /// /// Reverse the bits of a 16 bit value. /// /// Value to reverse bits /// Value with bits reversed public static short BitReverse(int toReverse) { return (short)(bit4Reverse[toReverse & 0xF] << 12 | bit4Reverse[(toReverse >> 4) & 0xF] << 8 | bit4Reverse[(toReverse >> 8) & 0xF] << 4 | bit4Reverse[toReverse >> 12]); } static DeflaterHuffman() { /* See RFC 1951 3.2.6 */ /* Literal codes */ staticLCodes = new short[LITERAL_NUM]; staticLLength = new byte[LITERAL_NUM]; int i = 0; while (i < 144) { staticLCodes[i] = BitReverse((0x030 + i) << 8); staticLLength[i++] = 8; } while (i < 256) { staticLCodes[i] = BitReverse((0x190 - 144 + i) << 7); staticLLength[i++] = 9; } while (i < 280) { staticLCodes[i] = BitReverse((0x000 - 256 + i) << 9); staticLLength[i++] = 7; } while (i < LITERAL_NUM) { staticLCodes[i] = BitReverse((0x0c0 - 280 + i) << 8); staticLLength[i++] = 8; } /* Distant codes */ staticDCodes = new short[DIST_NUM]; staticDLength = new byte[DIST_NUM]; for (i = 0; i < DIST_NUM; i++) { staticDCodes[i] = BitReverse(i << 11); staticDLength[i] = 5; } } /// /// Construct instance with pending buffer /// /// Pending buffer to use public DeflaterHuffman(DeflaterPending pending) { this.pending = pending; literalTree = new Tree(this, LITERAL_NUM, 257, 15); distTree = new Tree(this, DIST_NUM, 1, 15); blTree = new Tree(this, BITLEN_NUM, 4, 7); d_buf = new short[BUFSIZE]; l_buf = new byte[BUFSIZE]; } /// /// Reset internal state /// public void Reset() { last_lit = 0; extra_bits = 0; literalTree.Reset(); distTree.Reset(); blTree.Reset(); } int Lcode(int len) { if (len == 255) { return 285; } int code = 257; while (len >= 8) { code += 4; len >>= 1; } return code + len; } int Dcode(int distance) { int code = 0; while (distance >= 4) { code += 2; distance >>= 1; } return code + distance; } /// /// Write all trees to pending buffer /// public void SendAllTrees(int blTreeCodes) { blTree.BuildCodes(); literalTree.BuildCodes(); distTree.BuildCodes(); pending.WriteBits(literalTree.numCodes - 257, 5); pending.WriteBits(distTree.numCodes - 1, 5); pending.WriteBits(blTreeCodes - 4, 4); for (int rank = 0; rank < blTreeCodes; rank++) { pending.WriteBits(blTree.length[BL_ORDER[rank]], 3); } literalTree.WriteTree(blTree); distTree.WriteTree(blTree); // if (DeflaterConstants.DEBUGGING) { // blTree.CheckEmpty(); // } } /// /// Compress current buffer writing data to pending buffer /// public void CompressBlock() { for (int i = 0; i < last_lit; i++) { int litlen = l_buf[i] & 0xff; int dist = d_buf[i]; if (dist-- != 0) { // if (DeflaterConstants.DEBUGGING) { // Console.Write("["+(dist+1)+","+(litlen+3)+"]: "); // } int lc = Lcode(litlen); literalTree.WriteSymbol(lc); int bits = (lc - 261) / 4; if (bits > 0 && bits <= 5) { pending.WriteBits(litlen & ((1 << bits) - 1), bits); } int dc = Dcode(dist); distTree.WriteSymbol(dc); bits = dc / 2 - 1; if (bits > 0) { pending.WriteBits(dist & ((1 << bits) - 1), bits); } } else { // if (DeflaterConstants.DEBUGGING) { // if (litlen > 32 && litlen < 127) { // Console.Write("("+(char)litlen+"): "); // } else { // Console.Write("{"+litlen+"}: "); // } // } literalTree.WriteSymbol(litlen); } } // if (DeflaterConstants.DEBUGGING) { // Console.Write("EOF: "); // } literalTree.WriteSymbol(EOF_SYMBOL); // if (DeflaterConstants.DEBUGGING) { // literalTree.CheckEmpty(); // distTree.CheckEmpty(); // } } /// /// Flush block to output with no compression /// /// Data to write /// Index of first byte to write /// Count of bytes to write /// True if this is the last block public void FlushStoredBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock) { // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("Flushing stored block "+ storedLength); // } pending.WriteBits((DeflaterConstants.STORED_BLOCK << 1) + (lastBlock ? 1 : 0), 3); pending.AlignToByte(); pending.WriteShort(storedLength); pending.WriteShort(~storedLength); pending.WriteBlock(stored, storedOffset, storedLength); Reset(); } /// /// Flush block to output with compression /// /// Data to flush /// Index of first byte to flush /// Count of bytes to flush /// True if this is the last block public void FlushBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock) { literalTree.freqs[EOF_SYMBOL]++; /* Build trees */ literalTree.BuildTree(); distTree.BuildTree(); /* Calculate bitlen frequency */ literalTree.CalcBLFreq(blTree); distTree.CalcBLFreq(blTree); /* Build bitlen tree */ blTree.BuildTree(); int blTreeCodes = 4; for (int i = 18; i > blTreeCodes; i--) { if (blTree.length[BL_ORDER[i]] > 0) { blTreeCodes = i + 1; } } int opt_len = 14 + blTreeCodes * 3 + blTree.GetEncodedLength() + literalTree.GetEncodedLength() + distTree.GetEncodedLength() + extra_bits; int static_len = extra_bits; for (int i = 0; i < LITERAL_NUM; i++) { static_len += literalTree.freqs[i] * staticLLength[i]; } for (int i = 0; i < DIST_NUM; i++) { static_len += distTree.freqs[i] * staticDLength[i]; } if (opt_len >= static_len) { /* Force static trees */ opt_len = static_len; } if (storedOffset >= 0 && storedLength + 4 < opt_len >> 3) { /* Store Block */ // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("Storing, since " + storedLength + " < " + opt_len // + " <= " + static_len); // } FlushStoredBlock(stored, storedOffset, storedLength, lastBlock); } else if (opt_len == static_len) { /* Encode with static tree */ pending.WriteBits((DeflaterConstants.STATIC_TREES << 1) + (lastBlock ? 1 : 0), 3); literalTree.SetStaticCodes(staticLCodes, staticLLength); distTree.SetStaticCodes(staticDCodes, staticDLength); CompressBlock(); Reset(); } else { /* Encode with dynamic tree */ pending.WriteBits((DeflaterConstants.DYN_TREES << 1) + (lastBlock ? 1 : 0), 3); SendAllTrees(blTreeCodes); CompressBlock(); Reset(); } } /// /// Get value indicating if internal buffer is full /// /// true if buffer is full public bool IsFull() { return last_lit >= BUFSIZE; } /// /// Add literal to buffer /// /// /// Value indicating internal buffer is full public bool TallyLit(int lit) { // if (DeflaterConstants.DEBUGGING) { // if (lit > 32 && lit < 127) { // //Console.WriteLine("("+(char)lit+")"); // } else { // //Console.WriteLine("{"+lit+"}"); // } // } d_buf[last_lit] = 0; l_buf[last_lit++] = (byte)lit; literalTree.freqs[lit]++; return IsFull(); } /// /// Add distance code and length to literal and distance trees /// /// Distance code /// Length /// Value indicating if internal buffer is full public bool TallyDist(int dist, int len) { // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("["+dist+","+len+"]"); // } d_buf[last_lit] = (short)dist; l_buf[last_lit++] = (byte)(len - 3); int lc = Lcode(len - 3); literalTree.freqs[lc]++; if (lc >= 265 && lc < 285) { extra_bits += (lc - 261) / 4; } int dc = Dcode(dist - 1); distTree.freqs[dc]++; if (dc >= 4) { extra_bits += dc / 2 - 1; } return IsFull(); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/Compression/Streams/0000777000175000001440000000000011533760020025743 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/Compression/Streams/StreamManipulator.cs0000644000175000001440000002156611435766646031774 0ustar00gabeusers00000000000000// StreamManipulator.cs // // Copyright (C) 2001 Mike Krueger // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace PdfSharp.SharpZipLib.Zip.Compression.Streams { /// /// This class allows us to retrieve a specified number of bits from /// the input buffer, as well as copy big byte blocks. /// /// It uses an int buffer to store up to 31 bits for direct /// manipulation. This guarantees that we can get at least 16 bits, /// but we only need at most 15, so this is all safe. /// /// There are some optimizations in this class, for example, you must /// never peek more than 8 bits more than needed, and you must first /// peek bits before you may drop them. This is not a general purpose /// class but optimized for the behaviour of the Inflater. /// /// Authors of the original java version: John Leuner, Jochen Hoenicke /// internal class StreamManipulator { private byte[] window; private int window_start = 0; private int window_end = 0; private uint buffer = 0; private int bits_in_buffer = 0; /// /// Get the next n bits but don't increase input pointer. n must be /// less or equal 16 and if this call succeeds, you must drop /// at least n - 8 bits in the next call. /// /// /// the value of the bits, or -1 if not enough bits available. */ /// public int PeekBits(int n) { if (bits_in_buffer < n) { if (window_start == window_end) { return -1; // ok } buffer |= (uint)((window[window_start++] & 0xff | (window[window_start++] & 0xff) << 8) << bits_in_buffer); bits_in_buffer += 16; } return (int)(buffer & ((1 << n) - 1)); } /// /// Drops the next n bits from the input. You should have called PeekBits /// with a bigger or equal n before, to make sure that enough bits are in /// the bit buffer. /// public void DropBits(int n) { buffer >>= n; bits_in_buffer -= n; } /// /// Gets the next n bits and increases input pointer. This is equivalent /// to PeekBits followed by dropBits, except for correct error handling. /// /// /// the value of the bits, or -1 if not enough bits available. /// public int GetBits(int n) { int bits = PeekBits(n); if (bits >= 0) { DropBits(n); } return bits; } /// /// Gets the number of bits available in the bit buffer. This must be /// only called when a previous PeekBits() returned -1. /// /// /// the number of bits available. /// public int AvailableBits { get { return bits_in_buffer; } } /// /// Gets the number of bytes available. /// /// /// The number of bytes available. /// public int AvailableBytes { get { return window_end - window_start + (bits_in_buffer >> 3); } } /// /// Skips to the next byte boundary. /// public void SkipToByteBoundary() { buffer >>= (bits_in_buffer & 7); bits_in_buffer &= ~7; } /// /// Returns true when SetInput can be called /// public bool IsNeedingInput { get { return window_start == window_end; } } /// /// Copies length bytes from input buffer to output buffer starting /// at output[offset]. You have to make sure, that the buffer is /// byte aligned. If not enough bytes are available, copies fewer /// bytes. /// /// /// The buffer to copy bytes to. /// /// /// The offset in the buffer at which copying starts /// /// /// The length to copy, 0 is allowed. /// /// /// The number of bytes copied, 0 if no bytes were available. /// /// /// Length is less than zero /// /// /// Bit buffer isnt byte aligned /// public int CopyBytes(byte[] output, int offset, int length) { if (length < 0) { throw new ArgumentOutOfRangeException("length"); } if ((bits_in_buffer & 7) != 0) { /* bits_in_buffer may only be 0 or a multiple of 8 */ throw new InvalidOperationException("Bit buffer is not byte aligned!"); } int count = 0; while (bits_in_buffer > 0 && length > 0) { output[offset++] = (byte)buffer; buffer >>= 8; bits_in_buffer -= 8; length--; count++; } if (length == 0) { return count; } int avail = window_end - window_start; if (length > avail) { length = avail; } System.Array.Copy(window, window_start, output, offset, length); window_start += length; if (((window_start - window_end) & 1) != 0) { /* We always want an even number of bytes in input, see peekBits */ buffer = (uint)(window[window_start++] & 0xff); bits_in_buffer = 8; } return count + length; } /// /// Constructs a default StreamManipulator with all buffers empty /// public StreamManipulator() { } /// /// resets state and empties internal buffers /// public void Reset() { buffer = (uint)(window_start = window_end = bits_in_buffer = 0); } /// /// Add more input for consumption. /// Only call when IsNeedingInput returns true /// /// data to be input /// offset of first byte of input /// length of input public void SetInput(byte[] buf, int off, int len) { if (window_start < window_end) { throw new InvalidOperationException("Old input was not completely processed"); } int end = off + len; /* We want to throw an ArrayIndexOutOfBoundsException early. The * check is very tricky: it also handles integer wrap around. */ if (0 > off || off > end || end > buf.Length) { throw new ArgumentOutOfRangeException(); } if ((len & 1) != 0) { /* We always want an even number of bytes in input, see peekBits */ buffer |= (uint)((buf[off++] & 0xff) << bits_in_buffer); bits_in_buffer += 8; } window = buf; window_start = off; window_end = end; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/Compression/Streams/DeflaterOutputStream.cs0000644000175000001440000003256211435766646032446 0ustar00gabeusers00000000000000// DeflaterOutputStream.cs // // Copyright (C) 2001 Mike Krueger // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; using System.IO; using PdfSharp.SharpZipLib.Checksums; using PdfSharp.SharpZipLib.Zip.Compression; namespace PdfSharp.SharpZipLib.Zip.Compression.Streams { /// /// A special stream deflating or compressing the bytes that are /// written to it. It uses a Deflater to perform actual deflating.
/// Authors of the original java version: Tom Tromey, Jochen Hoenicke ///
internal class DeflaterOutputStream : Stream { /// /// This buffer is used temporarily to retrieve the bytes from the /// deflater and write them to the underlying output stream. /// protected byte[] buf; /// /// The deflater which is used to deflate the stream. /// protected Deflater def; /// /// Base stream the deflater depends on. /// protected Stream baseOutputStream; bool isStreamOwner = true; /// /// Get/set flag indicating ownership of underlying stream. /// When the flag is true will close the underlying stream also. /// public bool IsStreamOwner { get { return isStreamOwner; } set { isStreamOwner = value; } } /// /// Allows client to determine if an entry can be patched after its added /// public bool CanPatchEntries { get { return baseOutputStream.CanSeek; } } /// /// Gets value indicating stream can be read from /// public override bool CanRead { get { return baseOutputStream.CanRead; } } /// /// Gets a value indicating if seeking is supported for this stream /// This property always returns false /// public override bool CanSeek { get { return false; } } /// /// Get value indicating if this stream supports writing /// public override bool CanWrite { get { return baseOutputStream.CanWrite; } } /// /// Get current length of stream /// public override long Length { get { return baseOutputStream.Length; } } /// /// The current position within the stream. /// Always throws a NotSupportedException /// /// Any attempt to set position public override long Position { get { return baseOutputStream.Position; } set { throw new NotSupportedException("DefalterOutputStream Position not supported"); } } /// /// Sets the current position of this stream to the given value. Not supported by this class! /// /// Any access public override long Seek(long offset, SeekOrigin origin) { throw new NotSupportedException("DeflaterOutputStream Seek not supported"); } /// /// Sets the length of this stream to the given value. Not supported by this class! /// /// Any access public override void SetLength(long val) { throw new NotSupportedException("DeflaterOutputStream SetLength not supported"); } /// /// Read a byte from stream advancing position by one /// /// Any access public override int ReadByte() { throw new NotSupportedException("DeflaterOutputStream ReadByte not supported"); } /// /// Read a block of bytes from stream /// /// Any access public override int Read(byte[] b, int off, int len) { throw new NotSupportedException("DeflaterOutputStream Read not supported"); } /// /// Asynchronous reads are not supported a NotSupportedException is always thrown /// /// /// /// /// /// /// Any access public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { throw new NotSupportedException("DeflaterOutputStream BeginRead not currently supported"); } /// /// Asynchronous writes arent supported, a NotSupportedException is always thrown /// /// /// /// /// /// /// Any access public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { throw new NotSupportedException("DeflaterOutputStream BeginWrite not currently supported"); } /// /// Deflates everything in the input buffers. This will call /// def.deflate() until all bytes from the input buffers /// are processed. /// protected void Deflate() { while (!def.IsNeedingInput) { int len = def.Deflate(buf, 0, buf.Length); if (len <= 0) { break; } if (this.Password != null) { this.EncryptBlock(buf, 0, len); } baseOutputStream.Write(buf, 0, len); } if (!def.IsNeedingInput) { throw new SharpZipBaseException("DeflaterOutputStream can't deflate all input?"); } } /// /// Creates a new DeflaterOutputStream with a default Deflater and default buffer size. /// /// /// the output stream where deflated output should be written. /// public DeflaterOutputStream(Stream baseOutputStream) : this(baseOutputStream, new Deflater(), 512) { } /// /// Creates a new DeflaterOutputStream with the given Deflater and /// default buffer size. /// /// /// the output stream where deflated output should be written. /// /// /// the underlying deflater. /// public DeflaterOutputStream(Stream baseOutputStream, Deflater defl) : this(baseOutputStream, defl, 512) { } /// /// Creates a new DeflaterOutputStream with the given Deflater and /// buffer size. /// /// /// The output stream where deflated output is written. /// /// /// The underlying deflater to use /// /// /// The buffer size to use when deflating /// /// /// bufsize is less than or equal to zero. /// /// /// baseOutputStream does not support writing /// /// /// deflater instance is null /// public DeflaterOutputStream(Stream baseOutputStream, Deflater deflater, int bufsize) { if (baseOutputStream.CanWrite == false) { throw new ArgumentException("baseOutputStream", "must support writing"); } if (deflater == null) { throw new ArgumentNullException("deflater"); } if (bufsize <= 0) { throw new ArgumentOutOfRangeException("bufsize"); } this.baseOutputStream = baseOutputStream; buf = new byte[bufsize]; def = deflater; } /// /// Flushes the stream by calling flush() on the deflater and then /// on the underlying stream. This ensures that all bytes are /// flushed. /// public override void Flush() { def.Flush(); Deflate(); baseOutputStream.Flush(); } /// /// Finishes the stream by calling finish() on the deflater. /// /// /// Not all input is deflated /// public virtual void Finish() { def.Finish(); while (!def.IsFinished) { int len = def.Deflate(buf, 0, buf.Length); if (len <= 0) { break; } if (this.Password != null) { this.EncryptBlock(buf, 0, len); } baseOutputStream.Write(buf, 0, len); } if (!def.IsFinished) { throw new SharpZipBaseException("Can't deflate all input?"); } baseOutputStream.Flush(); } /// /// Calls finish() and closes the underlying /// stream when is true. /// public override void Close() { Finish(); if ( isStreamOwner ) { baseOutputStream.Close(); } } /// /// Writes a single byte to the compressed output stream. /// /// /// The byte value. /// public override void WriteByte(byte bval) { byte[] b = new byte[1]; b[0] = bval; Write(b, 0, 1); } /// /// Writes bytes from an array to the compressed stream. /// /// /// The byte array /// /// /// The offset into the byte array where to start. /// /// /// The number of bytes to write. /// public override void Write(byte[] buf, int off, int len) { def.SetInput(buf, off, len); Deflate(); } #region Encryption // TODO Refactor this code. The presence of Zip specific code in this low level class is wrong string password = null; uint[] keys = null; /// /// Get/set the password used for encryption. When null no encryption is performed /// public string Password { get { return password; } set { password = value; } } /// /// Encrypt a single byte /// /// /// The encrypted value /// protected byte EncryptByte() { uint temp = ((keys[2] & 0xFFFF) | 2); return (byte)((temp * (temp ^ 1)) >> 8); } /// /// Encrypt a block of data /// /// /// Data to encrypt. NOTE the original contents of the buffer are lost /// /// /// Offset of first byte in buffer to encrypt /// /// /// Number of bytes in buffer to encrypt /// protected void EncryptBlock(byte[] buffer, int offset, int length) { for (int i = offset; i < offset + length; ++i) { byte oldbyte = buffer[i]; buffer[i] ^= EncryptByte(); UpdateKeys(oldbyte); } } /// /// Initializes encryption keys based on given password /// protected void InitializePassword(string password) { keys = new uint[] { 0x12345678, 0x23456789, 0x34567890 }; for (int i = 0; i < password.Length; ++i) { UpdateKeys((byte)password[i]); } } /// /// Update encryption keys /// protected void UpdateKeys(byte ch) { keys[0] = Crc32.ComputeCrc32(keys[0], ch); keys[1] = keys[1] + (byte)keys[0]; keys[1] = keys[1] * 134775813 + 1; keys[2] = Crc32.ComputeCrc32(keys[2], (byte)(keys[1] >> 24)); } #endregion } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/Compression/Streams/OutputWindow.cs0000644000175000001440000001740611435766646031013 0ustar00gabeusers00000000000000// OutputWindow.cs // // Copyright (C) 2001 Mike Krueger // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace PdfSharp.SharpZipLib.Zip.Compression.Streams { /// /// Contains the output from the Inflation process. /// We need to have a window so that we can refer backwards into the output stream /// to repeat stuff.
/// Author of the original java version: John Leuner ///
internal class OutputWindow { private static int WINDOW_SIZE = 1 << 15; private static int WINDOW_MASK = WINDOW_SIZE - 1; private byte[] window = new byte[WINDOW_SIZE]; //The window is 2^15 bytes private int windowEnd = 0; private int windowFilled = 0; /// /// Write a byte to this output window /// /// value to write /// /// if window is full /// public void Write(int abyte) { if (windowFilled++ == WINDOW_SIZE) { throw new InvalidOperationException("Window full"); } window[windowEnd++] = (byte)abyte; windowEnd &= WINDOW_MASK; } private void SlowRepeat(int repStart, int len, int dist) { while (len-- > 0) { window[windowEnd++] = window[repStart++]; windowEnd &= WINDOW_MASK; repStart &= WINDOW_MASK; } } /// /// Append a byte pattern already in the window itself /// /// length of pattern to copy /// distance from end of window pattern occurs /// /// If the repeated data overflows the window /// public void Repeat(int len, int dist) { if ((windowFilled += len) > WINDOW_SIZE) { throw new InvalidOperationException("Window full"); } int rep_start = (windowEnd - dist) & WINDOW_MASK; int border = WINDOW_SIZE - len; if (rep_start <= border && windowEnd < border) { if (len <= dist) { System.Array.Copy(window, rep_start, window, windowEnd, len); windowEnd += len; } else { /* We have to copy manually, since the repeat pattern overlaps. */ while (len-- > 0) { window[windowEnd++] = window[rep_start++]; } } } else { SlowRepeat(rep_start, len, dist); } } /// /// Copy from input manipulator to internal window /// /// source of data /// length of data to copy /// the number of bytes copied public int CopyStored(StreamManipulator input, int len) { len = Math.Min(Math.Min(len, WINDOW_SIZE - windowFilled), input.AvailableBytes); int copied; int tailLen = WINDOW_SIZE - windowEnd; if (len > tailLen) { copied = input.CopyBytes(window, windowEnd, tailLen); if (copied == tailLen) { copied += input.CopyBytes(window, 0, len - tailLen); } } else { copied = input.CopyBytes(window, windowEnd, len); } windowEnd = (windowEnd + copied) & WINDOW_MASK; windowFilled += copied; return copied; } /// /// Copy dictionary to window /// /// source dictionary /// offset of start in source dictionary /// length of dictionary /// /// If window isnt empty /// public void CopyDict(byte[] dict, int offset, int len) { if (windowFilled > 0) { throw new InvalidOperationException(); } if (len > WINDOW_SIZE) { offset += len - WINDOW_SIZE; len = WINDOW_SIZE; } System.Array.Copy(dict, offset, window, 0, len); windowEnd = len & WINDOW_MASK; } /// /// Get remaining unfilled space in window /// /// Number of bytes left in window public int GetFreeSpace() { return WINDOW_SIZE - windowFilled; } /// /// Get bytes available for output in window /// /// Number of bytes filled public int GetAvailable() { return windowFilled; } /// /// Copy contents of window to output /// /// buffer to copy to /// offset to start at /// number of bytes to count /// The number of bytes copied /// /// If a window underflow occurs /// public int CopyOutput(byte[] output, int offset, int len) { int copy_end = windowEnd; if (len > windowFilled) { len = windowFilled; } else { copy_end = (windowEnd - windowFilled + len) & WINDOW_MASK; } int copied = len; int tailLen = len - copy_end; if (tailLen > 0) { System.Array.Copy(window, WINDOW_SIZE - tailLen, output, offset, tailLen); offset += tailLen; len = copy_end; } System.Array.Copy(window, copy_end - len, output, offset, len); windowFilled -= copied; if (windowFilled < 0) { throw new InvalidOperationException(); } return copied; } /// /// Reset by clearing window so GetAvailable returns 0 /// public void Reset() { windowFilled = windowEnd = 0; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/Compression/Streams/InflaterInputStream.cs0000644000175000001440000004122611435766646032260 0ustar00gabeusers00000000000000// InflaterInputStream.cs // // Copyright (C) 2001 Mike Krueger // Copyright (C) 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; using System.IO; using PdfSharp.SharpZipLib.Zip.Compression; using PdfSharp.SharpZipLib.Checksums; namespace PdfSharp.SharpZipLib.Zip.Compression.Streams { /// /// This filter stream is used to decompress data compressed using the "deflate" /// format. The "deflate" format is described in RFC 1951. /// /// Author of the original java version: John Leuner. /// internal class InflaterInputStream : Stream { /// /// Decompressor for this stream /// protected Inflater inf; /// /// Byte array used for buffering input. /// protected byte[] buf; /// /// Size of buffer /// protected int len; // Used for reading single bytes the ReadByte() call private byte[] onebytebuffer = new byte[1]; /// /// Base stream the inflater reads from. /// protected Stream baseInputStream; //// /// //// /// The compressed size //// /// //// protected long csize; bool isStreamOwner = true; /// /// Get/set flag indicating ownership of underlying stream. /// When the flag is true will close the underlying stream also. /// /// /// The default value is true. /// public bool IsStreamOwner { get { return isStreamOwner; } set { isStreamOwner = value; } } /// /// Gets a value indicating whether the current stream supports reading /// public override bool CanRead { get { return baseInputStream.CanRead; } } /// /// Gets a value of false indicating seeking is not supported for this stream. /// public override bool CanSeek { get { return false; } } /// /// Gets a value of false indicating that this stream is not writeable. /// public override bool CanWrite { get { return false; } } /// /// A value representing the length of the stream in bytes. /// public override long Length { get { return len; } } /// /// The current position within the stream. /// Throws a NotSupportedException when attempting to set the position /// /// Attempting to set the position public override long Position { get { return baseInputStream.Position; } set { throw new NotSupportedException("InflaterInputStream Position not supported"); } } /// /// Flushes the baseInputStream /// public override void Flush() { baseInputStream.Flush(); } /// /// Sets the position within the current stream /// Always throws a NotSupportedException /// /// Any access public override long Seek(long offset, SeekOrigin origin) { throw new NotSupportedException("Seek not supported"); } /// /// Set the length of the current stream /// Always throws a NotSupportedException /// /// Any access public override void SetLength(long val) { throw new NotSupportedException("InflaterInputStream SetLength not supported"); } /// /// Writes a sequence of bytes to stream and advances the current position /// This method always throws a NotSupportedException /// /// Any access public override void Write(byte[] array, int offset, int count) { throw new NotSupportedException("InflaterInputStream Write not supported"); } /// /// Writes one byte to the current stream and advances the current position /// Always throws a NotSupportedException /// /// Any access public override void WriteByte(byte val) { throw new NotSupportedException("InflaterInputStream WriteByte not supported"); } /// /// Entry point to begin an asynchronous write. Always throws a NotSupportedException. /// /// The buffer to write data from /// Offset of first byte to write /// The maximum number of bytes to write /// The method to be called when the asynchronous write operation is completed /// A user-provided object that distinguishes this particular asynchronous write request from other requests /// An IAsyncResult that references the asynchronous write /// Any access public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { throw new NotSupportedException("InflaterInputStream BeginWrite not supported"); } /// /// Create an InflaterInputStream with the default decompressor /// and a default buffer size of 4KB. /// /// /// The InputStream to read bytes from /// public InflaterInputStream(Stream baseInputStream) : this(baseInputStream, new Inflater(), 4096) { } /// /// Create an InflaterInputStream with the specified decompressor /// and a default buffer size of 4KB. /// /// /// The source of input data /// /// /// The decompressor used to decompress data read from baseInputStream /// public InflaterInputStream(Stream baseInputStream, Inflater inf) : this(baseInputStream, inf, 4096) { } /// /// Create an InflaterInputStream with the specified decompressor /// and the specified buffer size. /// /// /// The InputStream to read bytes from /// /// /// The decompressor to use /// /// /// Size of the buffer to use /// public InflaterInputStream(Stream baseInputStream, Inflater inflater, int bufferSize) { if (baseInputStream == null) { throw new ArgumentNullException("InflaterInputStream baseInputStream is null"); } if (inflater == null) { throw new ArgumentNullException("InflaterInputStream Inflater is null"); } if (bufferSize <= 0) { throw new ArgumentOutOfRangeException("bufferSize"); } this.baseInputStream = baseInputStream; this.inf = inflater; buf = new byte[bufferSize]; if (baseInputStream.CanSeek) { this.len = (int)baseInputStream.Length; } else { this.len = 0; } } /// /// Returns 0 once the end of the stream (EOF) has been reached. /// Otherwise returns 1. /// public virtual int Available { get { return inf.IsFinished ? 0 : 1; } } /// /// Closes the input stream. When /// is true the underlying stream is also closed. /// public override void Close() { if (isStreamOwner) { baseInputStream.Close(); } } int readChunkSize = 0; /// /// Sets the size of chunks to read from the input stream /// 0 means as larger as possible. /// /// /// Used to handle decryption where the length of stream is unknown. /// protected int BufferReadSize { get { return readChunkSize; } set { readChunkSize = value; } } /// /// Fill input buffer with a chunk of data. /// protected void FillInputBuffer() { if (readChunkSize <= 0) { len = baseInputStream.Read(buf, 0, buf.Length); } else { len = baseInputStream.Read(buf, 0, readChunkSize); } } /// /// Fills the buffer with more data to decompress. /// /// /// Stream ends early /// protected void Fill() { FillInputBuffer(); if (keys != null) { DecryptBlock(buf, 0, len); } #if READ_SINGLE_WHEN_DECRYPTING // This solves some decryption problems but there are still some lurking. // At issue is exactly where the stream and decryption should finish. if (keys == null) { len = baseInputStream.Read(buf, 0, buf.Length); } else { len = baseInputStream.Read(buf, 0, 1); } if (keys != null) { DecryptBlock(buf, 0, len); } #endif #if STANDARD len = baseInputStream.Read(buf, 0, buf.Length); if (keys != null) { DecryptBlock(buf, 0, System.Math.Min((int)(csize - inf.TotalIn), len)); } #endif if (len <= 0) { throw new SharpZipBaseException("Deflated stream ends early."); } inf.SetInput(buf, 0, len); } /// /// Reads one byte of decompressed data. /// /// The byte is baseInputStream the lower 8 bits of the int. /// /// /// The byte read cast to an int, or -1 on end of stream. /// public override int ReadByte() { int nread = Read(onebytebuffer, 0, 1); // read one byte if (nread > 0) { return onebytebuffer[0] & 0xff; } return -1; // ok } /// /// Decompresses data into the byte array /// /// /// The array to read and decompress data into /// /// /// The offset indicating where the data should be placed /// /// /// The number of bytes to decompress /// /// The number of bytes read. Zero signals the end of stream /// /// Inflater needs a dictionary /// public override int Read(byte[] b, int off, int len) { for (; ; ) { int count; try { count = inf.Inflate(b, off, len); } catch (Exception e) { throw new SharpZipBaseException(e.ToString()); } if (count > 0) { return count; } if (inf.IsNeedingDictionary) { throw new SharpZipBaseException("Need a dictionary"); } else if (inf.IsFinished) { return 0; } else if (inf.IsNeedingInput) { Fill(); } else { throw new InvalidOperationException("Don't know what to do"); } } } /// /// Skip specified number of bytes of uncompressed data /// /// /// Number of bytes to skip /// /// /// The number of bytes skipped, zero if the end of /// stream has been reached /// /// /// Number of bytes to skip is zero or less /// public long Skip(long n) { if (n <= 0) { throw new ArgumentOutOfRangeException("n"); } // v0.80 Skip by seeking if underlying stream supports it... if (baseInputStream.CanSeek) { baseInputStream.Seek(n, SeekOrigin.Current); return n; } else { int len = 2048; if (n < len) { len = (int)n; } byte[] tmp = new byte[len]; return (long)baseInputStream.Read(tmp, 0, tmp.Length); } } #region Encryption stuff // TODO Refactor this code. The presence of Zip specific code in this low level class is wrong /// /// A buffer used for decrypting data. Used to hold Zip crypto header. /// protected byte[] cryptbuffer = null; uint[] keys = null; /// /// Decrypt a single byte /// /// plain text byte value protected byte DecryptByte() { uint temp = ((keys[2] & 0xFFFF) | 2); return (byte)((temp * (temp ^ 1)) >> 8); } /// /// Decrypt cipher text block, updating keys /// /// Data to decrypt /// Offset of first byte to process /// Number of bytes to process protected void DecryptBlock(byte[] buf, int off, int len) { for (int i = off; i < off + len; ++i) { buf[i] ^= DecryptByte(); UpdateKeys(buf[i]); } } /// /// Initialise the decryption keys /// /// The password used to initialise the keys protected void InitializePassword(string password) { keys = new uint[] { 0x12345678, 0x23456789, 0x34567890 }; for (int i = 0; i < password.Length; ++i) { UpdateKeys((byte)password[i]); } } /// /// Update the decryption keys /// /// Character to update the keys with protected void UpdateKeys(byte ch) { keys[0] = Crc32.ComputeCrc32(keys[0], ch); keys[1] = keys[1] + (byte)keys[0]; keys[1] = keys[1] * 134775813 + 1; keys[2] = Crc32.ComputeCrc32(keys[2], (byte)(keys[1] >> 24)); } /// /// Clear any cryptographic state. /// protected void StopDecrypting() { keys = null; cryptbuffer = null; } #endregion } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/Compression/PendingBuffer.cs0000644000175000001440000002006111435766646027412 0ustar00gabeusers00000000000000// PendingBuffer.cs // // Copyright (C) 2001 Mike Krueger // Copyright (C) 2004 John Reilly // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; namespace PdfSharp.SharpZipLib.Zip.Compression { /// /// This class is general purpose class for writing data to a buffer. /// /// It allows you to write bits as well as bytes /// Based on DeflaterPending.java /// /// Author of the original java version: Jochen Hoenicke /// internal class PendingBuffer { /// Internal work buffer /// protected byte[] buf; int start; int end; uint bits; int bitCount; /// /// construct instance using default buffer size of 4096 /// public PendingBuffer() : this(4096) { } /// /// construct instance using specified buffer size /// /// /// size to use for internal buffer /// public PendingBuffer(int bufsize) { buf = new byte[bufsize]; } /// /// Clear internal state/buffers /// public void Reset() { start = end = bitCount = 0; } /// /// write a byte to buffer /// /// /// value to write /// public void WriteByte(int b) { if (DeflaterConstants.DEBUGGING && start != 0) { throw new SharpZipBaseException(); } buf[end++] = (byte)b; } /// /// Write a short value to buffer LSB first /// /// /// value to write /// public void WriteShort(int s) { if (DeflaterConstants.DEBUGGING && start != 0) { throw new SharpZipBaseException(); } buf[end++] = (byte)s; buf[end++] = (byte)(s >> 8); } /// /// write an integer LSB first /// /// value to write public void WriteInt(int s) { if (DeflaterConstants.DEBUGGING && start != 0) { throw new SharpZipBaseException(); } buf[end++] = (byte)s; buf[end++] = (byte)(s >> 8); buf[end++] = (byte)(s >> 16); buf[end++] = (byte)(s >> 24); } /// /// Write a block of data to buffer /// /// data to write /// offset of first byte to write /// number of bytes to write public void WriteBlock(byte[] block, int offset, int len) { if (DeflaterConstants.DEBUGGING && start != 0) { throw new SharpZipBaseException(); } System.Array.Copy(block, offset, buf, end, len); end += len; } /// /// The number of bits written to the buffer /// public int BitCount { get { return bitCount; } } /// /// Align internal buffer on a byte boundary /// public void AlignToByte() { if (DeflaterConstants.DEBUGGING && start != 0) { throw new SharpZipBaseException(); } if (bitCount > 0) { buf[end++] = (byte)bits; if (bitCount > 8) { buf[end++] = (byte)(bits >> 8); } } bits = 0; bitCount = 0; } /// /// Write bits to internal buffer /// /// source of bits /// number of bits to write public void WriteBits(int b, int count) { if (DeflaterConstants.DEBUGGING && start != 0) { throw new SharpZipBaseException(); } // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("writeBits("+b+","+count+")"); // } bits |= (uint)(b << bitCount); bitCount += count; if (bitCount >= 16) { buf[end++] = (byte)bits; buf[end++] = (byte)(bits >> 8); bits >>= 16; bitCount -= 16; } } /// /// Write a short value to internal buffer most significant byte first /// /// value to write public void WriteShortMSB(int s) { if (DeflaterConstants.DEBUGGING && start != 0) { throw new SharpZipBaseException(); } buf[end++] = (byte)(s >> 8); buf[end++] = (byte)s; } /// /// Indicates if buffer has been flushed /// public bool IsFlushed { get { return end == 0; } } /// /// Flushes the pending buffer into the given output array. If the /// output array is to small, only a partial flush is done. /// /// /// the output array; /// /// /// the offset into output array; /// /// /// length the maximum number of bytes to store; /// /// /// IndexOutOfBoundsException if offset or length are invalid. /// public int Flush(byte[] output, int offset, int length) { if (bitCount >= 8) { buf[end++] = (byte)bits; bits >>= 8; bitCount -= 8; } if (length > end - start) { length = end - start; System.Array.Copy(buf, start, output, offset, length); start = 0; end = 0; } else { System.Array.Copy(buf, start, output, offset, length); start += length; } return length; } /// /// Convert internal buffer to byte array. /// Buffer is empty on completion /// /// /// converted buffer contents contents /// public byte[] ToByteArray() { byte[] ret = new byte[end - start]; System.Array.Copy(buf, start, ret, 0, ret.Length); start = 0; end = 0; return ret; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.SharpZipLib/Zip/Compression/InflaterDynHeader.cs0000644000175000001440000001372011435763706030222 0ustar00gabeusers00000000000000// InflaterDynHeader.cs // Copyright (C) 2001 Mike Krueger // // This file was translated from java, it was part of the GNU Classpath // Copyright (C) 2001 Free Software Foundation, Inc. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Linking this library statically or dynamically with other modules is // making a combined work based on this library. Thus, the terms and // conditions of the GNU General Public License cover the whole // combination. // // As a special exception, the copyright holders of this library give you // permission to link this library with independent modules to produce an // executable, regardless of the license terms of these independent // modules, and to copy and distribute the resulting executable under // terms of your choice, provided that you also meet, for each linked // independent module, the terms and conditions of the license of that // module. An independent module is a module which is not derived from // or based on this library. If you modify this library, you may extend // this exception to your version of the library, but you are not // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. using System; using PdfSharp.SharpZipLib.Zip.Compression.Streams; namespace PdfSharp.SharpZipLib.Zip.Compression { class InflaterDynHeader { const int LNUM = 0; const int DNUM = 1; const int BLNUM = 2; const int BLLENS = 3; const int LENS = 4; const int REPS = 5; static readonly int[] repMin = { 3, 3, 11 }; static readonly int[] repBits = { 2, 3, 7 }; byte[] blLens; byte[] litdistLens; InflaterHuffmanTree blTree; int mode; int lnum, dnum, blnum, num; int repSymbol; byte lastLen; int ptr; static readonly int[] BL_ORDER = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; public InflaterDynHeader() { } public bool Decode(StreamManipulator input) { decode_loop: for (;;) { switch (mode) { case LNUM: lnum = input.PeekBits(5); if (lnum < 0) { return false; } lnum += 257; input.DropBits(5); // System.err.println("LNUM: "+lnum); mode = DNUM; goto case DNUM; // fall through case DNUM: dnum = input.PeekBits(5); if (dnum < 0) { return false; } dnum++; input.DropBits(5); // System.err.println("DNUM: "+dnum); num = lnum+dnum; litdistLens = new byte[num]; mode = BLNUM; goto case BLNUM; // fall through case BLNUM: blnum = input.PeekBits(4); if (blnum < 0) { return false; } blnum += 4; input.DropBits(4); blLens = new byte[19]; ptr = 0; // System.err.println("BLNUM: "+blnum); mode = BLLENS; goto case BLLENS; // fall through case BLLENS: while (ptr < blnum) { int len = input.PeekBits(3); if (len < 0) { return false; } input.DropBits(3); // System.err.println("blLens["+BL_ORDER[ptr]+"]: "+len); blLens[BL_ORDER[ptr]] = (byte) len; ptr++; } blTree = new InflaterHuffmanTree(blLens); blLens = null; ptr = 0; mode = LENS; goto case LENS; // fall through case LENS: { int symbol; while (((symbol = blTree.GetSymbol(input)) & ~15) == 0) { /* Normal case: symbol in [0..15] */ // System.err.println("litdistLens["+ptr+"]: "+symbol); litdistLens[ptr++] = lastLen = (byte)symbol; if (ptr == num) { /* Finished */ return true; } } /* need more input ? */ if (symbol < 0) { return false; } /* otherwise repeat code */ if (symbol >= 17) { /* repeat zero */ // System.err.println("repeating zero"); lastLen = 0; } else { if (ptr == 0) { throw new SharpZipBaseException(); } } repSymbol = symbol-16; } mode = REPS; goto case REPS; // fall through case REPS: { int bits = repBits[repSymbol]; int count = input.PeekBits(bits); if (count < 0) { return false; } input.DropBits(bits); count += repMin[repSymbol]; // System.err.println("litdistLens repeated: "+count); if (ptr + count > num) { throw new SharpZipBaseException(); } while (count-- > 0) { litdistLens[ptr++] = lastLen; } if (ptr == num) { /* Finished */ return true; } } mode = LENS; goto decode_loop; } } } public InflaterHuffmanTree BuildLitLenTree() { byte[] litlenLens = new byte[lnum]; Array.Copy(litdistLens, 0, litlenLens, 0, lnum); return new InflaterHuffmanTree(litlenLens); } public InflaterHuffmanTree BuildDistTree() { byte[] distLens = new byte[dnum]; Array.Copy(litdistLens, lnum, distLens, 0, dnum); return new InflaterHuffmanTree(distLens); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/0000777000175000001440000000000011533760020022147 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/CodeDataMatrix.cs0000644000175000001440000001664311435766646025362 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // David Stephensen (mailto:David.Stephensen@pdfsharp.com) // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; #if GDI using System.Drawing; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Drawing; namespace PdfSharp.Drawing.BarCodes { /// /// Defines the DataMatrix 2D barcode. THIS IS AN EMPIRA INTERNAL IMPLEMENTATION. THE CODE IN /// THE OPEN SOURCE VERSION IS A FAKE. /// public class CodeDataMatrix : MatrixCode { /// /// Initializes a new instance of CodeDataMatrix. /// public CodeDataMatrix() : this("", "", 26, 26, 0, XSize.Empty) { } /// /// Initializes a new instance of CodeDataMatrix. /// public CodeDataMatrix(string code, int length) : this(code, "", length, length, 0, XSize.Empty) { } /// /// Initializes a new instance of CodeDataMatrix. /// public CodeDataMatrix(string code, int length, XSize size) : this(code, "", length, length, 0, size) { } /// /// Initializes a new instance of CodeDataMatrix. /// public CodeDataMatrix(string code, DataMatrixEncoding dmEncoding, int length, XSize size) : this(code, CreateEncoding(dmEncoding, code.Length), length, length, 0, size) { } /// /// Initializes a new instance of CodeDataMatrix. /// public CodeDataMatrix(string code, int rows, int columns) : this(code, "", rows, columns, 0, XSize.Empty) { } /// /// Initializes a new instance of CodeDataMatrix. /// public CodeDataMatrix(string code, int rows, int columns, XSize size) : this(code, "", rows, columns, 0, size) { } /// /// Initializes a new instance of CodeDataMatrix. /// public CodeDataMatrix(string code, DataMatrixEncoding dmEncoding, int rows, int columns, XSize size) : this(code, CreateEncoding(dmEncoding, code.Length), rows, columns, 0, size) { } /// /// Initializes a new instance of CodeDataMatrix. /// public CodeDataMatrix(string code, int rows, int columns, int quietZone) : this(code, "", rows, columns, quietZone, XSize.Empty) { } /// /// Initializes a new instance of CodeDataMatrix. /// public CodeDataMatrix(string code, string encoding, int rows, int columns, int quietZone, XSize size) : base(code, encoding, rows, columns, size) { QuietZone = quietZone; } /// /// Sets the encoding of the DataMatrix. /// public void SetEncoding(DataMatrixEncoding dmEncoding) { Encoding = CreateEncoding(dmEncoding, Text.Length); } static string CreateEncoding(DataMatrixEncoding dmEncoding, int length) { string tempencoding = ""; switch (dmEncoding) { case DataMatrixEncoding.Ascii: tempencoding = new String('a', length); break; case DataMatrixEncoding.C40: tempencoding = new String('c', length); break; case DataMatrixEncoding.Text: tempencoding = new String('t', length); break; case DataMatrixEncoding.X12: tempencoding = new String('x', length); break; case DataMatrixEncoding.EDIFACT: tempencoding = new String('e', length); break; case DataMatrixEncoding.Base256: tempencoding = new String('b', length); break; } return tempencoding; } /// /// Gets or sets the size of the Matrix' Quiet Zone. /// public int QuietZone { get { return this.quietZone; } set { this.quietZone = value; } } int quietZone; /// /// Renders the matrix code. /// protected internal override void Render(XGraphics gfx, XBrush brush, XPoint position) { XGraphicsState state = gfx.Save(); switch (this.direction) { case CodeDirection.RightToLeft: gfx.RotateAtTransform(180, position); break; case CodeDirection.TopToBottom: gfx.RotateAtTransform(90, position); break; case CodeDirection.BottomToTop: gfx.RotateAtTransform(-90, position); break; } XPoint pos = position + CodeBase.CalcDistance(this.anchor, AnchorType.TopLeft, this.size); if (this.matrixImage == null) this.matrixImage = DataMatrixImage.GenerateMatrixImage(Text, Encoding, Rows, Columns); if (QuietZone > 0) { XSize sizeWithZone = new XSize(this.size.width, this.size.height); sizeWithZone.width = sizeWithZone.width / (Columns + 2 * QuietZone) * Columns; sizeWithZone.height = sizeWithZone.height / (Rows + 2 * QuietZone) * Rows; XPoint posWithZone = new XPoint(pos.X, pos.Y); posWithZone.X += size.width / (Columns + 2 * QuietZone) * QuietZone; posWithZone.Y += size.height / (Rows + 2 * QuietZone) * QuietZone; gfx.DrawRectangle(XBrushes.White, pos.x, pos.y, size.width, size.height); gfx.DrawImage(matrixImage, posWithZone.x, posWithZone.y, sizeWithZone.width, sizeWithZone.height); } else gfx.DrawImage(matrixImage, pos.x, pos.y, this.size.width, this.size.height); gfx.Restore(state); } /// /// Determines whether the specified string can be used as data in the DataMatrix. /// /// The code to be checked. protected override void CheckCode(string text) { if (text == null) throw new ArgumentNullException("text"); DataMatrixImage mImage = new DataMatrixImage(Text, Encoding, Rows, Columns); mImage.Iec16022Ecc200(Columns, Rows, Encoding, Text.Length, Text, 0, 0, 0); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/ThickThinBarcodeRenderer.cs0000644000175000001440000001322111435766646027352 0ustar00gabeusers00000000000000// // PDFsharp - A library for processing PDF // // Authors: // Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System; using System.Diagnostics; using PdfSharp.Drawing; namespace PdfSharp.Drawing.BarCodes { /// /// Internal base class for several bar code types. /// public abstract class ThickThinBarCode : BarCode // TODO: The name is not optimal { /// /// Initializes a new instance of the class. /// public ThickThinBarCode(string code, XSize size, CodeDirection direction) : base(code, size, direction) { } internal override void InitRendering(BarCodeRenderInfo info) { base.InitRendering(info); CalcThinBarWidth(info); info.BarHeight = Size.Height; // HACK in ThickThinBarCode if (this.textLocation != TextLocation.None) info.BarHeight *= 4.0 / 5; #if DEBUG_ XColor back = XColors.LightSalmon; back.A = 0.3; XSolidBrush brush = new XSolidBrush(back); info.Gfx.DrawRectangle(brush, new XRect(info.Center - this.size / 2, this.size)); #endif switch (this.direction) { case CodeDirection.RightToLeft: info.Gfx.RotateAtTransform(180, info.Position); break; case CodeDirection.TopToBottom: info.Gfx.RotateAtTransform(90, info.Position); break; case CodeDirection.BottomToTop: info.Gfx.RotateAtTransform(-90, info.Position); break; } } /// /// Gets or sets the ration between thick an thin lines. Must be between 2 and 3. /// Optimal and also default value is 2.6. /// public override double WideNarrowRatio { get { return this.wideNarrowRatio; } set { if (value > 3 || value < 2) throw new ArgumentOutOfRangeException("value", BcgSR.Invalid2of5Relation); this.wideNarrowRatio = value; } } internal double wideNarrowRatio = 2.6; /// /// Renders a thick or thin line for the bar code. /// /// /// Determines whether a thick or a thin line is about to be rendered. internal void RenderBar(BarCodeRenderInfo info, bool isThick) { double barWidth = GetBarWidth(info, isThick); double height = Size.Height; if (TextLocation != TextLocation.None) height *= 4.0 / 5; XRect rect = new XRect(info.CurrPos.X, info.CurrPos.Y, barWidth, height); info.Gfx.DrawRectangle(info.Brush, rect); info.CurrPos.X += barWidth; } /// /// Renders a thick or thin gap for the bar code. /// /// /// Determines whether a thick or a thin gap is about to be rendered. internal void RenderGap(BarCodeRenderInfo info, bool isThick) { info.CurrPos.X += GetBarWidth(info, isThick); } /// /// Renders a thick bar before or behind the code. /// internal void RenderTurboBit(BarCodeRenderInfo info, bool startBit) { if (startBit) info.CurrPos.X -= 0.5 + GetBarWidth(info, true); else info.CurrPos.X += 0.5; //GetBarWidth(info, true); RenderBar(info, true); if (startBit) info.CurrPos.X += 0.5; //GetBarWidth(info, true); } internal void RenderText(BarCodeRenderInfo info) { if (info.Font == null) info.Font = new XFont("Courier New", Size.Height / 6); XPoint center = info.Position + CodeBase.CalcDistance(this.anchor, AnchorType.TopLeft, this.size); //center.Y += info.Font.Size; info.Gfx.DrawString(this.text, info.Font, info.Brush, new XRect(center, Size), XStringFormats.BottomCenter); } /// /// Gets the width of a thick or a thin line (or gap). CalcLineWidth must have been called before. /// /// /// Determines whether a thick line's with shall be returned. internal double GetBarWidth(BarCodeRenderInfo info, bool isThick) { if (isThick) return info.ThinBarWidth * this.wideNarrowRatio; else return info.ThinBarWidth; } internal abstract void CalcThinBarWidth(BarCodeRenderInfo info); } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/BarCode.cs0000644000175000001440000001300611435766646024016 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.ComponentModel; using PdfSharp.Drawing; namespace PdfSharp.Drawing.BarCodes { /// /// Represents the base class of all bar codes. /// public abstract class BarCode : CodeBase { /// /// Initializes a new instance of the class. /// /// /// /// public BarCode(string text, XSize size, CodeDirection direction) : base(text, size, direction) { this.text = text; this.size = size; this.direction = direction; } /// /// Creates a bar code from the specified code type. /// public static BarCode FromType(CodeType type, string text, XSize size, CodeDirection direction) { switch (type) { case CodeType.Code2of5Interleaved: return new Code2of5Interleaved(text, size, direction); case CodeType.Code3of9Standard: return new Code3of9Standard(text, size, direction); default: #if !SILVERLIGHT throw new InvalidEnumArgumentException("type", (int)type, typeof(CodeType)); #else throw new ArgumentException("type", type.ToString()); #endif } } /// /// Creates a bar code from the specified code type. /// public static BarCode FromType(CodeType type, string text, XSize size) { return FromType(type, text, size, CodeDirection.LeftToRight); } /// /// Creates a bar code from the specified code type. /// public static BarCode FromType(CodeType type, string text) { return FromType(type, text, XSize.Empty, CodeDirection.LeftToRight); } /// /// Creates a bar code from the specified code type. /// public static BarCode FromType(CodeType type) { return FromType(type, String.Empty, XSize.Empty, CodeDirection.LeftToRight); } /// /// When overridden in a derived class gets or sets the wide narrow ratio. /// public virtual double WideNarrowRatio { get { return 0; } set { } } /// /// Gets or sets the location of the text next to the bar code. /// public TextLocation TextLocation { get { return this.textLocation; } set { this.textLocation = value; } } internal TextLocation textLocation; /// /// Gets or sets the length of the data that defines the bar code. /// public int DataLength { get { return this.dataLength; } set { this.dataLength = value; } } internal int dataLength; /// /// Gets or sets the optional start character. /// public char StartChar { get { return this.startChar; } set { this.startChar = value; } } internal char startChar; /// /// Gets or sets the optional end character. /// public char EndChar { get { return this.endChar; } set { this.endChar = value; } } internal char endChar; /// /// Gets or sets a value indicating whether the turbo bit is to be drawn. /// (A turbo bit is something special to Kern (computer output processing) company (as far as I know)) /// public virtual bool TurboBit { get { return this.turboBit; } set { this.turboBit = value; } } internal bool turboBit; internal virtual void InitRendering(BarCodeRenderInfo info) { if (this.text == null) throw new InvalidOperationException(BcgSR.BarCodeNotSet); if (this.Size.IsEmpty) throw new InvalidOperationException(BcgSR.EmptyBarCodeSize); } /// /// When defined in a derived class renders the code. /// protected internal abstract void Render(XGraphics gfx, XBrush brush, XFont font, XPoint position); } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/CodeBase.cs0000644000175000001440000001501711435766646024170 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.ComponentModel; using PdfSharp.Drawing; namespace PdfSharp.Drawing.BarCodes { /// /// Represents the base class of all codes. /// public abstract class CodeBase { /// /// Initializes a new instance of the class. /// public CodeBase(string text, XSize size, CodeDirection direction) { this.text = text; this.size = size; this.direction = direction; } //public static CodeBase FromType(CodeType type, string text, XSize size, CodeDirection direction) //{ // switch (type) // { // case CodeType.Code2of5Interleaved: // return new Code2of5Interleaved(text, size, direction); // case CodeType.Code3of9Standard: // return new Code3of9Standard(text, size, direction); // default: // throw new InvalidEnumArgumentException("type", (int)type, typeof(CodeType)); // } //} //public static CodeBase FromType(CodeType type, string text, XSize size) //{ // return FromType(type, text, size, CodeDirection.LeftToRight); //} //public static CodeBase FromType(CodeType type, string text) //{ // return FromType(type, text, XSize.Empty, CodeDirection.LeftToRight); //} //public static CodeBase FromType(CodeType type) //{ // return FromType(type, String.Empty, XSize.Empty, CodeDirection.LeftToRight); //} /// /// Gets or sets the size. /// public XSize Size { get { return this.size; } set { this.size = value; } } internal XSize size; /// /// Gets or sets the text the bar code shall represent. /// public string Text { get { return this.text; } set { CheckCode(value); this.text = value; } } internal string text; /// /// Always MiddleCenter. /// public AnchorType Anchor { get { return this.anchor; } set { this.anchor = value; } } internal AnchorType anchor; /// /// Gets or sets the drawing direction. /// public CodeDirection Direction { get { return this.direction; } set { this.direction = value; } } internal CodeDirection direction; /// /// When implemented in a derived class, determines whether the specified string can be used as Text /// for this bar code type. /// /// The code string to check. /// True if the text can be used for the actual barcode. protected abstract void CheckCode(string text); /// /// Calculates the distance between an old anchor point and a new anchor point. /// /// /// /// public static XVector CalcDistance(AnchorType oldType, AnchorType newType, XSize size) { if (oldType == newType) return new XVector(); XVector result; Delta delta = CodeBase.deltas[(int)oldType, (int)newType]; result = new XVector(size.width / 2 * delta.x, size.height / 2 * delta.y); return result; } struct Delta { public Delta(int x, int y) { this.x = x; this.y = y; } public int x; public int y; } static Delta[,] deltas = new Delta[9, 9] { {new Delta(0, 0), new Delta(1, 0), new Delta(2, 0), new Delta(0, 1), new Delta(1, 1), new Delta(2, 1), new Delta(0, 2), new Delta(1, 2), new Delta(2, 2)}, {new Delta(-1, 0), new Delta(0, 0), new Delta(1, 0), new Delta(-1, 1), new Delta(0, 1), new Delta(1, 1), new Delta(-1, 2), new Delta(0, 2), new Delta(1, 2)}, {new Delta(-2, 0), new Delta(-1, 0), new Delta(0, 0), new Delta(-2, 1), new Delta(-1, 1), new Delta(0, 1), new Delta(-2, 2), new Delta(-1, 2), new Delta(0, 2)}, {new Delta(0, -1), new Delta(1, -1), new Delta(2, -1), new Delta(0, 0), new Delta(1, 0), new Delta(2, 0), new Delta(0, 1), new Delta(1, 1), new Delta(2, 1)}, {new Delta(-1, -1), new Delta(0, -1), new Delta(1, -1), new Delta(-1, 0), new Delta(0, 0), new Delta(1, 0), new Delta(-1, 1), new Delta(0, 1), new Delta(1, 1)}, {new Delta(-2, -1), new Delta(-1, -1), new Delta(0, -1), new Delta(-2, 0), new Delta(-1, 0), new Delta(0, 0), new Delta(-2, 1), new Delta(-1, 1), new Delta(0, 1)}, {new Delta(0, -2), new Delta(1, -2), new Delta(2, -2), new Delta(0, -1), new Delta(1, -1), new Delta(2, -1), new Delta(0, 0), new Delta(1, 0), new Delta(2, 0)}, {new Delta(-1, -2), new Delta(0, -2), new Delta(1, -2), new Delta(-1, -1), new Delta(0, -1), new Delta(1, -1), new Delta(-1, 0), new Delta(0, 0), new Delta(1, 0)}, {new Delta(-2, -2), new Delta(-1, -2), new Delta(0, -2), new Delta(-2, -1), new Delta(-1, -1), new Delta(0, -1), new Delta(-2, 0), new Delta(-1, 0), new Delta(0, 0)}, }; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/enums/0000777000175000001440000000000011533760020023276 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/enums/CodeType.cs0000644000175000001440000000360711435766646025370 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing.BarCodes { /// /// Specifies the type of the bar code. /// public enum CodeType { /// /// The standard 2 of 5 interleaved bar code. /// Code2of5Interleaved, /// /// The standard 3 of 9 bar code. /// Code3of9Standard, /// /// The OMR code. /// Omr, /// /// The data matrix code. /// DataMatrix, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/enums/DataMatrixEncoding.cs0000644000175000001440000000367011435766646027361 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Text; namespace PdfSharp.Drawing.BarCodes { /// /// docDaSt /// public enum DataMatrixEncoding { /// /// docDaSt /// Ascii, /// /// docDaSt /// C40, /// /// docDaSt /// Text, /// /// docDaSt /// X12, /// /// docDaSt /// EDIFACT, /// /// docDaSt /// Base256 } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/enums/CodeDirection.cs0000644000175000001440000000370511435766646026366 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing.BarCodes { /// /// Specifies the drawing direction of the code. /// public enum CodeDirection { /// /// Does not rotate the code. /// LeftToRight, /// /// Rotates the code 180 at the anchor position. /// BottomToTop, /// /// Rotates the code 180 at the anchor position. /// RightToLeft, /// /// Rotates the code 180 at the anchor position. /// TopToBottom, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/enums/TextLocation.cs0000644000175000001440000000403111435766646026261 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing.BarCodes { /// /// Specifies whether and how the text is displayed at the code. /// public enum TextLocation { /// /// No text is drawn. /// None, /// /// The text is located above the code. /// Above, /// /// The text is located below the code. /// Below, /// /// The text is located above within the code. /// AboveEmbedded, /// /// The text is located below within the code. /// BelowEmbedded, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/enums/MarkDistance.cs0000644000175000001440000000364111435766646026217 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing.BarCodes { ///// ///// Valid mark distances for OMR Codes. ///// //public enum MarkDistance //{ // /// // /// 2/6 inch, valid for printing with 6 lpi. (line height = 12 pt). // /// // Inch1_6, // /// // /// 2/6 inch, valid for printing with 6 lpi (line height = 12 pt). // /// // Inch2_6, // /// // /// 2/8 inch, valid for printing with 8 lpi (line height = 9 pt). // /// // Inch2_8 //} }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/enums/AnchorType.cs0000644000175000001440000000467511435766646025736 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Drawing.BarCodes { /// /// Specifies whether and how the text is displayed at the code area. /// public enum AnchorType { /// /// The anchor is located top left. /// TopLeft, /// /// The anchor is located top center. /// TopCenter, /// /// The anchor is located top right. /// TopRight, /// /// The anchor is located middle left. /// MiddleLeft, /// /// The anchor is located middle center. /// MiddleCenter, /// /// The anchor is located middle right. /// MiddleRight, /// /// The anchor is located bottom left. /// BottomLeft, /// /// The anchor is located bottom center. /// BottomCenter, /// /// The anchor is located bottom right. /// BottomRight, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/DataMatrixImage.cs0000644000175000001440000002135511435766646025526 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // David Stephensen (mailto:David.Stephensen@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; #if GDI using System.Drawing; using System.Drawing.Imaging; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Drawing; // ======================================================================================== // ======================================================================================== // ===== THIS CLASS IS A FAKE. THE OPEN SOURCE VERSION OF PDFSHARP DOES NOT IMPLEMENT ===== // ===== A DATAMATRIX CODE. THIS IS BECAUSE OF THE ISO COPYRIGHT. ===== // ======================================================================================== // ======================================================================================== // Even if it looks like a datamatrix code it is just random namespace PdfSharp.Drawing.BarCodes { /// /// Creates the XImage object for a DataMatrix. /// Important note for OpenSource version of PDFsharp: /// The generated image object only contains random data. /// If you need the correct implementation as defined in the ISO/IEC 16022:2000 specification, /// please contact empira Software GmbH via www.pdfsharp.com. /// internal class DataMatrixImage { public static XImage GenerateMatrixImage(string text, string encoding, int rows, int columns) { DataMatrixImage dataMatrixImage = new DataMatrixImage(text, encoding, rows, columns); return dataMatrixImage.DrawMatrix(); } public DataMatrixImage(string text, string encoding, int rows, int columns) { this.text = text; this.encoding = encoding; this.rows = rows; this.columns = columns; } string text; string encoding; int rows; int columns; /// /// Possible ECC200 Matrixes /// static Ecc200Block[] ecc200Sizes = { new Ecc200Block( 10, 10, 10, 10, 3, 3, 5), // new Ecc200Block( 12, 12, 12, 12, 5, 5, 7), // new Ecc200Block( 8, 18, 8, 18, 5, 5, 7), // new Ecc200Block( 14, 14, 14, 14, 8, 8, 10), // new Ecc200Block( 8, 32, 8, 16, 10, 10, 11), // new Ecc200Block( 16, 16, 16, 16, 12, 12, 12), // new Ecc200Block( 12, 26, 12, 26, 16, 16, 14), // new Ecc200Block( 18, 18, 18, 18, 18, 18, 14), // new Ecc200Block( 20, 20, 20, 20, 22, 22, 18), // new Ecc200Block( 12, 36, 12, 18, 22, 22, 18), // new Ecc200Block( 22, 22, 22, 22, 30, 30, 20), // new Ecc200Block( 16, 36, 16, 18, 32, 32, 24), // new Ecc200Block( 24, 24, 24, 24, 36, 36, 24), // new Ecc200Block( 26, 26, 26, 26, 44, 44, 28), // new Ecc200Block( 16, 48, 16, 24, 49, 49, 28), // new Ecc200Block( 32, 32, 16, 16, 62, 62, 36), // new Ecc200Block( 36, 36, 18, 18, 86, 86, 42), // new Ecc200Block( 40, 40, 20, 20, 114, 114, 48), // new Ecc200Block( 44, 44, 22, 22, 144, 144, 56), // new Ecc200Block( 48, 48, 24, 24, 174, 174, 68), // new Ecc200Block( 52, 52, 26, 26, 204, 102, 42), // new Ecc200Block( 64, 64, 16, 16, 280, 140, 56), // new Ecc200Block( 72, 72, 18, 18, 368, 92, 36), // new Ecc200Block( 80, 80, 20, 20, 456, 114, 48), // new Ecc200Block( 88, 88, 22, 22, 576, 144, 56), // new Ecc200Block( 96, 96, 24, 24, 696, 174, 68), // new Ecc200Block(104, 104, 26, 26, 816, 136, 56), // new Ecc200Block(120, 120, 20, 20, 1050, 175, 68), // new Ecc200Block(132, 132, 22, 22, 1304, 163, 62), // new Ecc200Block(144, 144, 24, 24, 1558, 156, 62), // 156*4+155*2 new Ecc200Block( 0, 0, 0, 0, 0, 0, 0) // terminate }; public XImage DrawMatrix() { return CreateImage(DataMatrix(), this.rows, this.columns); } /// /// Creates the DataMatrix code. /// internal char[] DataMatrix() { int matrixColumns = this.columns; int matrixRows = this.rows; Ecc200Block matrix = new Ecc200Block(0, 0, 0, 0, 0, 0, 0); foreach (Ecc200Block eccmatrix in ecc200Sizes) { matrix = eccmatrix; if (matrix.Width != columns || matrix.Height != rows) continue; else break; } char[] grid = new char[matrixColumns * matrixRows]; Random rand = new Random(); for (int ccol = 0; ccol < matrixColumns; ccol++) grid[ccol] = (char)1; for (int rrows = 1; rrows < matrixRows; rrows++) { grid[rrows * matrixRows] = (char)1; for (int ccol = 1; ccol < matrixColumns; ccol++) grid[rrows * matrixRows + ccol] = (char)rand.Next(2); } if (grid == null || matrixColumns == 0) return null; //No barcode produced; return grid; } /// /// Encodes the DataMatrix. /// internal char[] Iec16022Ecc200(int columns, int rows, string encoding, int barcodelen, string barcode, int len, int max, int ecc) { return null; } /// /// Creates a DataMatrix image object. /// /// A hex string like "AB 08 C3...". /// I.e. 26 for a 26x26 matrix public XImage CreateImage(char[] code, int size)//(string code, int size) { return CreateImage(code, size, size, 10); } /// /// Creates a DataMatrix image object. /// public XImage CreateImage(char[] code, int rows, int columns) { return CreateImage(code, rows, columns, 10); } /// /// Creates a DataMatrix image object. /// public XImage CreateImage(char[] code, int rows, int columns, int pixelsize) { #if GDI Bitmap bm = new Bitmap(columns * pixelsize, rows * pixelsize); using (Graphics gfx = Graphics.FromImage(bm)) { gfx.FillRectangle(System.Drawing.Brushes.White, new Rectangle(0, 0, columns * pixelsize, rows * pixelsize)); for (int i = rows - 1; i >= 0; i--) { for (int j = 0; j < columns; j++) { if (code[((rows - 1) - i) * columns + j] == (char)1) gfx.FillRectangle(System.Drawing.Brushes.Black, j * pixelsize, i * pixelsize, pixelsize, pixelsize); } } System.Drawing.Pen pen = new System.Drawing.Pen(System.Drawing.Color.Firebrick, pixelsize); gfx.DrawLine(pen, 0, 0, rows * pixelsize, columns * pixelsize); gfx.DrawLine(pen, columns * pixelsize, 0, 0, rows * pixelsize); } XImage image = XImage.FromGdiPlusImage(bm); image.Interpolate = false; return image; #elif WPF return null; #endif } } struct Ecc200Block { public int Height; public int Width; public int CellHeight; public int CellWidth; public int Bytes; public int DataBlock; public int RSBlock; public Ecc200Block(int h, int w, int ch, int cw, int bytes, int datablock, int rsblock) { Height = h; Width = w; CellHeight = ch; CellWidth = cw; Bytes = bytes; DataBlock = datablock; RSBlock = rsblock; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/Code2of5Interleaved.cs0000644000175000001440000001524111435766646026253 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using PdfSharp.Drawing; namespace PdfSharp.Drawing.BarCodes { /// /// Implementation of the Code 2 of 5 bar code. /// public class Code2of5Interleaved : ThickThinBarCode { /// /// Initializes a new instance of Interleaved2of5. /// public Code2of5Interleaved() : base("", XSize.Empty, CodeDirection.LeftToRight) { } /// /// Initializes a new instance of Interleaved2of5. /// public Code2of5Interleaved(string code) : base(code, XSize.Empty, CodeDirection.LeftToRight) { } /// /// Initializes a new instance of Interleaved2of5. /// public Code2of5Interleaved(string code, XSize size) : base(code, size, CodeDirection.LeftToRight) { } /// /// Initializes a new instance of Interleaved2of5. /// public Code2of5Interleaved(string code, XSize size, CodeDirection direction) : base(code, size, direction) { } /// /// Returns an array of size 5 that represents the thick (true) and thin (false) lines or spaces /// representing the specified digit. /// /// The digit to represent. static bool[] ThickAndThinLines(int digit) { return Lines[digit]; } static bool[][] Lines = new bool[][] { new bool[] {false, false, true, true, false}, new bool[] {true, false, false, false, true}, new bool[] {false, true, false, false, true}, new bool[] {true, true, false, false, false}, new bool[] {false, false, true, false, true}, new bool[] {true, false, true, false, false}, new bool[] {false, true, true, false, false}, new bool[] {false, false, false, true, true}, new bool[] {true, false, false, true, false}, new bool[] {false, true, false, true, false}, }; /// /// Renders the bar code. /// protected internal override void Render(XGraphics gfx, XBrush brush, XFont font, XPoint position) { XGraphicsState state = gfx.Save(); BarCodeRenderInfo info = new BarCodeRenderInfo(gfx, brush, font, position); InitRendering(info); info.CurrPosInString = 0; //info.CurrPos = info.Center - this.size / 2; info.CurrPos = position - CodeBase.CalcDistance(AnchorType.TopLeft, this.anchor, this.size); if (TurboBit) RenderTurboBit(info, true); RenderStart(info); while (info.CurrPosInString < this.text.Length) RenderNextPair(info); RenderStop(info); if (TurboBit) RenderTurboBit(info, false); if (this.TextLocation != TextLocation.None) RenderText(info); gfx.Restore(state); } /// /// Calculates the thick and thin line widths, /// taking into account the required rendering size. /// internal override void CalcThinBarWidth(BarCodeRenderInfo info) { /* * The total width is the sum of the following parts: * Starting lines = 4 * thin * + * Code Representation = (2 * thick + 3 * thin) * code.Length * + * Stopping lines = 1 * thick + 2 * thin * * with r = relation ( = thick / thin), this results in * * Total width = (6 + r + (2 * r + 3) * text.Length) * thin */ double thinLineAmount = 6 + this.wideNarrowRatio + (2 * this.wideNarrowRatio + 3) * this.text.Length; info.ThinBarWidth = this.Size.Width / thinLineAmount; } private void RenderStart(BarCodeRenderInfo info) { RenderBar(info, false); RenderGap(info, false); RenderBar(info, false); RenderGap(info, false); } private void RenderStop(BarCodeRenderInfo info) { RenderBar(info, true); RenderGap(info, false); RenderBar(info, false); } /// /// Renders the next digit pair as bar code element. /// private void RenderNextPair(BarCodeRenderInfo info) { int digitForLines = int.Parse(this.text[info.CurrPosInString].ToString()); int digitForGaps = int.Parse(this.text[info.CurrPosInString + 1].ToString()); bool[] linesArray = Lines[digitForLines]; bool[] gapsArray = Lines[digitForGaps]; for (int idx = 0; idx < 5; ++idx) { RenderBar(info, linesArray[idx]); RenderGap(info, gapsArray[idx]); } info.CurrPosInString += 2; } /// /// Checks the code to be convertible into an interleaved 2 of 5 bar code. /// /// The code to be checked. protected override void CheckCode(string text) { #if true_ if (text == null) throw new ArgumentNullException("text"); if (text == "") throw new ArgumentException(BcgSR.Invalid2Of5Code(text)); if (text.Length % 2 != 0) throw new ArgumentException(BcgSR.Invalid2Of5Code(text)); foreach (char ch in text) { if (!Char.IsDigit(ch)) throw new ArgumentException(BcgSR.Invalid2Of5Code(text)); } #endif } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/BarCodeRenderInfo.cs0000644000175000001440000000371611435766646026001 0ustar00gabeusers00000000000000// // PDFsharp - A library for processing PDF // // Authors: // Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System; using System.Diagnostics; using PdfSharp.Drawing; namespace PdfSharp.Drawing.BarCodes { /// /// Holds all temporary information needed during rendering. /// class BarCodeRenderInfo { public BarCodeRenderInfo(XGraphics gfx, XBrush brush, XFont font, XPoint position) { Gfx = gfx; Brush = brush; Font = font; Position = position; } public XGraphics Gfx; public XBrush Brush; public XFont Font; public XPoint Position; public double BarHeight; public XPoint CurrPos; public int CurrPosInString; public double ThinBarWidth; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/BcgSR.cs0000644000175000001440000000701611435766646023463 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Drawing.BarCodes { // TODO: Mere with PDFsharp strings table /// /// String resources for the empira barcode renderer. /// internal class BcgSR { internal static string Invalid2Of5Code(string code) { return String.Format("'{0}' is not a valid code for an interleave 2 of 5 bar code. It can only represent an even number of digits.", code); } internal static string Invalid3Of9Code(string code) { return String.Format("'{0}' is not a valid code for a 3 of 9 standard bar code.", code); } internal static string BarCodeNotSet { get { return "A text must be set before rendering the bar code."; } } internal static string EmptyBarCodeSize { get { return "A non-empty size must be set before rendering the bar code."; } } internal static string Invalid2of5Relation { get { return "Value of relation between thick and thin lines on the interleaved 2 of 5 code must be between 2 and 3."; } } internal static string InvalidMarkName(string name) { return String.Format("'{0}' is not a valid mark name for this OMR representation.", name); } internal static string OmrAlreadyInitialized { get { return "Mark descriptions cannot be set when marks have already been set on OMR."; } } internal static string DataMatrixTooBig { get { return "The given data and encoding combination is too big for the matrix size."; } } internal static string DataMatrixNotSupported { get { return "Zero sizes, odd sizes and other than ecc200 coded DataMatrix is not supported."; } } internal static string DataMatrixNull { get { return "No DataMatrix code is produced."; } } internal static string DataMatrixInvalid(int columns, int rows) { return String.Format("'{1}'x'{0}' is an invalid ecc200 DataMatrix size.", columns, rows); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/OmrData.cs0000644000175000001440000000775411435766646024063 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Text; namespace PdfSharp.Drawing.BarCodes { #if _ /// /// Represents the data coded within the OMR code. /// class OmrData { private OmrData() { } public static OmrData ForTesting { get { OmrData data = new OmrData(); data.AddMarkDescription("LK"); data.AddMarkDescription("DGR"); data.AddMarkDescription("GM1"); data.AddMarkDescription("GM2"); data.AddMarkDescription("GM4"); data.AddMarkDescription("GM8"); data.AddMarkDescription("GM16"); data.AddMarkDescription("GM32"); data.AddMarkDescription("ZS1"); data.AddMarkDescription("ZS2"); data.AddMarkDescription("ZS3"); data.AddMarkDescription("ZS4"); data.AddMarkDescription("ZS5"); data.InitMarks(); return data; } } ///// ///// NYI: Get OMR description read from text file. ///// ///// An OmrData object. //public static OmrData FromDescriptionFile(string filename) //{ // throw new NotImplementedException(); //} /// /// Adds a mark description by name. /// /// The name to for setting or unsetting the mark. private void AddMarkDescription(string name) { if (this.marksInitialized) throw new InvalidOperationException(BcgSR.OmrAlreadyInitialized); this.nameToIndex[name] = this.addedDescriptions; ++this.addedDescriptions; } private void InitMarks() { if (this.addedDescriptions == 0) throw new InvalidOperationException(); this.marks = new bool[this.addedDescriptions]; this.marks.Initialize(); this.marksInitialized = true; } private int FindIndex(string name) { if (!this.marksInitialized) InitMarks(); if (!this.nameToIndex.Contains(name)) throw new ArgumentException(BcgSR.InvalidMarkName(name)); return (int)this.nameToIndex[name]; } public void SetMark(string name) { int idx = FindIndex(name); this.marks[idx] = true; } public void UnsetMark(string name) { int idx = FindIndex(name); this.marks[idx] = false; } public bool[] Marks { get { return this.marks; } } System.Collections.Hashtable nameToIndex = new Hashtable(); bool[] marks; int addedDescriptions = 0; bool marksInitialized = false; } #endif } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/Code3of9Standard.cs0000644000175000001440000002371011435766646025556 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; namespace PdfSharp.Drawing.BarCodes { /// /// Imlpementation of the Code 3 of 9 bar code. /// public class Code3of9Standard : ThickThinBarCode { /// /// Initializes a new instance of Standard3of9. /// public Code3of9Standard() : base("", XSize.Empty, CodeDirection.LeftToRight) { } /// /// Initializes a new instance of Standard3of9. /// public Code3of9Standard(string code) : base(code, XSize.Empty, CodeDirection.LeftToRight) { } /// /// Initializes a new instance of Standard3of9. /// public Code3of9Standard(string code, XSize size) : base(code, size, CodeDirection.LeftToRight) { } /// /// Initializes a new instance of Standard3of9. /// public Code3of9Standard(string code, XSize size, CodeDirection direction) : base(code, size, direction) { } /// /// Returns an array of size 9 that represents the thick (true) and thin (false) lines and spaces /// representing the specified digit. /// /// The character to represent. private static bool[] ThickThinLines(char ch) { return Lines["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%*".IndexOf(ch)]; } static bool[][] Lines = new bool[][] { // '0' new bool[] {false, false, false, true, true, false, true, false, false}, // '1' new bool[] {true, false, false, true, false, false, false, false, true}, // '2' new bool[] {false, false, true, true, false, false, false, false, true}, // '3' new bool[] {true, false, true, true, false, false, false, false, false}, // '4' new bool[] {false, false, false, true, true, false, false, false, true}, // '5' new bool[] {true, false, false, true, true, false, false, false, false}, // '6' new bool[] {false, false, true, true, true, false, false, false, false}, // '7' new bool[] {false, false, false, true, false, false, true, false, true}, // '8' new bool[] {true, false, false, true, false, false, true, false, false}, // '9' new bool[] {false, false, true, true, false, false, true, false, false}, // 'A' new bool[] {true, false, false, false, false, true, false, false, true}, // 'B' new bool[] {false, false, true, false, false, true, false, false, true}, // 'C' new bool[] {true, false, true, false, false, true, false, false, false}, // 'D' new bool[] {false, false, false, false, true, true, false, false, true}, // 'E' new bool[] {true, false, false, false, true, true, false, false, false}, // 'F' new bool[] {false, false, true, false, true, true, false, false, false}, // 'G' new bool[] {false, false, false, false, false, true, true, false, true}, // 'H' new bool[] {true, false, false, false, false, true, true, false, false}, // 'I' new bool[] {false, false, true, false, false, true, true, false, false}, // 'J' new bool[] {false, false, false, false, true, true, true, false, false}, // 'K' new bool[] {true, false, false, false, false, false, false, true, true}, // 'L' new bool[] {false, false, true, false, false, false, false, true, true}, // 'M' new bool[] {true, false, true, false, false, false, false, true, false}, // 'N' new bool[] {false, false, false, false, true, false, false, true, true}, // 'O' new bool[] {true, false, false, false, true, false, false, true, false}, // 'P': new bool[] {false, false, true, false, true, false, false, true, false}, // 'Q' new bool[] {false, false, false, false, false, false, true, true, true}, // 'R' new bool[] {true, false, false, false, false, false, true, true, false}, // 'S' new bool[] {false, false, true, false, false, false, true, true, false}, // 'T' new bool[] {false, false, false, false, true, false, true, true, false}, // 'U' new bool[] {true, true, false, false, false, false, false, false, true}, // 'V' new bool[] {false, true, true, false, false, false, false, false, true}, // 'W' new bool[] {true, true, true, false, false, false, false, false, false}, // 'X' new bool[] {false, true, false, false, true, false, false, false, true}, // 'Y' new bool[] {true, true, false, false, true, false, false, false, false}, // 'Z' new bool[] {false, true, true, false, true, false, false, false, false}, // '-' new bool[] {false, true, false, false, false, false, true, false, true}, // '.' new bool[] {true, true, false, false, false, false, true, false, false}, // ' ' new bool[] {false, true, true, false, false, false, true, false, false}, // '$' new bool[] {false, true, false, true, false, true, false, false, false}, // '/' new bool[] {false, true, false, true, false, false, false, true, false}, // '+' new bool[] {false, true, false, false, false, true, false, true, false}, // '%' new bool[] {false, false, false, true, false, true, false, true, false}, // '*' new bool[] {false, true, false, false, true, false, true, false, false}, }; /// /// Calculates the thick and thin line widths, /// taking into account the required rendering size. /// internal override void CalcThinBarWidth(BarCodeRenderInfo info) { /* * The total width is the sum of the following parts: * Starting lines = 3 * thick + 7 * thin * + * Code Representation = (3 * thick + 7 * thin) * code.Length * + * Stopping lines = 3 * thick + 6 * thin * * with r = relation ( = thick / thin), this results in * * Total width = (13 + 6 * r + (3 * r + 7) * code.Length) * thin */ double thinLineAmount = 13 + 6 * this.wideNarrowRatio + (3 * this.wideNarrowRatio + 7) * this.text.Length; info.ThinBarWidth = this.Size.Width / thinLineAmount; } /// /// Checks the code to be convertible into an standard 3 of 9 bar code. /// /// The code to be checked. protected override void CheckCode(string text) { if (text == null) throw new ArgumentNullException("text"); if (text.Length == 0) throw new ArgumentException(BcgSR.Invalid3Of9Code(text)); foreach (char ch in text) { if ("0123456789ABCDEFGHIJKLMNOP'QRSTUVWXYZ-. $/+%*".IndexOf(ch) < 0) throw new ArgumentException(BcgSR.Invalid3Of9Code(text)); } } /// /// Renders the bar code. /// protected internal override void Render(XGraphics gfx, XBrush brush, XFont font, XPoint position) { XGraphicsState state = gfx.Save(); BarCodeRenderInfo info = new BarCodeRenderInfo(gfx, brush, font, position); InitRendering(info); info.CurrPosInString = 0; //info.CurrPos = info.Center - this.size / 2; info.CurrPos = position - CodeBase.CalcDistance(AnchorType.TopLeft, this.anchor, this.size); if (TurboBit) RenderTurboBit(info, true); RenderStart(info); while (info.CurrPosInString < this.text.Length) { RenderNextChar(info); RenderGap(info, false); } RenderStop(info); if (TurboBit) RenderTurboBit(info, false); if (TextLocation != TextLocation.None) RenderText(info); gfx.Restore(state); } private void RenderNextChar(BarCodeRenderInfo info) { RenderChar(info, this.text[info.CurrPosInString]); ++info.CurrPosInString; } private void RenderChar(BarCodeRenderInfo info, char ch) { bool[] thickThinLines = ThickThinLines(ch); int idx = 0; while (idx < 9) { RenderBar(info, thickThinLines[idx]); if (idx < 8) RenderGap(info, thickThinLines[idx + 1]); idx += 2; } } private void RenderStart(BarCodeRenderInfo info) { RenderChar(info, '*'); RenderGap(info, false); } private void RenderStop(BarCodeRenderInfo info) { RenderChar(info, '*'); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/CodeOmr.cs0000644000175000001440000001762611435766646024063 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Klaus Potzesny (mailto:Klaus.Potzesny@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.ComponentModel; using PdfSharp.Drawing; namespace PdfSharp.Drawing.BarCodes { /// /// Represents an OMR code. /// public class CodeOmr : BarCode { /// /// initializes a new OmrCode with the given data. /// public CodeOmr(string text, XSize size, CodeDirection direction) : base(text, size, direction) { } /// /// Renders the OMR code. /// protected internal override void Render(XGraphics gfx, XBrush brush, XFont font, XPoint position) { XGraphicsState state = gfx.Save(); switch (this.direction) { case CodeDirection.RightToLeft: gfx.RotateAtTransform(180, position); break; case CodeDirection.TopToBottom: gfx.RotateAtTransform(90, position); break; case CodeDirection.BottomToTop: gfx.RotateAtTransform(-90, position); break; } //XPoint pt = center - this.size / 2; XPoint pt = position - CodeBase.CalcDistance(AnchorType.TopLeft, this.anchor, this.size); uint value; uint.TryParse(this.text, out value); #if true // HACK: Project Wallenwein: set LK value |= 1; this.synchronizeCode = true; #endif if (this.synchronizeCode) { XRect rect = new XRect(pt.x, pt.y, this.makerThickness, this.size.height); gfx.DrawRectangle(brush, rect); pt.x += 2 * this.makerDistance; } for (int idx = 0; idx < 32; idx++) { if ((value & 1) == 1) { XRect rect = new XRect(pt.x + idx * this.makerDistance, pt.y, this.makerThickness, this.size.height); gfx.DrawRectangle(brush, rect); } value = value >> 1; } gfx.Restore(state); } /// /// Gets or sets a value indicating whether a synchronize mark is rendered. /// public bool SynchronizeCode { get { return this.synchronizeCode; } set { this.synchronizeCode = value; } } bool synchronizeCode; /// /// Gets or sets the distance of the markers. /// public double MakerDistance { get { return this.makerDistance; } set { this.makerDistance = value; } } double makerDistance = 12; // 1/6" /// /// Gets or sets the thickness of the makers. /// public double MakerThickness { get { return this.makerThickness; } set { this.makerThickness = value; } } double makerThickness = 1; ///// ///// Renders the mark at the given position. ///// ///// The mark position to render. //private void RenderMark(int position) //{ // double yPos = this.TopLeft.Y + this.UpperDistance + position * ToUnit(this.markDistance).Centimeter; // //Center mark // double xPos = this.TopLeft.X + this.Width / 2 - this.MarkWidth / 2; // this.gfx.DrawLine(this.pen, xPos, yPos, xPos + this.MarkWidth, yPos); //} ///// ///// Distance of the marks. Default is 2/6 inch. ///// //public MarkDistance MarkDistance //{ // get { return this.markDistance; } // set { this.markDistance = value; } //} //private MarkDistance markDistance = MarkDistance.Inch2_6; ///// ///// Converts a mark distance to an XUnit object. ///// ///// The mark distance to convert. ///// The converted mark distance. //public static XUnit ToUnit(MarkDistance markDistance) //{ // switch (markDistance) // { // case MarkDistance.Inch1_6: // return XUnit.FromInch(1.0 / 6.0); // case MarkDistance.Inch2_6: // return XUnit.FromInch(2.0 / 6.0); // case MarkDistance.Inch2_8: // return XUnit.FromInch(2.0 / 8.0); // default: // throw new ArgumentOutOfRangeException("markDistance"); // } //} ///// ///// The upper left point of the reading zone. ///// //public XPoint TopLeft //{ // get // { // XPoint topLeft = this.center; // topLeft.X -= this.Width; // double height = this.upperDistance + this.lowerDistance; // height += (this.data.Marks.Length - 1) * ToUnit(this.MarkDistance).Centimeter; // topLeft.Y -= height / 2; // return topLeft; // } //} ///// ///// the upper distance from position to the first mark. ///// The default value is 8 / 6 inch. ///// //double UpperDistance //{ // get { return this.upperDistance; } // set { this.upperDistance = value; } //} //private double upperDistance = XUnit.FromInch(8.0 / 6.0).Centimeter; ///// ///// The lower distance from the last possible mark to the end of the reading zone. ///// The default value is ///// //double LowerDistance //{ // get { return this.lowerDistance; } // set { this.lowerDistance = value; } //} //private double lowerDistance = XUnit.FromInch(2.0 / 6.0).Centimeter; ///// ///// Gets or sets the width of the reading zone. ///// Default and minimum is 3/12 inch. ///// //public double Width //{ // get { return this.width; } // set { this.width = value; } //} //double width = XUnit.FromInch(3.0 / 12.0).Centimeter; ///// ///// Gets or sets the mark width. Default is 1/2 * width. ///// //public XUnit MarkWidth //{ // get // { // if (this.markWidth > 0) // return this.markWidth; // else // return this.width / 2; // } // set { this.markWidth = value; } //} //XUnit markWidth; ///// ///// Gets or sets the width of the mark line. Default is 1pt. ///// //public XUnit MarkLineWidth //{ // get { return this.markLineWidth; } // set { this.markLineWidth = value; } //} //XUnit markLineWidth = 1; /// /// Determines whether the specified string can be used as Text for the OMR code. /// protected override void CheckCode(string text) { } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.BarCodes/MatrixCode.cs0000644000175000001440000000733611435766646024567 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // David Stephensen (mailto:David.Stephensen@pdfsharp.com) // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.ComponentModel; using PdfSharp.Drawing; namespace PdfSharp.Drawing.BarCodes { /// /// Represents the base class of all 2D codes. /// public abstract class MatrixCode : CodeBase { /// /// Initializes a new instance of the class. /// public MatrixCode(string text, string encoding, int rows, int columns, XSize size) : base(text, size, CodeDirection.LeftToRight) { this.encoding = encoding; if (String.IsNullOrEmpty(this.encoding)) this.encoding = new String('a', this.text.Length); if (columns < rows) { this.rows = columns; this.columns = rows; } else { this.columns = columns; this.rows = rows; } this.Text = text; } /// /// Gets or sets the encoding. docDaSt /// public string Encoding { get { return this.encoding; } set { this.encoding = value; this.matrixImage = null; } } internal string encoding; /// /// docDaSt /// public int Columns { get { return this.columns; } set { this.columns = value; this.matrixImage = null; } } internal int columns; /// /// docDaSt /// public int Rows { get { return this.rows; } set { this.rows = value; this.matrixImage = null; } } internal int rows; /// /// docDaSt /// public new string Text { get { return base.Text; } set { base.Text = value; this.matrixImage = null; } } internal XImage matrixImage; /// /// When implemented in a derived class renders the 2D code. /// protected internal abstract void Render(XGraphics gfx, XBrush brush, XPoint center); /// /// Determines whether the specified string can be used as Text for this matrix code type. /// protected override void CheckCode(string text) { } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Actions/0000777000175000001440000000000011533760020021203 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Actions/enums/0000777000175000001440000000000011533760020022332 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Actions/enums/PdfNamedActionNames.cs0000644000175000001440000000355111435766646026506 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Pdf.AcroForms { /// /// Specifies the predefined PDF actions. /// public enum PdfNamedActionNames { /// /// Go to next page. /// NextPage, /// /// Go to previous page. /// PrevPage, /// /// Go to first page. /// FirstPage, /// /// Go to last page. /// LastPage } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Actions/PdfAction.cs0000644000175000001440000000640411435766646023426 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf; using PdfSharp.Internal; using PdfSharp.Drawing; namespace PdfSharp.Pdf.Actions { /// /// Represents the base class for all PDF actions. /// public abstract class PdfAction : PdfDictionary { /// /// Initializes a new instance of the class. /// protected PdfAction() { Elements.SetName(Keys.Type, "/Action"); } /// /// Initializes a new instance of the class. /// /// The document that owns this object. protected PdfAction(PdfDocument document) : base(document) { Elements.SetName(Keys.Type, "/Action"); } /// /// Predefined keys of this dictionary. /// internal class Keys : KeysBase { /// /// (Optional) The type of PDF object that this dictionary describes; /// if present, must be Action for an action dictionary. /// [KeyInfo(KeyType.Name | KeyType.Optional, FixedValue = "Action")] public const string Type = "/Type"; /// /// (Required) The type of action that this dictionary describes. /// [KeyInfo(KeyType.Name | KeyType.Required)] public const string S = "/S"; /// /// (Optional; PDF 1.2) The next action or sequence of actions to be performed /// after the action represented by this dictionary. The value is either a /// single action dictionary or an array of action dictionaries to be performed /// in order; see below for further discussion. /// [KeyInfo(KeyType.ArrayOrDictionary | KeyType.Optional)] public const string Next = "/Next"; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Content.Objects/0000777000175000001440000000000011533760020022605 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Content.Objects/enum/0000777000175000001440000000000011533760020023551 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Content.Objects/enum/OpCodeFlags.cs0000644000175000001440000000334111435766646026250 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Pdf.Content.Objects { /// /// Specifies the group of operations the op-code belongs to. /// [Flags] public enum OpCodeFlags { /// /// /// None, /// /// /// TextOut = 0x0001, //Color, Pattern, Images,... } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Content.Objects/enum/OpCodeName.cs0000644000175000001440000000366011435766646026100 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #pragma warning disable 1591 namespace PdfSharp.Pdf.Content.Objects { /// /// The names of the op-codes. /// public enum OpCodeName { // I know that this is not useable in VB or other languages with no case sensitivity. b, B, bx, Bx, BDC, BI, BMC, BT, BX, c, cm, CS, cs, d, d0, d1, Do, DP, EI, EMC, ET, EX, f, F, fx, G, g, gs, h, i, ID, j, J, K, k, l, m, M, MP, n, q, Q, re, RG, rg, ri, s, S, SC, sc, SCN, scn, sh, Tx, Tc, Td, TD, Tf, Tj, TJ, TL, Tm, Tr, Ts, Tw, Tz, v, w, W, Wx, y, QuoteSingle, QuoteDbl, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Content.Objects/Operators.cs0000644000175000001440000003475511435766646025151 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections; using System.Diagnostics; using System.Collections.Generic; namespace PdfSharp.Pdf.Content.Objects { /// /// Represents a PDF content stream operator description. /// public sealed class OpCode { OpCode() { } /// /// Initializes a new instance of the class. /// /// The name. /// The enum value of the operator. /// The number of operands. /// The postscript equivalent, or null, if no such operation exists. /// The flags. /// The description from Adobe PDF Reference. internal OpCode(string name, OpCodeName opcodeName, int operands, string postscript, OpCodeFlags flags, string description) { Name = name; OpCodeName = opcodeName; Operands = operands; Postscript = postscript; Flags = flags; Description = description; } /// /// The name of the operator. /// public readonly string Name; /// /// The enum value of the operator. /// public readonly OpCodeName OpCodeName; /// /// The number of operands. -1 indicates a variable number of operands. /// public readonly int Operands; /// /// The flags. /// public readonly OpCodeFlags Flags; /// /// The postscript equivalent, or null, if no such operation exists. /// public readonly string Postscript; /// /// The description from Adobe PDF Reference. /// public readonly string Description; } /// /// Static class with all PDF op-codes. /// sealed class OpCodes { OpCodes() { } /// /// Operators from name. /// /// The name. static public COperator OperatorFromName(string name) { COperator op = null; OpCode opcode = OpCodes.stringToOpCode[name] as OpCode; if (opcode != null) { op = new COperator(opcode); } else { Debug.Assert(false, "Unknown operator in PDF content stream."); } return op; } /// /// Initializes the class. /// static OpCodes() { stringToOpCode = new Dictionary(); for (int idx = 0; idx < ops.Length; idx++) { OpCode op = ops[idx]; stringToOpCode.Add(op.Name, op); } } static readonly Dictionary stringToOpCode; static OpCode b = new OpCode("b", OpCodeName.b, 0, "closepath, fill, stroke", OpCodeFlags.None, "Close, fill, and stroke path using nonzero winding number"); static OpCode B = new OpCode("B", OpCodeName.B, 0, "fill, stroke", OpCodeFlags.None, "Fill and stroke path using nonzero winding number rule"); static OpCode bx = new OpCode("b*", OpCodeName.bx, 0, "closepath, eofill, stroke", OpCodeFlags.None, "Close, fill, and stroke path using even-odd rule"); static OpCode Bx = new OpCode("B*", OpCodeName.Bx, 0, "eofill, stroke", OpCodeFlags.None, "Fill and stroke path using even-odd rule"); static OpCode BDC = new OpCode("BDC", OpCodeName.BDC, 2, null, OpCodeFlags.None, "(PDF 1.2) Begin marked-content sequence with property list"); static OpCode BI = new OpCode("BI", OpCodeName.BI, 0, null, OpCodeFlags.None, "Begin inline image object"); static OpCode BMC = new OpCode("BMC", OpCodeName.BMC, 1, null, OpCodeFlags.None, "(PDF 1.2) Begin marked-content sequence"); static OpCode BT = new OpCode("BT", OpCodeName.BT, 0, null, OpCodeFlags.None, "Begin text object"); static OpCode BX = new OpCode("BX", OpCodeName.BX, 0, null, OpCodeFlags.None, "(PDF 1.1) Begin compatibility section"); static OpCode c = new OpCode("c", OpCodeName.c, 6, "curveto", OpCodeFlags.None, "Append curved segment to path (three control points)"); static OpCode cm = new OpCode("cm", OpCodeName.cm, 6, "concat", OpCodeFlags.None, "Concatenate matrix to current transformation matrix"); static OpCode CS = new OpCode("CS", OpCodeName.CS, 1, "setcolorspace", OpCodeFlags.None, "(PDF 1.1) Set color space for stroking operations"); static OpCode cs = new OpCode("cs", OpCodeName.cs, 1, "setcolorspace", OpCodeFlags.None, "(PDF 1.1) Set color space for nonstroking operations"); static OpCode d = new OpCode("d", OpCodeName.d, 2, "setdash", OpCodeFlags.None, "Set line dash pattern"); static OpCode d0 = new OpCode("d0", OpCodeName.d0, 2, "setcharwidth", OpCodeFlags.None, "Set glyph width in Type 3 font"); static OpCode d1 = new OpCode("d1", OpCodeName.d1, 6, "setcachedevice", OpCodeFlags.None, "Set glyph width and bounding box in Type 3 font"); static OpCode Do = new OpCode("Do", OpCodeName.Do, 1, null, OpCodeFlags.None, "Invoke named XObject"); static OpCode DP = new OpCode("DP", OpCodeName.DP, 2, null, OpCodeFlags.None, "(PDF 1.2) Define marked-content point with property list"); static OpCode EI = new OpCode("EI", OpCodeName.EI, 0, null, OpCodeFlags.None, "End inline image object"); static OpCode EMC = new OpCode("EMC", OpCodeName.EMC, 0, null, OpCodeFlags.None, "(PDF 1.2) End marked-content sequence"); static OpCode ET = new OpCode("ET", OpCodeName.ET, 0, null, OpCodeFlags.None, "End text object"); static OpCode EX = new OpCode("EX", OpCodeName.EX, 0, null, OpCodeFlags.None, "(PDF 1.1) End compatibility section"); static OpCode f = new OpCode("f", OpCodeName.f, 0, "fill", OpCodeFlags.None, "Fill path using nonzero winding number rule"); static OpCode F = new OpCode("F", OpCodeName.F, 0, "fill", OpCodeFlags.None, "Fill path using nonzero winding number rule (obsolete)"); static OpCode fx = new OpCode("f*", OpCodeName.fx, 0, "eofill", OpCodeFlags.None, "Fill path using even-odd rule"); static OpCode G = new OpCode("G", OpCodeName.G, 1, "setgray", OpCodeFlags.None, "Set gray level for stroking operations"); static OpCode g = new OpCode("g", OpCodeName.g, 1, "setgray", OpCodeFlags.None, "Set gray level for nonstroking operations"); static OpCode gs = new OpCode("gs", OpCodeName.gs, 1, null, OpCodeFlags.None, "(PDF 1.2) Set parameters from graphics state parameter dictionary"); static OpCode h = new OpCode("h", OpCodeName.h, 0, "closepath", OpCodeFlags.None, "Close subpath"); static OpCode i = new OpCode("i", OpCodeName.i, 1, "setflat", OpCodeFlags.None, "Set flatness tolerance"); static OpCode ID = new OpCode("ID", OpCodeName.ID, 0, null, OpCodeFlags.None, "Begin inline image data"); static OpCode j = new OpCode("j", OpCodeName.j, 1, "setlinejoin", OpCodeFlags.None, "Set line join style"); static OpCode J = new OpCode("J", OpCodeName.J, 1, "setlinecap", OpCodeFlags.None, "Set line cap style"); static OpCode K = new OpCode("K", OpCodeName.K, 4, "setcmykcolor", OpCodeFlags.None, "Set CMYK color for stroking operations"); static OpCode k = new OpCode("k", OpCodeName.k, 4, "setcmykcolor", OpCodeFlags.None, "Set CMYK color for nonstroking operations"); static OpCode l = new OpCode("l", OpCodeName.l, 2, "lineto", OpCodeFlags.None, "Append straight line segment to path"); static OpCode m = new OpCode("m", OpCodeName.m, 2, "moveto", OpCodeFlags.None, "Begin new subpath"); static OpCode M = new OpCode("M", OpCodeName.M, 1, "setmiterlimit", OpCodeFlags.None, "Set miter limit"); static OpCode MP = new OpCode("MP", OpCodeName.MP, 1, null, OpCodeFlags.None, "(PDF 1.2) Define marked-content point"); static OpCode n = new OpCode("n", OpCodeName.n, 0, null, OpCodeFlags.None, "End path without filling or stroking"); static OpCode q = new OpCode("q", OpCodeName.q, 0, "gsave", OpCodeFlags.None, "Save graphics state"); static OpCode Q = new OpCode("Q", OpCodeName.Q, 0, "grestore", OpCodeFlags.None, "Restore graphics state"); static OpCode re = new OpCode("re", OpCodeName.re, 4, null, OpCodeFlags.None, "Append rectangle to path"); static OpCode RG = new OpCode("RG", OpCodeName.RG, 3, "setrgbcolor", OpCodeFlags.None, "Set RGB color for stroking operations"); static OpCode rg = new OpCode("rg", OpCodeName.rg, 3, "setrgbcolor", OpCodeFlags.None, "Set RGB color for nonstroking operations"); static OpCode ri = new OpCode("ri", OpCodeName.ri, 1, null, OpCodeFlags.None, "Set color rendering intent"); static OpCode s = new OpCode("s", OpCodeName.s, 0, "closepath,stroke", OpCodeFlags.None, "Close and stroke path"); static OpCode S = new OpCode("S", OpCodeName.S, 0, "stroke", OpCodeFlags.None, "Stroke path"); static OpCode SC = new OpCode("SC", OpCodeName.SC, -1, "setcolor", OpCodeFlags.None, "(PDF 1.1) Set color for stroking operations"); static OpCode sc = new OpCode("sc", OpCodeName.sc, -1, "setcolor", OpCodeFlags.None, "(PDF 1.1) Set color for nonstroking operations"); static OpCode SCN = new OpCode("SCN", OpCodeName.SCN, -1, "setcolor", OpCodeFlags.None, "(PDF 1.2) Set color for stroking operations (ICCBased and special color spaces)"); static OpCode scn = new OpCode("scn", OpCodeName.scn, -1, "setcolor", OpCodeFlags.None, "(PDF 1.2) Set color for nonstroking operations (ICCBased and special color spaces)"); static OpCode sh = new OpCode("sh", OpCodeName.sh, 1, "shfill", OpCodeFlags.None, "(PDF 1.3) Paint area defined by shading pattern"); static OpCode Tx = new OpCode("T*", OpCodeName.Tx, 0, null, OpCodeFlags.None, "Move to start of next text line"); static OpCode Tc = new OpCode("Tc", OpCodeName.Tc, 1, null, OpCodeFlags.None, "Set character spacing"); static OpCode Td = new OpCode("Td", OpCodeName.Td, 2, null, OpCodeFlags.None, "Move text position"); static OpCode TD = new OpCode("TD", OpCodeName.TD, 2, null, OpCodeFlags.None, "Move text position and set leading"); static OpCode Tf = new OpCode("Tf", OpCodeName.Tf, 2, "selectfont", OpCodeFlags.None, "Set text font and size"); static OpCode Tj = new OpCode("Tj", OpCodeName.Tj, 1, "show", OpCodeFlags.TextOut, "Show text"); static OpCode TJ = new OpCode("TJ", OpCodeName.TJ, 1, null, OpCodeFlags.TextOut, "Show text, allowing individual glyph positioning"); static OpCode TL = new OpCode("TL", OpCodeName.TL, 1, null, OpCodeFlags.None, "Set text leading"); static OpCode Tm = new OpCode("Tm", OpCodeName.Tm, 6, null, OpCodeFlags.None, "Set text matrix and text line matrix"); static OpCode Tr = new OpCode("Tr", OpCodeName.Tr, 1, null, OpCodeFlags.None, "Set text rendering mode"); static OpCode Ts = new OpCode("Ts", OpCodeName.Ts, 1, null, OpCodeFlags.None, "Set text rise"); static OpCode Tw = new OpCode("Tw", OpCodeName.Tw, 1, null, OpCodeFlags.None, "Set word spacing"); static OpCode Tz = new OpCode("Tz", OpCodeName.Tz, 1, null, OpCodeFlags.None, "Set horizontal text scaling"); static OpCode v = new OpCode("v", OpCodeName.v, 4, "curveto", OpCodeFlags.None, "Append curved segment to path (initial point replicated)"); static OpCode w = new OpCode("w", OpCodeName.w, 1, "setlinewidth", OpCodeFlags.None, "Set line width"); static OpCode W = new OpCode("W", OpCodeName.W, 0, "clip", OpCodeFlags.None, "Set clipping path using nonzero winding number rule"); static OpCode Wx = new OpCode("W*", OpCodeName.Wx, 0, "eoclip", OpCodeFlags.None, "Set clipping path using even-odd rule"); static OpCode y = new OpCode("y", OpCodeName.y, 4, "curveto", OpCodeFlags.None, "Append curved segment to path (final point replicated)"); static OpCode QuoteSingle = new OpCode("'", OpCodeName.QuoteSingle, 1, null, OpCodeFlags.TextOut, "Move to next line and show text"); static OpCode QuoteDbl = new OpCode("\"", OpCodeName.QuoteDbl, 3, null, OpCodeFlags.TextOut, "Set word and character spacing, move to next line, and show text"); /// /// Array of all OpCodes. /// static OpCode[] ops = new OpCode[] { // Must be defined behind the code above to ensure that the values are initialized. b, B, bx, Bx, BDC, BI, BMC, BT, BX, c, cm, CS, cs, d, d0, d1, Do, DP, EI, EMC, ET, EX, f, F, fx, G, g, gs, h, i, ID, j, J, K, k, l, m, M, MP, n, q, Q, re, RG, rg, ri, s, S, SC, sc, SCN, scn, sh, Tx, Tc, Td, TD, Tf, Tj, TJ, TL, Tm, Tr, Ts, Tw, Tz, v, w, W, Wx, y, QuoteSingle, QuoteDbl }; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Content.Objects/CObjects.cs0000644000175000001440000005255711435766646024667 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using System.Globalization; using System.IO; using System.Text; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Content.Objects // TODO: split into single files { /// /// Base class for all PDF content stream objects. /// public abstract class CObject : ICloneable { /// /// Initializes a new instance of the class. /// protected CObject() { } /// /// Creates a new object that is a copy of the current instance. /// object ICloneable.Clone() { return Copy(); } /// /// Creates a new object that is a copy of the current instance. /// public CObject Clone() { return (CObject)Copy(); } /// /// Implements the copy mechanism. Must be overridden in derived classes. /// protected virtual CObject Copy() { return (CObject)MemberwiseClone(); } /// /// /// internal abstract void WriteObject(ContentWriter writer); } /// /// Represents a comment in a PDF content stream. /// [DebuggerDisplay("({Text})")] public class CComment : CObject { /// /// Creates a new object that is a copy of the current instance. /// public new CComment Clone() { return (CComment)Copy(); } /// /// Implements the copy mechanism of this class. /// protected override CObject Copy() { CObject obj = base.Copy(); return obj; } /// /// Gets or sets the comment text. /// public string Text { get { return this.text; } set { this.text = value; } } string text; /// /// Returns a string that represents the current comment. /// public override string ToString() { return "% " + this.text; } internal override void WriteObject(ContentWriter writer) { writer.WriteLineRaw(ToString()); } } /// /// Represents a sequence of objects in a PDF content stream. /// [DebuggerDisplay("(count={Count})")] public class CSequence : CObject, IList, ICollection, IEnumerable { List items = new List(); /// /// Creates a new object that is a copy of the current instance. /// public new CSequence Clone() { return (CSequence)Copy(); } /// /// Implements the copy mechanism of this class. /// protected override CObject Copy() { CObject obj = base.Copy(); this.items = new List(this.items); for (int idx = 0; idx < this.items.Count; idx++) this.items[idx] = this.items[idx].Clone(); return obj; } /// /// Adds the specified sequence. /// /// The sequence. public void Add(CSequence sequence) { int count = sequence.Count; for (int idx = 0; idx < count; idx++) this.items.Add(sequence[idx]); } #region IList Members /// /// Adds the specified value add the end of the sequence. /// public void Add(CObject value) { this.items.Add(value); } /// /// Removes all elements from the sequence. /// public void Clear() { this.items.Clear(); } //bool IList.Contains(object value) //{ // return this.items.Contains(value); //} /// /// Determines whether the specified value is in the sequence. /// public bool Contains(CObject value) { return this.items.Contains(value); } /// /// Returns the index of the specified value in the sequence or -1, if no such value is in the sequence. /// public int IndexOf(CObject value) { return this.items.IndexOf(value); } /// /// Inserts the specified value in the sequence. /// public void Insert(int index, CObject value) { this.items.Insert(index, value); } /////// /////// Gets a value indicating whether the sequence has a fixed size. /////// ////public bool IsFixedSize ////{ //// get { return this.items.IsFixedSize; } ////} /////// /////// Gets a value indicating whether the sequence is read-only. /////// ////public bool IsReadOnly ////{ //// get { return this.items.IsReadOnly; } ////} /// /// Removes the specified value from the sequence. /// public bool Remove(CObject value) { return this.items.Remove(value); } /// /// Removes the value at the specified index from the sequence. /// public void RemoveAt(int index) { this.items.RemoveAt(index); } /// /// Gets or sets a CObject at the specified index. /// /// public CObject this[int index] { get { return (CObject)this.items[index]; } set { this.items[index] = value; } } #endregion #region ICollection Members /// /// Copies the elements of the sequence to the specified array. /// public void CopyTo(CObject[] array, int index) { this.items.CopyTo(array, index); } /// /// Gets the number of elements contained in the sequence. /// public int Count { get { return this.items.Count; } } ///// ///// Gets a value indicating whether access to the sequence is synchronized (thread safe). ///// //public bool IsSynchronized //{ // get { return this.items.IsSynchronized; } //} ///// ///// Gets an object that can be used to synchronize access to the sequence. ///// //public object SyncRoot //{ // get { return this.items.SyncRoot; } //} #endregion #region IEnumerable Members /// /// Returns an enumerator that iterates through the sequence. /// public IEnumerator GetEnumerator() { return this.items.GetEnumerator(); } #endregion /// /// Converts the sequence to a PDF content stream. /// public byte[] ToContent() { Stream stream = new MemoryStream(); ContentWriter writer = new ContentWriter(stream); WriteObject(writer); writer.Close(false); stream.Position = 0; int count = (int)stream.Length; byte[] bytes = new byte[count]; stream.Read(bytes, 0, count); stream.Close(); return bytes; } /// /// Returns a string containing all elements of the sequence. /// public override string ToString() { StringBuilder s = new StringBuilder(); for (int idx = 0; idx < this.items.Count; idx++) s.Append(this.items[idx].ToString()); return s.ToString(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } internal override void WriteObject(ContentWriter writer) { for (int idx = 0; idx < this.items.Count; idx++) (this.items[idx] as CObject).WriteObject(writer); } #region IList Members int IList.IndexOf(CObject item) { throw new NotImplementedException(); } void IList.Insert(int index, CObject item) { throw new NotImplementedException(); } void IList.RemoveAt(int index) { throw new NotImplementedException(); } CObject IList.this[int index] { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } #endregion #region ICollection Members void ICollection.Add(CObject item) { throw new NotImplementedException(); } void ICollection.Clear() { throw new NotImplementedException(); } bool ICollection.Contains(CObject item) { throw new NotImplementedException(); } void ICollection.CopyTo(CObject[] array, int arrayIndex) { throw new NotImplementedException(); } int ICollection.Count { get { throw new NotImplementedException(); } } bool ICollection.IsReadOnly { get { throw new NotImplementedException(); } } bool ICollection.Remove(CObject item) { throw new NotImplementedException(); } #endregion #region IEnumerable Members IEnumerator IEnumerable.GetEnumerator() { throw new NotImplementedException(); } #endregion } /// /// Represents the base class for numerical objects in a PDF content stream. /// public abstract class CNumber : CObject { /// /// Creates a new object that is a copy of the current instance. /// public new CNumber Clone() { return (CNumber)Copy(); } /// /// Implements the copy mechanism of this class. /// protected override CObject Copy() { CObject obj = base.Copy(); return obj; } //internal override void WriteObject(ContentWriter writer) //{ // throw new Exception("Must not come here."); //} } /// /// Represents an integer value in a PDF content stream. /// [DebuggerDisplay("({Value})")] public class CInteger : CNumber { /// /// Creates a new object that is a copy of the current instance. /// public new CInteger Clone() { return (CInteger)Copy(); } /// /// Implements the copy mechanism of this class. /// protected override CObject Copy() { CObject obj = base.Copy(); return obj; } /// /// Gets or sets the value. /// public int Value { get { return this.value; } set { this.value = value; } } int value; /// /// Returns a string that represents the current value. /// public override string ToString() { return this.value.ToString(CultureInfo.InvariantCulture); } internal override void WriteObject(ContentWriter writer) { writer.WriteRaw(ToString() + " "); } } /// /// Represents a real value in a PDF content stream. /// [DebuggerDisplay("({Value})")] public class CReal : CNumber { /// /// Creates a new object that is a copy of the current instance. /// public new CReal Clone() { return (CReal)Copy(); } /// /// Implements the copy mechanism of this class. /// protected override CObject Copy() { CObject obj = base.Copy(); return obj; } /// /// Gets or sets the value. /// public double Value { get { return this.value; } set { this.value = value; } } double value; /// /// Returns a string that represents the current value. /// public override string ToString() { return this.value.ToString(CultureInfo.InvariantCulture); } internal override void WriteObject(ContentWriter writer) { writer.WriteRaw(ToString() + " "); } } /// /// Represents a string value in a PDF content stream. /// [DebuggerDisplay("({Value})")] public class CString : CObject { /// /// Creates a new object that is a copy of the current instance. /// public new CString Clone() { return (CString)Copy(); } /// /// Implements the copy mechanism of this class. /// protected override CObject Copy() { CObject obj = base.Copy(); return obj; } /// /// Gets or sets the value. /// public string Value { get { return this.value; } set { this.value = value; } } string value; /// /// Returns a string that represents the current value. /// public override string ToString() { StringBuilder s = new StringBuilder("("); int length = this.value.Length; for (int ich = 0; ich < length; ich++) { char ch = this.value[ich]; switch (ch) { case Chars.LF: s.Append("\\n"); break; case Chars.CR: s.Append("\\r"); break; case Chars.HT: s.Append("\\t"); break; case Chars.BS: s.Append("\\b"); break; case Chars.FF: s.Append("\\f"); break; case Chars.ParenLeft: s.Append("\\("); break; case Chars.ParenRight: s.Append("\\)"); break; case Chars.BackSlash: s.Append("\\\\"); break; default: #if true_ // not absolut necessary to use octal encoding for characters less than blank if (ch < ' ') { s.Append("\\"); s.Append((char)(((ch >> 6) & 7) + '0')); s.Append((char)(((ch >> 3) & 7) + '0')); s.Append((char)((ch & 7) + '0')); } else #endif s.Append(ch); break; } } s.Append(')'); return s.ToString(); } internal override void WriteObject(ContentWriter writer) { writer.WriteRaw(ToString()); } } /// /// Represents a name in a PDF content stream. /// [DebuggerDisplay("({Name})")] public class CName : CObject { /// /// Initializes a new instance of the class. /// public CName() { this.name = "/"; } /// /// Initializes a new instance of the class. /// /// The name. public CName(string name) { Name = name; } /// /// Creates a new object that is a copy of the current instance. /// public new CName Clone() { return (CName)Copy(); } /// /// Implements the copy mechanism of this class. /// protected override CObject Copy() { CObject obj = base.Copy(); return obj; } /// /// Gets or sets the name. Names must start with a slash. /// public string Name { get { return this.name; } set { if (name == null || name.Length == 0) throw new ArgumentNullException("name"); if (name[0] != '/') throw new ArgumentException(PSSR.NameMustStartWithSlash); this.name = value; } } string name; /// /// Returns a string that represents the current value. /// public override string ToString() { return this.name; } internal override void WriteObject(ContentWriter writer) { writer.WriteRaw(ToString() + " "); } } /// /// Represents an array of objects in a PDF content stream. /// [DebuggerDisplay("(count={Count})")] public class CArray : CSequence { /// /// Creates a new object that is a copy of the current instance. /// public new CArray Clone() { return (CArray)Copy(); } /// /// Implements the copy mechanism of this class. /// protected override CObject Copy() { CObject obj = base.Copy(); return obj; } /// /// Returns a string that represents the current value. /// public override string ToString() { return "[" + base.ToString() + "]"; } internal override void WriteObject(ContentWriter writer) { writer.WriteRaw(ToString()); } } /// /// Represents an operator a PDF content stream. /// [DebuggerDisplay("({Name}, operands={Operands.Count})")] public class COperator : CObject { /// /// Initializes a new instance of the class. /// protected COperator() { } internal COperator(OpCode opcode) { this.opcode = opcode; } /// /// Creates a new object that is a copy of the current instance. /// public new COperator Clone() { return (COperator)Copy(); } /// /// Implements the copy mechanism of this class. /// protected override CObject Copy() { CObject obj = base.Copy(); return obj; } /// /// Gets or sets the name of the operator /// /// The name. public virtual string Name { get { return this.opcode.Name; } } /// /// Gets or sets the operands. /// /// The operands. public CSequence Operands { get { if (this.seqence == null) this.seqence = new CSequence(); return this.seqence; } } CSequence seqence; /// /// Gets the operator description for this instance. /// public OpCode OpCode { get { return this.opcode; } } OpCode opcode; /// /// Returns a string that represents the current operator. /// public override string ToString() { return this.Name; } internal override void WriteObject(ContentWriter writer) { int count = this.seqence != null ? this.seqence.Count : 0; for (int idx = 0; idx < count; idx++) this.seqence[idx].WriteObject(writer); writer.WriteLineRaw(ToString()); } } #if true_ public class CGenericOperator : COperator { internal CGenericOperator(string name) { this.name = name; } /// /// Creates a new object that is a copy of the current instance. /// public new CGenericOperator Clone() { return (CGenericOperator)Copy(); } /// /// Implements the copy mechanism of this class. /// protected override CObject Copy() { CObject obj = base.Copy(); return obj; } /// /// Gets or sets the name of the operator /// /// The name. public override string Name { get { return this.name; } } string name; /// /// Returns a string that represents the current operator. /// public override string ToString() { return this.Name; } } #endif } pdfmod-0.9.1/lib/PdfSharp/Properties/0000777000175000001440000000000011533760020017521 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/Properties/AssemblyInfo.cs0000644000175000001440000000657611435766646022502 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; //[assembly:AllowPartiallyTrustedCallers] //[assembly:SecurityPermission(SecurityAction.RequestMinimum)] //[assembly:FileIOPermission(SecurityAction.RequestMinimum, Unrestricted = true)] // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // [assembly: AssemblyTitle(PdfSharp.VersionInfo.Title)] [assembly: AssemblyVersion(PdfSharp.VersionInfo.Version)] [assembly: AssemblyDescription(PdfSharp.VersionInfo.Description)] [assembly: AssemblyConfiguration(PdfSharp.VersionInfo.Configuration)] [assembly: AssemblyCompany(PdfSharp.VersionInfo.Company)] #if DEBUG [assembly: AssemblyProduct(PdfSharp.ProductVersionInfo.Product + " (Debug Build)")] #else [assembly: AssemblyProduct(PdfSharp.ProductVersionInfo.Product)] #endif [assembly: AssemblyCopyright(PdfSharp.VersionInfo.Copyright)] [assembly: AssemblyTrademark(PdfSharp.VersionInfo.Trademark)] [assembly: AssemblyCulture(PdfSharp.VersionInfo.Culture)] [assembly: InternalsVisibleTo("PdfSharp.UnitTest, PublicKey=00240000048000009400000006020000002400005253413100040000010001008794e803e566eccc3c9181f52c4f7044e5442cc2ce3cbba9fc11bc4186ba2e446cd31deea20c1a8f499e978417fad2bc74143a4f8398f7cf5c5c0271b0f7fe907c537cff28b9d582da41289d1dae90168a3da2a5ed1115210a18fdae832479d3e639ca4003286ba8b98dc9144615c040ed838981ac816112df3b5a9e7cab4fbb")] #if WPF [assembly: InternalsVisibleTo("PdfSharp.Xps, PublicKey=00240000048000009400000006020000002400005253413100040000010001008794e803e566eccc3c9181f52c4f7044e5442cc2ce3cbba9fc11bc4186ba2e446cd31deea20c1a8f499e978417fad2bc74143a4f8398f7cf5c5c0271b0f7fe907c537cff28b9d582da41289d1dae90168a3da2a5ed1115210a18fdae832479d3e639ca4003286ba8b98dc9144615c040ed838981ac816112df3b5a9e7cab4fbb")] #endif [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyName("")] [assembly: ComVisibleAttribute(false)] pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Printing/0000777000175000001440000000000011533760020021375 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Printing/PdfFilePrinter.cs0000644000175000001440000002257111435766646024631 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.IO; namespace PdfSharp.Pdf.Printing { // Some googled inforamtion about command line switches: // // AcroRd32.exe filename Executes the reader and displays a file. // AcroRd32.exe /p filename Executes the reader and prints a file. // AcroRd32.exe /t path printername drivername portname Executes the reader and prints a file // while suppressing the Acrobat print // dialog box, then terminating the Reader. // // The four parameters of the /t option evaluate to strings. // printername The name of the Printer. // drivername Your printer drivers name i.e. whatever apperars in the Driver Used box when viewing printer properties. // portname The printers port. portname cannot contain any "/" characters; if it does, output is routed to // the default port for that printer. // // // Acrobat.exe /n Launch a separate instance of the Acrobat application // Acrobat.exe /s Open Acrobat suppressing the splash screen // Acrobat.exe /o Open Acrobat suppressing the openfile dialog // Acrobat.exe /h Open Acrobat in hidden mode /// /// A wrapper around Adobe Reader or Adobe Acrobat that helps to print PDF files. /// The property AdobeReaderPath must be set before the class can be used for printing. /// The class was tested with Adobe Reader 7.0.7. /// If this stuff does not work, please don't write me mails! /// If you enhance this class, please let me know. /// public class PdfFilePrinter { /// /// Initializes a new instance of the class. /// public PdfFilePrinter() { } /// /// Initializes a new instance of the class. /// /// Name of the PDF file. public PdfFilePrinter(string pdfFileName) { this.PdfFileName = pdfFileName; } /// /// Initializes a new instance of the class. /// /// Name of the PDF file. /// Name of the printer. public PdfFilePrinter(string pdfFileName, string printerName) { this.pdfFileName = pdfFileName; this.printerName = printerName; } /// /// Gets or sets the name of the PDF file to print. /// public string PdfFileName { get { return this.pdfFileName; } set { this.pdfFileName = value; } } string pdfFileName; /// /// Gets or sets the name of the printer. A typical name looks like '\\myserver\HP LaserJet PCL5'. /// /// The name of the printer. public string PrinterName { get { return this.printerName; } set { this.printerName = value; } } string printerName; /// /// Gets or sets the working directory. /// public string WorkingDirectory { get { return this.workingDirectory; } set { this.workingDirectory = value; } } string workingDirectory; /// /// Prints the PDF file. /// public void Print() { Print(-1); } /// /// Prints the PDF file. /// /// The number of milliseconds to wait for completing the print job. public void Print(int milliseconds) { if (this.printerName == null || this.printerName.Length == 0) this.printerName = PdfFilePrinter.defaultPrinterName; if (PdfFilePrinter.adobeReaderPath == null || PdfFilePrinter.adobeReaderPath.Length == 0) throw new InvalidOperationException("No full qualified path to AcroRd32.exe or Acrobat.exe is set."); if (this.printerName == null || this.printerName.Length == 0) throw new InvalidOperationException("No printer name set."); // Check whether file exists. string fqName = String.Empty; if (this.workingDirectory != null && this.workingDirectory.Length != 0) fqName = Path.Combine(this.workingDirectory, this.pdfFileName); else fqName = Path.Combine(Directory.GetCurrentDirectory(), this.pdfFileName); if (!File.Exists(fqName)) throw new InvalidOperationException(String.Format("The file {0} does not exist.", fqName)); // TODO: Check whether printer exists. try { DoSomeVeryDirtyHacksToMakeItWork(); //acrord32.exe /t <- seems to work best //acrord32.exe /h /p <- some swear by this version ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = PdfFilePrinter.adobeReaderPath; string args = String.Format("/t \"{0}\" \"{1}\"", this.pdfFileName, this.printerName); //Debug.WriteLine(args); startInfo.Arguments = args; startInfo.CreateNoWindow = true; startInfo.ErrorDialog = false; startInfo.UseShellExecute = false; if (this.workingDirectory != null && this.workingDirectory.Length != 0) startInfo.WorkingDirectory = this.workingDirectory; Process process = Process.Start(startInfo); if (!process.WaitForExit(milliseconds)) { // Kill Adobe Reader/Acrobat process.Kill(); } } catch (Exception ex) { throw ex; } } /// /// For reasons only Adobe knows the Reader seams to open and shows the document instead of printing it /// when it was not already running. /// If you use PDFsharp and have any suggestions to circumvent this function, please let us know. /// void DoSomeVeryDirtyHacksToMakeItWork() { if (PdfFilePrinter.runningAcro != null) { if (!PdfFilePrinter.runningAcro.HasExited) return; PdfFilePrinter.runningAcro.Dispose(); PdfFilePrinter.runningAcro = null; } // Is any Adobe Reader/Acrobat running? Process[] processes = Process.GetProcesses(); int count = processes.Length; for (int idx = 0; idx < count; idx++) { try { Process process = processes[idx]; ProcessModule module = process.MainModule; if (String.Compare(Path.GetFileName(module.FileName), Path.GetFileName(PdfFilePrinter.adobeReaderPath), true) == 0) { // Yes: Fine, we can print. PdfFilePrinter.runningAcro = process; break; } } catch { } } if (PdfFilePrinter.runningAcro == null) { // No: Start an Adobe Reader/Acrobat. // If you are within ASP.NET, good luck... PdfFilePrinter.runningAcro = Process.Start(PdfFilePrinter.adobeReaderPath); PdfFilePrinter.runningAcro.WaitForInputIdle(); } } static Process runningAcro; /// /// Gets or sets the Adobe Reader or Adobe Acrobat path. /// A typical name looks like 'C:\Program Files\Adobe\Adobe Reader 7.0\AcroRd32.exe'. /// static public string AdobeReaderPath { get { return PdfFilePrinter.adobeReaderPath; } set { PdfFilePrinter.adobeReaderPath = value; } } static string adobeReaderPath; /// /// Gets or sets the name of the default printer. A typical name looks like '\\myserver\HP LaserJet PCL5'. /// static public string DefaultPrinterName { get { return PdfFilePrinter.defaultPrinterName; } set { PdfFilePrinter.defaultPrinterName = value; } } static string defaultPrinterName; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Internal/0000777000175000001440000000000011533760020020647 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Internal/ColorHelper.cs0000644000175000001440000000462211435766646023441 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; #if GDI using System.Drawing; #endif #if WPF using System.Windows; #endif using PdfSharp.Drawing; namespace PdfSharp.Internal { struct SColor { public byte a; public byte r; public byte g; public byte b; } struct SCColor { public float a; public float r; public float g; public float b; } static class ColorHelper { public static float sRgbToScRgb(byte bval) { float num = ((float)bval) / 255f; if (num <= 0.0) return 0f; if (num <= 0.04045) return (num / 12.92f); if (num < 1f) return (float)Math.Pow((num + 0.055) / 1.055, 2.4); return 1f; } public static byte ScRgbTosRgb(float val) { if (val <= 0.0) return 0; if (val <= 0.0031308) return (byte)(((255f * val) * 12.92f) + 0.5f); if (val < 1.0) return (byte)((255f * ((1.055f * ((float)Math.Pow((double)val, 0.41666666666666669))) - 0.055f)) + 0.5f); return 0xff; } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Internal/DoubleUtil.cs0000644000175000001440000001557211435766646023301 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Runtime.InteropServices; using PdfSharp.Drawing; namespace PdfSharp.Internal { /// /// Some floating point utilities. Partially reflected from WPF, later equalized with original source code. /// internal static class DoubleUtil { internal const double Epsilon = 2.2204460492503131E-16; // smallest such that 1.0 + Epsilon != 1.0 internal const float FloatMinimum = 1.175494E-38f; /// /// Indicates whether the values are so close that they can be considered as equal. /// public static bool AreClose(double value1, double value2) { if (value1 == value2) return true; // This computes (|value1-value2| / (|value1| + |value2| + 10.0)) < Epsilon double eps = (Math.Abs(value1) + Math.Abs(value2) + 10.0) * Epsilon; double delta = value1 - value2; return (-eps < delta) && (eps > delta); } /// /// Indicates whether the values are so close that they can be considered as equal. /// public static bool AreRoughlyEqual(double value1, double value2, int decimalPlace) { if (value1 == value2) return true; return Math.Abs(value1 - value2) < decs[decimalPlace]; } static double[] decs = new double[] { 1, 1E-1, 1E-2, 1E-3, 1E-4, 1E-5, 1E-6, 1E-7, 1E-8, 1E-9, 1E-10, 1E-11, 1E-12, 1E-13, 1E-14, 1E-15, 1E-16 }; /// /// Indicates whether the values are so close that they can be considered as equal. /// public static bool AreClose(XPoint point1, XPoint point2) { return AreClose(point1.X, point2.X) && AreClose(point1.Y, point2.Y); } /// /// Indicates whether the values are so close that they can be considered as equal. /// public static bool AreClose(XRect rect1, XRect rect2) { if (rect1.IsEmpty) return rect2.IsEmpty; return !rect2.IsEmpty && AreClose(rect1.X, rect2.X) && AreClose(rect1.Y, rect2.Y) && AreClose(rect1.Height, rect2.Height) && AreClose(rect1.Width, rect2.Width); } /// /// Indicates whether the values are so close that they can be considered as equal. /// public static bool AreClose(XSize size1, XSize size2) { return AreClose(size1.Width, size2.Width) && AreClose(size1.Height, size2.Height); } /// /// Indicates whether the values are so close that they can be considered as equal. /// public static bool AreClose(XVector vector1, XVector vector2) { return AreClose(vector1.X, vector2.X) && AreClose(vector1.Y, vector2.Y); } /// /// Indicates whether value1 is greater than value2 and the values are not close to each other. /// public static bool GreaterThan(double value1, double value2) { return value1 > value2 && !AreClose(value1, value2); } /// /// Indicates whether value1 is greater than value2 or the values are close to each other. /// public static bool GreaterThanOrClose(double value1, double value2) { return value1 > value2 || AreClose(value1, value2); } /// /// Indicates whether value1 is less than value2 and the values are not close to each other. /// public static bool LessThan(double value1, double value2) { return value1 < value2 && !AreClose(value1, value2); } /// /// Indicates whether value1 is less than value2 or the values are close to each other. /// public static bool LessThanOrClose(double value1, double value2) { return value1 < value2 || AreClose(value1, value2); } /// /// Indicates whether the value is between 0 and 1 or close to 0 or 1. /// public static bool IsBetweenZeroAndOne(double value) { return GreaterThanOrClose(value, 0) && LessThanOrClose(value, 1); } /// /// Indicates whether the value is not a number. /// public static bool IsNaN(double value) { NanUnion t = new NanUnion(); t.DoubleValue = value; UInt64 exp = t.UintValue & 0xfff0000000000000; UInt64 man = t.UintValue & 0x000fffffffffffff; return (exp == 0x7ff0000000000000 || exp == 0xfff0000000000000) && (man != 0); } /// /// Indicates whether at least one of the four rectangle values is not a number. /// public static bool RectHasNaN(XRect r) { return IsNaN(r.x) || IsNaN(r.y) || IsNaN(r.height) || IsNaN(r.width); } /// /// Indicates whether the value is 1 or close to 1. /// public static bool IsOne(double value) { return Math.Abs(value - 1.0) < 10.0 * Epsilon; } /// /// Indicates whether the value is 0 or close to 0. /// public static bool IsZero(double value) { return Math.Abs(value) < 10.0 * Epsilon; } /// /// Converts a double to integer. /// public static int DoubleToInt(double value) { return 0 < value ? (int)(value + 0.5) : (int)(value - 0.5); } [StructLayout(LayoutKind.Explicit)] struct NanUnion { [FieldOffset(0)] internal double DoubleValue; [FieldOffset(0)] internal ulong UintValue; } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Internal/NativeMethods.cs0000644000175000001440000001203411435766646023771 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.Security; namespace PdfSharp.Internal { /// /// Required native Win32 calls. Don't know what to do under Mono. /// static class NativeMethods { /// /// Reflected from System.Drawing.SafeNativeMethods+LOGFONT /// //[SuppressUnmanagedCodeSecurity] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] public class LOGFONT { // Preserve us for warning CS0649... LOGFONT(int dummy) { this.lfHeight = 0; this.lfWidth = 0; this.lfEscapement = 0; this.lfOrientation = 0; this.lfWeight = 0; this.lfItalic = 0; this.lfUnderline = 0; this.lfStrikeOut = 0; this.lfCharSet = 0; this.lfOutPrecision = 0; this.lfClipPrecision = 0; this.lfQuality = 0; this.lfPitchAndFamily = 0; this.lfFaceName = ""; } public int lfHeight; public int lfWidth; public int lfEscapement; public int lfOrientation; public int lfWeight; public byte lfItalic; public byte lfUnderline; public byte lfStrikeOut; public byte lfCharSet; public byte lfOutPrecision; public byte lfClipPrecision; public byte lfQuality; public byte lfPitchAndFamily; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string lfFaceName; public override string ToString() { object[] objArray1 = new object[0x1c] { "lfHeight=", this.lfHeight, ", lfWidth=", this.lfWidth, ", lfEscapement=", this.lfEscapement, ", lfOrientation=", this.lfOrientation, ", lfWeight=", this.lfWeight, ", lfItalic=", this.lfItalic, ", lfUnderline=", this.lfUnderline, ", lfStrikeOut=", this.lfStrikeOut, ", lfCharSet=", this.lfCharSet, ", lfOutPrecision=", this.lfOutPrecision, ", lfClipPrecision=", this.lfClipPrecision, ", lfQuality=", this.lfQuality, ", lfPitchAndFamily=", this.lfPitchAndFamily, ", lfFaceName=", this.lfFaceName }; return string.Concat(objArray1); } public LOGFONT() { } } [DllImport("user32.dll")] public static extern IntPtr GetDC(IntPtr hwnd); [DllImport("user32.dll")] public static extern IntPtr ReleaseDC(IntPtr hwnd, IntPtr hdc); [DllImport("gdi32.dll", SetLastError = true)] public static extern int GetFontData( IntPtr hdc, // handle to DC uint dwTable, // metric table name uint dwOffset, // offset into table byte[] lpvBuffer, // buffer for returned data int cbData // length of data ); [DllImport("gdi32.dll", EntryPoint = "CreateFontIndirectW")] public static extern IntPtr CreateFontIndirect(LOGFONT lpLogFont); [DllImport("gdi32.dll")] public static extern IntPtr SelectObject(IntPtr hdc, IntPtr hgdiobj); [DllImport("gdi32.dll")] public static extern bool DeleteObject(IntPtr hgdiobj); public const int HORZSIZE = 4; // Horizontal size in millimeters public const int VERTSIZE = 6; // Vertical size in millimeters public const int HORZRES = 8; // Horizontal width in pixels public const int VERTRES = 10; // Vertical height in pixels public const int LOGPIXELSX = 88; // Logical pixels/inch in X public const int LOGPIXELSY = 90; // Logical pixels/inch in Y [DllImport("gdi32.dll")] public static extern int GetDeviceCaps(IntPtr hdc, int nIndex); } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Internal/Calc.cs0000644000175000001440000000656211435766646022072 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; #if GDI using System.Drawing; #endif #if WPF using System.Windows; #endif using PdfSharp.Drawing; namespace PdfSharp.Internal { /// /// Some static helper functions for calculations. /// internal static class Calc { /// /// Degree to radiant factor. /// public const double Deg2Rad = Math.PI / 180; /// /// Half of pi. /// public const double πHalf = Math.PI / 2; // α - β κ /// /// Get page size in point from specified PageSize. /// public static XSize PageSizeToSize(PageSize value) { switch (value) { case PageSize.A0: return new XSize(2380, 3368); case PageSize.A1: return new XSize(1684, 2380); case PageSize.A2: return new XSize(1190, 1684); case PageSize.A3: return new XSize(842, 1190); case PageSize.A4: return new XSize(595, 842); case PageSize.A5: return new XSize(420, 595); case PageSize.B4: return new XSize(729, 1032); case PageSize.B5: return new XSize(516, 729); // The strange sizes from overseas... case PageSize.Letter: return new XSize(612, 792); case PageSize.Legal: return new XSize(612, 1008); case PageSize.Tabloid: return new XSize(792, 1224); case PageSize.Ledger: return new XSize(1224, 792); case PageSize.Statement: return new XSize(396, 612); case PageSize.Executive: return new XSize(540, 720); case PageSize.Folio: return new XSize(612, 936); case PageSize.Quarto: return new XSize(610, 780); case PageSize.Size10x14: return new XSize(720, 1008); } throw new ArgumentException("Invalid PageSize."); } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Internal/TokenizerHelper.cs0000644000175000001440000001665011435766646024341 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections.Generic; using System.Text; using System.Globalization; namespace PdfSharp.Internal { // Relected from WPF to ensure compatibility // Use netmassdownloader -d "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0" -output g:\cachetest -v class TokenizerHelper { internal char PeekNextCharacter() { if (this.charIndex >= this.strLen) return 'X'; char ch = this.str[this.charIndex]; return ch; } private static readonly IFormatProvider NeutralCulture = CultureInfo.InvariantCulture; //.GetCultureInfo("en-us"); public TokenizerHelper(string str) : this(str, NeutralCulture) { } public TokenizerHelper(string str, IFormatProvider formatProvider) { char numericListSeparator = GetNumericListSeparator(formatProvider); Initialize(str, '\'', numericListSeparator); } public TokenizerHelper(string str, char quoteChar, char separator) { Initialize(str, quoteChar, separator); } internal string GetCurrentToken() { if (this.currentTokenIndex < 0) return null; return this.str.Substring(this.currentTokenIndex, this.currentTokenLength); } internal static char GetNumericListSeparator(IFormatProvider provider) { char ch = ','; NumberFormatInfo instance = NumberFormatInfo.GetInstance(provider); if (instance.NumberDecimalSeparator.Length > 0 && ch == instance.NumberDecimalSeparator[0]) ch = ';'; return ch; } void Initialize(string str, char quoteChar, char separator) { this.str = str; this.strLen = (str == null) ? 0 : str.Length; this.currentTokenIndex = -1; this.quoteChar = quoteChar; this.argSeparator = separator; while (this.charIndex < this.strLen) { if (!Char.IsWhiteSpace(this.str, this.charIndex)) return; this.charIndex++; } } internal void LastTokenRequired() { if (this.charIndex != this.strLen) throw new InvalidOperationException("Extra data encountered"); //SR.Get(SRID.TokenizerHelperExtraDataEncountered, new object[0])); } internal bool NextToken() { return NextToken(false); } internal bool NextToken(bool allowQuotedToken) { return NextToken(allowQuotedToken, this.argSeparator); } internal bool NextToken(bool allowQuotedToken, char separator) { this.currentTokenIndex = -1; this.foundSeparator = false; if (this.charIndex >= this.strLen) return false; char c = this.str[this.charIndex]; int charCount = 0; if (allowQuotedToken && c == this.quoteChar) { charCount++; this.charIndex++; } int index = this.charIndex; int num3 = 0; while (this.charIndex < this.strLen) { c = this.str[this.charIndex]; if (charCount > 0) { if (c != this.quoteChar) goto Label_00AA; charCount--; if (charCount != 0) goto Label_00AA; this.charIndex++; break; } if (char.IsWhiteSpace(c) || c == separator) { if (c == separator) this.foundSeparator = true; break; } Label_00AA: this.charIndex++; num3++; } if (charCount > 0) throw new InvalidOperationException("Missing end quote"); //SR.Get(SRID.TokenizerHelperMissingEndQuote, new object[0])); ScanToNextToken(separator); this.currentTokenIndex = index; this.currentTokenLength = num3; if (this.currentTokenLength < 1) throw new InvalidOperationException("Empty token"); // SR.Get(SRID.TokenizerHelperEmptyToken, new object[0])); #if DEBUG_ string s = GetCurrentToken(); if (s == "169.466971230985") Debugger.Break(); //Debug.WriteLine(GetCurrentToken()); #endif return true; } public string NextTokenRequired() { if (!NextToken(false)) throw new InvalidOperationException("PrematureStringTermination"); //SR.Get(SRID.TokenizerHelperPrematureStringTermination, new object[0])); return GetCurrentToken(); } public string NextTokenRequired(bool allowQuotedToken) { if (!NextToken(allowQuotedToken)) throw new InvalidOperationException("PrematureStringTermination"); //SR.Get(SRID.TokenizerHelperPrematureStringTermination, new object[0])); return GetCurrentToken(); } private void ScanToNextToken(char separator) { if (this.charIndex < this.strLen) { char c = this.str[this.charIndex]; if (c != separator && !char.IsWhiteSpace(c)) { throw new InvalidOperationException("ExtraDataEncountered"); //SR.Get(SRID.TokenizerHelperExtraDataEncountered, new object[0])); } int num = 0; while (this.charIndex < this.strLen) { c = this.str[this.charIndex]; if (c == separator) { this.foundSeparator = true; num++; this.charIndex++; if (num > 1) throw new InvalidOperationException("EmptyToken"); //SR.Get(SRID.TokenizerHelperEmptyToken, new object[0])); } else { if (!char.IsWhiteSpace(c)) break; this.charIndex++; } } if (num > 0 && this.charIndex >= this.strLen) throw new InvalidOperationException("EmptyToken"); // SR.Get(SRID.TokenizerHelperEmptyToken, new object[0])); } } internal bool FoundSeparator { get { return this.foundSeparator; } } private bool foundSeparator; private char argSeparator; private int charIndex; internal int currentTokenIndex; internal int currentTokenLength; private char quoteChar; private string str; private int strLen; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts/0000777000175000001440000000000011533760020020164 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts/AdobeGlyphListForNewFonts.cs0000644000175000001440000030571011435766646025547 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Fonts { /// /// Testing only /// public sealed class AdobeGlyphListForNewFonts { AdobeGlyphListForNewFonts() { } // ReSharper disable InconsistentNaming /// /// LATIN CAPITAL LETTER A /// public const char A = '\u0041'; /// /// LATIN CAPITAL LETTER AE /// public const char AE = '\u00C6'; /// /// LATIN CAPITAL LETTER AE WITH ACUTE /// public const char AEacute = '\u01FC'; /// /// LATIN CAPITAL LETTER A WITH ACUTE /// public const char Aacute = '\u00C1'; /// /// LATIN CAPITAL LETTER A WITH BREVE /// public const char Abreve = '\u0102'; /// /// LATIN CAPITAL LETTER A WITH CIRCUMFLEX /// public const char Acircumflex = '\u00C2'; /// /// LATIN CAPITAL LETTER A WITH DIAERESIS /// public const char Adieresis = '\u00C4'; /// /// LATIN CAPITAL LETTER A WITH GRAVE /// public const char Agrave = '\u00C0'; /// /// GREEK CAPITAL LETTER ALPHA /// public const char Alpha = '\u0391'; /// /// GREEK CAPITAL LETTER ALPHA WITH TONOS /// public const char Alphatonos = '\u0386'; /// /// LATIN CAPITAL LETTER A WITH MACRON /// public const char Amacron = '\u0100'; /// /// LATIN CAPITAL LETTER A WITH OGONEK /// public const char Aogonek = '\u0104'; /// /// LATIN CAPITAL LETTER A WITH RING ABOVE /// public const char Aring = '\u00C5'; /// /// LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE /// public const char Aringacute = '\u01FA'; /// /// LATIN CAPITAL LETTER A WITH TILDE /// public const char Atilde = '\u00C3'; /// /// LATIN CAPITAL LETTER B /// public const char B = '\u0042'; /// /// GREEK CAPITAL LETTER BETA /// public const char Beta = '\u0392'; /// /// LATIN CAPITAL LETTER C /// public const char C = '\u0043'; /// /// LATIN CAPITAL LETTER C WITH ACUTE /// public const char Cacute = '\u0106'; /// /// LATIN CAPITAL LETTER C WITH CARON /// public const char Ccaron = '\u010C'; /// /// LATIN CAPITAL LETTER C WITH CEDILLA /// public const char Ccedilla = '\u00C7'; /// /// LATIN CAPITAL LETTER C WITH CIRCUMFLEX /// public const char Ccircumflex = '\u0108'; /// /// LATIN CAPITAL LETTER C WITH DOT ABOVE /// public const char Cdotaccent = '\u010A'; /// /// GREEK CAPITAL LETTER CHI /// public const char Chi = '\u03A7'; /// /// LATIN CAPITAL LETTER D /// public const char D = '\u0044'; /// /// LATIN CAPITAL LETTER D WITH CARON /// public const char Dcaron = '\u010E'; /// /// LATIN CAPITAL LETTER D WITH STROKE /// public const char Dcroat = '\u0110'; /// /// INCREMENT /// public const char Delta = '\u2206'; /// /// LATIN CAPITAL LETTER E /// public const char E = '\u0045'; /// /// LATIN CAPITAL LETTER E WITH ACUTE /// public const char Eacute = '\u00C9'; /// /// LATIN CAPITAL LETTER E WITH BREVE /// public const char Ebreve = '\u0114'; /// /// LATIN CAPITAL LETTER E WITH CARON /// public const char Ecaron = '\u011A'; /// /// LATIN CAPITAL LETTER E WITH CIRCUMFLEX /// public const char Ecircumflex = '\u00CA'; /// /// LATIN CAPITAL LETTER E WITH DIAERESIS /// public const char Edieresis = '\u00CB'; /// /// LATIN CAPITAL LETTER E WITH DOT ABOVE /// public const char Edotaccent = '\u0116'; /// /// LATIN CAPITAL LETTER E WITH GRAVE /// public const char Egrave = '\u00C8'; /// /// LATIN CAPITAL LETTER E WITH MACRON /// public const char Emacron = '\u0112'; /// /// LATIN CAPITAL LETTER ENG /// public const char Eng = '\u014A'; /// /// LATIN CAPITAL LETTER E WITH OGONEK /// public const char Eogonek = '\u0118'; /// /// GREEK CAPITAL LETTER EPSILON /// public const char Epsilon = '\u0395'; /// /// GREEK CAPITAL LETTER EPSILON WITH TONOS /// public const char Epsilontonos = '\u0388'; /// /// GREEK CAPITAL LETTER ETA /// public const char Eta = '\u0397'; /// /// GREEK CAPITAL LETTER ETA WITH TONOS /// public const char Etatonos = '\u0389'; /// /// LATIN CAPITAL LETTER ETH /// public const char Eth = '\u00D0'; /// /// EURO SIGN /// public const char Euro = '\u20AC'; /// /// LATIN CAPITAL LETTER F /// public const char F = '\u0046'; /// /// LATIN CAPITAL LETTER G /// public const char G = '\u0047'; /// /// GREEK CAPITAL LETTER GAMMA /// public const char Gamma = '\u0393'; /// /// LATIN CAPITAL LETTER G WITH BREVE /// public const char Gbreve = '\u011E'; /// /// LATIN CAPITAL LETTER G WITH CARON /// public const char Gcaron = '\u01E6'; /// /// LATIN CAPITAL LETTER G WITH CIRCUMFLEX /// public const char Gcircumflex = '\u011C'; /// /// LATIN CAPITAL LETTER G WITH CEDILLA /// public const char Gcommaaccent = '\u0122'; /// /// LATIN CAPITAL LETTER G WITH DOT ABOVE /// public const char Gdotaccent = '\u0120'; /// /// LATIN CAPITAL LETTER H /// public const char H = '\u0048'; /// /// BLACK CIRCLE /// public const char H18533 = '\u25CF'; /// /// BLACK SMALL SQUARE /// public const char H18543 = '\u25AA'; /// /// WHITE SMALL SQUARE /// public const char H18551 = '\u25AB'; /// /// WHITE SQUARE /// public const char H22073 = '\u25A1'; /// /// LATIN CAPITAL LETTER H WITH STROKE /// public const char Hbar = '\u0126'; /// /// LATIN CAPITAL LETTER H WITH CIRCUMFLEX /// public const char Hcircumflex = '\u0124'; /// /// LATIN CAPITAL LETTER I /// public const char I = '\u0049'; /// /// LATIN CAPITAL LIGATURE IJ /// public const char IJ = '\u0132'; /// /// LATIN CAPITAL LETTER I WITH ACUTE /// public const char Iacute = '\u00CD'; /// /// LATIN CAPITAL LETTER I WITH BREVE /// public const char Ibreve = '\u012C'; /// /// LATIN CAPITAL LETTER I WITH CIRCUMFLEX /// public const char Icircumflex = '\u00CE'; /// /// LATIN CAPITAL LETTER I WITH DIAERESIS /// public const char Idieresis = '\u00CF'; /// /// LATIN CAPITAL LETTER I WITH DOT ABOVE /// public const char Idotaccent = '\u0130'; /// /// BLACK-LETTER CAPITAL I /// public const char Ifraktur = '\u2111'; /// /// LATIN CAPITAL LETTER I WITH GRAVE /// public const char Igrave = '\u00CC'; /// /// LATIN CAPITAL LETTER I WITH MACRON /// public const char Imacron = '\u012A'; /// /// LATIN CAPITAL LETTER I WITH OGONEK /// public const char Iogonek = '\u012E'; /// /// GREEK CAPITAL LETTER IOTA /// public const char Iota = '\u0399'; /// /// GREEK CAPITAL LETTER IOTA WITH DIALYTIKA /// public const char Iotadieresis = '\u03AA'; /// /// GREEK CAPITAL LETTER IOTA WITH TONOS /// public const char Iotatonos = '\u038A'; /// /// LATIN CAPITAL LETTER I WITH TILDE /// public const char Itilde = '\u0128'; /// /// LATIN CAPITAL LETTER J /// public const char J = '\u004A'; /// /// LATIN CAPITAL LETTER J WITH CIRCUMFLEX /// public const char Jcircumflex = '\u0134'; /// /// LATIN CAPITAL LETTER K /// public const char K = '\u004B'; /// /// GREEK CAPITAL LETTER KAPPA /// public const char Kappa = '\u039A'; /// /// LATIN CAPITAL LETTER K WITH CEDILLA /// public const char Kcommaaccent = '\u0136'; /// /// LATIN CAPITAL LETTER L /// public const char L = '\u004C'; /// /// LATIN CAPITAL LETTER L WITH ACUTE /// public const char Lacute = '\u0139'; /// /// GREEK CAPITAL LETTER LAMDA /// public const char Lambda = '\u039B'; /// /// LATIN CAPITAL LETTER L WITH CARON /// public const char Lcaron = '\u013D'; /// /// LATIN CAPITAL LETTER L WITH CEDILLA /// public const char Lcommaaccent = '\u013B'; /// /// LATIN CAPITAL LETTER L WITH MIDDLE DOT /// public const char Ldot = '\u013F'; /// /// LATIN CAPITAL LETTER L WITH STROKE /// public const char Lslash = '\u0141'; /// /// LATIN CAPITAL LETTER M /// public const char M = '\u004D'; /// /// GREEK CAPITAL LETTER MU /// public const char Mu = '\u039C'; /// /// LATIN CAPITAL LETTER N /// public const char N = '\u004E'; /// /// LATIN CAPITAL LETTER N WITH ACUTE /// public const char Nacute = '\u0143'; /// /// LATIN CAPITAL LETTER N WITH CARON /// public const char Ncaron = '\u0147'; /// /// LATIN CAPITAL LETTER N WITH CEDILLA /// public const char Ncommaaccent = '\u0145'; /// /// LATIN CAPITAL LETTER N WITH TILDE /// public const char Ntilde = '\u00D1'; /// /// GREEK CAPITAL LETTER NU /// public const char Nu = '\u039D'; /// /// LATIN CAPITAL LETTER O /// public const char O = '\u004F'; /// /// LATIN CAPITAL LIGATURE OE /// public const char OE = '\u0152'; /// /// LATIN CAPITAL LETTER O WITH ACUTE /// public const char Oacute = '\u00D3'; /// /// LATIN CAPITAL LETTER O WITH BREVE /// public const char Obreve = '\u014E'; /// /// LATIN CAPITAL LETTER O WITH CIRCUMFLEX /// public const char Ocircumflex = '\u00D4'; /// /// LATIN CAPITAL LETTER O WITH DIAERESIS /// public const char Odieresis = '\u00D6'; /// /// LATIN CAPITAL LETTER O WITH GRAVE /// public const char Ograve = '\u00D2'; /// /// LATIN CAPITAL LETTER O WITH HORN /// public const char Ohorn = '\u01A0'; /// /// LATIN CAPITAL LETTER O WITH DOUBLE ACUTE /// public const char Ohungarumlaut = '\u0150'; /// /// LATIN CAPITAL LETTER O WITH MACRON /// public const char Omacron = '\u014C'; /// /// OHM SIGN /// public const char Omega = '\u2126'; /// /// GREEK CAPITAL LETTER OMEGA WITH TONOS /// public const char Omegatonos = '\u038F'; /// /// GREEK CAPITAL LETTER OMICRON /// public const char Omicron = '\u039F'; /// /// GREEK CAPITAL LETTER OMICRON WITH TONOS /// public const char Omicrontonos = '\u038C'; /// /// LATIN CAPITAL LETTER O WITH STROKE /// public const char Oslash = '\u00D8'; /// /// LATIN CAPITAL LETTER O WITH STROKE AND ACUTE /// public const char Oslashacute = '\u01FE'; /// /// LATIN CAPITAL LETTER O WITH TILDE /// public const char Otilde = '\u00D5'; /// /// LATIN CAPITAL LETTER P /// public const char P = '\u0050'; /// /// GREEK CAPITAL LETTER PHI /// public const char Phi = '\u03A6'; /// /// GREEK CAPITAL LETTER PI /// public const char Pi = '\u03A0'; /// /// GREEK CAPITAL LETTER PSI /// public const char Psi = '\u03A8'; /// /// LATIN CAPITAL LETTER Q /// public const char Q = '\u0051'; /// /// LATIN CAPITAL LETTER R /// public const char R = '\u0052'; /// /// LATIN CAPITAL LETTER R WITH ACUTE /// public const char Racute = '\u0154'; /// /// LATIN CAPITAL LETTER R WITH CARON /// public const char Rcaron = '\u0158'; /// /// LATIN CAPITAL LETTER R WITH CEDILLA /// public const char Rcommaaccent = '\u0156'; /// /// BLACK-LETTER CAPITAL R /// public const char Rfraktur = '\u211C'; /// /// GREEK CAPITAL LETTER RHO /// public const char Rho = '\u03A1'; /// /// LATIN CAPITAL LETTER S /// public const char S = '\u0053'; /// /// BOX DRAWINGS LIGHT DOWN AND RIGHT /// public const char SF010000 = '\u250C'; /// /// BOX DRAWINGS LIGHT UP AND RIGHT /// public const char SF020000 = '\u2514'; /// /// BOX DRAWINGS LIGHT DOWN AND LEFT /// public const char SF030000 = '\u2510'; /// /// BOX DRAWINGS LIGHT UP AND LEFT /// public const char SF040000 = '\u2518'; /// /// BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL /// public const char SF050000 = '\u253C'; /// /// BOX DRAWINGS LIGHT DOWN AND HORIZONTAL /// public const char SF060000 = '\u252C'; /// /// BOX DRAWINGS LIGHT UP AND HORIZONTAL /// public const char SF070000 = '\u2534'; /// /// BOX DRAWINGS LIGHT VERTICAL AND RIGHT /// public const char SF080000 = '\u251C'; /// /// BOX DRAWINGS LIGHT VERTICAL AND LEFT /// public const char SF090000 = '\u2524'; /// /// BOX DRAWINGS LIGHT HORIZONTAL /// public const char SF100000 = '\u2500'; /// /// BOX DRAWINGS LIGHT VERTICAL /// public const char SF110000 = '\u2502'; /// /// BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE /// public const char SF190000 = '\u2561'; /// /// BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE /// public const char SF200000 = '\u2562'; /// /// BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE /// public const char SF210000 = '\u2556'; /// /// BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE /// public const char SF220000 = '\u2555'; /// /// BOX DRAWINGS DOUBLE VERTICAL AND LEFT /// public const char SF230000 = '\u2563'; /// /// BOX DRAWINGS DOUBLE VERTICAL /// public const char SF240000 = '\u2551'; /// /// BOX DRAWINGS DOUBLE DOWN AND LEFT /// public const char SF250000 = '\u2557'; /// /// BOX DRAWINGS DOUBLE UP AND LEFT /// public const char SF260000 = '\u255D'; /// /// BOX DRAWINGS UP DOUBLE AND LEFT SINGLE /// public const char SF270000 = '\u255C'; /// /// BOX DRAWINGS UP SINGLE AND LEFT DOUBLE /// public const char SF280000 = '\u255B'; /// /// BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE /// public const char SF360000 = '\u255E'; /// /// BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE /// public const char SF370000 = '\u255F'; /// /// BOX DRAWINGS DOUBLE UP AND RIGHT /// public const char SF380000 = '\u255A'; /// /// BOX DRAWINGS DOUBLE DOWN AND RIGHT /// public const char SF390000 = '\u2554'; /// /// BOX DRAWINGS DOUBLE UP AND HORIZONTAL /// public const char SF400000 = '\u2569'; /// /// BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL /// public const char SF410000 = '\u2566'; /// /// BOX DRAWINGS DOUBLE VERTICAL AND RIGHT /// public const char SF420000 = '\u2560'; /// /// BOX DRAWINGS DOUBLE HORIZONTAL /// public const char SF430000 = '\u2550'; /// /// BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL /// public const char SF440000 = '\u256C'; /// /// BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE /// public const char SF450000 = '\u2567'; /// /// BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE /// public const char SF460000 = '\u2568'; /// /// BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE /// public const char SF470000 = '\u2564'; /// /// BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE /// public const char SF480000 = '\u2565'; /// /// BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE /// public const char SF490000 = '\u2559'; /// /// BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE /// public const char SF500000 = '\u2558'; /// /// BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE /// public const char SF510000 = '\u2552'; /// /// BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE /// public const char SF520000 = '\u2553'; /// /// BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE /// public const char SF530000 = '\u256B'; /// /// BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE /// public const char SF540000 = '\u256A'; /// /// LATIN CAPITAL LETTER S WITH ACUTE /// public const char Sacute = '\u015A'; /// /// LATIN CAPITAL LETTER S WITH CARON /// public const char Scaron = '\u0160'; /// /// LATIN CAPITAL LETTER S WITH CEDILLA /// public const char Scedilla = '\u015E'; /// /// LATIN CAPITAL LETTER S WITH CIRCUMFLEX /// public const char Scircumflex = '\u015C'; /// /// LATIN CAPITAL LETTER S WITH COMMA BELOW /// public const char Scommaaccent = '\u0218'; /// /// GREEK CAPITAL LETTER SIGMA /// public const char Sigma = '\u03A3'; /// /// LATIN CAPITAL LETTER T /// public const char T = '\u0054'; /// /// GREEK CAPITAL LETTER TAU /// public const char Tau = '\u03A4'; /// /// LATIN CAPITAL LETTER T WITH STROKE /// public const char Tbar = '\u0166'; /// /// LATIN CAPITAL LETTER T WITH CARON /// public const char Tcaron = '\u0164'; /// /// LATIN CAPITAL LETTER T WITH CEDILLA /// public const char Tcommaaccent = '\u0162'; /// /// GREEK CAPITAL LETTER THETA /// public const char Theta = '\u0398'; /// /// LATIN CAPITAL LETTER THORN /// public const char Thorn = '\u00DE'; /// /// LATIN CAPITAL LETTER U /// public const char U = '\u0055'; /// /// LATIN CAPITAL LETTER U WITH ACUTE /// public const char Uacute = '\u00DA'; /// /// LATIN CAPITAL LETTER U WITH BREVE /// public const char Ubreve = '\u016C'; /// /// LATIN CAPITAL LETTER U WITH CIRCUMFLEX /// public const char Ucircumflex = '\u00DB'; /// /// LATIN CAPITAL LETTER U WITH DIAERESIS /// public const char Udieresis = '\u00DC'; /// /// LATIN CAPITAL LETTER U WITH GRAVE /// public const char Ugrave = '\u00D9'; /// /// LATIN CAPITAL LETTER U WITH HORN /// public const char Uhorn = '\u01AF'; /// /// LATIN CAPITAL LETTER U WITH DOUBLE ACUTE /// public const char Uhungarumlaut = '\u0170'; /// /// LATIN CAPITAL LETTER U WITH MACRON /// public const char Umacron = '\u016A'; /// /// LATIN CAPITAL LETTER U WITH OGONEK /// public const char Uogonek = '\u0172'; /// /// GREEK CAPITAL LETTER UPSILON /// public const char Upsilon = '\u03A5'; /// /// GREEK UPSILON WITH HOOK SYMBOL /// public const char Upsilon1 = '\u03D2'; /// /// GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA /// public const char Upsilondieresis = '\u03AB'; /// /// GREEK CAPITAL LETTER UPSILON WITH TONOS /// public const char Upsilontonos = '\u038E'; /// /// LATIN CAPITAL LETTER U WITH RING ABOVE /// public const char Uring = '\u016E'; /// /// LATIN CAPITAL LETTER U WITH TILDE /// public const char Utilde = '\u0168'; /// /// LATIN CAPITAL LETTER V /// public const char V = '\u0056'; /// /// LATIN CAPITAL LETTER W /// public const char W = '\u0057'; /// /// LATIN CAPITAL LETTER W WITH ACUTE /// public const char Wacute = '\u1E82'; /// /// LATIN CAPITAL LETTER W WITH CIRCUMFLEX /// public const char Wcircumflex = '\u0174'; /// /// LATIN CAPITAL LETTER W WITH DIAERESIS /// public const char Wdieresis = '\u1E84'; /// /// LATIN CAPITAL LETTER W WITH GRAVE /// public const char Wgrave = '\u1E80'; /// /// LATIN CAPITAL LETTER X /// public const char X = '\u0058'; /// /// GREEK CAPITAL LETTER XI /// public const char Xi = '\u039E'; /// /// LATIN CAPITAL LETTER Y /// public const char Y = '\u0059'; /// /// LATIN CAPITAL LETTER Y WITH ACUTE /// public const char Yacute = '\u00DD'; /// /// LATIN CAPITAL LETTER Y WITH CIRCUMFLEX /// public const char Ycircumflex = '\u0176'; /// /// LATIN CAPITAL LETTER Y WITH DIAERESIS /// public const char Ydieresis = '\u0178'; /// /// LATIN CAPITAL LETTER Y WITH GRAVE /// public const char Ygrave = '\u1EF2'; /// /// LATIN CAPITAL LETTER Z /// public const char Z = '\u005A'; /// /// LATIN CAPITAL LETTER Z WITH ACUTE /// public const char Zacute = '\u0179'; /// /// LATIN CAPITAL LETTER Z WITH CARON /// public const char Zcaron = '\u017D'; /// /// LATIN CAPITAL LETTER Z WITH DOT ABOVE /// public const char Zdotaccent = '\u017B'; /// /// GREEK CAPITAL LETTER ZETA /// public const char Zeta = '\u0396'; /// /// LATIN SMALL LETTER A /// public const char a = '\u0061'; /// /// LATIN SMALL LETTER A WITH ACUTE /// public const char aacute = '\u00E1'; /// /// LATIN SMALL LETTER A WITH BREVE /// public const char abreve = '\u0103'; /// /// LATIN SMALL LETTER A WITH CIRCUMFLEX /// public const char acircumflex = '\u00E2'; /// /// ACUTE ACCENT /// public const char acute = '\u00B4'; /// /// COMBINING ACUTE ACCENT /// public const char acutecomb = '\u0301'; /// /// LATIN SMALL LETTER A WITH DIAERESIS /// public const char adieresis = '\u00E4'; /// /// LATIN SMALL LETTER AE /// public const char ae = '\u00E6'; /// /// LATIN SMALL LETTER AE WITH ACUTE /// public const char aeacute = '\u01FD'; /// /// HORIZONTAL BAR /// public const char afii00208 = '\u2015'; /// /// CYRILLIC CAPITAL LETTER A /// public const char afii10017 = '\u0410'; /// /// CYRILLIC CAPITAL LETTER BE /// public const char afii10018 = '\u0411'; /// /// CYRILLIC CAPITAL LETTER VE /// public const char afii10019 = '\u0412'; /// /// CYRILLIC CAPITAL LETTER GHE /// public const char afii10020 = '\u0413'; /// /// CYRILLIC CAPITAL LETTER DE /// public const char afii10021 = '\u0414'; /// /// CYRILLIC CAPITAL LETTER IE /// public const char afii10022 = '\u0415'; /// /// CYRILLIC CAPITAL LETTER IO /// public const char afii10023 = '\u0401'; /// /// CYRILLIC CAPITAL LETTER ZHE /// public const char afii10024 = '\u0416'; /// /// CYRILLIC CAPITAL LETTER ZE /// public const char afii10025 = '\u0417'; /// /// CYRILLIC CAPITAL LETTER I /// public const char afii10026 = '\u0418'; /// /// CYRILLIC CAPITAL LETTER SHORT I /// public const char afii10027 = '\u0419'; /// /// CYRILLIC CAPITAL LETTER KA /// public const char afii10028 = '\u041A'; /// /// CYRILLIC CAPITAL LETTER EL /// public const char afii10029 = '\u041B'; /// /// CYRILLIC CAPITAL LETTER EM /// public const char afii10030 = '\u041C'; /// /// CYRILLIC CAPITAL LETTER EN /// public const char afii10031 = '\u041D'; /// /// CYRILLIC CAPITAL LETTER O /// public const char afii10032 = '\u041E'; /// /// CYRILLIC CAPITAL LETTER PE /// public const char afii10033 = '\u041F'; /// /// CYRILLIC CAPITAL LETTER ER /// public const char afii10034 = '\u0420'; /// /// CYRILLIC CAPITAL LETTER ES /// public const char afii10035 = '\u0421'; /// /// CYRILLIC CAPITAL LETTER TE /// public const char afii10036 = '\u0422'; /// /// CYRILLIC CAPITAL LETTER U /// public const char afii10037 = '\u0423'; /// /// CYRILLIC CAPITAL LETTER EF /// public const char afii10038 = '\u0424'; /// /// CYRILLIC CAPITAL LETTER HA /// public const char afii10039 = '\u0425'; /// /// CYRILLIC CAPITAL LETTER TSE /// public const char afii10040 = '\u0426'; /// /// CYRILLIC CAPITAL LETTER CHE /// public const char afii10041 = '\u0427'; /// /// CYRILLIC CAPITAL LETTER SHA /// public const char afii10042 = '\u0428'; /// /// CYRILLIC CAPITAL LETTER SHCHA /// public const char afii10043 = '\u0429'; /// /// CYRILLIC CAPITAL LETTER HARD SIGN /// public const char afii10044 = '\u042A'; /// /// CYRILLIC CAPITAL LETTER YERU /// public const char afii10045 = '\u042B'; /// /// CYRILLIC CAPITAL LETTER SOFT SIGN /// public const char afii10046 = '\u042C'; /// /// CYRILLIC CAPITAL LETTER E /// public const char afii10047 = '\u042D'; /// /// CYRILLIC CAPITAL LETTER YU /// public const char afii10048 = '\u042E'; /// /// CYRILLIC CAPITAL LETTER YA /// public const char afii10049 = '\u042F'; /// /// CYRILLIC CAPITAL LETTER GHE WITH UPTURN /// public const char afii10050 = '\u0490'; /// /// CYRILLIC CAPITAL LETTER DJE /// public const char afii10051 = '\u0402'; /// /// CYRILLIC CAPITAL LETTER GJE /// public const char afii10052 = '\u0403'; /// /// CYRILLIC CAPITAL LETTER UKRAINIAN IE /// public const char afii10053 = '\u0404'; /// /// CYRILLIC CAPITAL LETTER DZE /// public const char afii10054 = '\u0405'; /// /// CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I /// public const char afii10055 = '\u0406'; /// /// CYRILLIC CAPITAL LETTER YI /// public const char afii10056 = '\u0407'; /// /// CYRILLIC CAPITAL LETTER JE /// public const char afii10057 = '\u0408'; /// /// CYRILLIC CAPITAL LETTER LJE /// public const char afii10058 = '\u0409'; /// /// CYRILLIC CAPITAL LETTER NJE /// public const char afii10059 = '\u040A'; /// /// CYRILLIC CAPITAL LETTER TSHE /// public const char afii10060 = '\u040B'; /// /// CYRILLIC CAPITAL LETTER KJE /// public const char afii10061 = '\u040C'; /// /// CYRILLIC CAPITAL LETTER SHORT U /// public const char afii10062 = '\u040E'; /// /// CYRILLIC SMALL LETTER A /// public const char afii10065 = '\u0430'; /// /// CYRILLIC SMALL LETTER BE /// public const char afii10066 = '\u0431'; /// /// CYRILLIC SMALL LETTER VE /// public const char afii10067 = '\u0432'; /// /// CYRILLIC SMALL LETTER GHE /// public const char afii10068 = '\u0433'; /// /// CYRILLIC SMALL LETTER DE /// public const char afii10069 = '\u0434'; /// /// CYRILLIC SMALL LETTER IE /// public const char afii10070 = '\u0435'; /// /// CYRILLIC SMALL LETTER IO /// public const char afii10071 = '\u0451'; /// /// CYRILLIC SMALL LETTER ZHE /// public const char afii10072 = '\u0436'; /// /// CYRILLIC SMALL LETTER ZE /// public const char afii10073 = '\u0437'; /// /// CYRILLIC SMALL LETTER I /// public const char afii10074 = '\u0438'; /// /// CYRILLIC SMALL LETTER SHORT I /// public const char afii10075 = '\u0439'; /// /// CYRILLIC SMALL LETTER KA /// public const char afii10076 = '\u043A'; /// /// CYRILLIC SMALL LETTER EL /// public const char afii10077 = '\u043B'; /// /// CYRILLIC SMALL LETTER EM /// public const char afii10078 = '\u043C'; /// /// CYRILLIC SMALL LETTER EN /// public const char afii10079 = '\u043D'; /// /// CYRILLIC SMALL LETTER O /// public const char afii10080 = '\u043E'; /// /// CYRILLIC SMALL LETTER PE /// public const char afii10081 = '\u043F'; /// /// CYRILLIC SMALL LETTER ER /// public const char afii10082 = '\u0440'; /// /// CYRILLIC SMALL LETTER ES /// public const char afii10083 = '\u0441'; /// /// CYRILLIC SMALL LETTER TE /// public const char afii10084 = '\u0442'; /// /// CYRILLIC SMALL LETTER U /// public const char afii10085 = '\u0443'; /// /// CYRILLIC SMALL LETTER EF /// public const char afii10086 = '\u0444'; /// /// CYRILLIC SMALL LETTER HA /// public const char afii10087 = '\u0445'; /// /// CYRILLIC SMALL LETTER TSE /// public const char afii10088 = '\u0446'; /// /// CYRILLIC SMALL LETTER CHE /// public const char afii10089 = '\u0447'; /// /// CYRILLIC SMALL LETTER SHA /// public const char afii10090 = '\u0448'; /// /// CYRILLIC SMALL LETTER SHCHA /// public const char afii10091 = '\u0449'; /// /// CYRILLIC SMALL LETTER HARD SIGN /// public const char afii10092 = '\u044A'; /// /// CYRILLIC SMALL LETTER YERU /// public const char afii10093 = '\u044B'; /// /// CYRILLIC SMALL LETTER SOFT SIGN /// public const char afii10094 = '\u044C'; /// /// CYRILLIC SMALL LETTER E /// public const char afii10095 = '\u044D'; /// /// CYRILLIC SMALL LETTER YU /// public const char afii10096 = '\u044E'; /// /// CYRILLIC SMALL LETTER YA /// public const char afii10097 = '\u044F'; /// /// CYRILLIC SMALL LETTER GHE WITH UPTURN /// public const char afii10098 = '\u0491'; /// /// CYRILLIC SMALL LETTER DJE /// public const char afii10099 = '\u0452'; /// /// CYRILLIC SMALL LETTER GJE /// public const char afii10100 = '\u0453'; /// /// CYRILLIC SMALL LETTER UKRAINIAN IE /// public const char afii10101 = '\u0454'; /// /// CYRILLIC SMALL LETTER DZE /// public const char afii10102 = '\u0455'; /// /// CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I /// public const char afii10103 = '\u0456'; /// /// CYRILLIC SMALL LETTER YI /// public const char afii10104 = '\u0457'; /// /// CYRILLIC SMALL LETTER JE /// public const char afii10105 = '\u0458'; /// /// CYRILLIC SMALL LETTER LJE /// public const char afii10106 = '\u0459'; /// /// CYRILLIC SMALL LETTER NJE /// public const char afii10107 = '\u045A'; /// /// CYRILLIC SMALL LETTER TSHE /// public const char afii10108 = '\u045B'; /// /// CYRILLIC SMALL LETTER KJE /// public const char afii10109 = '\u045C'; /// /// CYRILLIC SMALL LETTER SHORT U /// public const char afii10110 = '\u045E'; /// /// CYRILLIC CAPITAL LETTER DZHE /// public const char afii10145 = '\u040F'; /// /// CYRILLIC CAPITAL LETTER YAT /// public const char afii10146 = '\u0462'; /// /// CYRILLIC CAPITAL LETTER FITA /// public const char afii10147 = '\u0472'; /// /// CYRILLIC CAPITAL LETTER IZHITSA /// public const char afii10148 = '\u0474'; /// /// CYRILLIC SMALL LETTER DZHE /// public const char afii10193 = '\u045F'; /// /// CYRILLIC SMALL LETTER YAT /// public const char afii10194 = '\u0463'; /// /// CYRILLIC SMALL LETTER FITA /// public const char afii10195 = '\u0473'; /// /// CYRILLIC SMALL LETTER IZHITSA /// public const char afii10196 = '\u0475'; /// /// CYRILLIC SMALL LETTER SCHWA /// public const char afii10846 = '\u04D9'; /// /// LEFT-TO-RIGHT MARK /// public const char afii299 = '\u200E'; /// /// RIGHT-TO-LEFT MARK /// public const char afii300 = '\u200F'; /// /// ZERO WIDTH JOINER /// public const char afii301 = '\u200D'; /// /// ARABIC PERCENT SIGN /// public const char afii57381 = '\u066A'; /// /// ARABIC COMMA /// public const char afii57388 = '\u060C'; /// /// ARABIC-INDIC DIGIT ZERO /// public const char afii57392 = '\u0660'; /// /// ARABIC-INDIC DIGIT ONE /// public const char afii57393 = '\u0661'; /// /// ARABIC-INDIC DIGIT TWO /// public const char afii57394 = '\u0662'; /// /// ARABIC-INDIC DIGIT THREE /// public const char afii57395 = '\u0663'; /// /// ARABIC-INDIC DIGIT FOUR /// public const char afii57396 = '\u0664'; /// /// ARABIC-INDIC DIGIT FIVE /// public const char afii57397 = '\u0665'; /// /// ARABIC-INDIC DIGIT SIX /// public const char afii57398 = '\u0666'; /// /// ARABIC-INDIC DIGIT SEVEN /// public const char afii57399 = '\u0667'; /// /// ARABIC-INDIC DIGIT EIGHT /// public const char afii57400 = '\u0668'; /// /// ARABIC-INDIC DIGIT NINE /// public const char afii57401 = '\u0669'; /// /// ARABIC SEMICOLON /// public const char afii57403 = '\u061B'; /// /// ARABIC QUESTION MARK /// public const char afii57407 = '\u061F'; /// /// ARABIC LETTER HAMZA /// public const char afii57409 = '\u0621'; /// /// ARABIC LETTER ALEF WITH MADDA ABOVE /// public const char afii57410 = '\u0622'; /// /// ARABIC LETTER ALEF WITH HAMZA ABOVE /// public const char afii57411 = '\u0623'; /// /// ARABIC LETTER WAW WITH HAMZA ABOVE /// public const char afii57412 = '\u0624'; /// /// ARABIC LETTER ALEF WITH HAMZA BELOW /// public const char afii57413 = '\u0625'; /// /// ARABIC LETTER YEH WITH HAMZA ABOVE /// public const char afii57414 = '\u0626'; /// /// ARABIC LETTER ALEF /// public const char afii57415 = '\u0627'; /// /// ARABIC LETTER BEH /// public const char afii57416 = '\u0628'; /// /// ARABIC LETTER TEH MARBUTA /// public const char afii57417 = '\u0629'; /// /// ARABIC LETTER TEH /// public const char afii57418 = '\u062A'; /// /// ARABIC LETTER THEH /// public const char afii57419 = '\u062B'; /// /// ARABIC LETTER JEEM /// public const char afii57420 = '\u062C'; /// /// ARABIC LETTER HAH /// public const char afii57421 = '\u062D'; /// /// ARABIC LETTER KHAH /// public const char afii57422 = '\u062E'; /// /// ARABIC LETTER DAL /// public const char afii57423 = '\u062F'; /// /// ARABIC LETTER THAL /// public const char afii57424 = '\u0630'; /// /// ARABIC LETTER REH /// public const char afii57425 = '\u0631'; /// /// ARABIC LETTER ZAIN /// public const char afii57426 = '\u0632'; /// /// ARABIC LETTER SEEN /// public const char afii57427 = '\u0633'; /// /// ARABIC LETTER SHEEN /// public const char afii57428 = '\u0634'; /// /// ARABIC LETTER SAD /// public const char afii57429 = '\u0635'; /// /// ARABIC LETTER DAD /// public const char afii57430 = '\u0636'; /// /// ARABIC LETTER TAH /// public const char afii57431 = '\u0637'; /// /// ARABIC LETTER ZAH /// public const char afii57432 = '\u0638'; /// /// ARABIC LETTER AIN /// public const char afii57433 = '\u0639'; /// /// ARABIC LETTER GHAIN /// public const char afii57434 = '\u063A'; /// /// ARABIC TATWEEL /// public const char afii57440 = '\u0640'; /// /// ARABIC LETTER FEH /// public const char afii57441 = '\u0641'; /// /// ARABIC LETTER QAF /// public const char afii57442 = '\u0642'; /// /// ARABIC LETTER KAF /// public const char afii57443 = '\u0643'; /// /// ARABIC LETTER LAM /// public const char afii57444 = '\u0644'; /// /// ARABIC LETTER MEEM /// public const char afii57445 = '\u0645'; /// /// ARABIC LETTER NOON /// public const char afii57446 = '\u0646'; /// /// ARABIC LETTER WAW /// public const char afii57448 = '\u0648'; /// /// ARABIC LETTER ALEF MAKSURA /// public const char afii57449 = '\u0649'; /// /// ARABIC LETTER YEH /// public const char afii57450 = '\u064A'; /// /// ARABIC FATHATAN /// public const char afii57451 = '\u064B'; /// /// ARABIC DAMMATAN /// public const char afii57452 = '\u064C'; /// /// ARABIC KASRATAN /// public const char afii57453 = '\u064D'; /// /// ARABIC FATHA /// public const char afii57454 = '\u064E'; /// /// ARABIC DAMMA /// public const char afii57455 = '\u064F'; /// /// ARABIC KASRA /// public const char afii57456 = '\u0650'; /// /// ARABIC SHADDA /// public const char afii57457 = '\u0651'; /// /// ARABIC SUKUN /// public const char afii57458 = '\u0652'; /// /// ARABIC LETTER HEH /// public const char afii57470 = '\u0647'; /// /// ARABIC LETTER VEH /// public const char afii57505 = '\u06A4'; /// /// ARABIC LETTER PEH /// public const char afii57506 = '\u067E'; /// /// ARABIC LETTER TCHEH /// public const char afii57507 = '\u0686'; /// /// ARABIC LETTER JEH /// public const char afii57508 = '\u0698'; /// /// ARABIC LETTER GAF /// public const char afii57509 = '\u06AF'; /// /// ARABIC LETTER TTEH /// public const char afii57511 = '\u0679'; /// /// ARABIC LETTER DDAL /// public const char afii57512 = '\u0688'; /// /// ARABIC LETTER RREH /// public const char afii57513 = '\u0691'; /// /// ARABIC LETTER NOON GHUNNA /// public const char afii57514 = '\u06BA'; /// /// ARABIC LETTER YEH BARREE /// public const char afii57519 = '\u06D2'; /// /// ARABIC LETTER AE /// public const char afii57534 = '\u06D5'; /// /// NEW SHEQEL SIGN /// public const char afii57636 = '\u20AA'; /// /// HEBREW PUNCTUATION MAQAF /// public const char afii57645 = '\u05BE'; /// /// HEBREW PUNCTUATION SOF PASUQ /// public const char afii57658 = '\u05C3'; /// /// HEBREW LETTER ALEF /// public const char afii57664 = '\u05D0'; /// /// HEBREW LETTER BET /// public const char afii57665 = '\u05D1'; /// /// HEBREW LETTER GIMEL /// public const char afii57666 = '\u05D2'; /// /// HEBREW LETTER DALET /// public const char afii57667 = '\u05D3'; /// /// HEBREW LETTER HE /// public const char afii57668 = '\u05D4'; /// /// HEBREW LETTER VAV /// public const char afii57669 = '\u05D5'; /// /// HEBREW LETTER ZAYIN /// public const char afii57670 = '\u05D6'; /// /// HEBREW LETTER HET /// public const char afii57671 = '\u05D7'; /// /// HEBREW LETTER TET /// public const char afii57672 = '\u05D8'; /// /// HEBREW LETTER YOD /// public const char afii57673 = '\u05D9'; /// /// HEBREW LETTER FINAL KAF /// public const char afii57674 = '\u05DA'; /// /// HEBREW LETTER KAF /// public const char afii57675 = '\u05DB'; /// /// HEBREW LETTER LAMED /// public const char afii57676 = '\u05DC'; /// /// HEBREW LETTER FINAL MEM /// public const char afii57677 = '\u05DD'; /// /// HEBREW LETTER MEM /// public const char afii57678 = '\u05DE'; /// /// HEBREW LETTER FINAL NUN /// public const char afii57679 = '\u05DF'; /// /// HEBREW LETTER NUN /// public const char afii57680 = '\u05E0'; /// /// HEBREW LETTER SAMEKH /// public const char afii57681 = '\u05E1'; /// /// HEBREW LETTER AYIN /// public const char afii57682 = '\u05E2'; /// /// HEBREW LETTER FINAL PE /// public const char afii57683 = '\u05E3'; /// /// HEBREW LETTER PE /// public const char afii57684 = '\u05E4'; /// /// HEBREW LETTER FINAL TSADI /// public const char afii57685 = '\u05E5'; /// /// HEBREW LETTER TSADI /// public const char afii57686 = '\u05E6'; /// /// HEBREW LETTER QOF /// public const char afii57687 = '\u05E7'; /// /// HEBREW LETTER RESH /// public const char afii57688 = '\u05E8'; /// /// HEBREW LETTER SHIN /// public const char afii57689 = '\u05E9'; /// /// HEBREW LETTER TAV /// public const char afii57690 = '\u05EA'; /// /// HEBREW LIGATURE YIDDISH DOUBLE VAV /// public const char afii57716 = '\u05F0'; /// /// HEBREW LIGATURE YIDDISH VAV YOD /// public const char afii57717 = '\u05F1'; /// /// HEBREW LIGATURE YIDDISH DOUBLE YOD /// public const char afii57718 = '\u05F2'; /// /// HEBREW POINT HIRIQ /// public const char afii57793 = '\u05B4'; /// /// HEBREW POINT TSERE /// public const char afii57794 = '\u05B5'; /// /// HEBREW POINT SEGOL /// public const char afii57795 = '\u05B6'; /// /// HEBREW POINT QUBUTS /// public const char afii57796 = '\u05BB'; /// /// HEBREW POINT QAMATS /// public const char afii57797 = '\u05B8'; /// /// HEBREW POINT PATAH /// public const char afii57798 = '\u05B7'; /// /// HEBREW POINT SHEVA /// public const char afii57799 = '\u05B0'; /// /// HEBREW POINT HATAF PATAH /// public const char afii57800 = '\u05B2'; /// /// HEBREW POINT HATAF SEGOL /// public const char afii57801 = '\u05B1'; /// /// HEBREW POINT HATAF QAMATS /// public const char afii57802 = '\u05B3'; /// /// HEBREW POINT SIN DOT /// public const char afii57803 = '\u05C2'; /// /// HEBREW POINT SHIN DOT /// public const char afii57804 = '\u05C1'; /// /// HEBREW POINT HOLAM /// public const char afii57806 = '\u05B9'; /// /// HEBREW POINT DAGESH OR MAPIQ /// public const char afii57807 = '\u05BC'; /// /// HEBREW POINT METEG /// public const char afii57839 = '\u05BD'; /// /// HEBREW POINT RAFE /// public const char afii57841 = '\u05BF'; /// /// HEBREW PUNCTUATION PASEQ /// public const char afii57842 = '\u05C0'; /// /// MODIFIER LETTER APOSTROPHE /// public const char afii57929 = '\u02BC'; /// /// CARE OF /// public const char afii61248 = '\u2105'; /// /// SCRIPT SMALL L /// public const char afii61289 = '\u2113'; /// /// NUMERO SIGN /// public const char afii61352 = '\u2116'; /// /// POP DIRECTIONAL FORMATTING /// public const char afii61573 = '\u202C'; /// /// LEFT-TO-RIGHT OVERRIDE /// public const char afii61574 = '\u202D'; /// /// RIGHT-TO-LEFT OVERRIDE /// public const char afii61575 = '\u202E'; /// /// ZERO WIDTH NON-JOINER /// public const char afii61664 = '\u200C'; /// /// ARABIC FIVE POINTED STAR /// public const char afii63167 = '\u066D'; /// /// MODIFIER LETTER REVERSED COMMA /// public const char afii64937 = '\u02BD'; /// /// LATIN SMALL LETTER A WITH GRAVE /// public const char agrave = '\u00E0'; /// /// ALEF SYMBOL /// public const char aleph = '\u2135'; /// /// GREEK SMALL LETTER ALPHA /// public const char alpha = '\u03B1'; /// /// GREEK SMALL LETTER ALPHA WITH TONOS /// public const char alphatonos = '\u03AC'; /// /// LATIN SMALL LETTER A WITH MACRON /// public const char amacron = '\u0101'; /// /// AMPERSAND /// public const char ampersand = '\u0026'; /// /// ANGLE /// public const char angle = '\u2220'; /// /// LEFT-POINTING ANGLE BRACKET /// public const char angleleft = '\u2329'; /// /// RIGHT-POINTING ANGLE BRACKET /// public const char angleright = '\u232A'; /// /// GREEK ANO TELEIA /// public const char anoteleia = '\u0387'; /// /// LATIN SMALL LETTER A WITH OGONEK /// public const char aogonek = '\u0105'; /// /// ALMOST EQUAL TO /// public const char approxequal = '\u2248'; /// /// LATIN SMALL LETTER A WITH RING ABOVE /// public const char aring = '\u00E5'; /// /// LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE /// public const char aringacute = '\u01FB'; /// /// LEFT RIGHT ARROW /// public const char arrowboth = '\u2194'; /// /// LEFT RIGHT DOUBLE ARROW /// public const char arrowdblboth = '\u21D4'; /// /// DOWNWARDS DOUBLE ARROW /// public const char arrowdbldown = '\u21D3'; /// /// LEFTWARDS DOUBLE ARROW /// public const char arrowdblleft = '\u21D0'; /// /// RIGHTWARDS DOUBLE ARROW /// public const char arrowdblright = '\u21D2'; /// /// UPWARDS DOUBLE ARROW /// public const char arrowdblup = '\u21D1'; /// /// DOWNWARDS ARROW /// public const char arrowdown = '\u2193'; /// /// LEFTWARDS ARROW /// public const char arrowleft = '\u2190'; /// /// RIGHTWARDS ARROW /// public const char arrowright = '\u2192'; /// /// UPWARDS ARROW /// public const char arrowup = '\u2191'; /// /// UP DOWN ARROW /// public const char arrowupdn = '\u2195'; /// /// UP DOWN ARROW WITH BASE /// public const char arrowupdnbse = '\u21A8'; // EXTENDER //public const char ARROW = '\u;arrowvertex;VERTICAL' /// /// CIRCUMFLEX ACCENT /// public const char asciicircum = '\u005E'; /// /// TILDE /// public const char asciitilde = '\u007E'; /// /// ASTERISK /// public const char asterisk = '\u002A'; /// /// ASTERISK OPERATOR /// public const char asteriskmath = '\u2217'; /// /// COMMERCIAL AT /// public const char at = '\u0040'; /// /// LATIN SMALL LETTER A WITH TILDE /// public const char atilde = '\u00E3'; /// /// LATIN SMALL LETTER B /// public const char b = '\u0062'; /// /// REVERSE SOLIDUS /// public const char backslash = '\u005C'; /// /// VERTICAL LINE /// public const char bar = '\u007C'; /// /// GREEK SMALL LETTER BETA /// public const char beta = '\u03B2'; /// /// FULL BLOCK /// public const char block = '\u2588'; /// /// LEFT CURLY BRACKET /// public const char braceleft = '\u007B'; /// /// RIGHT CURLY BRACKET /// public const char braceright = '\u007D'; /// /// LEFT SQUARE BRACKET /// public const char bracketleft = '\u005B'; /// /// RIGHT SQUARE BRACKET /// public const char bracketright = '\u005D'; /// /// BREVE /// public const char breve = '\u02D8'; /// /// BROKEN BAR /// public const char brokenbar = '\u00A6'; /// /// BULLET /// public const char bullet = '\u2022'; /// /// LATIN SMALL LETTER C /// public const char c = '\u0063'; /// /// LATIN SMALL LETTER C WITH ACUTE /// public const char cacute = '\u0107'; /// /// CARON /// public const char caron = '\u02C7'; /// /// DOWNWARDS ARROW WITH CORNER LEFTWARDS /// public const char carriagereturn = '\u21B5'; /// /// LATIN SMALL LETTER C WITH CARON /// public const char ccaron = '\u010D'; /// /// LATIN SMALL LETTER C WITH CEDILLA /// public const char ccedilla = '\u00E7'; /// /// LATIN SMALL LETTER C WITH CIRCUMFLEX /// public const char ccircumflex = '\u0109'; /// /// LATIN SMALL LETTER C WITH DOT ABOVE /// public const char cdotaccent = '\u010B'; /// /// CEDILLA /// public const char cedilla = '\u00B8'; /// /// CENT SIGN /// public const char cent = '\u00A2'; /// /// GREEK SMALL LETTER CHI /// public const char chi = '\u03C7'; /// /// WHITE CIRCLE /// public const char circle = '\u25CB'; /// /// CIRCLED TIMES /// public const char circlemultiply = '\u2297'; /// /// CIRCLED PLUS /// public const char circleplus = '\u2295'; /// /// MODIFIER LETTER CIRCUMFLEX ACCENT /// public const char circumflex = '\u02C6'; /// /// BLACK CLUB SUIT /// public const char club = '\u2663'; /// /// COLON /// public const char colon = '\u003A'; /// /// COLON SIGN /// public const char colonmonetary = '\u20A1'; /// /// COMMA /// public const char comma = '\u002C'; /// /// APPROXIMATELY EQUAL TO /// public const char congruent = '\u2245'; /// /// COPYRIGHT SIGN /// public const char copyright = '\u00A9'; /// /// CURRENCY SIGN /// public const char currency = '\u00A4'; /// /// LATIN SMALL LETTER D /// public const char d = '\u0064'; /// /// DAGGER /// public const char dagger = '\u2020'; /// /// DOUBLE DAGGER /// public const char daggerdbl = '\u2021'; /// /// LATIN SMALL LETTER D WITH CARON /// public const char dcaron = '\u010F'; /// /// LATIN SMALL LETTER D WITH STROKE /// public const char dcroat = '\u0111'; /// /// DEGREE SIGN /// public const char degree = '\u00B0'; /// /// GREEK SMALL LETTER DELTA /// public const char delta = '\u03B4'; /// /// BLACK DIAMOND SUIT /// public const char diamond = '\u2666'; /// /// DIAERESIS /// public const char dieresis = '\u00A8'; /// /// GREEK DIALYTIKA TONOS /// public const char dieresistonos = '\u0385'; /// /// DIVISION SIGN /// public const char divide = '\u00F7'; /// /// DARK SHADE /// public const char dkshade = '\u2593'; /// /// LOWER HALF BLOCK /// public const char dnblock = '\u2584'; /// /// DOLLAR SIGN /// public const char dollar = '\u0024'; /// /// DONG SIGN /// public const char dong = '\u20AB'; /// /// DOT ABOVE /// public const char dotaccent = '\u02D9'; /// /// COMBINING DOT BELOW /// public const char dotbelowcomb = '\u0323'; /// /// LATIN SMALL LETTER DOTLESS I /// public const char dotlessi = '\u0131'; /// /// DOT OPERATOR /// public const char dotmath = '\u22C5'; /// /// LATIN SMALL LETTER E /// public const char e = '\u0065'; /// /// LATIN SMALL LETTER E WITH ACUTE /// public const char eacute = '\u00E9'; /// /// LATIN SMALL LETTER E WITH BREVE /// public const char ebreve = '\u0115'; /// /// LATIN SMALL LETTER E WITH CARON /// public const char ecaron = '\u011B'; /// /// LATIN SMALL LETTER E WITH CIRCUMFLEX /// public const char ecircumflex = '\u00EA'; /// /// LATIN SMALL LETTER E WITH DIAERESIS /// public const char edieresis = '\u00EB'; /// /// LATIN SMALL LETTER E WITH DOT ABOVE /// public const char edotaccent = '\u0117'; /// /// LATIN SMALL LETTER E WITH GRAVE /// public const char egrave = '\u00E8'; /// /// DIGIT EIGHT /// public const char eight = '\u0038'; /// /// ELEMENT OF /// public const char element = '\u2208'; /// /// HORIZONTAL ELLIPSIS /// public const char ellipsis = '\u2026'; /// /// LATIN SMALL LETTER E WITH MACRON /// public const char emacron = '\u0113'; /// /// EM DASH /// public const char emdash = '\u2014'; /// /// EMPTY SET /// public const char emptyset = '\u2205'; /// /// EN DASH /// public const char endash = '\u2013'; /// /// LATIN SMALL LETTER ENG /// public const char eng = '\u014B'; /// /// LATIN SMALL LETTER E WITH OGONEK /// public const char eogonek = '\u0119'; /// /// GREEK SMALL LETTER EPSILON /// public const char epsilon = '\u03B5'; /// /// GREEK SMALL LETTER EPSILON WITH TONOS /// public const char epsilontonos = '\u03AD'; /// /// EQUALS SIGN /// public const char equal = '\u003D'; /// /// IDENTICAL TO /// public const char equivalence = '\u2261'; /// /// ESTIMATED SYMBOL /// public const char estimated = '\u212E'; /// /// GREEK SMALL LETTER ETA /// public const char eta = '\u03B7'; /// /// GREEK SMALL LETTER ETA WITH TONOS /// public const char etatonos = '\u03AE'; /// /// LATIN SMALL LETTER ETH /// public const char eth = '\u00F0'; /// /// EXCLAMATION MARK /// public const char exclam = '\u0021'; /// /// DOUBLE EXCLAMATION MARK /// public const char exclamdbl = '\u203C'; /// /// INVERTED EXCLAMATION MARK /// public const char exclamdown = '\u00A1'; /// /// THERE EXISTS /// public const char existential = '\u2203'; /// /// LATIN SMALL LETTER F /// public const char f = '\u0066'; /// /// FEMALE SIGN /// public const char female = '\u2640'; /// /// FIGURE DASH /// public const char figuredash = '\u2012'; /// /// BLACK SQUARE /// public const char filledbox = '\u25A0'; /// /// BLACK RECTANGLE /// public const char filledrect = '\u25AC'; /// /// DIGIT FIVE /// public const char five = '\u0035'; /// /// VULGAR FRACTION FIVE EIGHTHS /// public const char fiveeighths = '\u215D'; /// /// LATIN SMALL LETTER F WITH HOOK /// public const char florin = '\u0192'; /// /// DIGIT FOUR /// public const char four = '\u0034'; /// /// FRACTION SLASH /// public const char fraction = '\u2044'; /// /// FRENCH FRANC SIGN /// public const char franc = '\u20A3'; /// /// LATIN SMALL LETTER G /// public const char g = '\u0067'; /// /// GREEK SMALL LETTER GAMMA /// public const char gamma = '\u03B3'; /// /// LATIN SMALL LETTER G WITH BREVE /// public const char gbreve = '\u011F'; /// /// LATIN SMALL LETTER G WITH CARON /// public const char gcaron = '\u01E7'; /// /// LATIN SMALL LETTER G WITH CIRCUMFLEX /// public const char gcircumflex = '\u011D'; /// /// LATIN SMALL LETTER G WITH CEDILLA /// public const char gcommaaccent = '\u0123'; /// /// LATIN SMALL LETTER G WITH DOT ABOVE /// public const char gdotaccent = '\u0121'; /// /// LATIN SMALL LETTER SHARP S /// public const char germandbls = '\u00DF'; /// /// NABLA /// public const char gradient = '\u2207'; /// /// GRAVE ACCENT /// public const char grave = '\u0060'; /// /// COMBINING GRAVE ACCENT /// public const char gravecomb = '\u0300'; /// /// GREATER-THAN SIGN /// public const char greater = '\u003E'; /// /// GREATER-THAN OR EQUAL TO /// public const char greaterequal = '\u2265'; /// /// LEFT-POINTING DOUBLE ANGLE QUOTATION MARK /// public const char guillemotleft = '\u00AB'; /// /// RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK /// public const char guillemotright = '\u00BB'; /// /// SINGLE LEFT-POINTING ANGLE QUOTATION MARK /// public const char guilsinglleft = '\u2039'; /// /// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK /// public const char guilsinglright = '\u203A'; /// /// LATIN SMALL LETTER H /// public const char h = '\u0068'; /// /// LATIN SMALL LETTER H WITH STROKE /// public const char hbar = '\u0127'; /// /// LATIN SMALL LETTER H WITH CIRCUMFLEX /// public const char hcircumflex = '\u0125'; /// /// BLACK HEART SUIT /// public const char heart = '\u2665'; /// /// COMBINING HOOK ABOVE /// public const char hookabovecomb = '\u0309'; /// /// HOUSE /// public const char house = '\u2302'; /// /// DOUBLE ACUTE ACCENT /// public const char hungarumlaut = '\u02DD'; /// /// HYPHEN-MINUS /// public const char hyphen = '\u002D'; /// /// LATIN SMALL LETTER I /// public const char i = '\u0069'; /// /// LATIN SMALL LETTER I WITH ACUTE /// public const char iacute = '\u00ED'; /// /// LATIN SMALL LETTER I WITH BREVE /// public const char ibreve = '\u012D'; /// /// LATIN SMALL LETTER I WITH CIRCUMFLEX /// public const char icircumflex = '\u00EE'; /// /// LATIN SMALL LETTER I WITH DIAERESIS /// public const char idieresis = '\u00EF'; /// /// LATIN SMALL LETTER I WITH GRAVE /// public const char igrave = '\u00EC'; /// /// LATIN SMALL LIGATURE IJ /// public const char ij = '\u0133'; /// /// LATIN SMALL LETTER I WITH MACRON /// public const char imacron = '\u012B'; /// /// INFINITY /// public const char infinity = '\u221E'; /// /// INTEGRAL /// public const char integral = '\u222B'; /// /// BOTTOM HALF INTEGRAL /// public const char integralbt = '\u2321'; /// /// TOP HALF INTEGRAL /// public const char integraltp = '\u2320'; /// /// INTERSECTION /// public const char intersection = '\u2229'; /// /// INVERSE BULLET /// public const char invbullet = '\u25D8'; /// /// INVERSE WHITE CIRCLE /// public const char invcircle = '\u25D9'; /// /// BLACK SMILING FACE /// public const char invsmileface = '\u263B'; /// /// LATIN SMALL LETTER I WITH OGONEK /// public const char iogonek = '\u012F'; /// /// GREEK SMALL LETTER IOTA /// public const char iota = '\u03B9'; /// /// GREEK SMALL LETTER IOTA WITH DIALYTIKA /// public const char iotadieresis = '\u03CA'; /// /// GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS /// public const char iotadieresistonos = '\u0390'; /// /// GREEK SMALL LETTER IOTA WITH TONOS /// public const char iotatonos = '\u03AF'; /// /// LATIN SMALL LETTER I WITH TILDE /// public const char itilde = '\u0129'; /// /// LATIN SMALL LETTER J /// public const char j = '\u006A'; /// /// LATIN SMALL LETTER J WITH CIRCUMFLEX /// public const char jcircumflex = '\u0135'; /// /// LATIN SMALL LETTER K /// public const char k = '\u006B'; /// /// GREEK SMALL LETTER KAPPA /// public const char kappa = '\u03BA'; /// /// LATIN SMALL LETTER K WITH CEDILLA /// public const char kcommaaccent = '\u0137'; /// /// LATIN SMALL LETTER KRA /// public const char kgreenlandic = '\u0138'; /// /// LATIN SMALL LETTER L /// public const char l = '\u006C'; /// /// LATIN SMALL LETTER L WITH ACUTE /// public const char lacute = '\u013A'; /// /// GREEK SMALL LETTER LAMDA /// public const char lambda = '\u03BB'; /// /// LATIN SMALL LETTER L WITH CARON /// public const char lcaron = '\u013E'; /// /// LATIN SMALL LETTER L WITH CEDILLA /// public const char lcommaaccent = '\u013C'; /// /// LATIN SMALL LETTER L WITH MIDDLE DOT /// public const char ldot = '\u0140'; /// /// LESS-THAN SIGN /// public const char less = '\u003C'; /// /// LESS-THAN OR EQUAL TO /// public const char lessequal = '\u2264'; /// /// LEFT HALF BLOCK /// public const char lfblock = '\u258C'; /// /// LIRA SIGN /// public const char lira = '\u20A4'; /// /// LOGICAL AND /// public const char logicaland = '\u2227'; /// /// NOT SIGN /// public const char logicalnot = '\u00AC'; /// /// LOGICAL OR /// public const char logicalor = '\u2228'; /// /// LATIN SMALL LETTER LONG S /// public const char longs = '\u017F'; /// /// LOZENGE /// public const char lozenge = '\u25CA'; /// /// LATIN SMALL LETTER L WITH STROKE /// public const char lslash = '\u0142'; /// /// LIGHT SHADE /// public const char ltshade = '\u2591'; /// /// LATIN SMALL LETTER M /// public const char m = '\u006D'; /// /// MACRON /// public const char macron = '\u00AF'; /// /// MALE SIGN /// public const char male = '\u2642'; /// /// MINUS SIGN /// public const char minus = '\u2212'; /// /// PRIME /// public const char minute = '\u2032'; /// /// MICRO SIGN /// public const char mu = '\u00B5'; /// /// MULTIPLICATION SIGN /// public const char multiply = '\u00D7'; /// /// EIGHTH NOTE /// public const char musicalnote = '\u266A'; /// /// BEAMED EIGHTH NOTES /// public const char musicalnotedbl = '\u266B'; /// /// LATIN SMALL LETTER N /// public const char n = '\u006E'; /// /// LATIN SMALL LETTER N WITH ACUTE /// public const char nacute = '\u0144'; /// /// LATIN SMALL LETTER N PRECEDED BY APOSTROPHE /// public const char napostrophe = '\u0149'; /// /// LATIN SMALL LETTER N WITH CARON /// public const char ncaron = '\u0148'; /// /// LATIN SMALL LETTER N WITH CEDILLA /// public const char ncommaaccent = '\u0146'; /// /// DIGIT NINE /// public const char nine = '\u0039'; /// /// NOT AN ELEMENT OF /// public const char notelement = '\u2209'; /// /// NOT EQUAL TO /// public const char notequal = '\u2260'; /// /// NOT A SUBSET OF /// public const char notsubset = '\u2284'; /// /// LATIN SMALL LETTER N WITH TILDE /// public const char ntilde = '\u00F1'; /// /// GREEK SMALL LETTER NU /// public const char nu = '\u03BD'; /// /// NUMBER SIGN /// public const char numbersign = '\u0023'; /// /// LATIN SMALL LETTER O /// public const char o = '\u006F'; /// /// LATIN SMALL LETTER O WITH ACUTE /// public const char oacute = '\u00F3'; /// /// LATIN SMALL LETTER O WITH BREVE /// public const char obreve = '\u014F'; /// /// LATIN SMALL LETTER O WITH CIRCUMFLEX /// public const char ocircumflex = '\u00F4'; /// /// LATIN SMALL LETTER O WITH DIAERESIS /// public const char odieresis = '\u00F6'; /// /// LATIN SMALL LIGATURE OE /// public const char oe = '\u0153'; /// /// OGONEK /// public const char ogonek = '\u02DB'; /// /// LATIN SMALL LETTER O WITH GRAVE /// public const char ograve = '\u00F2'; /// /// LATIN SMALL LETTER O WITH HORN /// public const char ohorn = '\u01A1'; /// /// LATIN SMALL LETTER O WITH DOUBLE ACUTE /// public const char ohungarumlaut = '\u0151'; /// /// LATIN SMALL LETTER O WITH MACRON /// public const char omacron = '\u014D'; /// /// GREEK SMALL LETTER OMEGA /// public const char omega = '\u03C9'; /// /// GREEK PI SYMBOL /// public const char omega1 = '\u03D6'; /// /// GREEK SMALL LETTER OMEGA WITH TONOS /// public const char omegatonos = '\u03CE'; /// /// GREEK SMALL LETTER OMICRON /// public const char omicron = '\u03BF'; /// /// GREEK SMALL LETTER OMICRON WITH TONOS /// public const char omicrontonos = '\u03CC'; /// /// DIGIT ONE /// public const char one = '\u0031'; /// /// ONE DOT LEADER /// public const char onedotenleader = '\u2024'; /// /// VULGAR FRACTION ONE EIGHTH /// public const char oneeighth = '\u215B'; /// /// VULGAR FRACTION ONE HALF /// public const char onehalf = '\u00BD'; /// /// VULGAR FRACTION ONE QUARTER /// public const char onequarter = '\u00BC'; /// /// VULGAR FRACTION ONE THIRD /// public const char onethird = '\u2153'; /// /// WHITE BULLET /// public const char openbullet = '\u25E6'; /// /// FEMININE ORDINAL INDICATOR /// public const char ordfeminine = '\u00AA'; /// /// MASCULINE ORDINAL INDICATOR /// public const char ordmasculine = '\u00BA'; /// /// RIGHT ANGLE /// public const char orthogonal = '\u221F'; /// /// LATIN SMALL LETTER O WITH STROKE /// public const char oslash = '\u00F8'; /// /// LATIN SMALL LETTER O WITH STROKE AND ACUTE /// public const char oslashacute = '\u01FF'; /// /// LATIN SMALL LETTER O WITH TILDE /// public const char otilde = '\u00F5'; /// /// LATIN SMALL LETTER P /// public const char p = '\u0070'; /// /// PILCROW SIGN /// public const char paragraph = '\u00B6'; /// /// LEFT PARENTHESIS /// public const char parenleft = '\u0028'; /// /// RIGHT PARENTHESIS /// public const char parenright = '\u0029'; /// /// PARTIAL DIFFERENTIAL /// public const char partialdiff = '\u2202'; /// /// PERCENT SIGN /// public const char percent = '\u0025'; /// /// FULL STOP /// public const char period = '\u002E'; /// /// MIDDLE DOT /// public const char periodcentered = '\u00B7'; /// /// UP TACK /// public const char perpendicular = '\u22A5'; /// /// PER MILLE SIGN /// public const char perthousand = '\u2030'; /// /// PESETA SIGN /// public const char peseta = '\u20A7'; /// /// GREEK SMALL LETTER PHI /// public const char phi = '\u03C6'; /// /// GREEK PHI SYMBOL /// public const char phi1 = '\u03D5'; /// /// GREEK SMALL LETTER PI /// public const char pi = '\u03C0'; /// /// PLUS SIGN /// public const char plus = '\u002B'; /// /// PLUS-MINUS SIGN /// public const char plusminus = '\u00B1'; /// /// PRESCRIPTION TAKE /// public const char prescription = '\u211E'; /// /// N-ARY PRODUCT /// public const char product = '\u220F'; /// /// SUBSET OF /// public const char propersubset = '\u2282'; /// /// SUPERSET OF /// public const char propersuperset = '\u2283'; /// /// PROPORTIONAL TO /// public const char proportional = '\u221D'; /// /// GREEK SMALL LETTER PSI /// public const char psi = '\u03C8'; /// /// LATIN SMALL LETTER Q /// public const char q = '\u0071'; /// /// QUESTION MARK /// public const char question = '\u003F'; /// /// INVERTED QUESTION MARK /// public const char questiondown = '\u00BF'; /// /// QUOTATION MARK /// public const char quotedbl = '\u0022'; /// /// DOUBLE LOW-9 QUOTATION MARK /// public const char quotedblbase = '\u201E'; /// /// LEFT DOUBLE QUOTATION MARK /// public const char quotedblleft = '\u201C'; /// /// RIGHT DOUBLE QUOTATION MARK /// public const char quotedblright = '\u201D'; /// /// LEFT SINGLE QUOTATION MARK /// public const char quoteleft = '\u2018'; /// /// SINGLE HIGH-REVERSED-9 QUOTATION MARK /// public const char quotereversed = '\u201B'; /// /// RIGHT SINGLE QUOTATION MARK /// public const char quoteright = '\u2019'; /// /// SINGLE LOW-9 QUOTATION MARK /// public const char quotesinglbase = '\u201A'; /// /// APOSTROPHE /// public const char quotesingle = '\u0027'; /// /// LATIN SMALL LETTER R /// public const char r = '\u0072'; /// /// LATIN SMALL LETTER R WITH ACUTE /// public const char racute = '\u0155'; /// /// SQUARE ROOT /// public const char radical = '\u221A'; /// /// LATIN SMALL LETTER R WITH CARON /// public const char rcaron = '\u0159'; /// /// LATIN SMALL LETTER R WITH CEDILLA /// public const char rcommaaccent = '\u0157'; /// /// SUBSET OF OR EQUAL TO /// public const char reflexsubset = '\u2286'; /// /// SUPERSET OF OR EQUAL TO /// public const char reflexsuperset = '\u2287'; /// /// REGISTERED SIGN /// public const char registered = '\u00AE'; /// /// REVERSED NOT SIGN /// public const char revlogicalnot = '\u2310'; /// /// GREEK SMALL LETTER RHO /// public const char rho = '\u03C1'; /// /// RING ABOVE /// public const char ring = '\u02DA'; /// /// RIGHT HALF BLOCK /// public const char rtblock = '\u2590'; /// /// LATIN SMALL LETTER S /// public const char s = '\u0073'; /// /// LATIN SMALL LETTER S WITH ACUTE /// public const char sacute = '\u015B'; /// /// LATIN SMALL LETTER S WITH CARON /// public const char scaron = '\u0161'; /// /// LATIN SMALL LETTER S WITH CEDILLA /// public const char scedilla = '\u015F'; /// /// LATIN SMALL LETTER S WITH CIRCUMFLEX /// public const char scircumflex = '\u015D'; /// /// LATIN SMALL LETTER S WITH COMMA BELOW /// public const char scommaaccent = '\u0219'; /// /// DOUBLE PRIME /// public const char second = '\u2033'; /// /// SECTION SIGN /// public const char section = '\u00A7'; /// /// SEMICOLON /// public const char semicolon = '\u003B'; /// /// DIGIT SEVEN /// public const char seven = '\u0037'; /// /// VULGAR FRACTION SEVEN EIGHTHS /// public const char seveneighths = '\u215E'; /// /// MEDIUM SHADE /// public const char shade = '\u2592'; /// /// GREEK SMALL LETTER SIGMA /// public const char sigma = '\u03C3'; /// /// GREEK SMALL LETTER FINAL SIGMA /// public const char sigma1 = '\u03C2'; /// /// TILDE OPERATOR /// public const char similar = '\u223C'; /// /// DIGIT SIX /// public const char six = '\u0036'; /// /// SOLIDUS /// public const char slash = '\u002F'; /// /// WHITE SMILING FACE /// public const char smileface = '\u263A'; /// /// SPACE /// public const char space = '\u0020'; /// /// BLACK SPADE SUIT /// public const char spade = '\u2660'; /// /// POUND SIGN /// public const char sterling = '\u00A3'; /// /// CONTAINS AS MEMBER /// public const char suchthat = '\u220B'; /// /// N-ARY SUMMATION /// public const char summation = '\u2211'; /// /// WHITE SUN WITH RAYS /// public const char sun = '\u263C'; /// /// LATIN SMALL LETTER T /// public const char t = '\u0074'; /// /// GREEK SMALL LETTER TAU /// public const char tau = '\u03C4'; /// /// LATIN SMALL LETTER T WITH STROKE /// public const char tbar = '\u0167'; /// /// LATIN SMALL LETTER T WITH CARON /// public const char tcaron = '\u0165'; /// /// LATIN SMALL LETTER T WITH CEDILLA /// public const char tcommaaccent = '\u0163'; /// /// THEREFORE /// public const char therefore = '\u2234'; /// /// GREEK SMALL LETTER THETA /// public const char theta = '\u03B8'; /// /// GREEK THETA SYMBOL /// public const char theta1 = '\u03D1'; /// /// LATIN SMALL LETTER THORN /// public const char thorn = '\u00FE'; /// /// DIGIT THREE /// public const char three = '\u0033'; /// /// VULGAR FRACTION THREE EIGHTHS /// public const char threeeighths = '\u215C'; /// /// VULGAR FRACTION THREE QUARTERS /// public const char threequarters = '\u00BE'; /// /// SMALL TILDE /// public const char tilde = '\u02DC'; /// /// COMBINING TILDE /// public const char tildecomb = '\u0303'; /// /// GREEK TONOS /// public const char tonos = '\u0384'; /// /// TRADE MARK SIGN /// public const char trademark = '\u2122'; /// /// BLACK DOWN-POINTING TRIANGLE /// public const char triagdn = '\u25BC'; /// /// BLACK LEFT-POINTING POINTER /// public const char triaglf = '\u25C4'; /// /// BLACK RIGHT-POINTING POINTER /// public const char triagrt = '\u25BA'; /// /// BLACK UP-POINTING TRIANGLE /// public const char triagup = '\u25B2'; /// /// DIGIT TWO /// public const char two = '\u0032'; /// /// TWO DOT LEADER /// public const char twodotenleader = '\u2025'; /// /// VULGAR FRACTION TWO THIRDS /// public const char twothirds = '\u2154'; /// /// LATIN SMALL LETTER U /// public const char u = '\u0075'; /// /// LATIN SMALL LETTER U WITH ACUTE /// public const char uacute = '\u00FA'; /// /// LATIN SMALL LETTER U WITH BREVE /// public const char ubreve = '\u016D'; /// /// LATIN SMALL LETTER U WITH CIRCUMFLEX /// public const char ucircumflex = '\u00FB'; /// /// LATIN SMALL LETTER U WITH DIAERESIS /// public const char udieresis = '\u00FC'; /// /// LATIN SMALL LETTER U WITH GRAVE /// public const char ugrave = '\u00F9'; /// /// LATIN SMALL LETTER U WITH HORN /// public const char uhorn = '\u01B0'; /// /// LATIN SMALL LETTER U WITH DOUBLE ACUTE /// public const char uhungarumlaut = '\u0171'; /// /// LATIN SMALL LETTER U WITH MACRON /// public const char umacron = '\u016B'; /// /// LOW LINE /// public const char underscore = '\u005F'; /// /// DOUBLE LOW LINE /// public const char underscoredbl = '\u2017'; /// /// UNION /// public const char union = '\u222A'; /// /// FOR ALL /// public const char universal = '\u2200'; /// /// LATIN SMALL LETTER U WITH OGONEK /// public const char uogonek = '\u0173'; /// /// UPPER HALF BLOCK /// public const char upblock = '\u2580'; /// /// GREEK SMALL LETTER UPSILON /// public const char upsilon = '\u03C5'; /// /// GREEK SMALL LETTER UPSILON WITH DIALYTIKA /// public const char upsilondieresis = '\u03CB'; /// /// GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS /// public const char upsilondieresistonos = '\u03B0'; /// /// GREEK SMALL LETTER UPSILON WITH TONOS /// public const char upsilontonos = '\u03CD'; /// /// LATIN SMALL LETTER U WITH RING ABOVE /// public const char uring = '\u016F'; /// /// LATIN SMALL LETTER U WITH TILDE /// public const char utilde = '\u0169'; /// /// LATIN SMALL LETTER V /// public const char v = '\u0076'; /// /// LATIN SMALL LETTER W /// public const char w = '\u0077'; /// /// LATIN SMALL LETTER W WITH ACUTE /// public const char wacute = '\u1E83'; /// /// LATIN SMALL LETTER W WITH CIRCUMFLEX /// public const char wcircumflex = '\u0175'; /// /// LATIN SMALL LETTER W WITH DIAERESIS /// public const char wdieresis = '\u1E85'; /// /// SCRIPT CAPITAL P /// public const char weierstrass = '\u2118'; /// /// LATIN SMALL LETTER W WITH GRAVE /// public const char wgrave = '\u1E81'; /// /// LATIN SMALL LETTER X /// public const char x = '\u0078'; /// /// GREEK SMALL LETTER XI /// public const char xi = '\u03BE'; /// /// LATIN SMALL LETTER Y /// public const char y = '\u0079'; /// /// LATIN SMALL LETTER Y WITH ACUTE /// public const char yacute = '\u00FD'; /// /// LATIN SMALL LETTER Y WITH CIRCUMFLEX /// public const char ycircumflex = '\u0177'; /// /// LATIN SMALL LETTER Y WITH DIAERESIS /// public const char ydieresis = '\u00FF'; /// /// YEN SIGN /// public const char yen = '\u00A5'; /// /// LATIN SMALL LETTER Y WITH GRAVE /// public const char ygrave = '\u1EF3'; /// /// LATIN SMALL LETTER Z /// public const char z = '\u007A'; /// /// LATIN SMALL LETTER Z WITH ACUTE /// public const char zacute = '\u017A'; /// /// LATIN SMALL LETTER Z WITH CARON /// public const char zcaron = '\u017E'; /// /// LATIN SMALL LETTER Z WITH DOT ABOVE /// public const char zdotaccent = '\u017C'; /// /// DIGIT ZERO /// public const char zero = '\u0030'; /// /// GREEK SMALL LETTER ZETA /// public const char zeta = '\u03B6'; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts/FontWriter.cs0000644000175000001440000001176311435766646022647 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Text; using System.IO; namespace PdfSharp.Fonts { /// /// Represents a writer for generation of font file streams. /// internal class FontWriter { /// /// Initializes a new instance of the class. /// public FontWriter(Stream stream) { this.stream = stream; } /// /// Closes the writer and, if specified, the underlying stream. /// public void Close(bool closeUnderlyingStream) { if (this.stream != null && closeUnderlyingStream) this.stream.Close(); //this.stream = null; } /// /// Closes the writer and the underlying stream. /// public void Close() { Close(true); } /// /// Gets or sets the position within the stream. /// public int Position { get { return (int)this.stream.Position; } set { this.stream.Position = value; } } /// /// Writes the specified value to the font stream. /// public void WriteByte(byte value) { this.stream.WriteByte(value); } /// /// Writes the specified value to the font stream. /// public void WriteByte(int value) { this.stream.WriteByte((byte)value); } /// /// Writes the specified value to the font stream using big-endian. /// public void WriteShort(short value) { this.stream.WriteByte((byte)(value >> 8)); this.stream.WriteByte((byte)value); } /// /// Writes the specified value to the font stream using big-endian. /// public void WriteShort(int value) { WriteShort((short)value); } /// /// Writes the specified value to the font stream using big-endian. /// public void WriteUShort(ushort value) { this.stream.WriteByte((byte)(value >> 8)); this.stream.WriteByte((byte)value); } /// /// Writes the specified value to the font stream using big-endian. /// public void WriteUShort(int value) { WriteUShort((ushort)value); } /// /// Writes the specified value to the font stream using big-endian. /// public void WriteInt(int value) { this.stream.WriteByte((byte)(value >> 24)); this.stream.WriteByte((byte)(value >> 16)); this.stream.WriteByte((byte)(value >> 8)); this.stream.WriteByte((byte)value); } /// /// Writes the specified value to the font stream using big-endian. /// public void WriteUInt(uint value) { this.stream.WriteByte((byte)(value >> 24)); this.stream.WriteByte((byte)(value >> 16)); this.stream.WriteByte((byte)(value >> 8)); this.stream.WriteByte((byte)value); } //public short ReadFWord() //public ushort ReadUFWord() //public long ReadLongDate() //public string ReadString(int size) public void Write(byte[] buffer) { this.stream.Write(buffer, 0, buffer.Length); } public void Write(byte[] buffer, int offset, int count) { this.stream.Write(buffer, offset, count); } /// /// Gets the underlying stream. /// internal Stream Stream { get { return this.stream; } } readonly Stream stream; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts/FontDescriptor.cs0000644000175000001440000001565011435766646023510 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.Text; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Pdf.Internal; using PdfSharp.Drawing; namespace PdfSharp.Fonts { /// /// Base class for all font descriptors. /// internal class FontDescriptor { /// /// /// public string FontFile { get { return this.fontFile; } } protected string fontFile; /// /// /// public string FontType { get { return this.fontType; } } protected string fontType; /// /// /// public string FontName { get { return this.fontName; } } protected string fontName; /// /// /// public string FullName { get { return this.fullName; } } protected string fullName; /// /// /// public string FamilyName { get { return this.familyName; } } protected string familyName; /// /// /// public string Weight { get { return this.weight; } } protected string weight; /// /// Gets a value indicating whether this instance belongs to a bold font. /// public virtual bool IsBoldFace { get { return false; } } /// /// /// public float ItalicAngle { get { return this.italicAngle; } } protected float italicAngle; /// /// Gets a value indicating whether this instance belongs to an italic font. /// public virtual bool IsItalicFace { get { return false; } } /// /// /// public int XMin { get { return this.xMin; } } protected int xMin; /// /// /// public int YMin { get { return this.yMin; } } protected int yMin; /// /// /// public int XMax { get { return this.xMax; } } protected int xMax; /// /// /// public int YMax { get { return this.yMax; } } protected int yMax; /// /// /// public bool IsFixedPitch { get { return this.isFixedPitch; } } protected bool isFixedPitch; //Rect FontBBox; /// /// /// public int UnderlinePosition { get { return this.underlinePosition; } } protected int underlinePosition; /// /// /// public int UnderlineThickness { get { return this.underlineThickness; } } protected int underlineThickness; /// /// /// public int StrikeoutPosition { get { return this.strikeoutPosition; } } protected int strikeoutPosition; /// /// /// public int StrikeoutSize { get { return this.strikeoutSize; } } protected int strikeoutSize; /// /// /// public string Version { get { return this.version; } } protected string version; ///// ///// ///// //public string Notice //{ // get { return this.Notice; } //} //protected string notice; /// /// /// public string EncodingScheme { get { return this.encodingScheme; } } protected string encodingScheme; /// /// /// public int UnitsPerEm { get { return this.unitsPerEm; } } protected int unitsPerEm; /// /// /// public int CapHeight { get { return this.capHeight; } } protected int capHeight; /// /// /// public int XHeight { get { return this.xHeight; } } protected int xHeight; /// /// /// public int Ascender { get { return this.ascender; } } protected int ascender; /// /// /// public int Descender { get { return this.descender; } } protected int descender; /// /// /// public int Leading { get { return this.leading; } } protected int leading; /// /// /// public int Flags { get { return this.flags; } } protected int flags; /// /// /// public int StemV { get { return this.stemV; } } protected int stemV; /// /// Under Construction /// public XFontMetrics FontMetrics { get { if (this.fontMetrics == null) { this.fontMetrics = new XFontMetrics(this.fontName, this.unitsPerEm, this.ascender, this.descender, this.leading, this.capHeight, this.xHeight, this.stemV, 0, 0, 0); } return this.fontMetrics; } } XFontMetrics fontMetrics; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts/FontDescriptorStock.cs0000644000175000001440000004054511435766646024515 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections.Generic; using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; namespace PdfSharp.Fonts { #if true /// /// Global table of TrueType fontdescriptor objects. /// class FontDescriptorStock { FontDescriptorStock() { this.table = new Dictionary(); } /// /// Gets the FontDescriptor identified by the specified FontSelector. Returns null if no /// such objects exists. /// public FontDescriptor FindDescriptor(FontSelector selector) { if (selector == null) return null; FontDescriptor descriptor = this.table[selector] as FontDescriptor; return descriptor; } ///// ///// Gets the FontDescriptor identified by the specified FontSelector. If no such objects ///// exists, a new FontDescriptor is created and added to the stock. ///// //public FontDescriptor CreateDescriptor(FontSelector selector) //{ // if (selector == null) // throw new ArgumentNullException("selector"); // FontDescriptor descriptor = this.table[selector] as FontDescriptor; // if (descriptor == null) // { // descriptor = new TrueTypeDescriptor(selector); // this.table.Add(selector, descriptor); // } // return descriptor; //} /// /// Gets the FontDescriptor identified by the specified FontSelector. If no such objects /// exists, a new FontDescriptor is created and added to the stock. /// public FontDescriptor CreateDescriptor(XFont font) { if (font == null) throw new ArgumentNullException("font"); FontSelector selector = new FontSelector(font); FontDescriptor descriptor; if (!this.table.TryGetValue(selector, out descriptor)) { lock (typeof(FontDescriptorStock)) { // may be created by other thread meanwhile if (!this.table.TryGetValue(selector, out descriptor)) { descriptor = new OpenTypeDescriptor(font); this.table.Add(selector, descriptor); } } } return descriptor; } /// /// Gets the FontDescriptor identified by the specified FontSelector. If no such objects /// exists, a new FontDescriptor is created and added to the stock. /// public FontDescriptor CreateDescriptor(XFontFamily family, XFontStyle style) { if (family == null) throw new ArgumentNullException("family"); FontSelector selector = new FontSelector(family, style); FontDescriptor descriptor; if (!this.table.TryGetValue(selector, out descriptor)) { lock (typeof(FontDescriptorStock)) { // may be created by other thread meanwhile if (!this.table.TryGetValue(selector, out descriptor)) { XFont font = new XFont(family.Name, 10, style); descriptor = new OpenTypeDescriptor(font); if (this.table.ContainsKey(selector)) GetType(); else this.table.Add(selector, descriptor); } } } return descriptor; } public FontDescriptor CreateDescriptor(string idName, byte[] fontData) { FontSelector selector = new FontSelector(idName); FontDescriptor descriptor; if (!this.table.TryGetValue(selector, out descriptor)) { lock (typeof(FontDescriptorStock)) { // may be created by other thread meanwhile if (!this.table.TryGetValue(selector, out descriptor)) { descriptor = new OpenTypeDescriptor(idName, fontData); this.table.Add(selector, descriptor); } } } return descriptor; } //public FontDescriptor RegisterFontDate(byte[] fontData) //{ // uint checksum = CalcChecksum(fontData); // string name = String.Format("??{0:X}", checksum); // FontSelector selector = new FontSelector(name); // HACK: font data distinguished only by checksum // FontDescriptor descriptor = this.table[selector] as FontDescriptor; // if (descriptor == null) // { // lock (typeof(FontDescriptorStock)) // { // // may be created by other thread meanwhile // descriptor = this.table[selector] as FontDescriptor; // if (descriptor == null) // { // descriptor = new TrueTypeDescriptor(fontData); // this.table.Add(selector, descriptor); // } // } // } // return descriptor; //} ///// ///// Calculates an Adler32 checksum. ///// //uint CalcChecksum(byte[] buffer) //{ // if (buffer == null) // throw new ArgumentNullException("buffer"); // const uint BASE = 65521; // largest prime smaller than 65536 // uint s1 = 0; // uint s2 = 0; // int length = buffer.Length; // int offset = 0; // while (length > 0) // { // int n = 3800; // if (n > length) // n = length; // length -= n; // while (--n >= 0) // { // s1 = s1 + (uint)(buffer[offset++] & 0xFF); // s2 = s2 + s1; // } // s1 %= BASE; // s2 %= BASE; // } // return (s2 << 16) | s1; //} public static FontDescriptorStock Global { get { if (global == null) { lock (typeof(FontDescriptorStock)) { if (global == null) global = new FontDescriptorStock(); } } return global; } } static FontDescriptorStock global; Dictionary table; /// /// A collection of information that uniquely identifies a particular font. /// Used to map XFont to PdfFont. /// There is a one to one relationship between a FontSelector and a TrueType/OpenType file. /// internal class FontSelector { public FontSelector(XFont font) { this.name = font.Name; this.style = font.Style; } public FontSelector(XFontFamily family, XFontStyle style) { this.name = family.Name; this.style = style; } public FontSelector(string idName) { this.name = idName; this.style = XFontStyle.Regular; } public string Name { get { return this.name; } } string name; public XFontStyle Style { get { return this.style; } } XFontStyle style; public static bool operator ==(FontSelector selector1, FontSelector selector2) { if (!Equals(selector1, null)) selector1.Equals(selector2); return Equals(selector2, null); } public static bool operator !=(FontSelector selector1, FontSelector selector2) { return !(selector1 == selector2); } public override bool Equals(object obj) { if (obj == null) // removing this can lead to stack overflow return false; FontSelector selector = obj as FontSelector; if (!Equals(selector, null)) return this.name == selector.name && this.style == selector.style; return false; } public override int GetHashCode() { return this.name.GetHashCode() ^ this.style.GetHashCode(); } /// /// Returns a string for diagnostic purposes only. /// public override string ToString() { string variation = ""; switch (this.style) { case XFontStyle.Regular: variation = "(Regular)"; break; case XFontStyle.Bold: variation = "(Bold)"; break; case XFontStyle.Italic: variation = "(Italic)"; break; case XFontStyle.Bold | XFontStyle.Italic: variation = "(BoldItalic)"; break; } return this.name + variation; } } } #else /// /// Global table of TrueType fontdescriptor objects. /// class FontDescriptorStock { private FontDescriptorStock() { this.table = new Hashtable(); } /// /// Gets the FontDescriptor identified by the specified FontSelector. Returns null if no /// such objects exists. /// public FontDescriptor FindDescriptor(FontSelector selector) { if (selector == null) return null; FontDescriptor descriptor = this.table[selector] as FontDescriptor; return descriptor; } ///// ///// Gets the FontDescriptor identified by the specified FontSelector. If no such objects ///// exists, a new FontDescriptor is created and added to the stock. ///// //public FontDescriptor CreateDescriptor(FontSelector selector) //{ // if (selector == null) // throw new ArgumentNullException("selector"); // FontDescriptor descriptor = this.table[selector] as FontDescriptor; // if (descriptor == null) // { // descriptor = new TrueTypeDescriptor(selector); // this.table.Add(selector, descriptor); // } // return descriptor; //} /// /// Gets the FontDescriptor identified by the specified FontSelector. If no such objects /// exists, a new FontDescriptor is created and added to the stock. /// public FontDescriptor CreateDescriptor(XFont font) { if (font == null) throw new ArgumentNullException("font"); FontSelector selector = new FontSelector(font); FontDescriptor descriptor = this.table[selector] as FontDescriptor; if (descriptor == null) { lock (typeof(FontDescriptorStock)) { // may be created by other thread meanwhile descriptor = this.table[selector] as FontDescriptor; if (descriptor == null) { descriptor = new TrueTypeDescriptor(font, font.privateFontCollection); this.table.Add(selector, descriptor); } } } return descriptor; } /// /// Gets the FontDescriptor identified by the specified FontSelector. If no such objects /// exists, a new FontDescriptor is created and added to the stock. /// public FontDescriptor CreateDescriptor(XFontFamily family, XFontStyle style) { if (family == null) throw new ArgumentNullException("family"); FontSelector selector = new FontSelector(family, style); FontDescriptor descriptor = this.table[selector] as FontDescriptor; if (descriptor == null) { lock (typeof(FontDescriptorStock)) { // may be created by other thread meanwhile descriptor = this.table[selector] as FontDescriptor; if (descriptor == null) { XFont font = new XFont(family.Name, 10, style); descriptor = new TrueTypeDescriptor(font, font.privateFontCollection); if (this.table.ContainsKey(selector)) GetType(); else this.table.Add(selector, descriptor); } } } return descriptor; } public FontDescriptor CreateDescriptor(string idName, byte[] fontData) { FontSelector selector = new FontSelector(idName); FontDescriptor descriptor = this.table[selector] as FontDescriptor; if (descriptor == null) { lock (typeof(FontDescriptorStock)) { // may be created by other thread meanwhile descriptor = this.table[selector] as FontDescriptor; if (descriptor == null) { descriptor = new TrueTypeDescriptor(idName, fontData); this.table.Add(selector, descriptor); } } } return descriptor; } public static FontDescriptorStock Global { get { if (FontDescriptorStock.global == null) { lock (typeof(FontDescriptorStock)) { if (FontDescriptorStock.global == null) FontDescriptorStock.global = new FontDescriptorStock(); } } return FontDescriptorStock.global; } } static FontDescriptorStock global; H ashtable table; /// /// A collection of information that uniquely identifies a particular font. /// Used to map XFont to PdfFont. /// There is a one to one relationship between a FontSelector and a TrueType/OpenType file. /// internal class FontSelector { public FontSelector(XFont font) { this.name = font.Name; this.style = font.Style; } public FontSelector(XFontFamily family, XFontStyle style) { this.name = family.Name; this.style = style; } public FontSelector(string idName) { this.name = idName; this.style = XFontStyle.Regular; } public string Name { get { return this.name; } } string name; public XFontStyle Style { get { return this.style; } } XFontStyle style; public static bool operator ==(FontSelector selector1, FontSelector selector2) { if (selector1 != null) selector1.Equals(selector2); return selector2 == null; } public static bool operator !=(FontSelector selector1, FontSelector selector2) { return !(selector1 == selector2); } public override bool Equals(object obj) { FontSelector selector = obj as FontSelector; if (obj != null && this.name == selector.name) return this.style == selector.style; return false; } public override int GetHashCode() { return this.name.GetHashCode() ^ this.style.GetHashCode(); } /// /// Returns a string for diagnostic purposes only. /// public override string ToString() { string variation = ""; switch (this.style) { case XFontStyle.Regular: variation = "(Regular)"; break; case XFontStyle.Bold: variation = "(Bold)"; break; case XFontStyle.Italic: variation = "(Italic)"; break; case XFontStyle.Bold | XFontStyle.Italic: variation = "(BoldItalic)"; break; } return this.name + variation; } } } #endif }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts/AdobeGlyphList20.cs0000644000175000001440000030455611435766646023565 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; #if DEBUG_ namespace PdfSharp.Fonts { /// /// Pre-defined names for Unicode characters. /// /*public*/ class AdobeGlyphList20 { AdobeGlyphList20() { } public char A = '\u0041'; public char AE = '\u00C6'; public char AEacute = '\u01FC'; public char AEmacron = '\u01E2'; public char AEsmall = '\uF7E6'; public char Aacute = '\u00C1'; public char Aacutesmall = '\uF7E1'; public char Abreve = '\u0102'; public char Abreveacute = '\u1EAE'; public char Abrevecyrillic = '\u04D0'; public char Abrevedotbelow = '\u1EB6'; public char Abrevegrave = '\u1EB0'; public char Abrevehookabove = '\u1EB2'; public char Abrevetilde = '\u1EB4'; public char Acaron = '\u01CD'; public char Acircle = '\u24B6'; public char Acircumflex = '\u00C2'; public char Acircumflexacute = '\u1EA4'; public char Acircumflexdotbelow = '\u1EAC'; public char Acircumflexgrave = '\u1EA6'; public char Acircumflexhookabove = '\u1EA8'; public char Acircumflexsmall = '\uF7E2'; public char Acircumflextilde = '\u1EAA'; public char Acute = '\uF6C9'; public char Acutesmall = '\uF7B4'; public char Acyrillic = '\u0410'; public char Adblgrave = '\u0200'; public char Adieresis = '\u00C4'; public char Adieresiscyrillic = '\u04D2'; public char Adieresismacron = '\u01DE'; public char Adieresissmall = '\uF7E4'; public char Adotbelow = '\u1EA0'; public char Adotmacron = '\u01E0'; public char Agrave = '\u00C0'; public char Agravesmall = '\uF7E0'; public char Ahookabove = '\u1EA2'; public char Aiecyrillic = '\u04D4'; public char Ainvertedbreve = '\u0202'; public char Alpha = '\u0391'; public char Alphatonos = '\u0386'; public char Amacron = '\u0100'; public char Amonospace = '\uFF21'; public char Aogonek = '\u0104'; public char Aring = '\u00C5'; public char Aringacute = '\u01FA'; public char Aringbelow = '\u1E00'; public char Aringsmall = '\uF7E5'; public char Asmall = '\uF761'; public char Atilde = '\u00C3'; public char Atildesmall = '\uF7E3'; public char Aybarmenian = '\u0531'; public char B = '\u0042'; public char Bcircle = '\u24B7'; public char Bdotaccent = '\u1E02'; public char Bdotbelow = '\u1E04'; public char Becyrillic = '\u0411'; public char Benarmenian = '\u0532'; public char Beta = '\u0392'; public char Bhook = '\u0181'; public char Blinebelow = '\u1E06'; public char Bmonospace = '\uFF22'; public char Brevesmall = '\uF6F4'; public char Bsmall = '\uF762'; public char Btopbar = '\u0182'; public char C = '\u0043'; public char Caarmenian = '\u053E'; public char Cacute = '\u0106'; public char Caron = '\uF6CA'; public char Caronsmall = '\uF6F5'; public char Ccaron = '\u010C'; public char Ccedilla = '\u00C7'; public char Ccedillaacute = '\u1E08'; public char Ccedillasmall = '\uF7E7'; public char Ccircle = '\u24B8'; public char Ccircumflex = '\u0108'; public char Cdot = '\u010A'; public char Cdotaccent = '\u010A'; public char Cedillasmall = '\uF7B8'; public char Chaarmenian = '\u0549'; public char Cheabkhasiancyrillic = '\u04BC'; public char Checyrillic = '\u0427'; public char Chedescenderabkhasiancyrillic = '\u04BE'; public char Chedescendercyrillic = '\u04B6'; public char Chedieresiscyrillic = '\u04F4'; public char Cheharmenian = '\u0543'; public char Chekhakassiancyrillic = '\u04CB'; public char Cheverticalstrokecyrillic = '\u04B8'; public char Chi = '\u03A7'; public char Chook = '\u0187'; public char Circumflexsmall = '\uF6F6'; public char Cmonospace = '\uFF23'; public char Coarmenian = '\u0551'; public char Csmall = '\uF763'; public char D = '\u0044'; public char DZ = '\u01F1'; public char DZcaron = '\u01C4'; public char Daarmenian = '\u0534'; public char Dafrican = '\u0189'; public char Dcaron = '\u010E'; public char Dcedilla = '\u1E10'; public char Dcircle = '\u24B9'; public char Dcircumflexbelow = '\u1E12'; public char Dcroat = '\u0110'; public char Ddotaccent = '\u1E0A'; public char Ddotbelow = '\u1E0C'; public char Decyrillic = '\u0414'; public char Deicoptic = '\u03EE'; public char Delta = '\u2206'; public char Deltagreek = '\u0394'; public char Dhook = '\u018A'; public char Dieresis = '\uF6CB'; public char DieresisAcute = '\uF6CC'; public char DieresisGrave = '\uF6CD'; public char Dieresissmall = '\uF7A8'; public char Digammagreek = '\u03DC'; public char Djecyrillic = '\u0402'; public char Dlinebelow = '\u1E0E'; public char Dmonospace = '\uFF24'; public char Dotaccentsmall = '\uF6F7'; public char Dslash = '\u0110'; public char Dsmall = '\uF764'; public char Dtopbar = '\u018B'; public char Dz = '\u01F2'; public char Dzcaron = '\u01C5'; public char Dzeabkhasiancyrillic = '\u04E0'; public char Dzecyrillic = '\u0405'; public char Dzhecyrillic = '\u040F'; public char E = '\u0045'; public char Eacute = '\u00C9'; public char Eacutesmall = '\uF7E9'; public char Ebreve = '\u0114'; public char Ecaron = '\u011A'; public char Ecedillabreve = '\u1E1C'; public char Echarmenian = '\u0535'; public char Ecircle = '\u24BA'; public char Ecircumflex = '\u00CA'; public char Ecircumflexacute = '\u1EBE'; public char Ecircumflexbelow = '\u1E18'; public char Ecircumflexdotbelow = '\u1EC6'; public char Ecircumflexgrave = '\u1EC0'; public char Ecircumflexhookabove = '\u1EC2'; public char Ecircumflexsmall = '\uF7EA'; public char Ecircumflextilde = '\u1EC4'; public char Ecyrillic = '\u0404'; public char Edblgrave = '\u0204'; public char Edieresis = '\u00CB'; public char Edieresissmall = '\uF7EB'; public char Edot = '\u0116'; public char Edotaccent = '\u0116'; public char Edotbelow = '\u1EB8'; public char Efcyrillic = '\u0424'; public char Egrave = '\u00C8'; public char Egravesmall = '\uF7E8'; public char Eharmenian = '\u0537'; public char Ehookabove = '\u1EBA'; public char Eightroman = '\u2167'; public char Einvertedbreve = '\u0206'; public char Eiotifiedcyrillic = '\u0464'; public char Elcyrillic = '\u041B'; public char Elevenroman = '\u216A'; public char Emacron = '\u0112'; public char Emacronacute = '\u1E16'; public char Emacrongrave = '\u1E14'; public char Emcyrillic = '\u041C'; public char Emonospace = '\uFF25'; public char Encyrillic = '\u041D'; public char Endescendercyrillic = '\u04A2'; public char Eng = '\u014A'; public char Enghecyrillic = '\u04A4'; public char Enhookcyrillic = '\u04C7'; public char Eogonek = '\u0118'; public char Eopen = '\u0190'; public char Epsilon = '\u0395'; public char Epsilontonos = '\u0388'; public char Ercyrillic = '\u0420'; public char Ereversed = '\u018E'; public char Ereversedcyrillic = '\u042D'; public char Escyrillic = '\u0421'; public char Esdescendercyrillic = '\u04AA'; public char Esh = '\u01A9'; public char Esmall = '\uF765'; public char Eta = '\u0397'; public char Etarmenian = '\u0538'; public char Etatonos = '\u0389'; public char Eth = '\u00D0'; public char Ethsmall = '\uF7F0'; public char Etilde = '\u1EBC'; public char Etildebelow = '\u1E1A'; public char Euro = '\u20AC'; public char Ezh = '\u01B7'; public char Ezhcaron = '\u01EE'; public char Ezhreversed = '\u01B8'; public char F = '\u0046'; public char Fcircle = '\u24BB'; public char Fdotaccent = '\u1E1E'; public char Feharmenian = '\u0556'; public char Feicoptic = '\u03E4'; public char Fhook = '\u0191'; public char Fitacyrillic = '\u0472'; public char Fiveroman = '\u2164'; public char Fmonospace = '\uFF26'; public char Fourroman = '\u2163'; public char Fsmall = '\uF766'; public char G = '\u0047'; public char GBsquare = '\u3387'; public char Gacute = '\u01F4'; public char Gamma = '\u0393'; public char Gammaafrican = '\u0194'; public char Gangiacoptic = '\u03EA'; public char Gbreve = '\u011E'; public char Gcaron = '\u01E6'; public char Gcedilla = '\u0122'; public char Gcircle = '\u24BC'; public char Gcircumflex = '\u011C'; public char Gcommaaccent = '\u0122'; public char Gdot = '\u0120'; public char Gdotaccent = '\u0120'; public char Gecyrillic = '\u0413'; public char Ghadarmenian = '\u0542'; public char Ghemiddlehookcyrillic = '\u0494'; public char Ghestrokecyrillic = '\u0492'; public char Gheupturncyrillic = '\u0490'; public char Ghook = '\u0193'; public char Gimarmenian = '\u0533'; public char Gjecyrillic = '\u0403'; public char Gmacron = '\u1E20'; public char Gmonospace = '\uFF27'; public char Grave = '\uF6CE'; public char Gravesmall = '\uF760'; public char Gsmall = '\uF767'; public char Gsmallhook = '\u029B'; public char Gstroke = '\u01E4'; public char H = '\u0048'; public char H18533 = '\u25CF'; public char H18543 = '\u25AA'; public char H18551 = '\u25AB'; public char H22073 = '\u25A1'; public char HPsquare = '\u33CB'; public char Haabkhasiancyrillic = '\u04A8'; public char Hadescendercyrillic = '\u04B2'; public char Hardsigncyrillic = '\u042A'; public char Hbar = '\u0126'; public char Hbrevebelow = '\u1E2A'; public char Hcedilla = '\u1E28'; public char Hcircle = '\u24BD'; public char Hcircumflex = '\u0124'; public char Hdieresis = '\u1E26'; public char Hdotaccent = '\u1E22'; public char Hdotbelow = '\u1E24'; public char Hmonospace = '\uFF28'; public char Hoarmenian = '\u0540'; public char Horicoptic = '\u03E8'; public char Hsmall = '\uF768'; public char Hungarumlaut = '\uF6CF'; public char Hungarumlautsmall = '\uF6F8'; public char Hzsquare = '\u3390'; public char I = '\u0049'; public char IAcyrillic = '\u042F'; public char IJ = '\u0132'; public char IUcyrillic = '\u042E'; public char Iacute = '\u00CD'; public char Iacutesmall = '\uF7ED'; public char Ibreve = '\u012C'; public char Icaron = '\u01CF'; public char Icircle = '\u24BE'; public char Icircumflex = '\u00CE'; public char Icircumflexsmall = '\uF7EE'; public char Icyrillic = '\u0406'; public char Idblgrave = '\u0208'; public char Idieresis = '\u00CF'; public char Idieresisacute = '\u1E2E'; public char Idieresiscyrillic = '\u04E4'; public char Idieresissmall = '\uF7EF'; public char Idot = '\u0130'; public char Idotaccent = '\u0130'; public char Idotbelow = '\u1ECA'; public char Iebrevecyrillic = '\u04D6'; public char Iecyrillic = '\u0415'; public char Ifraktur = '\u2111'; public char Igrave = '\u00CC'; public char Igravesmall = '\uF7EC'; public char Ihookabove = '\u1EC8'; public char Iicyrillic = '\u0418'; public char Iinvertedbreve = '\u020A'; public char Iishortcyrillic = '\u0419'; public char Imacron = '\u012A'; public char Imacroncyrillic = '\u04E2'; public char Imonospace = '\uFF29'; public char Iniarmenian = '\u053B'; public char Iocyrillic = '\u0401'; public char Iogonek = '\u012E'; public char Iota = '\u0399'; public char Iotaafrican = '\u0196'; public char Iotadieresis = '\u03AA'; public char Iotatonos = '\u038A'; public char Ismall = '\uF769'; public char Istroke = '\u0197'; public char Itilde = '\u0128'; public char Itildebelow = '\u1E2C'; public char Izhitsacyrillic = '\u0474'; public char Izhitsadblgravecyrillic = '\u0476'; public char J = '\u004A'; public char Jaarmenian = '\u0541'; public char Jcircle = '\u24BF'; public char Jcircumflex = '\u0134'; public char Jecyrillic = '\u0408'; public char Jheharmenian = '\u054B'; public char Jmonospace = '\uFF2A'; public char Jsmall = '\uF76A'; public char K = '\u004B'; public char KBsquare = '\u3385'; public char KKsquare = '\u33CD'; public char Kabashkircyrillic = '\u04A0'; public char Kacute = '\u1E30'; public char Kacyrillic = '\u041A'; public char Kadescendercyrillic = '\u049A'; public char Kahookcyrillic = '\u04C3'; public char Kappa = '\u039A'; public char Kastrokecyrillic = '\u049E'; public char Kaverticalstrokecyrillic = '\u049C'; public char Kcaron = '\u01E8'; public char Kcedilla = '\u0136'; public char Kcircle = '\u24C0'; public char Kcommaaccent = '\u0136'; public char Kdotbelow = '\u1E32'; public char Keharmenian = '\u0554'; public char Kenarmenian = '\u053F'; public char Khacyrillic = '\u0425'; public char Kheicoptic = '\u03E6'; public char Khook = '\u0198'; public char Kjecyrillic = '\u040C'; public char Klinebelow = '\u1E34'; public char Kmonospace = '\uFF2B'; public char Koppacyrillic = '\u0480'; public char Koppagreek = '\u03DE'; public char Ksicyrillic = '\u046E'; public char Ksmall = '\uF76B'; public char L = '\u004C'; public char LJ = '\u01C7'; public char LL = '\uF6BF'; public char Lacute = '\u0139'; public char Lambda = '\u039B'; public char Lcaron = '\u013D'; public char Lcedilla = '\u013B'; public char Lcircle = '\u24C1'; public char Lcircumflexbelow = '\u1E3C'; public char Lcommaaccent = '\u013B'; public char Ldot = '\u013F'; public char Ldotaccent = '\u013F'; public char Ldotbelow = '\u1E36'; public char Ldotbelowmacron = '\u1E38'; public char Liwnarmenian = '\u053C'; public char Lj = '\u01C8'; public char Ljecyrillic = '\u0409'; public char Llinebelow = '\u1E3A'; public char Lmonospace = '\uFF2C'; public char Lslash = '\u0141'; public char Lslashsmall = '\uF6F9'; public char Lsmall = '\uF76C'; public char M = '\u004D'; public char MBsquare = '\u3386'; public char Macron = '\uF6D0'; public char Macronsmall = '\uF7AF'; public char Macute = '\u1E3E'; public char Mcircle = '\u24C2'; public char Mdotaccent = '\u1E40'; public char Mdotbelow = '\u1E42'; public char Menarmenian = '\u0544'; public char Mmonospace = '\uFF2D'; public char Msmall = '\uF76D'; public char Mturned = '\u019C'; public char Mu = '\u039C'; public char N = '\u004E'; public char NJ = '\u01CA'; public char Nacute = '\u0143'; public char Ncaron = '\u0147'; public char Ncedilla = '\u0145'; public char Ncircle = '\u24C3'; public char Ncircumflexbelow = '\u1E4A'; public char Ncommaaccent = '\u0145'; public char Ndotaccent = '\u1E44'; public char Ndotbelow = '\u1E46'; public char Nhookleft = '\u019D'; public char Nineroman = '\u2168'; public char Nj = '\u01CB'; public char Njecyrillic = '\u040A'; public char Nlinebelow = '\u1E48'; public char Nmonospace = '\uFF2E'; public char Nowarmenian = '\u0546'; public char Nsmall = '\uF76E'; public char Ntilde = '\u00D1'; public char Ntildesmall = '\uF7F1'; public char Nu = '\u039D'; public char O = '\u004F'; public char OE = '\u0152'; public char OEsmall = '\uF6FA'; public char Oacute = '\u00D3'; public char Oacutesmall = '\uF7F3'; //Obarredcyrillic;04E8 //Obarreddieresiscyrillic;04EA //Obreve;014E //Ocaron;01D1 //Ocenteredtilde;019F //Ocircle;24C4 //Ocircumflex;00D4 //Ocircumflexacute;1ED0 //Ocircumflexdotbelow;1ED8 //Ocircumflexgrave;1ED2 //Ocircumflexhookabove;1ED4 //Ocircumflexsmall;F7F4 //Ocircumflextilde;1ED6 //Ocyrillic;041E //Odblacute;0150 //Odblgrave;020C //Odieresis;00D6 //Odieresiscyrillic;04E6 //Odieresissmall;F7F6 //Odotbelow;1ECC //Ogoneksmall;F6FB //Ograve;00D2 //Ogravesmall;F7F2 //Oharmenian;0555 //Ohm;2126 //Ohookabove;1ECE //Ohorn;01A0 //Ohornacute;1EDA //Ohorndotbelow;1EE2 //Ohorngrave;1EDC //Ohornhookabove;1EDE //Ohorntilde;1EE0 //Ohungarumlaut;0150 //Oi;01A2 //Oinvertedbreve;020E //Omacron;014C //Omacronacute;1E52 //Omacrongrave;1E50 //Omega;2126 //Omegacyrillic;0460 //Omegagreek;03A9 //Omegaroundcyrillic;047A //Omegatitlocyrillic;047C //Omegatonos;038F //Omicron;039F //Omicrontonos;038C //Omonospace;FF2F //Oneroman;2160 //Oogonek;01EA //Oogonekmacron;01EC //Oopen;0186 //Oslash;00D8 //Oslashacute;01FE //Oslashsmall;F7F8 //Osmall;F76F //Ostrokeacute;01FE //Otcyrillic;047E //Otilde;00D5 //Otildeacute;1E4C //Otildedieresis;1E4E //Otildesmall;F7F5 //P;0050 //Pacute;1E54 //Pcircle;24C5 //Pdotaccent;1E56 //Pecyrillic;041F //Peharmenian;054A //Pemiddlehookcyrillic;04A6 //Phi;03A6 //Phook;01A4 //Pi;03A0 //Piwrarmenian;0553 //Pmonospace;FF30 //Psi;03A8 //Psicyrillic;0470 //Psmall;F770 //Q;0051 //Qcircle;24C6 //Qmonospace;FF31 //Qsmall;F771 //R;0052 //Raarmenian;054C //Racute;0154 //Rcaron;0158 //Rcedilla;0156 //Rcircle;24C7 //Rcommaaccent;0156 //Rdblgrave;0210 //Rdotaccent;1E58 //Rdotbelow;1E5A //Rdotbelowmacron;1E5C //Reharmenian;0550 //Rfraktur;211C //Rho;03A1 //Ringsmall;F6FC //Rinvertedbreve;0212 //Rlinebelow;1E5E //Rmonospace;FF32 //Rsmall;F772 //Rsmallinverted;0281 //Rsmallinvertedsuperior;02B6 //S;0053 //SF010000;250C //SF020000;2514 //SF030000;2510 //SF040000;2518 //SF050000;253C //SF060000;252C //SF070000;2534 //SF080000;251C //SF090000;2524 //SF100000;2500 //SF110000;2502 //SF190000;2561 //SF200000;2562 //SF210000;2556 //SF220000;2555 //SF230000;2563 //SF240000;2551 //SF250000;2557 //SF260000;255D //SF270000;255C //SF280000;255B //SF360000;255E //SF370000;255F //SF380000;255A //SF390000;2554 //SF400000;2569 //SF410000;2566 //SF420000;2560 //SF430000;2550 //SF440000;256C //SF450000;2567 //SF460000;2568 //SF470000;2564 //SF480000;2565 //SF490000;2559 //SF500000;2558 //SF510000;2552 //SF520000;2553 //SF530000;256B //SF540000;256A //Sacute;015A //Sacutedotaccent;1E64 //Sampigreek;03E0 //Scaron;0160 //Scarondotaccent;1E66 //Scaronsmall;F6FD //Scedilla;015E //Schwa;018F //Schwacyrillic;04D8 //Schwadieresiscyrillic;04DA //Scircle;24C8 //Scircumflex;015C //Scommaaccent;0218 //Sdotaccent;1E60 //Sdotbelow;1E62 //Sdotbelowdotaccent;1E68 //Seharmenian;054D //Sevenroman;2166 //Shaarmenian;0547 //Shacyrillic;0428 //Shchacyrillic;0429 //Sheicoptic;03E2 //Shhacyrillic;04BA //Shimacoptic;03EC //Sigma;03A3 //Sixroman;2165 //Smonospace;FF33 //Softsigncyrillic;042C //Ssmall;F773 //Stigmagreek;03DA //T;0054 //Tau;03A4 //Tbar;0166 //Tcaron;0164 //Tcedilla;0162 //Tcircle;24C9 //Tcircumflexbelow;1E70 //Tcommaaccent;0162 //Tdotaccent;1E6A //Tdotbelow;1E6C //Tecyrillic;0422 //Tedescendercyrillic;04AC //Tenroman;2169 //Tetsecyrillic;04B4 //Theta;0398 //Thook;01AC //Thorn;00DE //Thornsmall;F7FE //Threeroman;2162 //Tildesmall;F6FE //Tiwnarmenian;054F //Tlinebelow;1E6E //Tmonospace;FF34 //Toarmenian;0539 //Tonefive;01BC //Tonesix;0184 //Tonetwo;01A7 //Tretroflexhook;01AE //Tsecyrillic;0426 //Tshecyrillic;040B //Tsmall;F774 //Twelveroman;216B //Tworoman;2161 //U;0055 //Uacute;00DA //Uacutesmall;F7FA //Ubreve;016C //Ucaron;01D3 //Ucircle;24CA //Ucircumflex;00DB //Ucircumflexbelow;1E76 //Ucircumflexsmall;F7FB //Ucyrillic;0423 //Udblacute;0170 //Udblgrave;0214 //Udieresis;00DC //Udieresisacute;01D7 //Udieresisbelow;1E72 //Udieresiscaron;01D9 //Udieresiscyrillic;04F0 //Udieresisgrave;01DB //Udieresismacron;01D5 //Udieresissmall;F7FC //Udotbelow;1EE4 //Ugrave;00D9 //Ugravesmall;F7F9 //Uhookabove;1EE6 //Uhorn;01AF //Uhornacute;1EE8 //Uhorndotbelow;1EF0 //Uhorngrave;1EEA //Uhornhookabove;1EEC //Uhorntilde;1EEE //Uhungarumlaut;0170 //Uhungarumlautcyrillic;04F2 //Uinvertedbreve;0216 //Ukcyrillic;0478 //Umacron;016A //Umacroncyrillic;04EE //Umacrondieresis;1E7A //Umonospace;FF35 //Uogonek;0172 //Upsilon;03A5 //Upsilon1;03D2 //Upsilonacutehooksymbolgreek;03D3 //Upsilonafrican;01B1 //Upsilondieresis;03AB //Upsilondieresishooksymbolgreek;03D4 //Upsilonhooksymbol;03D2 //Upsilontonos;038E //Uring;016E //Ushortcyrillic;040E //Usmall;F775 //Ustraightcyrillic;04AE //Ustraightstrokecyrillic;04B0 //Utilde;0168 //Utildeacute;1E78 //Utildebelow;1E74 //V;0056 //Vcircle;24CB //Vdotbelow;1E7E //Vecyrillic;0412 //Vewarmenian;054E //Vhook;01B2 //Vmonospace;FF36 //Voarmenian;0548 //Vsmall;F776 //Vtilde;1E7C //W;0057 //Wacute;1E82 //Wcircle;24CC //Wcircumflex;0174 //Wdieresis;1E84 //Wdotaccent;1E86 //Wdotbelow;1E88 //Wgrave;1E80 //Wmonospace;FF37 //Wsmall;F777 //X;0058 //Xcircle;24CD //Xdieresis;1E8C //Xdotaccent;1E8A //Xeharmenian;053D //Xi;039E //Xmonospace;FF38 //Xsmall;F778 //Y;0059 //Yacute;00DD //Yacutesmall;F7FD //Yatcyrillic;0462 //Ycircle;24CE //Ycircumflex;0176 //Ydieresis;0178 //Ydieresissmall;F7FF //Ydotaccent;1E8E //Ydotbelow;1EF4 //Yericyrillic;042B //Yerudieresiscyrillic;04F8 //Ygrave;1EF2 //Yhook;01B3 //Yhookabove;1EF6 //Yiarmenian;0545 //Yicyrillic;0407 //Yiwnarmenian;0552 //Ymonospace;FF39 //Ysmall;F779 //Ytilde;1EF8 //Yusbigcyrillic;046A //Yusbigiotifiedcyrillic;046C //Yuslittlecyrillic;0466 //Yuslittleiotifiedcyrillic;0468 //Z;005A //Zaarmenian;0536 //Zacute;0179 //Zcaron;017D //Zcaronsmall;F6FF //Zcircle;24CF //Zcircumflex;1E90 //Zdot;017B //Zdotaccent;017B //Zdotbelow;1E92 //Zecyrillic;0417 //Zedescendercyrillic;0498 //Zedieresiscyrillic;04DE //Zeta;0396 //Zhearmenian;053A //Zhebrevecyrillic;04C1 //Zhecyrillic;0416 //Zhedescendercyrillic;0496 //Zhedieresiscyrillic;04DC //Zlinebelow;1E94 //Zmonospace;FF3A //Zsmall;F77A //Zstroke;01B5 //a;0061 //aabengali;0986 //aacute;00E1 //aadeva;0906 //aagujarati;0A86 //aagurmukhi;0A06 //aamatragurmukhi;0A3E //aarusquare;3303 //aavowelsignbengali;09BE //aavowelsigndeva;093E //aavowelsigngujarati;0ABE //abbreviationmarkarmenian;055F //abbreviationsigndeva;0970 //abengali;0985 //abopomofo;311A //abreve;0103 //abreveacute;1EAF //abrevecyrillic;04D1 //abrevedotbelow;1EB7 //abrevegrave;1EB1 //abrevehookabove;1EB3 //abrevetilde;1EB5 //acaron;01CE //acircle;24D0 //acircumflex;00E2 //acircumflexacute;1EA5 //acircumflexdotbelow;1EAD //acircumflexgrave;1EA7 //acircumflexhookabove;1EA9 //acircumflextilde;1EAB //acute;00B4 //acutebelowcmb;0317 //acutecmb;0301 //acutecomb;0301 //acutedeva;0954 //acutelowmod;02CF //acutetonecmb;0341 //acyrillic;0430 //adblgrave;0201 //addakgurmukhi;0A71 //adeva;0905 //adieresis;00E4 //adieresiscyrillic;04D3 //adieresismacron;01DF //adotbelow;1EA1 //adotmacron;01E1 //ae;00E6 //aeacute;01FD //aekorean;3150 //aemacron;01E3 //afii00208;2015 //afii08941;20A4 //afii10017;0410 //afii10018;0411 //afii10019;0412 //afii10020;0413 //afii10021;0414 //afii10022;0415 //afii10023;0401 //afii10024;0416 //afii10025;0417 //afii10026;0418 //afii10027;0419 //afii10028;041A //afii10029;041B //afii10030;041C //afii10031;041D //afii10032;041E //afii10033;041F //afii10034;0420 //afii10035;0421 //afii10036;0422 //afii10037;0423 //afii10038;0424 //afii10039;0425 //afii10040;0426 //afii10041;0427 //afii10042;0428 //afii10043;0429 //afii10044;042A //afii10045;042B //afii10046;042C //afii10047;042D //afii10048;042E //afii10049;042F //afii10050;0490 //afii10051;0402 //afii10052;0403 //afii10053;0404 //afii10054;0405 //afii10055;0406 //afii10056;0407 //afii10057;0408 //afii10058;0409 //afii10059;040A //afii10060;040B //afii10061;040C //afii10062;040E //afii10063;F6C4 //afii10064;F6C5 //afii10065;0430 //afii10066;0431 //afii10067;0432 //afii10068;0433 //afii10069;0434 //afii10070;0435 //afii10071;0451 //afii10072;0436 //afii10073;0437 //afii10074;0438 //afii10075;0439 //afii10076;043A //afii10077;043B //afii10078;043C //afii10079;043D //afii10080;043E //afii10081;043F //afii10082;0440 //afii10083;0441 //afii10084;0442 //afii10085;0443 //afii10086;0444 //afii10087;0445 //afii10088;0446 //afii10089;0447 //afii10090;0448 //afii10091;0449 //afii10092;044A //afii10093;044B //afii10094;044C //afii10095;044D //afii10096;044E //afii10097;044F //afii10098;0491 //afii10099;0452 //afii10100;0453 //afii10101;0454 //afii10102;0455 //afii10103;0456 //afii10104;0457 //afii10105;0458 //afii10106;0459 //afii10107;045A //afii10108;045B //afii10109;045C //afii10110;045E //afii10145;040F //afii10146;0462 //afii10147;0472 //afii10148;0474 //afii10192;F6C6 //afii10193;045F //afii10194;0463 //afii10195;0473 //afii10196;0475 //afii10831;F6C7 //afii10832;F6C8 //afii10846;04D9 //afii299;200E //afii300;200F //afii301;200D //afii57381;066A //afii57388;060C //afii57392;0660 //afii57393;0661 //afii57394;0662 //afii57395;0663 //afii57396;0664 //afii57397;0665 //afii57398;0666 //afii57399;0667 //afii57400;0668 //afii57401;0669 //afii57403;061B //afii57407;061F //afii57409;0621 //afii57410;0622 //afii57411;0623 //afii57412;0624 //afii57413;0625 //afii57414;0626 //afii57415;0627 //afii57416;0628 //afii57417;0629 //afii57418;062A //afii57419;062B //afii57420;062C //afii57421;062D //afii57422;062E //afii57423;062F //afii57424;0630 //afii57425;0631 //afii57426;0632 //afii57427;0633 //afii57428;0634 //afii57429;0635 //afii57430;0636 //afii57431;0637 //afii57432;0638 //afii57433;0639 //afii57434;063A //afii57440;0640 //afii57441;0641 //afii57442;0642 //afii57443;0643 //afii57444;0644 //afii57445;0645 //afii57446;0646 //afii57448;0648 //afii57449;0649 //afii57450;064A //afii57451;064B //afii57452;064C //afii57453;064D //afii57454;064E //afii57455;064F //afii57456;0650 //afii57457;0651 //afii57458;0652 //afii57470;0647 //afii57505;06A4 //afii57506;067E //afii57507;0686 //afii57508;0698 //afii57509;06AF //afii57511;0679 //afii57512;0688 //afii57513;0691 //afii57514;06BA //afii57519;06D2 //afii57534;06D5 //afii57636;20AA //afii57645;05BE //afii57658;05C3 //afii57664;05D0 //afii57665;05D1 //afii57666;05D2 //afii57667;05D3 //afii57668;05D4 //afii57669;05D5 //afii57670;05D6 //afii57671;05D7 //afii57672;05D8 //afii57673;05D9 //afii57674;05DA //afii57675;05DB //afii57676;05DC //afii57677;05DD //afii57678;05DE //afii57679;05DF //afii57680;05E0 //afii57681;05E1 //afii57682;05E2 //afii57683;05E3 //afii57684;05E4 //afii57685;05E5 //afii57686;05E6 //afii57687;05E7 //afii57688;05E8 //afii57689;05E9 //afii57690;05EA //afii57694;FB2A //afii57695;FB2B //afii57700;FB4B //afii57705;FB1F //afii57716;05F0 //afii57717;05F1 //afii57718;05F2 //afii57723;FB35 //afii57793;05B4 //afii57794;05B5 //afii57795;05B6 //afii57796;05BB //afii57797;05B8 //afii57798;05B7 //afii57799;05B0 //afii57800;05B2 //afii57801;05B1 //afii57802;05B3 //afii57803;05C2 //afii57804;05C1 //afii57806;05B9 //afii57807;05BC //afii57839;05BD //afii57841;05BF //afii57842;05C0 //afii57929;02BC //afii61248;2105 //afii61289;2113 //afii61352;2116 //afii61573;202C //afii61574;202D //afii61575;202E //afii61664;200C //afii63167;066D //afii64937;02BD //agrave;00E0 //agujarati;0A85 //agurmukhi;0A05 //ahiragana;3042 //ahookabove;1EA3 //aibengali;0990 //aibopomofo;311E //aideva;0910 //aiecyrillic;04D5 //aigujarati;0A90 //aigurmukhi;0A10 //aimatragurmukhi;0A48 //ainarabic;0639 //ainfinalarabic;FECA //aininitialarabic;FECB //ainmedialarabic;FECC //ainvertedbreve;0203 //aivowelsignbengali;09C8 //aivowelsigndeva;0948 //aivowelsigngujarati;0AC8 //akatakana;30A2 //akatakanahalfwidth;FF71 //akorean;314F //alef;05D0 //alefarabic;0627 //alefdageshhebrew;FB30 //aleffinalarabic;FE8E //alefhamzaabovearabic;0623 //alefhamzaabovefinalarabic;FE84 //alefhamzabelowarabic;0625 //alefhamzabelowfinalarabic;FE88 //alefhebrew;05D0 //aleflamedhebrew;FB4F //alefmaddaabovearabic;0622 //alefmaddaabovefinalarabic;FE82 //alefmaksuraarabic;0649 //alefmaksurafinalarabic;FEF0 //alefmaksurainitialarabic;FEF3 //alefmaksuramedialarabic;FEF4 //alefpatahhebrew;FB2E //alefqamatshebrew;FB2F //aleph;2135 //allequal;224C //alpha;03B1 //alphatonos;03AC //amacron;0101 //amonospace;FF41 //ampersand;0026 //ampersandmonospace;FF06 //ampersandsmall;F726 //amsquare;33C2 //anbopomofo;3122 //angbopomofo;3124 //angkhankhuthai;0E5A //angle;2220 //anglebracketleft;3008 //anglebracketleftvertical;FE3F //anglebracketright;3009 //anglebracketrightvertical;FE40 //angleleft;2329 //angleright;232A //angstrom;212B //anoteleia;0387 //anudattadeva;0952 //anusvarabengali;0982 //anusvaradeva;0902 //anusvaragujarati;0A82 //aogonek;0105 //apaatosquare;3300 //aparen;249C //apostrophearmenian;055A //apostrophemod;02BC //apple;F8FF //approaches;2250 //approxequal;2248 //approxequalorimage;2252 //approximatelyequal;2245 //araeaekorean;318E //araeakorean;318D //arc;2312 //arighthalfring;1E9A //aring;00E5 //aringacute;01FB //aringbelow;1E01 //arrowboth;2194 //arrowdashdown;21E3 //arrowdashleft;21E0 //arrowdashright;21E2 //arrowdashup;21E1 //arrowdblboth;21D4 //arrowdbldown;21D3 //arrowdblleft;21D0 //arrowdblright;21D2 //arrowdblup;21D1 //arrowdown;2193 //arrowdownleft;2199 //arrowdownright;2198 //arrowdownwhite;21E9 //arrowheaddownmod;02C5 //arrowheadleftmod;02C2 //arrowheadrightmod;02C3 //arrowheadupmod;02C4 //arrowhorizex;F8E7 //arrowleft;2190 //arrowleftdbl;21D0 //arrowleftdblstroke;21CD //arrowleftoverright;21C6 //arrowleftwhite;21E6 //arrowright;2192 //arrowrightdblstroke;21CF //arrowrightheavy;279E //arrowrightoverleft;21C4 //arrowrightwhite;21E8 //arrowtableft;21E4 //arrowtabright;21E5 //arrowup;2191 //arrowupdn;2195 //arrowupdnbse;21A8 //arrowupdownbase;21A8 //arrowupleft;2196 //arrowupleftofdown;21C5 //arrowupright;2197 //arrowupwhite;21E7 //arrowvertex;F8E6 //asciicircum;005E //asciicircummonospace;FF3E //asciitilde;007E //asciitildemonospace;FF5E //ascript;0251 //ascriptturned;0252 //asmallhiragana;3041 //asmallkatakana;30A1 //asmallkatakanahalfwidth;FF67 //asterisk;002A //asteriskaltonearabic;066D //asteriskarabic;066D //asteriskmath;2217 //asteriskmonospace;FF0A //asterisksmall;FE61 //asterism;2042 //asuperior;F6E9 //asymptoticallyequal;2243 //at;0040 //atilde;00E3 //atmonospace;FF20 //atsmall;FE6B //aturned;0250 //aubengali;0994 //aubopomofo;3120 //audeva;0914 //augujarati;0A94 //augurmukhi;0A14 //aulengthmarkbengali;09D7 //aumatragurmukhi;0A4C //auvowelsignbengali;09CC //auvowelsigndeva;094C //auvowelsigngujarati;0ACC //avagrahadeva;093D //aybarmenian;0561 //ayin;05E2 //ayinaltonehebrew;FB20 //ayinhebrew;05E2 //b;0062 //babengali;09AC //backslash;005C //backslashmonospace;FF3C //badeva;092C //bagujarati;0AAC //bagurmukhi;0A2C //bahiragana;3070 //bahtthai;0E3F //bakatakana;30D0 //bar;007C //barmonospace;FF5C //bbopomofo;3105 //bcircle;24D1 //bdotaccent;1E03 //bdotbelow;1E05 //beamedsixteenthnotes;266C //because;2235 //becyrillic;0431 //beharabic;0628 //behfinalarabic;FE90 //behinitialarabic;FE91 //behiragana;3079 //behmedialarabic;FE92 //behmeeminitialarabic;FC9F //behmeemisolatedarabic;FC08 //behnoonfinalarabic;FC6D //bekatakana;30D9 //benarmenian;0562 //bet;05D1 //beta;03B2 //betasymbolgreek;03D0 //betdagesh;FB31 //betdageshhebrew;FB31 //bethebrew;05D1 //betrafehebrew;FB4C //bhabengali;09AD //bhadeva;092D //bhagujarati;0AAD //bhagurmukhi;0A2D //bhook;0253 //bihiragana;3073 //bikatakana;30D3 //bilabialclick;0298 //bindigurmukhi;0A02 //birusquare;3331 //blackcircle;25CF //blackdiamond;25C6 //blackdownpointingtriangle;25BC //blackleftpointingpointer;25C4 //blackleftpointingtriangle;25C0 //blacklenticularbracketleft;3010 //blacklenticularbracketleftvertical;FE3B //blacklenticularbracketright;3011 //blacklenticularbracketrightvertical;FE3C //blacklowerlefttriangle;25E3 //blacklowerrighttriangle;25E2 //blackrectangle;25AC //blackrightpointingpointer;25BA //blackrightpointingtriangle;25B6 //blacksmallsquare;25AA //blacksmilingface;263B //blacksquare;25A0 //blackstar;2605 //blackupperlefttriangle;25E4 //blackupperrighttriangle;25E5 //blackuppointingsmalltriangle;25B4 //blackuppointingtriangle;25B2 //blank;2423 //blinebelow;1E07 //block;2588 //bmonospace;FF42 //bobaimaithai;0E1A //bohiragana;307C //bokatakana;30DC //bparen;249D //bqsquare;33C3 //braceex;F8F4 //braceleft;007B //braceleftbt;F8F3 //braceleftmid;F8F2 //braceleftmonospace;FF5B //braceleftsmall;FE5B //bracelefttp;F8F1 //braceleftvertical;FE37 //braceright;007D //bracerightbt;F8FE //bracerightmid;F8FD //bracerightmonospace;FF5D //bracerightsmall;FE5C //bracerighttp;F8FC //bracerightvertical;FE38 //bracketleft;005B //bracketleftbt;F8F0 //bracketleftex;F8EF //bracketleftmonospace;FF3B //bracketlefttp;F8EE //bracketright;005D //bracketrightbt;F8FB //bracketrightex;F8FA //bracketrightmonospace;FF3D //bracketrighttp;F8F9 //breve;02D8 //brevebelowcmb;032E //brevecmb;0306 //breveinvertedbelowcmb;032F //breveinvertedcmb;0311 //breveinverteddoublecmb;0361 //bridgebelowcmb;032A //bridgeinvertedbelowcmb;033A //brokenbar;00A6 //bstroke;0180 //bsuperior;F6EA //btopbar;0183 //buhiragana;3076 //bukatakana;30D6 //bullet;2022 //bulletinverse;25D8 //bulletoperator;2219 //bullseye;25CE //c;0063 //caarmenian;056E //cabengali;099A //cacute;0107 //cadeva;091A //cagujarati;0A9A //cagurmukhi;0A1A //calsquare;3388 //candrabindubengali;0981 //candrabinducmb;0310 //candrabindudeva;0901 //candrabindugujarati;0A81 //capslock;21EA //careof;2105 //caron;02C7 //caronbelowcmb;032C //caroncmb;030C //carriagereturn;21B5 //cbopomofo;3118 //ccaron;010D //ccedilla;00E7 //ccedillaacute;1E09 //ccircle;24D2 //ccircumflex;0109 //ccurl;0255 //cdot;010B //cdotaccent;010B //cdsquare;33C5 //cedilla;00B8 //cedillacmb;0327 //cent;00A2 //centigrade;2103 //centinferior;F6DF //centmonospace;FFE0 //centoldstyle;F7A2 //centsuperior;F6E0 //chaarmenian;0579 //chabengali;099B //chadeva;091B //chagujarati;0A9B //chagurmukhi;0A1B //chbopomofo;3114 //cheabkhasiancyrillic;04BD //checkmark;2713 //checyrillic;0447 //chedescenderabkhasiancyrillic;04BF //chedescendercyrillic;04B7 //chedieresiscyrillic;04F5 //cheharmenian;0573 //chekhakassiancyrillic;04CC //cheverticalstrokecyrillic;04B9 //chi;03C7 //chieuchacirclekorean;3277 //chieuchaparenkorean;3217 //chieuchcirclekorean;3269 //chieuchkorean;314A //chieuchparenkorean;3209 //chochangthai;0E0A //chochanthai;0E08 //chochingthai;0E09 //chochoethai;0E0C //chook;0188 //cieucacirclekorean;3276 //cieucaparenkorean;3216 //cieuccirclekorean;3268 //cieuckorean;3148 //cieucparenkorean;3208 //cieucuparenkorean;321C //circle;25CB //circlemultiply;2297 //circleot;2299 //circleplus;2295 //circlepostalmark;3036 //circlewithlefthalfblack;25D0 //circlewithrighthalfblack;25D1 //circumflex;02C6 //circumflexbelowcmb;032D //circumflexcmb;0302 //clear;2327 //clickalveolar;01C2 //clickdental;01C0 //clicklateral;01C1 //clickretroflex;01C3 //club;2663 //clubsuitblack;2663 //clubsuitwhite;2667 //cmcubedsquare;33A4 //cmonospace;FF43 //cmsquaredsquare;33A0 //coarmenian;0581 //colon;003A //colonmonetary;20A1 //colonmonospace;FF1A //colonsign;20A1 //colonsmall;FE55 //colontriangularhalfmod;02D1 //colontriangularmod;02D0 //comma;002C //commaabovecmb;0313 //commaaboverightcmb;0315 //commaaccent;F6C3 //commaarabic;060C //commaarmenian;055D //commainferior;F6E1 //commamonospace;FF0C //commareversedabovecmb;0314 //commareversedmod;02BD //commasmall;FE50 //commasuperior;F6E2 //commaturnedabovecmb;0312 //commaturnedmod;02BB //compass;263C //congruent;2245 //contourintegral;222E //control;2303 //controlACK;0006 //controlBEL;0007 //controlBS;0008 //controlCAN;0018 //controlCR;000D //controlDC1;0011 //controlDC2;0012 //controlDC3;0013 //controlDC4;0014 //controlDEL;007F //controlDLE;0010 //controlEM;0019 //controlENQ;0005 //controlEOT;0004 //controlESC;001B //controlETB;0017 //controlETX;0003 //controlFF;000C //controlFS;001C //controlGS;001D //controlHT;0009 //controlLF;000A //controlNAK;0015 //controlRS;001E //controlSI;000F //controlSO;000E //controlSOT;0002 //controlSTX;0001 //controlSUB;001A //controlSYN;0016 //controlUS;001F //controlVT;000B //copyright;00A9 //copyrightsans;F8E9 //copyrightserif;F6D9 //cornerbracketleft;300C //cornerbracketlefthalfwidth;FF62 //cornerbracketleftvertical;FE41 //cornerbracketright;300D //cornerbracketrighthalfwidth;FF63 //cornerbracketrightvertical;FE42 //corporationsquare;337F //cosquare;33C7 //coverkgsquare;33C6 //cparen;249E //cruzeiro;20A2 //cstretched;0297 //curlyand;22CF //curlyor;22CE //currency;00A4 //cyrBreve;F6D1 //cyrFlex;F6D2 //cyrbreve;F6D4 //cyrflex;F6D5 //d;0064 //daarmenian;0564 //dabengali;09A6 //dadarabic;0636 //dadeva;0926 //dadfinalarabic;FEBE //dadinitialarabic;FEBF //dadmedialarabic;FEC0 //dagesh;05BC //dageshhebrew;05BC //dagger;2020 //daggerdbl;2021 //dagujarati;0AA6 //dagurmukhi;0A26 //dahiragana;3060 //dakatakana;30C0 //dalarabic;062F //dalet;05D3 //daletdagesh;FB33 //daletdageshhebrew;FB33 //dalethatafpatah;05D3 05B2 //dalethatafpatahhebrew;05D3 05B2 //dalethatafsegol;05D3 05B1 //dalethatafsegolhebrew;05D3 05B1 //dalethebrew;05D3 //dalethiriq;05D3 05B4 //dalethiriqhebrew;05D3 05B4 //daletholam;05D3 05B9 //daletholamhebrew;05D3 05B9 //daletpatah;05D3 05B7 //daletpatahhebrew;05D3 05B7 //daletqamats;05D3 05B8 //daletqamatshebrew;05D3 05B8 //daletqubuts;05D3 05BB //daletqubutshebrew;05D3 05BB //daletsegol;05D3 05B6 //daletsegolhebrew;05D3 05B6 //daletsheva;05D3 05B0 //daletshevahebrew;05D3 05B0 //dalettsere;05D3 05B5 //dalettserehebrew;05D3 05B5 //dalfinalarabic;FEAA //dammaarabic;064F //dammalowarabic;064F //dammatanaltonearabic;064C //dammatanarabic;064C //danda;0964 //dargahebrew;05A7 //dargalefthebrew;05A7 //dasiapneumatacyrilliccmb;0485 //dblGrave;F6D3 //dblanglebracketleft;300A //dblanglebracketleftvertical;FE3D //dblanglebracketright;300B //dblanglebracketrightvertical;FE3E //dblarchinvertedbelowcmb;032B //dblarrowleft;21D4 //dblarrowright;21D2 //dbldanda;0965 //dblgrave;F6D6 //dblgravecmb;030F //dblintegral;222C //dbllowline;2017 //dbllowlinecmb;0333 //dbloverlinecmb;033F //dblprimemod;02BA //dblverticalbar;2016 //dblverticallineabovecmb;030E //dbopomofo;3109 //dbsquare;33C8 //dcaron;010F //dcedilla;1E11 //dcircle;24D3 //dcircumflexbelow;1E13 //dcroat;0111 //ddabengali;09A1 //ddadeva;0921 //ddagujarati;0AA1 //ddagurmukhi;0A21 //ddalarabic;0688 //ddalfinalarabic;FB89 //dddhadeva;095C //ddhabengali;09A2 //ddhadeva;0922 //ddhagujarati;0AA2 //ddhagurmukhi;0A22 //ddotaccent;1E0B //ddotbelow;1E0D //decimalseparatorarabic;066B //decimalseparatorpersian;066B //decyrillic;0434 //degree;00B0 //dehihebrew;05AD //dehiragana;3067 //deicoptic;03EF //dekatakana;30C7 //deleteleft;232B //deleteright;2326 //delta;03B4 //deltaturned;018D //denominatorminusonenumeratorbengali;09F8 //dezh;02A4 //dhabengali;09A7 //dhadeva;0927 //dhagujarati;0AA7 //dhagurmukhi;0A27 //dhook;0257 //dialytikatonos;0385 //dialytikatonoscmb;0344 //diamond;2666 //diamondsuitwhite;2662 //dieresis;00A8 //dieresisacute;F6D7 //dieresisbelowcmb;0324 //dieresiscmb;0308 //dieresisgrave;F6D8 //dieresistonos;0385 //dihiragana;3062 //dikatakana;30C2 //dittomark;3003 //divide;00F7 //divides;2223 //divisionslash;2215 //djecyrillic;0452 //dkshade;2593 //dlinebelow;1E0F //dlsquare;3397 //dmacron;0111 //dmonospace;FF44 //dnblock;2584 //dochadathai;0E0E //dodekthai;0E14 //dohiragana;3069 //dokatakana;30C9 //dollar;0024 //dollarinferior;F6E3 //dollarmonospace;FF04 //dollaroldstyle;F724 //dollarsmall;FE69 //dollarsuperior;F6E4 //dong;20AB //dorusquare;3326 //dotaccent;02D9 //dotaccentcmb;0307 //dotbelowcmb;0323 //dotbelowcomb;0323 //dotkatakana;30FB //dotlessi;0131 //dotlessj;F6BE //dotlessjstrokehook;0284 //dotmath;22C5 //dottedcircle;25CC //doubleyodpatah;FB1F //doubleyodpatahhebrew;FB1F //downtackbelowcmb;031E //downtackmod;02D5 //dparen;249F //dsuperior;F6EB //dtail;0256 //dtopbar;018C //duhiragana;3065 //dukatakana;30C5 //dz;01F3 //dzaltone;02A3 //dzcaron;01C6 //dzcurl;02A5 //dzeabkhasiancyrillic;04E1 //dzecyrillic;0455 //dzhecyrillic;045F //e;0065 //eacute;00E9 //earth;2641 //ebengali;098F //ebopomofo;311C //ebreve;0115 //ecandradeva;090D //ecandragujarati;0A8D //ecandravowelsigndeva;0945 //ecandravowelsigngujarati;0AC5 //ecaron;011B //ecedillabreve;1E1D //echarmenian;0565 //echyiwnarmenian;0587 //ecircle;24D4 //ecircumflex;00EA //ecircumflexacute;1EBF //ecircumflexbelow;1E19 //ecircumflexdotbelow;1EC7 //ecircumflexgrave;1EC1 //ecircumflexhookabove;1EC3 //ecircumflextilde;1EC5 //ecyrillic;0454 //edblgrave;0205 //edeva;090F //edieresis;00EB //edot;0117 //edotaccent;0117 //edotbelow;1EB9 //eegurmukhi;0A0F //eematragurmukhi;0A47 //efcyrillic;0444 //egrave;00E8 //egujarati;0A8F //eharmenian;0567 //ehbopomofo;311D //ehiragana;3048 //ehookabove;1EBB //eibopomofo;311F //eight;0038 //eightarabic;0668 //eightbengali;09EE //eightcircle;2467 //eightcircleinversesansserif;2791 //eightdeva;096E //eighteencircle;2471 //eighteenparen;2485 //eighteenperiod;2499 //eightgujarati;0AEE //eightgurmukhi;0A6E //eighthackarabic;0668 //eighthangzhou;3028 //eighthnotebeamed;266B //eightideographicparen;3227 //eightinferior;2088 //eightmonospace;FF18 //eightoldstyle;F738 //eightparen;247B //eightperiod;248F //eightpersian;06F8 //eightroman;2177 //eightsuperior;2078 //eightthai;0E58 //einvertedbreve;0207 //eiotifiedcyrillic;0465 //ekatakana;30A8 //ekatakanahalfwidth;FF74 //ekonkargurmukhi;0A74 //ekorean;3154 //elcyrillic;043B //element;2208 //elevencircle;246A //elevenparen;247E //elevenperiod;2492 //elevenroman;217A //ellipsis;2026 //ellipsisvertical;22EE //emacron;0113 //emacronacute;1E17 //emacrongrave;1E15 //emcyrillic;043C //emdash;2014 //emdashvertical;FE31 //emonospace;FF45 //emphasismarkarmenian;055B //emptyset;2205 //enbopomofo;3123 //encyrillic;043D //endash;2013 //endashvertical;FE32 //endescendercyrillic;04A3 //eng;014B //engbopomofo;3125 //enghecyrillic;04A5 //enhookcyrillic;04C8 //enspace;2002 //eogonek;0119 //eokorean;3153 //eopen;025B //eopenclosed;029A //eopenreversed;025C //eopenreversedclosed;025E //eopenreversedhook;025D //eparen;24A0 //epsilon;03B5 //epsilontonos;03AD //equal;003D //equalmonospace;FF1D //equalsmall;FE66 //equalsuperior;207C //equivalence;2261 //erbopomofo;3126 //ercyrillic;0440 //ereversed;0258 //ereversedcyrillic;044D //escyrillic;0441 //esdescendercyrillic;04AB //esh;0283 //eshcurl;0286 //eshortdeva;090E //eshortvowelsigndeva;0946 //eshreversedloop;01AA //eshsquatreversed;0285 //esmallhiragana;3047 //esmallkatakana;30A7 //esmallkatakanahalfwidth;FF6A //estimated;212E //esuperior;F6EC //eta;03B7 //etarmenian;0568 //etatonos;03AE //eth;00F0 //etilde;1EBD //etildebelow;1E1B //etnahtafoukhhebrew;0591 //etnahtafoukhlefthebrew;0591 //etnahtahebrew;0591 //etnahtalefthebrew;0591 //eturned;01DD //eukorean;3161 //euro;20AC //evowelsignbengali;09C7 //evowelsigndeva;0947 //evowelsigngujarati;0AC7 //exclam;0021 //exclamarmenian;055C //exclamdbl;203C //exclamdown;00A1 //exclamdownsmall;F7A1 //exclammonospace;FF01 //exclamsmall;F721 //existential;2203 //ezh;0292 //ezhcaron;01EF //ezhcurl;0293 //ezhreversed;01B9 //ezhtail;01BA //f;0066 //fadeva;095E //fagurmukhi;0A5E //fahrenheit;2109 //fathaarabic;064E //fathalowarabic;064E //fathatanarabic;064B //fbopomofo;3108 //fcircle;24D5 //fdotaccent;1E1F //feharabic;0641 //feharmenian;0586 //fehfinalarabic;FED2 //fehinitialarabic;FED3 //fehmedialarabic;FED4 //feicoptic;03E5 //female;2640 //ff;FB00 //ffi;FB03 //ffl;FB04 //fi;FB01 //fifteencircle;246E //fifteenparen;2482 //fifteenperiod;2496 //figuredash;2012 //filledbox;25A0 //filledrect;25AC //finalkaf;05DA //finalkafdagesh;FB3A //finalkafdageshhebrew;FB3A //finalkafhebrew;05DA //finalkafqamats;05DA 05B8 //finalkafqamatshebrew;05DA 05B8 //finalkafsheva;05DA 05B0 //finalkafshevahebrew;05DA 05B0 //finalmem;05DD //finalmemhebrew;05DD //finalnun;05DF //finalnunhebrew;05DF //finalpe;05E3 //finalpehebrew;05E3 //finaltsadi;05E5 //finaltsadihebrew;05E5 //firsttonechinese;02C9 //fisheye;25C9 //fitacyrillic;0473 //five;0035 //fivearabic;0665 //fivebengali;09EB //fivecircle;2464 //fivecircleinversesansserif;278E //fivedeva;096B //fiveeighths;215D //fivegujarati;0AEB //fivegurmukhi;0A6B //fivehackarabic;0665 //fivehangzhou;3025 //fiveideographicparen;3224 //fiveinferior;2085 //fivemonospace;FF15 //fiveoldstyle;F735 //fiveparen;2478 //fiveperiod;248C //fivepersian;06F5 //fiveroman;2174 //fivesuperior;2075 //fivethai;0E55 //fl;FB02 //florin;0192 //fmonospace;FF46 //fmsquare;3399 //fofanthai;0E1F //fofathai;0E1D //fongmanthai;0E4F //forall;2200 //four;0034 //fourarabic;0664 //fourbengali;09EA //fourcircle;2463 //fourcircleinversesansserif;278D //fourdeva;096A //fourgujarati;0AEA //fourgurmukhi;0A6A //fourhackarabic;0664 //fourhangzhou;3024 //fourideographicparen;3223 //fourinferior;2084 //fourmonospace;FF14 //fournumeratorbengali;09F7 //fouroldstyle;F734 //fourparen;2477 //fourperiod;248B //fourpersian;06F4 //fourroman;2173 //foursuperior;2074 //fourteencircle;246D //fourteenparen;2481 //fourteenperiod;2495 //fourthai;0E54 //fourthtonechinese;02CB //fparen;24A1 //fraction;2044 //franc;20A3 //g;0067 //gabengali;0997 //gacute;01F5 //gadeva;0917 //gafarabic;06AF //gaffinalarabic;FB93 //gafinitialarabic;FB94 //gafmedialarabic;FB95 //gagujarati;0A97 //gagurmukhi;0A17 //gahiragana;304C //gakatakana;30AC //gamma;03B3 //gammalatinsmall;0263 //gammasuperior;02E0 //gangiacoptic;03EB //gbopomofo;310D //gbreve;011F //gcaron;01E7 //gcedilla;0123 //gcircle;24D6 //gcircumflex;011D //gcommaaccent;0123 //gdot;0121 //gdotaccent;0121 //gecyrillic;0433 //gehiragana;3052 //gekatakana;30B2 //geometricallyequal;2251 //gereshaccenthebrew;059C //gereshhebrew;05F3 //gereshmuqdamhebrew;059D //germandbls;00DF //gershayimaccenthebrew;059E //gershayimhebrew;05F4 //getamark;3013 //ghabengali;0998 //ghadarmenian;0572 //ghadeva;0918 //ghagujarati;0A98 //ghagurmukhi;0A18 //ghainarabic;063A //ghainfinalarabic;FECE //ghaininitialarabic;FECF //ghainmedialarabic;FED0 //ghemiddlehookcyrillic;0495 //ghestrokecyrillic;0493 //gheupturncyrillic;0491 //ghhadeva;095A //ghhagurmukhi;0A5A //ghook;0260 //ghzsquare;3393 //gihiragana;304E //gikatakana;30AE //gimarmenian;0563 //gimel;05D2 //gimeldagesh;FB32 //gimeldageshhebrew;FB32 //gimelhebrew;05D2 //gjecyrillic;0453 //glottalinvertedstroke;01BE //glottalstop;0294 //glottalstopinverted;0296 //glottalstopmod;02C0 //glottalstopreversed;0295 //glottalstopreversedmod;02C1 //glottalstopreversedsuperior;02E4 //glottalstopstroke;02A1 //glottalstopstrokereversed;02A2 //gmacron;1E21 //gmonospace;FF47 //gohiragana;3054 //gokatakana;30B4 //gparen;24A2 //gpasquare;33AC //gradient;2207 //grave;0060 //gravebelowcmb;0316 //gravecmb;0300 //gravecomb;0300 //gravedeva;0953 //gravelowmod;02CE //gravemonospace;FF40 //gravetonecmb;0340 //greater;003E //greaterequal;2265 //greaterequalorless;22DB //greatermonospace;FF1E //greaterorequivalent;2273 //greaterorless;2277 //greateroverequal;2267 //greatersmall;FE65 //gscript;0261 //gstroke;01E5 //guhiragana;3050 //guillemotleft;00AB //guillemotright;00BB //guilsinglleft;2039 //guilsinglright;203A //gukatakana;30B0 //guramusquare;3318 //gysquare;33C9 //h;0068 //haabkhasiancyrillic;04A9 //haaltonearabic;06C1 //habengali;09B9 //hadescendercyrillic;04B3 //hadeva;0939 //hagujarati;0AB9 //hagurmukhi;0A39 //haharabic;062D //hahfinalarabic;FEA2 //hahinitialarabic;FEA3 //hahiragana;306F //hahmedialarabic;FEA4 //haitusquare;332A //hakatakana;30CF //hakatakanahalfwidth;FF8A //halantgurmukhi;0A4D //hamzaarabic;0621 //hamzadammaarabic;0621 064F //hamzadammatanarabic;0621 064C //hamzafathaarabic;0621 064E //hamzafathatanarabic;0621 064B //hamzalowarabic;0621 //hamzalowkasraarabic;0621 0650 //hamzalowkasratanarabic;0621 064D //hamzasukunarabic;0621 0652 //hangulfiller;3164 //hardsigncyrillic;044A //harpoonleftbarbup;21BC //harpoonrightbarbup;21C0 //hasquare;33CA //hatafpatah;05B2 //hatafpatah16;05B2 //hatafpatah23;05B2 //hatafpatah2f;05B2 //hatafpatahhebrew;05B2 //hatafpatahnarrowhebrew;05B2 //hatafpatahquarterhebrew;05B2 //hatafpatahwidehebrew;05B2 //hatafqamats;05B3 //hatafqamats1b;05B3 //hatafqamats28;05B3 //hatafqamats34;05B3 //hatafqamatshebrew;05B3 //hatafqamatsnarrowhebrew;05B3 //hatafqamatsquarterhebrew;05B3 //hatafqamatswidehebrew;05B3 //hatafsegol;05B1 //hatafsegol17;05B1 //hatafsegol24;05B1 //hatafsegol30;05B1 //hatafsegolhebrew;05B1 //hatafsegolnarrowhebrew;05B1 //hatafsegolquarterhebrew;05B1 //hatafsegolwidehebrew;05B1 //hbar;0127 //hbopomofo;310F //hbrevebelow;1E2B //hcedilla;1E29 //hcircle;24D7 //hcircumflex;0125 //hdieresis;1E27 //hdotaccent;1E23 //hdotbelow;1E25 //he;05D4 //heart;2665 //heartsuitblack;2665 //heartsuitwhite;2661 //hedagesh;FB34 //hedageshhebrew;FB34 //hehaltonearabic;06C1 //heharabic;0647 //hehebrew;05D4 //hehfinalaltonearabic;FBA7 //hehfinalalttwoarabic;FEEA //hehfinalarabic;FEEA //hehhamzaabovefinalarabic;FBA5 //hehhamzaaboveisolatedarabic;FBA4 //hehinitialaltonearabic;FBA8 //hehinitialarabic;FEEB //hehiragana;3078 //hehmedialaltonearabic;FBA9 //hehmedialarabic;FEEC //heiseierasquare;337B //hekatakana;30D8 //hekatakanahalfwidth;FF8D //hekutaarusquare;3336 //henghook;0267 //herutusquare;3339 //het;05D7 //hethebrew;05D7 //hhook;0266 //hhooksuperior;02B1 //hieuhacirclekorean;327B //hieuhaparenkorean;321B //hieuhcirclekorean;326D //hieuhkorean;314E //hieuhparenkorean;320D //hihiragana;3072 //hikatakana;30D2 //hikatakanahalfwidth;FF8B //hiriq;05B4 //hiriq14;05B4 //hiriq21;05B4 //hiriq2d;05B4 //hiriqhebrew;05B4 //hiriqnarrowhebrew;05B4 //hiriqquarterhebrew;05B4 //hiriqwidehebrew;05B4 //hlinebelow;1E96 //hmonospace;FF48 //hoarmenian;0570 //hohipthai;0E2B //hohiragana;307B //hokatakana;30DB //hokatakanahalfwidth;FF8E //holam;05B9 //holam19;05B9 //holam26;05B9 //holam32;05B9 //holamhebrew;05B9 //holamnarrowhebrew;05B9 //holamquarterhebrew;05B9 //holamwidehebrew;05B9 //honokhukthai;0E2E //hookabovecomb;0309 //hookcmb;0309 //hookpalatalizedbelowcmb;0321 //hookretroflexbelowcmb;0322 //hoonsquare;3342 //horicoptic;03E9 //horizontalbar;2015 //horncmb;031B //hotsprings;2668 //house;2302 //hparen;24A3 //hsuperior;02B0 //hturned;0265 //huhiragana;3075 //huiitosquare;3333 //hukatakana;30D5 //hukatakanahalfwidth;FF8C //hungarumlaut;02DD //hungarumlautcmb;030B //hv;0195 //hyphen;002D //hypheninferior;F6E5 //hyphenmonospace;FF0D //hyphensmall;FE63 //hyphensuperior;F6E6 //hyphentwo;2010 //i;0069 //iacute;00ED //iacyrillic;044F //ibengali;0987 //ibopomofo;3127 //ibreve;012D //icaron;01D0 //icircle;24D8 //icircumflex;00EE //icyrillic;0456 //idblgrave;0209 //ideographearthcircle;328F //ideographfirecircle;328B //ideographicallianceparen;323F //ideographiccallparen;323A //ideographiccentrecircle;32A5 //ideographicclose;3006 //ideographiccomma;3001 //ideographiccommaleft;FF64 //ideographiccongratulationparen;3237 //ideographiccorrectcircle;32A3 //ideographicearthparen;322F //ideographicenterpriseparen;323D //ideographicexcellentcircle;329D //ideographicfestivalparen;3240 //ideographicfinancialcircle;3296 //ideographicfinancialparen;3236 //ideographicfireparen;322B //ideographichaveparen;3232 //ideographichighcircle;32A4 //ideographiciterationmark;3005 //ideographiclaborcircle;3298 //ideographiclaborparen;3238 //ideographicleftcircle;32A7 //ideographiclowcircle;32A6 //ideographicmedicinecircle;32A9 //ideographicmetalparen;322E //ideographicmoonparen;322A //ideographicnameparen;3234 //ideographicperiod;3002 //ideographicprintcircle;329E //ideographicreachparen;3243 //ideographicrepresentparen;3239 //ideographicresourceparen;323E //ideographicrightcircle;32A8 //ideographicsecretcircle;3299 //ideographicselfparen;3242 //ideographicsocietyparen;3233 //ideographicspace;3000 //ideographicspecialparen;3235 //ideographicstockparen;3231 //ideographicstudyparen;323B //ideographicsunparen;3230 //ideographicsuperviseparen;323C //ideographicwaterparen;322C //ideographicwoodparen;322D //ideographiczero;3007 //ideographmetalcircle;328E //ideographmooncircle;328A //ideographnamecircle;3294 //ideographsuncircle;3290 //ideographwatercircle;328C //ideographwoodcircle;328D //ideva;0907 //idieresis;00EF //idieresisacute;1E2F //idieresiscyrillic;04E5 //idotbelow;1ECB //iebrevecyrillic;04D7 //iecyrillic;0435 //ieungacirclekorean;3275 //ieungaparenkorean;3215 //ieungcirclekorean;3267 //ieungkorean;3147 //ieungparenkorean;3207 //igrave;00EC //igujarati;0A87 //igurmukhi;0A07 //ihiragana;3044 //ihookabove;1EC9 //iibengali;0988 //iicyrillic;0438 //iideva;0908 //iigujarati;0A88 //iigurmukhi;0A08 //iimatragurmukhi;0A40 //iinvertedbreve;020B //iishortcyrillic;0439 //iivowelsignbengali;09C0 //iivowelsigndeva;0940 //iivowelsigngujarati;0AC0 //ij;0133 //ikatakana;30A4 //ikatakanahalfwidth;FF72 //ikorean;3163 //ilde;02DC //iluyhebrew;05AC //imacron;012B //imacroncyrillic;04E3 //imageorapproximatelyequal;2253 //imatragurmukhi;0A3F //imonospace;FF49 //increment;2206 //infinity;221E //iniarmenian;056B //integral;222B //integralbottom;2321 //integralbt;2321 //integralex;F8F5 //integraltop;2320 //integraltp;2320 //intersection;2229 //intisquare;3305 //invbullet;25D8 //invcircle;25D9 //invsmileface;263B //iocyrillic;0451 //iogonek;012F //iota;03B9 //iotadieresis;03CA //iotadieresistonos;0390 //iotalatin;0269 //iotatonos;03AF //iparen;24A4 //irigurmukhi;0A72 //ismallhiragana;3043 //ismallkatakana;30A3 //ismallkatakanahalfwidth;FF68 //issharbengali;09FA //istroke;0268 //isuperior;F6ED //iterationhiragana;309D //iterationkatakana;30FD //itilde;0129 //itildebelow;1E2D //iubopomofo;3129 //iucyrillic;044E //ivowelsignbengali;09BF //ivowelsigndeva;093F //ivowelsigngujarati;0ABF //izhitsacyrillic;0475 //izhitsadblgravecyrillic;0477 //j;006A //jaarmenian;0571 //jabengali;099C //jadeva;091C //jagujarati;0A9C //jagurmukhi;0A1C //jbopomofo;3110 //jcaron;01F0 //jcircle;24D9 //jcircumflex;0135 //jcrossedtail;029D //jdotlessstroke;025F //jecyrillic;0458 //jeemarabic;062C //jeemfinalarabic;FE9E //jeeminitialarabic;FE9F //jeemmedialarabic;FEA0 //jeharabic;0698 //jehfinalarabic;FB8B //jhabengali;099D //jhadeva;091D //jhagujarati;0A9D //jhagurmukhi;0A1D //jheharmenian;057B //jis;3004 //jmonospace;FF4A //jparen;24A5 //jsuperior;02B2 //k;006B //kabashkircyrillic;04A1 //kabengali;0995 //kacute;1E31 //kacyrillic;043A //kadescendercyrillic;049B //kadeva;0915 //kaf;05DB //kafarabic;0643 //kafdagesh;FB3B //kafdageshhebrew;FB3B //kaffinalarabic;FEDA //kafhebrew;05DB //kafinitialarabic;FEDB //kafmedialarabic;FEDC //kafrafehebrew;FB4D //kagujarati;0A95 //kagurmukhi;0A15 //kahiragana;304B //kahookcyrillic;04C4 //kakatakana;30AB //kakatakanahalfwidth;FF76 //kappa;03BA //kappasymbolgreek;03F0 //kapyeounmieumkorean;3171 //kapyeounphieuphkorean;3184 //kapyeounpieupkorean;3178 //kapyeounssangpieupkorean;3179 //karoriisquare;330D //kashidaautoarabic;0640 //kashidaautonosidebearingarabic;0640 //kasmallkatakana;30F5 //kasquare;3384 //kasraarabic;0650 //kasratanarabic;064D //kastrokecyrillic;049F //katahiraprolongmarkhalfwidth;FF70 //kaverticalstrokecyrillic;049D //kbopomofo;310E //kcalsquare;3389 //kcaron;01E9 //kcedilla;0137 //kcircle;24DA //kcommaaccent;0137 //kdotbelow;1E33 //keharmenian;0584 //kehiragana;3051 //kekatakana;30B1 //kekatakanahalfwidth;FF79 //kenarmenian;056F //kesmallkatakana;30F6 //kgreenlandic;0138 //khabengali;0996 //khacyrillic;0445 //khadeva;0916 //khagujarati;0A96 //khagurmukhi;0A16 //khaharabic;062E //khahfinalarabic;FEA6 //khahinitialarabic;FEA7 //khahmedialarabic;FEA8 //kheicoptic;03E7 //khhadeva;0959 //khhagurmukhi;0A59 //khieukhacirclekorean;3278 //khieukhaparenkorean;3218 //khieukhcirclekorean;326A //khieukhkorean;314B //khieukhparenkorean;320A //khokhaithai;0E02 //khokhonthai;0E05 //khokhuatthai;0E03 //khokhwaithai;0E04 //khomutthai;0E5B //khook;0199 //khorakhangthai;0E06 //khzsquare;3391 //kihiragana;304D //kikatakana;30AD //kikatakanahalfwidth;FF77 //kiroguramusquare;3315 //kiromeetorusquare;3316 //kirosquare;3314 //kiyeokacirclekorean;326E //kiyeokaparenkorean;320E //kiyeokcirclekorean;3260 //kiyeokkorean;3131 //kiyeokparenkorean;3200 //kiyeoksioskorean;3133 //kjecyrillic;045C //klinebelow;1E35 //klsquare;3398 //kmcubedsquare;33A6 //kmonospace;FF4B //kmsquaredsquare;33A2 //kohiragana;3053 //kohmsquare;33C0 //kokaithai;0E01 //kokatakana;30B3 //kokatakanahalfwidth;FF7A //kooposquare;331E //koppacyrillic;0481 //koreanstandardsymbol;327F //koroniscmb;0343 //kparen;24A6 //kpasquare;33AA //ksicyrillic;046F //ktsquare;33CF //kturned;029E //kuhiragana;304F //kukatakana;30AF //kukatakanahalfwidth;FF78 //kvsquare;33B8 //kwsquare;33BE //l;006C //labengali;09B2 //lacute;013A //ladeva;0932 //lagujarati;0AB2 //lagurmukhi;0A32 //lakkhangyaothai;0E45 //lamaleffinalarabic;FEFC //lamalefhamzaabovefinalarabic;FEF8 //lamalefhamzaaboveisolatedarabic;FEF7 //lamalefhamzabelowfinalarabic;FEFA //lamalefhamzabelowisolatedarabic;FEF9 //lamalefisolatedarabic;FEFB //lamalefmaddaabovefinalarabic;FEF6 //lamalefmaddaaboveisolatedarabic;FEF5 //lamarabic;0644 //lambda;03BB //lambdastroke;019B //lamed;05DC //lameddagesh;FB3C //lameddageshhebrew;FB3C //lamedhebrew;05DC //lamedholam;05DC 05B9 //lamedholamdagesh;05DC 05B9 05BC //lamedholamdageshhebrew;05DC 05B9 05BC //lamedholamhebrew;05DC 05B9 //lamfinalarabic;FEDE //lamhahinitialarabic;FCCA //laminitialarabic;FEDF //lamjeeminitialarabic;FCC9 //lamkhahinitialarabic;FCCB //lamlamhehisolatedarabic;FDF2 //lammedialarabic;FEE0 //lammeemhahinitialarabic;FD88 //lammeeminitialarabic;FCCC //lammeemjeeminitialarabic;FEDF FEE4 FEA0 //lammeemkhahinitialarabic;FEDF FEE4 FEA8 //largecircle;25EF //lbar;019A //lbelt;026C //lbopomofo;310C //lcaron;013E //lcedilla;013C //lcircle;24DB //lcircumflexbelow;1E3D //lcommaaccent;013C //ldot;0140 //ldotaccent;0140 //ldotbelow;1E37 //ldotbelowmacron;1E39 //leftangleabovecmb;031A //lefttackbelowcmb;0318 //less;003C //lessequal;2264 //lessequalorgreater;22DA //lessmonospace;FF1C //lessorequivalent;2272 //lessorgreater;2276 //lessoverequal;2266 //lesssmall;FE64 //lezh;026E //lfblock;258C //lhookretroflex;026D //lira;20A4 //liwnarmenian;056C //lj;01C9 //ljecyrillic;0459 //ll;F6C0 //lladeva;0933 //llagujarati;0AB3 //llinebelow;1E3B //llladeva;0934 //llvocalicbengali;09E1 //llvocalicdeva;0961 //llvocalicvowelsignbengali;09E3 //llvocalicvowelsigndeva;0963 //lmiddletilde;026B //lmonospace;FF4C //lmsquare;33D0 //lochulathai;0E2C //logicaland;2227 //logicalnot;00AC //logicalnotreversed;2310 //logicalor;2228 //lolingthai;0E25 //longs;017F //lowlinecenterline;FE4E //lowlinecmb;0332 //lowlinedashed;FE4D //lozenge;25CA //lparen;24A7 //lslash;0142 //lsquare;2113 //lsuperior;F6EE //ltshade;2591 //luthai;0E26 //lvocalicbengali;098C //lvocalicdeva;090C //lvocalicvowelsignbengali;09E2 //lvocalicvowelsigndeva;0962 //lxsquare;33D3 //m;006D //mabengali;09AE //macron;00AF //macronbelowcmb;0331 //macroncmb;0304 //macronlowmod;02CD //macronmonospace;FFE3 //macute;1E3F //madeva;092E //magujarati;0AAE //magurmukhi;0A2E //mahapakhhebrew;05A4 //mahapakhlefthebrew;05A4 //mahiragana;307E //maichattawalowleftthai;F895 //maichattawalowrightthai;F894 //maichattawathai;0E4B //maichattawaupperleftthai;F893 //maieklowleftthai;F88C //maieklowrightthai;F88B //maiekthai;0E48 //maiekupperleftthai;F88A //maihanakatleftthai;F884 //maihanakatthai;0E31 //maitaikhuleftthai;F889 //maitaikhuthai;0E47 //maitholowleftthai;F88F //maitholowrightthai;F88E //maithothai;0E49 //maithoupperleftthai;F88D //maitrilowleftthai;F892 //maitrilowrightthai;F891 //maitrithai;0E4A //maitriupperleftthai;F890 //maiyamokthai;0E46 //makatakana;30DE //makatakanahalfwidth;FF8F //male;2642 //mansyonsquare;3347 //maqafhebrew;05BE //mars;2642 //masoracirclehebrew;05AF //masquare;3383 //mbopomofo;3107 //mbsquare;33D4 //mcircle;24DC //mcubedsquare;33A5 //mdotaccent;1E41 //mdotbelow;1E43 //meemarabic;0645 //meemfinalarabic;FEE2 //meeminitialarabic;FEE3 //meemmedialarabic;FEE4 //meemmeeminitialarabic;FCD1 //meemmeemisolatedarabic;FC48 //meetorusquare;334D //mehiragana;3081 //meizierasquare;337E //mekatakana;30E1 //mekatakanahalfwidth;FF92 //mem;05DE //memdagesh;FB3E //memdageshhebrew;FB3E //memhebrew;05DE //menarmenian;0574 //merkhahebrew;05A5 //merkhakefulahebrew;05A6 //merkhakefulalefthebrew;05A6 //merkhalefthebrew;05A5 //mhook;0271 //mhzsquare;3392 //middledotkatakanahalfwidth;FF65 //middot;00B7 //mieumacirclekorean;3272 //mieumaparenkorean;3212 //mieumcirclekorean;3264 //mieumkorean;3141 //mieumpansioskorean;3170 //mieumparenkorean;3204 //mieumpieupkorean;316E //mieumsioskorean;316F //mihiragana;307F //mikatakana;30DF //mikatakanahalfwidth;FF90 //minus;2212 //minusbelowcmb;0320 //minuscircle;2296 //minusmod;02D7 //minusplus;2213 //minute;2032 //miribaarusquare;334A //mirisquare;3349 //mlonglegturned;0270 //mlsquare;3396 //mmcubedsquare;33A3 //mmonospace;FF4D //mmsquaredsquare;339F //mohiragana;3082 //mohmsquare;33C1 //mokatakana;30E2 //mokatakanahalfwidth;FF93 //molsquare;33D6 //momathai;0E21 //moverssquare;33A7 //moverssquaredsquare;33A8 //mparen;24A8 //mpasquare;33AB //mssquare;33B3 //msuperior;F6EF //mturned;026F //mu;00B5 //mu1;00B5 //muasquare;3382 //muchgreater;226B //muchless;226A //mufsquare;338C //mugreek;03BC //mugsquare;338D //muhiragana;3080 //mukatakana;30E0 //mukatakanahalfwidth;FF91 //mulsquare;3395 //multiply;00D7 //mumsquare;339B //munahhebrew;05A3 //munahlefthebrew;05A3 //musicalnote;266A //musicalnotedbl;266B //musicflatsign;266D //musicsharpsign;266F //mussquare;33B2 //muvsquare;33B6 //muwsquare;33BC //mvmegasquare;33B9 //mvsquare;33B7 //mwmegasquare;33BF //mwsquare;33BD //n;006E //nabengali;09A8 //nabla;2207 //nacute;0144 //nadeva;0928 //nagujarati;0AA8 //nagurmukhi;0A28 //nahiragana;306A //nakatakana;30CA //nakatakanahalfwidth;FF85 //napostrophe;0149 //nasquare;3381 //nbopomofo;310B //nbspace;00A0 //ncaron;0148 //ncedilla;0146 //ncircle;24DD //ncircumflexbelow;1E4B //ncommaaccent;0146 //ndotaccent;1E45 //ndotbelow;1E47 //nehiragana;306D //nekatakana;30CD //nekatakanahalfwidth;FF88 //newsheqelsign;20AA //nfsquare;338B //ngabengali;0999 //ngadeva;0919 //ngagujarati;0A99 //ngagurmukhi;0A19 //ngonguthai;0E07 //nhiragana;3093 //nhookleft;0272 //nhookretroflex;0273 //nieunacirclekorean;326F //nieunaparenkorean;320F //nieuncieuckorean;3135 //nieuncirclekorean;3261 //nieunhieuhkorean;3136 //nieunkorean;3134 //nieunpansioskorean;3168 //nieunparenkorean;3201 //nieunsioskorean;3167 //nieuntikeutkorean;3166 //nihiragana;306B //nikatakana;30CB //nikatakanahalfwidth;FF86 //nikhahitleftthai;F899 //nikhahitthai;0E4D //nine;0039 //ninearabic;0669 //ninebengali;09EF //ninecircle;2468 //ninecircleinversesansserif;2792 //ninedeva;096F //ninegujarati;0AEF //ninegurmukhi;0A6F //ninehackarabic;0669 //ninehangzhou;3029 //nineideographicparen;3228 //nineinferior;2089 //ninemonospace;FF19 //nineoldstyle;F739 //nineparen;247C //nineperiod;2490 //ninepersian;06F9 //nineroman;2178 //ninesuperior;2079 //nineteencircle;2472 //nineteenparen;2486 //nineteenperiod;249A //ninethai;0E59 //nj;01CC //njecyrillic;045A //nkatakana;30F3 //nkatakanahalfwidth;FF9D //nlegrightlong;019E //nlinebelow;1E49 //nmonospace;FF4E //nmsquare;339A //nnabengali;09A3 //nnadeva;0923 //nnagujarati;0AA3 //nnagurmukhi;0A23 //nnnadeva;0929 //nohiragana;306E //nokatakana;30CE //nokatakanahalfwidth;FF89 //nonbreakingspace;00A0 //nonenthai;0E13 //nonuthai;0E19 //noonarabic;0646 //noonfinalarabic;FEE6 //noonghunnaarabic;06BA //noonghunnafinalarabic;FB9F //noonhehinitialarabic;FEE7 FEEC //nooninitialarabic;FEE7 //noonjeeminitialarabic;FCD2 //noonjeemisolatedarabic;FC4B //noonmedialarabic;FEE8 //noonmeeminitialarabic;FCD5 //noonmeemisolatedarabic;FC4E //noonnoonfinalarabic;FC8D //notcontains;220C //notelement;2209 //notelementof;2209 //notequal;2260 //notgreater;226F //notgreaternorequal;2271 //notgreaternorless;2279 //notidentical;2262 //notless;226E //notlessnorequal;2270 //notparallel;2226 //notprecedes;2280 //notsubset;2284 //notsucceeds;2281 //notsuperset;2285 //nowarmenian;0576 //nparen;24A9 //nssquare;33B1 //nsuperior;207F //ntilde;00F1 //nu;03BD //nuhiragana;306C //nukatakana;30CC //nukatakanahalfwidth;FF87 //nuktabengali;09BC //nuktadeva;093C //nuktagujarati;0ABC //nuktagurmukhi;0A3C //numbersign;0023 //numbersignmonospace;FF03 //numbersignsmall;FE5F //numeralsigngreek;0374 //numeralsignlowergreek;0375 //numero;2116 //nun;05E0 //nundagesh;FB40 //nundageshhebrew;FB40 //nunhebrew;05E0 //nvsquare;33B5 //nwsquare;33BB //nyabengali;099E //nyadeva;091E //nyagujarati;0A9E //nyagurmukhi;0A1E //o;006F //oacute;00F3 //oangthai;0E2D //obarred;0275 //obarredcyrillic;04E9 //obarreddieresiscyrillic;04EB //obengali;0993 //obopomofo;311B //obreve;014F //ocandradeva;0911 //ocandragujarati;0A91 //ocandravowelsigndeva;0949 //ocandravowelsigngujarati;0AC9 //ocaron;01D2 //ocircle;24DE //ocircumflex;00F4 //ocircumflexacute;1ED1 //ocircumflexdotbelow;1ED9 //ocircumflexgrave;1ED3 //ocircumflexhookabove;1ED5 //ocircumflextilde;1ED7 //ocyrillic;043E //odblacute;0151 //odblgrave;020D //odeva;0913 //odieresis;00F6 //odieresiscyrillic;04E7 //odotbelow;1ECD //oe;0153 //oekorean;315A //ogonek;02DB //ogonekcmb;0328 //ograve;00F2 //ogujarati;0A93 //oharmenian;0585 //ohiragana;304A //ohookabove;1ECF //ohorn;01A1 //ohornacute;1EDB //ohorndotbelow;1EE3 //ohorngrave;1EDD //ohornhookabove;1EDF //ohorntilde;1EE1 //ohungarumlaut;0151 //oi;01A3 //oinvertedbreve;020F //okatakana;30AA //okatakanahalfwidth;FF75 //okorean;3157 //olehebrew;05AB //omacron;014D //omacronacute;1E53 //omacrongrave;1E51 //omdeva;0950 //omega;03C9 //omega1;03D6 //omegacyrillic;0461 //omegalatinclosed;0277 //omegaroundcyrillic;047B //omegatitlocyrillic;047D //omegatonos;03CE //omgujarati;0AD0 //omicron;03BF //omicrontonos;03CC //omonospace;FF4F //one;0031 //onearabic;0661 //onebengali;09E7 //onecircle;2460 //onecircleinversesansserif;278A //onedeva;0967 //onedotenleader;2024 //oneeighth;215B //onefitted;F6DC //onegujarati;0AE7 //onegurmukhi;0A67 //onehackarabic;0661 //onehalf;00BD //onehangzhou;3021 //oneideographicparen;3220 //oneinferior;2081 //onemonospace;FF11 //onenumeratorbengali;09F4 //oneoldstyle;F731 //oneparen;2474 //oneperiod;2488 //onepersian;06F1 //onequarter;00BC //oneroman;2170 //onesuperior;00B9 //onethai;0E51 //onethird;2153 //oogonek;01EB //oogonekmacron;01ED //oogurmukhi;0A13 //oomatragurmukhi;0A4B //oopen;0254 //oparen;24AA //openbullet;25E6 //option;2325 //ordfeminine;00AA //ordmasculine;00BA //orthogonal;221F //oshortdeva;0912 //oshortvowelsigndeva;094A //oslash;00F8 //oslashacute;01FF //osmallhiragana;3049 //osmallkatakana;30A9 //osmallkatakanahalfwidth;FF6B //ostrokeacute;01FF //osuperior;F6F0 //otcyrillic;047F //otilde;00F5 //otildeacute;1E4D //otildedieresis;1E4F //oubopomofo;3121 //overline;203E //overlinecenterline;FE4A //overlinecmb;0305 //overlinedashed;FE49 //overlinedblwavy;FE4C //overlinewavy;FE4B //overscore;00AF //ovowelsignbengali;09CB //ovowelsigndeva;094B //ovowelsigngujarati;0ACB //p;0070 //paampssquare;3380 //paasentosquare;332B //pabengali;09AA //pacute;1E55 //padeva;092A //pagedown;21DF //pageup;21DE //pagujarati;0AAA //pagurmukhi;0A2A //pahiragana;3071 //paiyannoithai;0E2F //pakatakana;30D1 //palatalizationcyrilliccmb;0484 //palochkacyrillic;04C0 //pansioskorean;317F //paragraph;00B6 //parallel;2225 //parenleft;0028 //parenleftaltonearabic;FD3E //parenleftbt;F8ED //parenleftex;F8EC //parenleftinferior;208D //parenleftmonospace;FF08 //parenleftsmall;FE59 //parenleftsuperior;207D //parenlefttp;F8EB //parenleftvertical;FE35 //parenright;0029 //parenrightaltonearabic;FD3F //parenrightbt;F8F8 //parenrightex;F8F7 //parenrightinferior;208E //parenrightmonospace;FF09 //parenrightsmall;FE5A //parenrightsuperior;207E //parenrighttp;F8F6 //parenrightvertical;FE36 //partialdiff;2202 //paseqhebrew;05C0 //pashtahebrew;0599 //pasquare;33A9 //patah;05B7 //patah11;05B7 //patah1d;05B7 //patah2a;05B7 //patahhebrew;05B7 //patahnarrowhebrew;05B7 //patahquarterhebrew;05B7 //patahwidehebrew;05B7 //pazerhebrew;05A1 //pbopomofo;3106 //pcircle;24DF //pdotaccent;1E57 //pe;05E4 //pecyrillic;043F //pedagesh;FB44 //pedageshhebrew;FB44 //peezisquare;333B //pefinaldageshhebrew;FB43 //peharabic;067E //peharmenian;057A //pehebrew;05E4 //pehfinalarabic;FB57 //pehinitialarabic;FB58 //pehiragana;307A //pehmedialarabic;FB59 //pekatakana;30DA //pemiddlehookcyrillic;04A7 //perafehebrew;FB4E //percent;0025 //percentarabic;066A //percentmonospace;FF05 //percentsmall;FE6A //period;002E //periodarmenian;0589 //periodcentered;00B7 //periodhalfwidth;FF61 //periodinferior;F6E7 //periodmonospace;FF0E //periodsmall;FE52 //periodsuperior;F6E8 //perispomenigreekcmb;0342 //perpendicular;22A5 //perthousand;2030 //peseta;20A7 //pfsquare;338A //phabengali;09AB //phadeva;092B //phagujarati;0AAB //phagurmukhi;0A2B //phi;03C6 //phi1;03D5 //phieuphacirclekorean;327A //phieuphaparenkorean;321A //phieuphcirclekorean;326C //phieuphkorean;314D //phieuphparenkorean;320C //philatin;0278 //phinthuthai;0E3A //phisymbolgreek;03D5 //phook;01A5 //phophanthai;0E1E //phophungthai;0E1C //phosamphaothai;0E20 //pi;03C0 //pieupacirclekorean;3273 //pieupaparenkorean;3213 //pieupcieuckorean;3176 //pieupcirclekorean;3265 //pieupkiyeokkorean;3172 //pieupkorean;3142 //pieupparenkorean;3205 //pieupsioskiyeokkorean;3174 //pieupsioskorean;3144 //pieupsiostikeutkorean;3175 //pieupthieuthkorean;3177 //pieuptikeutkorean;3173 //pihiragana;3074 //pikatakana;30D4 //pisymbolgreek;03D6 //piwrarmenian;0583 //plus;002B //plusbelowcmb;031F //pluscircle;2295 //plusminus;00B1 //plusmod;02D6 //plusmonospace;FF0B //plussmall;FE62 //plussuperior;207A //pmonospace;FF50 //pmsquare;33D8 //pohiragana;307D //pointingindexdownwhite;261F //pointingindexleftwhite;261C //pointingindexrightwhite;261E //pointingindexupwhite;261D //pokatakana;30DD //poplathai;0E1B //postalmark;3012 //postalmarkface;3020 //pparen;24AB //precedes;227A //prescription;211E //primemod;02B9 //primereversed;2035 //product;220F //projective;2305 //prolongedkana;30FC //propellor;2318 //propersubset;2282 //propersuperset;2283 //proportion;2237 //proportional;221D //psi;03C8 //psicyrillic;0471 //psilipneumatacyrilliccmb;0486 //pssquare;33B0 //puhiragana;3077 //pukatakana;30D7 //pvsquare;33B4 //pwsquare;33BA //q;0071 //qadeva;0958 //qadmahebrew;05A8 //qafarabic;0642 //qaffinalarabic;FED6 //qafinitialarabic;FED7 //qafmedialarabic;FED8 //qamats;05B8 //qamats10;05B8 //qamats1a;05B8 //qamats1c;05B8 //qamats27;05B8 //qamats29;05B8 //qamats33;05B8 //qamatsde;05B8 //qamatshebrew;05B8 //qamatsnarrowhebrew;05B8 //qamatsqatanhebrew;05B8 //qamatsqatannarrowhebrew;05B8 //qamatsqatanquarterhebrew;05B8 //qamatsqatanwidehebrew;05B8 //qamatsquarterhebrew;05B8 //qamatswidehebrew;05B8 //qarneyparahebrew;059F //qbopomofo;3111 //qcircle;24E0 //qhook;02A0 //qmonospace;FF51 //qof;05E7 //qofdagesh;FB47 //qofdageshhebrew;FB47 //qofhatafpatah;05E7 05B2 //qofhatafpatahhebrew;05E7 05B2 //qofhatafsegol;05E7 05B1 //qofhatafsegolhebrew;05E7 05B1 //qofhebrew;05E7 //qofhiriq;05E7 05B4 //qofhiriqhebrew;05E7 05B4 //qofholam;05E7 05B9 //qofholamhebrew;05E7 05B9 //qofpatah;05E7 05B7 //qofpatahhebrew;05E7 05B7 //qofqamats;05E7 05B8 //qofqamatshebrew;05E7 05B8 //qofqubuts;05E7 05BB //qofqubutshebrew;05E7 05BB //qofsegol;05E7 05B6 //qofsegolhebrew;05E7 05B6 //qofsheva;05E7 05B0 //qofshevahebrew;05E7 05B0 //qoftsere;05E7 05B5 //qoftserehebrew;05E7 05B5 //qparen;24AC //quarternote;2669 //qubuts;05BB //qubuts18;05BB //qubuts25;05BB //qubuts31;05BB //qubutshebrew;05BB //qubutsnarrowhebrew;05BB //qubutsquarterhebrew;05BB //qubutswidehebrew;05BB //question;003F //questionarabic;061F //questionarmenian;055E //questiondown;00BF //questiondownsmall;F7BF //questiongreek;037E //questionmonospace;FF1F //questionsmall;F73F //quotedbl;0022 //quotedblbase;201E //quotedblleft;201C //quotedblmonospace;FF02 //quotedblprime;301E //quotedblprimereversed;301D //quotedblright;201D //quoteleft;2018 //quoteleftreversed;201B //quotereversed;201B //quoteright;2019 //quoterightn;0149 //quotesinglbase;201A //quotesingle;0027 //quotesinglemonospace;FF07 //r;0072 //raarmenian;057C //rabengali;09B0 //racute;0155 //radeva;0930 //radical;221A //radicalex;F8E5 //radoverssquare;33AE //radoverssquaredsquare;33AF //radsquare;33AD //rafe;05BF //rafehebrew;05BF //ragujarati;0AB0 //ragurmukhi;0A30 //rahiragana;3089 //rakatakana;30E9 //rakatakanahalfwidth;FF97 //ralowerdiagonalbengali;09F1 //ramiddlediagonalbengali;09F0 //ramshorn;0264 //ratio;2236 //rbopomofo;3116 //rcaron;0159 //rcedilla;0157 //rcircle;24E1 //rcommaaccent;0157 //rdblgrave;0211 //rdotaccent;1E59 //rdotbelow;1E5B //rdotbelowmacron;1E5D //referencemark;203B //reflexsubset;2286 //reflexsuperset;2287 //registered;00AE //registersans;F8E8 //registerserif;F6DA //reharabic;0631 //reharmenian;0580 //rehfinalarabic;FEAE //rehiragana;308C //rehyehaleflamarabic;0631 FEF3 FE8E 0644 //rekatakana;30EC //rekatakanahalfwidth;FF9A //resh;05E8 //reshdageshhebrew;FB48 //reshhatafpatah;05E8 05B2 //reshhatafpatahhebrew;05E8 05B2 //reshhatafsegol;05E8 05B1 //reshhatafsegolhebrew;05E8 05B1 //reshhebrew;05E8 //reshhiriq;05E8 05B4 //reshhiriqhebrew;05E8 05B4 //reshholam;05E8 05B9 //reshholamhebrew;05E8 05B9 //reshpatah;05E8 05B7 //reshpatahhebrew;05E8 05B7 //reshqamats;05E8 05B8 //reshqamatshebrew;05E8 05B8 //reshqubuts;05E8 05BB //reshqubutshebrew;05E8 05BB //reshsegol;05E8 05B6 //reshsegolhebrew;05E8 05B6 //reshsheva;05E8 05B0 //reshshevahebrew;05E8 05B0 //reshtsere;05E8 05B5 //reshtserehebrew;05E8 05B5 //reversedtilde;223D //reviahebrew;0597 //reviamugrashhebrew;0597 //revlogicalnot;2310 //rfishhook;027E //rfishhookreversed;027F //rhabengali;09DD //rhadeva;095D //rho;03C1 //rhook;027D //rhookturned;027B //rhookturnedsuperior;02B5 //rhosymbolgreek;03F1 //rhotichookmod;02DE //rieulacirclekorean;3271 //rieulaparenkorean;3211 //rieulcirclekorean;3263 //rieulhieuhkorean;3140 //rieulkiyeokkorean;313A //rieulkiyeoksioskorean;3169 //rieulkorean;3139 //rieulmieumkorean;313B //rieulpansioskorean;316C //rieulparenkorean;3203 //rieulphieuphkorean;313F //rieulpieupkorean;313C //rieulpieupsioskorean;316B //rieulsioskorean;313D //rieulthieuthkorean;313E //rieultikeutkorean;316A //rieulyeorinhieuhkorean;316D //rightangle;221F //righttackbelowcmb;0319 //righttriangle;22BF //rihiragana;308A //rikatakana;30EA //rikatakanahalfwidth;FF98 //ring;02DA //ringbelowcmb;0325 //ringcmb;030A //ringhalfleft;02BF //ringhalfleftarmenian;0559 //ringhalfleftbelowcmb;031C //ringhalfleftcentered;02D3 //ringhalfright;02BE //ringhalfrightbelowcmb;0339 //ringhalfrightcentered;02D2 //rinvertedbreve;0213 //rittorusquare;3351 //rlinebelow;1E5F //rlongleg;027C //rlonglegturned;027A //rmonospace;FF52 //rohiragana;308D //rokatakana;30ED //rokatakanahalfwidth;FF9B //roruathai;0E23 //rparen;24AD //rrabengali;09DC //rradeva;0931 //rragurmukhi;0A5C //rreharabic;0691 //rrehfinalarabic;FB8D //rrvocalicbengali;09E0 //rrvocalicdeva;0960 //rrvocalicgujarati;0AE0 //rrvocalicvowelsignbengali;09C4 //rrvocalicvowelsigndeva;0944 //rrvocalicvowelsigngujarati;0AC4 //rsuperior;F6F1 //rtblock;2590 //rturned;0279 //rturnedsuperior;02B4 //ruhiragana;308B //rukatakana;30EB //rukatakanahalfwidth;FF99 //rupeemarkbengali;09F2 //rupeesignbengali;09F3 //rupiah;F6DD //ruthai;0E24 //rvocalicbengali;098B //rvocalicdeva;090B //rvocalicgujarati;0A8B //rvocalicvowelsignbengali;09C3 //rvocalicvowelsigndeva;0943 //rvocalicvowelsigngujarati;0AC3 //s;0073 //sabengali;09B8 //sacute;015B //sacutedotaccent;1E65 //sadarabic;0635 //sadeva;0938 //sadfinalarabic;FEBA //sadinitialarabic;FEBB //sadmedialarabic;FEBC //sagujarati;0AB8 //sagurmukhi;0A38 //sahiragana;3055 //sakatakana;30B5 //sakatakanahalfwidth;FF7B //sallallahoualayhewasallamarabic;FDFA //samekh;05E1 //samekhdagesh;FB41 //samekhdageshhebrew;FB41 //samekhhebrew;05E1 //saraaathai;0E32 //saraaethai;0E41 //saraaimaimalaithai;0E44 //saraaimaimuanthai;0E43 //saraamthai;0E33 //saraathai;0E30 //saraethai;0E40 //saraiileftthai;F886 //saraiithai;0E35 //saraileftthai;F885 //saraithai;0E34 //saraothai;0E42 //saraueeleftthai;F888 //saraueethai;0E37 //saraueleftthai;F887 //sarauethai;0E36 //sarauthai;0E38 //sarauuthai;0E39 //sbopomofo;3119 //scaron;0161 //scarondotaccent;1E67 //scedilla;015F //schwa;0259 //schwacyrillic;04D9 //schwadieresiscyrillic;04DB //schwahook;025A //scircle;24E2 //scircumflex;015D //scommaaccent;0219 //sdotaccent;1E61 //sdotbelow;1E63 //sdotbelowdotaccent;1E69 //seagullbelowcmb;033C //second;2033 //secondtonechinese;02CA //section;00A7 //seenarabic;0633 //seenfinalarabic;FEB2 //seeninitialarabic;FEB3 //seenmedialarabic;FEB4 //segol;05B6 //segol13;05B6 //segol1f;05B6 //segol2c;05B6 //segolhebrew;05B6 //segolnarrowhebrew;05B6 //segolquarterhebrew;05B6 //segoltahebrew;0592 //segolwidehebrew;05B6 //seharmenian;057D //sehiragana;305B //sekatakana;30BB //sekatakanahalfwidth;FF7E //semicolon;003B //semicolonarabic;061B //semicolonmonospace;FF1B //semicolonsmall;FE54 //semivoicedmarkkana;309C //semivoicedmarkkanahalfwidth;FF9F //sentisquare;3322 //sentosquare;3323 //seven;0037 //sevenarabic;0667 //sevenbengali;09ED //sevencircle;2466 //sevencircleinversesansserif;2790 //sevendeva;096D //seveneighths;215E //sevengujarati;0AED //sevengurmukhi;0A6D //sevenhackarabic;0667 //sevenhangzhou;3027 //sevenideographicparen;3226 //seveninferior;2087 //sevenmonospace;FF17 //sevenoldstyle;F737 //sevenparen;247A //sevenperiod;248E //sevenpersian;06F7 //sevenroman;2176 //sevensuperior;2077 //seventeencircle;2470 //seventeenparen;2484 //seventeenperiod;2498 //seventhai;0E57 //sfthyphen;00AD //shaarmenian;0577 //shabengali;09B6 //shacyrillic;0448 //shaddaarabic;0651 //shaddadammaarabic;FC61 //shaddadammatanarabic;FC5E //shaddafathaarabic;FC60 //shaddafathatanarabic;0651 064B //shaddakasraarabic;FC62 //shaddakasratanarabic;FC5F //shade;2592 //shadedark;2593 //shadelight;2591 //shademedium;2592 //shadeva;0936 //shagujarati;0AB6 //shagurmukhi;0A36 //shalshelethebrew;0593 //shbopomofo;3115 //shchacyrillic;0449 //sheenarabic;0634 //sheenfinalarabic;FEB6 //sheeninitialarabic;FEB7 //sheenmedialarabic;FEB8 //sheicoptic;03E3 //sheqel;20AA //sheqelhebrew;20AA //sheva;05B0 //sheva115;05B0 //sheva15;05B0 //sheva22;05B0 //sheva2e;05B0 //shevahebrew;05B0 //shevanarrowhebrew;05B0 //shevaquarterhebrew;05B0 //shevawidehebrew;05B0 //shhacyrillic;04BB //shimacoptic;03ED //shin;05E9 //shindagesh;FB49 //shindageshhebrew;FB49 //shindageshshindot;FB2C //shindageshshindothebrew;FB2C //shindageshsindot;FB2D //shindageshsindothebrew;FB2D //shindothebrew;05C1 //shinhebrew;05E9 //shinshindot;FB2A //shinshindothebrew;FB2A //shinsindot;FB2B //shinsindothebrew;FB2B //shook;0282 //sigma;03C3 //sigma1;03C2 //sigmafinal;03C2 //sigmalunatesymbolgreek;03F2 //sihiragana;3057 //sikatakana;30B7 //sikatakanahalfwidth;FF7C //siluqhebrew;05BD //siluqlefthebrew;05BD //similar;223C //sindothebrew;05C2 //siosacirclekorean;3274 //siosaparenkorean;3214 //sioscieuckorean;317E //sioscirclekorean;3266 //sioskiyeokkorean;317A //sioskorean;3145 //siosnieunkorean;317B //siosparenkorean;3206 //siospieupkorean;317D //siostikeutkorean;317C //six;0036 //sixarabic;0666 //sixbengali;09EC //sixcircle;2465 //sixcircleinversesansserif;278F //sixdeva;096C //sixgujarati;0AEC //sixgurmukhi;0A6C //sixhackarabic;0666 //sixhangzhou;3026 //sixideographicparen;3225 //sixinferior;2086 //sixmonospace;FF16 //sixoldstyle;F736 //sixparen;2479 //sixperiod;248D //sixpersian;06F6 //sixroman;2175 //sixsuperior;2076 //sixteencircle;246F //sixteencurrencydenominatorbengali;09F9 //sixteenparen;2483 //sixteenperiod;2497 //sixthai;0E56 //slash;002F //slashmonospace;FF0F //slong;017F //slongdotaccent;1E9B //smileface;263A //smonospace;FF53 //sofpasuqhebrew;05C3 //softhyphen;00AD //softsigncyrillic;044C //sohiragana;305D //sokatakana;30BD //sokatakanahalfwidth;FF7F //soliduslongoverlaycmb;0338 //solidusshortoverlaycmb;0337 //sorusithai;0E29 //sosalathai;0E28 //sosothai;0E0B //sosuathai;0E2A //space;0020 //spacehackarabic;0020 //spade;2660 //spadesuitblack;2660 //spadesuitwhite;2664 //sparen;24AE //squarebelowcmb;033B //squarecc;33C4 //squarecm;339D //squarediagonalcrosshatchfill;25A9 //squarehorizontalfill;25A4 //squarekg;338F //squarekm;339E //squarekmcapital;33CE //squareln;33D1 //squarelog;33D2 //squaremg;338E //squaremil;33D5 //squaremm;339C //squaremsquared;33A1 //squareorthogonalcrosshatchfill;25A6 //squareupperlefttolowerrightfill;25A7 //squareupperrighttolowerleftfill;25A8 //squareverticalfill;25A5 //squarewhitewithsmallblack;25A3 //srsquare;33DB //ssabengali;09B7 //ssadeva;0937 //ssagujarati;0AB7 //ssangcieuckorean;3149 //ssanghieuhkorean;3185 //ssangieungkorean;3180 //ssangkiyeokkorean;3132 //ssangnieunkorean;3165 //ssangpieupkorean;3143 //ssangsioskorean;3146 //ssangtikeutkorean;3138 //ssuperior;F6F2 //sterling;00A3 //sterlingmonospace;FFE1 //strokelongoverlaycmb;0336 //strokeshortoverlaycmb;0335 //subset;2282 //subsetnotequal;228A //subsetorequal;2286 //succeeds;227B //suchthat;220B //suhiragana;3059 //sukatakana;30B9 //sukatakanahalfwidth;FF7D //sukunarabic;0652 //summation;2211 //sun;263C //superset;2283 //supersetnotequal;228B //supersetorequal;2287 //svsquare;33DC //syouwaerasquare;337C //t;0074 //tabengali;09A4 //tackdown;22A4 //tackleft;22A3 //tadeva;0924 //tagujarati;0AA4 //tagurmukhi;0A24 //taharabic;0637 //tahfinalarabic;FEC2 //tahinitialarabic;FEC3 //tahiragana;305F //tahmedialarabic;FEC4 //taisyouerasquare;337D //takatakana;30BF //takatakanahalfwidth;FF80 //tatweelarabic;0640 //tau;03C4 //tav;05EA //tavdages;FB4A //tavdagesh;FB4A //tavdageshhebrew;FB4A //tavhebrew;05EA //tbar;0167 //tbopomofo;310A //tcaron;0165 //tccurl;02A8 //tcedilla;0163 //tcheharabic;0686 //tchehfinalarabic;FB7B //tchehinitialarabic;FB7C //tchehmedialarabic;FB7D //tchehmeeminitialarabic;FB7C FEE4 //tcircle;24E3 //tcircumflexbelow;1E71 //tcommaaccent;0163 //tdieresis;1E97 //tdotaccent;1E6B //tdotbelow;1E6D //tecyrillic;0442 //tedescendercyrillic;04AD //teharabic;062A //tehfinalarabic;FE96 //tehhahinitialarabic;FCA2 //tehhahisolatedarabic;FC0C //tehinitialarabic;FE97 //tehiragana;3066 //tehjeeminitialarabic;FCA1 //tehjeemisolatedarabic;FC0B //tehmarbutaarabic;0629 //tehmarbutafinalarabic;FE94 //tehmedialarabic;FE98 //tehmeeminitialarabic;FCA4 //tehmeemisolatedarabic;FC0E //tehnoonfinalarabic;FC73 //tekatakana;30C6 //tekatakanahalfwidth;FF83 //telephone;2121 //telephoneblack;260E //telishagedolahebrew;05A0 //telishaqetanahebrew;05A9 //tencircle;2469 //tenideographicparen;3229 //tenparen;247D //tenperiod;2491 //tenroman;2179 //tesh;02A7 //tet;05D8 //tetdagesh;FB38 //tetdageshhebrew;FB38 //tethebrew;05D8 //tetsecyrillic;04B5 //tevirhebrew;059B //tevirlefthebrew;059B //thabengali;09A5 //thadeva;0925 //thagujarati;0AA5 //thagurmukhi;0A25 //thalarabic;0630 //thalfinalarabic;FEAC //thanthakhatlowleftthai;F898 //thanthakhatlowrightthai;F897 //thanthakhatthai;0E4C //thanthakhatupperleftthai;F896 //theharabic;062B //thehfinalarabic;FE9A //thehinitialarabic;FE9B //thehmedialarabic;FE9C //thereexists;2203 //therefore;2234 //theta;03B8 //theta1;03D1 //thetasymbolgreek;03D1 //thieuthacirclekorean;3279 //thieuthaparenkorean;3219 //thieuthcirclekorean;326B //thieuthkorean;314C //thieuthparenkorean;320B //thirteencircle;246C //thirteenparen;2480 //thirteenperiod;2494 //thonangmonthothai;0E11 //thook;01AD //thophuthaothai;0E12 //thorn;00FE //thothahanthai;0E17 //thothanthai;0E10 //thothongthai;0E18 //thothungthai;0E16 //thousandcyrillic;0482 //thousandsseparatorarabic;066C //thousandsseparatorpersian;066C //three;0033 //threearabic;0663 //threebengali;09E9 //threecircle;2462 //threecircleinversesansserif;278C //threedeva;0969 //threeeighths;215C //threegujarati;0AE9 //threegurmukhi;0A69 //threehackarabic;0663 //threehangzhou;3023 //threeideographicparen;3222 //threeinferior;2083 //threemonospace;FF13 //threenumeratorbengali;09F6 //threeoldstyle;F733 //threeparen;2476 //threeperiod;248A //threepersian;06F3 //threequarters;00BE //threequartersemdash;F6DE //threeroman;2172 //threesuperior;00B3 //threethai;0E53 //thzsquare;3394 //tihiragana;3061 //tikatakana;30C1 //tikatakanahalfwidth;FF81 //tikeutacirclekorean;3270 //tikeutaparenkorean;3210 //tikeutcirclekorean;3262 //tikeutkorean;3137 //tikeutparenkorean;3202 //tilde;02DC //tildebelowcmb;0330 //tildecmb;0303 //tildecomb;0303 //tildedoublecmb;0360 //tildeoperator;223C //tildeoverlaycmb;0334 //tildeverticalcmb;033E //timescircle;2297 //tipehahebrew;0596 //tipehalefthebrew;0596 //tippigurmukhi;0A70 //titlocyrilliccmb;0483 //tiwnarmenian;057F //tlinebelow;1E6F //tmonospace;FF54 //toarmenian;0569 //tohiragana;3068 //tokatakana;30C8 //tokatakanahalfwidth;FF84 //tonebarextrahighmod;02E5 //tonebarextralowmod;02E9 //tonebarhighmod;02E6 //tonebarlowmod;02E8 //tonebarmidmod;02E7 //tonefive;01BD //tonesix;0185 //tonetwo;01A8 //tonos;0384 //tonsquare;3327 //topatakthai;0E0F //tortoiseshellbracketleft;3014 //tortoiseshellbracketleftsmall;FE5D //tortoiseshellbracketleftvertical;FE39 //tortoiseshellbracketright;3015 //tortoiseshellbracketrightsmall;FE5E //tortoiseshellbracketrightvertical;FE3A //totaothai;0E15 //tpalatalhook;01AB //tparen;24AF //trademark;2122 //trademarksans;F8EA //trademarkserif;F6DB //tretroflexhook;0288 //triagdn;25BC //triaglf;25C4 //triagrt;25BA //triagup;25B2 //ts;02A6 //tsadi;05E6 //tsadidagesh;FB46 //tsadidageshhebrew;FB46 //tsadihebrew;05E6 //tsecyrillic;0446 //tsere;05B5 //tsere12;05B5 //tsere1e;05B5 //tsere2b;05B5 //tserehebrew;05B5 //tserenarrowhebrew;05B5 //tserequarterhebrew;05B5 //tserewidehebrew;05B5 //tshecyrillic;045B //tsuperior;F6F3 //ttabengali;099F //ttadeva;091F //ttagujarati;0A9F //ttagurmukhi;0A1F //tteharabic;0679 //ttehfinalarabic;FB67 //ttehinitialarabic;FB68 //ttehmedialarabic;FB69 //tthabengali;09A0 //tthadeva;0920 //tthagujarati;0AA0 //tthagurmukhi;0A20 //tturned;0287 //tuhiragana;3064 //tukatakana;30C4 //tukatakanahalfwidth;FF82 //tusmallhiragana;3063 //tusmallkatakana;30C3 //tusmallkatakanahalfwidth;FF6F //twelvecircle;246B //twelveparen;247F //twelveperiod;2493 //twelveroman;217B //twentycircle;2473 //twentyhangzhou;5344 //twentyparen;2487 //twentyperiod;249B //two;0032 //twoarabic;0662 //twobengali;09E8 //twocircle;2461 //twocircleinversesansserif;278B //twodeva;0968 //twodotenleader;2025 //twodotleader;2025 //twodotleadervertical;FE30 //twogujarati;0AE8 //twogurmukhi;0A68 //twohackarabic;0662 //twohangzhou;3022 //twoideographicparen;3221 //twoinferior;2082 //twomonospace;FF12 //twonumeratorbengali;09F5 //twooldstyle;F732 //twoparen;2475 //twoperiod;2489 //twopersian;06F2 //tworoman;2171 //twostroke;01BB //twosuperior;00B2 //twothai;0E52 //twothirds;2154 //u;0075 //uacute;00FA //ubar;0289 //ubengali;0989 //ubopomofo;3128 //ubreve;016D //ucaron;01D4 //ucircle;24E4 //ucircumflex;00FB //ucircumflexbelow;1E77 //ucyrillic;0443 //udattadeva;0951 //udblacute;0171 //udblgrave;0215 //udeva;0909 //udieresis;00FC //udieresisacute;01D8 //udieresisbelow;1E73 //udieresiscaron;01DA //udieresiscyrillic;04F1 //udieresisgrave;01DC //udieresismacron;01D6 //udotbelow;1EE5 //ugrave;00F9 //ugujarati;0A89 //ugurmukhi;0A09 //uhiragana;3046 //uhookabove;1EE7 //uhorn;01B0 //uhornacute;1EE9 //uhorndotbelow;1EF1 //uhorngrave;1EEB //uhornhookabove;1EED //uhorntilde;1EEF //uhungarumlaut;0171 //uhungarumlautcyrillic;04F3 //uinvertedbreve;0217 //ukatakana;30A6 //ukatakanahalfwidth;FF73 //ukcyrillic;0479 //ukorean;315C //umacron;016B //umacroncyrillic;04EF //umacrondieresis;1E7B //umatragurmukhi;0A41 //umonospace;FF55 //underscore;005F //underscoredbl;2017 //underscoremonospace;FF3F //underscorevertical;FE33 //underscorewavy;FE4F //union;222A //universal;2200 //uogonek;0173 //uparen;24B0 //upblock;2580 //upperdothebrew;05C4 //upsilon;03C5 //upsilondieresis;03CB //upsilondieresistonos;03B0 //upsilonlatin;028A //upsilontonos;03CD //uptackbelowcmb;031D //uptackmod;02D4 //uragurmukhi;0A73 //uring;016F //ushortcyrillic;045E //usmallhiragana;3045 //usmallkatakana;30A5 //usmallkatakanahalfwidth;FF69 //ustraightcyrillic;04AF //ustraightstrokecyrillic;04B1 //utilde;0169 //utildeacute;1E79 //utildebelow;1E75 //uubengali;098A //uudeva;090A //uugujarati;0A8A //uugurmukhi;0A0A //uumatragurmukhi;0A42 //uuvowelsignbengali;09C2 //uuvowelsigndeva;0942 //uuvowelsigngujarati;0AC2 //uvowelsignbengali;09C1 //uvowelsigndeva;0941 //uvowelsigngujarati;0AC1 //v;0076 //vadeva;0935 //vagujarati;0AB5 //vagurmukhi;0A35 //vakatakana;30F7 //vav;05D5 //vavdagesh;FB35 //vavdagesh65;FB35 //vavdageshhebrew;FB35 //vavhebrew;05D5 //vavholam;FB4B //vavholamhebrew;FB4B //vavvavhebrew;05F0 //vavyodhebrew;05F1 //vcircle;24E5 //vdotbelow;1E7F //vecyrillic;0432 //veharabic;06A4 //vehfinalarabic;FB6B //vehinitialarabic;FB6C //vehmedialarabic;FB6D //vekatakana;30F9 //venus;2640 //verticalbar;007C //verticallineabovecmb;030D //verticallinebelowcmb;0329 //verticallinelowmod;02CC //verticallinemod;02C8 //vewarmenian;057E //vhook;028B //vikatakana;30F8 //viramabengali;09CD //viramadeva;094D //viramagujarati;0ACD //visargabengali;0983 //visargadeva;0903 //visargagujarati;0A83 //vmonospace;FF56 //voarmenian;0578 //voicediterationhiragana;309E //voicediterationkatakana;30FE //voicedmarkkana;309B //voicedmarkkanahalfwidth;FF9E //vokatakana;30FA //vparen;24B1 //vtilde;1E7D //vturned;028C //vuhiragana;3094 //vukatakana;30F4 //w;0077 //wacute;1E83 //waekorean;3159 //wahiragana;308F //wakatakana;30EF //wakatakanahalfwidth;FF9C //wakorean;3158 //wasmallhiragana;308E //wasmallkatakana;30EE //wattosquare;3357 //wavedash;301C //wavyunderscorevertical;FE34 //wawarabic;0648 //wawfinalarabic;FEEE //wawhamzaabovearabic;0624 //wawhamzaabovefinalarabic;FE86 //wbsquare;33DD //wcircle;24E6 //wcircumflex;0175 //wdieresis;1E85 //wdotaccent;1E87 //wdotbelow;1E89 //wehiragana;3091 //weierstrass;2118 //wekatakana;30F1 //wekorean;315E //weokorean;315D //wgrave;1E81 //whitebullet;25E6 //whitecircle;25CB //whitecircleinverse;25D9 //whitecornerbracketleft;300E //whitecornerbracketleftvertical;FE43 //whitecornerbracketright;300F //whitecornerbracketrightvertical;FE44 //whitediamond;25C7 //whitediamondcontainingblacksmalldiamond;25C8 //whitedownpointingsmalltriangle;25BF //whitedownpointingtriangle;25BD //whiteleftpointingsmalltriangle;25C3 //whiteleftpointingtriangle;25C1 //whitelenticularbracketleft;3016 //whitelenticularbracketright;3017 //whiterightpointingsmalltriangle;25B9 //whiterightpointingtriangle;25B7 //whitesmallsquare;25AB //whitesmilingface;263A //whitesquare;25A1 //whitestar;2606 //whitetelephone;260F //whitetortoiseshellbracketleft;3018 //whitetortoiseshellbracketright;3019 //whiteuppointingsmalltriangle;25B5 //whiteuppointingtriangle;25B3 //wihiragana;3090 //wikatakana;30F0 //wikorean;315F //wmonospace;FF57 //wohiragana;3092 //wokatakana;30F2 //wokatakanahalfwidth;FF66 //won;20A9 //wonmonospace;FFE6 //wowaenthai;0E27 //wparen;24B2 //wring;1E98 //wsuperior;02B7 //wturned;028D //wynn;01BF //x;0078 //xabovecmb;033D //xbopomofo;3112 //xcircle;24E7 //xdieresis;1E8D //xdotaccent;1E8B //xeharmenian;056D //xi;03BE //xmonospace;FF58 //xparen;24B3 //xsuperior;02E3 //y;0079 //yaadosquare;334E //yabengali;09AF //yacute;00FD //yadeva;092F //yaekorean;3152 //yagujarati;0AAF //yagurmukhi;0A2F //yahiragana;3084 //yakatakana;30E4 //yakatakanahalfwidth;FF94 //yakorean;3151 //yamakkanthai;0E4E //yasmallhiragana;3083 //yasmallkatakana;30E3 //yasmallkatakanahalfwidth;FF6C //yatcyrillic;0463 //ycircle;24E8 //ycircumflex;0177 //ydieresis;00FF //ydotaccent;1E8F //ydotbelow;1EF5 //yeharabic;064A //yehbarreearabic;06D2 //yehbarreefinalarabic;FBAF //yehfinalarabic;FEF2 //yehhamzaabovearabic;0626 //yehhamzaabovefinalarabic;FE8A //yehhamzaaboveinitialarabic;FE8B //yehhamzaabovemedialarabic;FE8C //yehinitialarabic;FEF3 //yehmedialarabic;FEF4 //yehmeeminitialarabic;FCDD //yehmeemisolatedarabic;FC58 //yehnoonfinalarabic;FC94 //yehthreedotsbelowarabic;06D1 //yekorean;3156 //yen;00A5 //yenmonospace;FFE5 //yeokorean;3155 //yeorinhieuhkorean;3186 //yerahbenyomohebrew;05AA //yerahbenyomolefthebrew;05AA //yericyrillic;044B //yerudieresiscyrillic;04F9 //yesieungkorean;3181 //yesieungpansioskorean;3183 //yesieungsioskorean;3182 //yetivhebrew;059A //ygrave;1EF3 //yhook;01B4 //yhookabove;1EF7 //yiarmenian;0575 //yicyrillic;0457 //yikorean;3162 //yinyang;262F //yiwnarmenian;0582 //ymonospace;FF59 //yod;05D9 //yoddagesh;FB39 //yoddageshhebrew;FB39 //yodhebrew;05D9 //yodyodhebrew;05F2 //yodyodpatahhebrew;FB1F //yohiragana;3088 //yoikorean;3189 //yokatakana;30E8 //yokatakanahalfwidth;FF96 //yokorean;315B //yosmallhiragana;3087 //yosmallkatakana;30E7 //yosmallkatakanahalfwidth;FF6E //yotgreek;03F3 //yoyaekorean;3188 //yoyakorean;3187 //yoyakthai;0E22 //yoyingthai;0E0D //yparen;24B4 //ypogegrammeni;037A //ypogegrammenigreekcmb;0345 //yr;01A6 //yring;1E99 //ysuperior;02B8 //ytilde;1EF9 //yturned;028E //yuhiragana;3086 //yuikorean;318C //yukatakana;30E6 //yukatakanahalfwidth;FF95 //yukorean;3160 //yusbigcyrillic;046B //yusbigiotifiedcyrillic;046D //yuslittlecyrillic;0467 //yuslittleiotifiedcyrillic;0469 //yusmallhiragana;3085 //yusmallkatakana;30E5 //yusmallkatakanahalfwidth;FF6D //yuyekorean;318B //yuyeokorean;318A //yyabengali;09DF //yyadeva;095F //z;007A //zaarmenian;0566 //zacute;017A //zadeva;095B //zagurmukhi;0A5B //zaharabic;0638 //zahfinalarabic;FEC6 //zahinitialarabic;FEC7 //zahiragana;3056 //zahmedialarabic;FEC8 //zainarabic;0632 //zainfinalarabic;FEB0 //zakatakana;30B6 //zaqefgadolhebrew;0595 //zaqefqatanhebrew;0594 //zarqahebrew;0598 //zayin;05D6 //zayindagesh;FB36 //zayindageshhebrew;FB36 //zayinhebrew;05D6 //zbopomofo;3117 //zcaron;017E //zcircle;24E9 //zcircumflex;1E91 //zcurl;0291 //zdot;017C //zdotaccent;017C //zdotbelow;1E93 //zecyrillic;0437 //zedescendercyrillic;0499 //zedieresiscyrillic;04DF //zehiragana;305C //zekatakana;30BC //zero;0030 //zeroarabic;0660 //zerobengali;09E6 //zerodeva;0966 //zerogujarati;0AE6 //zerogurmukhi;0A66 //zerohackarabic;0660 //zeroinferior;2080 //zeromonospace;FF10 //zerooldstyle;F730 //zeropersian;06F0 //zerosuperior;2070 //zerothai;0E50 //zerowidthjoiner;FEFF //zerowidthnonjoiner;200C //zerowidthspace;200B //zeta;03B6 //zhbopomofo;3113 //zhearmenian;056A //zhebrevecyrillic;04C2 //zhecyrillic;0436 //zhedescendercyrillic;0497 //zhedieresiscyrillic;04DD //zihiragana;3058 //zikatakana;30B8 //zinorhebrew;05AE //zlinebelow;1E95 //zmonospace;FF5A //zohiragana;305E //zokatakana;30BE //zparen;24B5 //zretroflexhook;0290 //zstroke;01B6 //zuhiragana;305A //zukatakana;30BA } } #endifpdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts/CMapInfo.cs0000644000175000001440000001115211435766646022170 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Text; using System.Collections; using System.Collections.Generic; using PdfSharp.Fonts.OpenType; using PdfSharp.Pdf.Internal; namespace PdfSharp.Fonts { /// /// Helper class that determines the characters used in a particular font. /// internal class CMapInfo { public CMapInfo(OpenTypeDescriptor descriptor) { Debug.Assert(descriptor != null); this.descriptor = descriptor; } internal OpenTypeDescriptor descriptor; /// /// Adds the characters of the specified string to the hashtable. /// public void AddChars(string text) { if (text != null) { bool symbol = this.descriptor.fontData.cmap.symbol; int length = text.Length; for (int idx = 0; idx < length; idx++) { char ch = text[idx]; if (!CharacterToGlyphIndex.ContainsKey(ch)) { int glyphIndex = 0; if (this.descriptor != null) { if (symbol) { glyphIndex = ch + (descriptor.fontData.os2.usFirstCharIndex & 0xFF00); // @@@ glyphIndex = descriptor.CharCodeToGlyphIndex((char)glyphIndex); } else glyphIndex = descriptor.CharCodeToGlyphIndex(ch); } CharacterToGlyphIndex.Add(ch, glyphIndex); //GlyphIndices.Add(glyphIndex, null); GlyphIndices[glyphIndex] = null; this.MinChar = (char)Math.Min(this.MinChar, ch); this.MaxChar = (char)Math.Max(this.MaxChar, ch); } } } } /// /// Adds the glyphIndices to the hashtable. /// public void AddGlyphIndices(string glyphIndices) { if (glyphIndices != null) { int length = glyphIndices.Length; for (int idx = 0; idx < length; idx++) { int glyphIndex = glyphIndices[idx]; GlyphIndices[glyphIndex] = null; } } } /// /// Adds a ANSI characters. /// internal void AddAnsiChars() { byte[] ansi = new byte[256 - 32]; for (int idx = 0; idx < 256 - 32; idx++) ansi[idx] = (byte)(idx + 32); string text = PdfEncoders.WinAnsiEncoding.GetString(ansi, 0, ansi.Length); // AGHACK AddChars(text); } internal bool Contains(char ch) { return CharacterToGlyphIndex.ContainsKey(ch); } public char[] Chars { get { char[] chars = new char[CharacterToGlyphIndex.Count]; CharacterToGlyphIndex.Keys.CopyTo(chars, 0); Array.Sort(chars); return chars; } } public int[] GetGlyphIndices() { int[] indices = new int[GlyphIndices.Count]; GlyphIndices.Keys.CopyTo(indices, 0); Array.Sort(indices); return indices; } public char MinChar = Char.MaxValue; public char MaxChar = Char.MinValue; public Dictionary CharacterToGlyphIndex = new Dictionary(); public Dictionary GlyphIndices = new Dictionary(); } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp/0000777000175000001440000000000011533760020017074 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp/enums/0000777000175000001440000000000011533760020020223 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp/enums/PSMsgID.cs0000644000175000001440000000465611435766646022014 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp { /// /// Represents IDs for error and diagnostic messages generated by PDFsharp. /// enum PSMsgID { // ----- General Messages --------------------------------------------------------------------- /// /// PSMsgID. /// SampleMessage1, /// /// PSMsgID. /// SampleMessage2, // ----- XGraphics Messages ------------------------------------------------------------------- // ----- PDF Messages ------------------------------------------------------------------------- /// /// PSMsgID. /// NameMustStartWithSlash, /// /// PSMsgID. /// UserOrOwnerPasswordRequired, // ----- PdfParser Messages ------------------------------------------------------------------- /// /// PSMsgID. /// UnexpectedToken, /// /// PSMsgID. /// UnknownEncryption, } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp/enums/PageOrientation.cs0000644000175000001440000000374211435766646023671 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp { /// /// Base namespace of PDFsharp. Most classes are implemented in nested namespaces like e. g. PdfSharp.Pdf. /// /// [System.Runtime.CompilerServices.CompilerGenerated] internal class NamespaceDoc { } /// /// Specifies the orientation of a page. /// public enum PageOrientation { /// /// The default page orientation. /// Portrait, /// /// The width and height of the page are reversed. /// Landscape, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp/enums/PageSize.cs0000644000175000001440000002056611435766646022313 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp { /// /// Identifies the most popular predefined page sizes. /// public enum PageSize { /// /// The width or height of the page are set manually and override the PageSize property. /// Undefined = 0, // ISO formats // see http://www.engineeringtoolbox.com/drawings-paper-sheets-sizes-25_349.html /// /// Identifies a paper sheet size of 841 mm times 1189 mm or 33.11 inch times 46.81 inch. /// A0 = 1, /// /// Identifies a paper sheet size of 594 mm times 841 mm or 23.39 inch times 33.1 inch. /// A1 = 2, /// /// Identifies a paper sheet size of 420 mm times 594 mm or 16.54 inch times 23.29 inch. /// A2 = 3, /// /// Identifies a paper sheet size of 297 mm times 420 mm or 11.69 inch times 16.54 inch. /// A3 = 4, /// /// Identifies a paper sheet size of 210 mm times 297 mm or 8.27 inch times 11.69 inch. /// A4 = 5, /// /// Identifies a paper sheet size of 148 mm times 210 mm or 5.83 inch times 8.27 inch. /// A5 = 6, /// /// Identifies a paper sheet size of 860 mm times 1220 mm. /// RA0 = 7, /// /// Identifies a paper sheet size of 610 mm times 860 mm. /// RA1 = 8, /// /// Identifies a paper sheet size of 430 mm times 610 mm. /// RA2 = 9, /// /// Identifies a paper sheet size of 305 mm times 430 mm. /// RA3 = 10, /// /// Identifies a paper sheet size of 215 mm times 305 mm. /// RA4 = 11, /// /// Identifies a paper sheet size of 153 mm times 215 mm. /// RA5 = 12, /// /// Identifies a paper sheet size of 1000 mm times 1414 mm or 39.37 inch times 55.67 inch. /// B0 = 13, /// /// Identifies a paper sheet size of 707 mm times 1000 mm or 27.83 inch times 39.37 inch. /// B1 = 14, /// /// Identifies a paper sheet size of 500 mm times 707 mm or 19.68 inch times 27.83 inch. /// B2 = 15, /// /// Identifies a paper sheet size of 353 mm times 500 mm or 13.90 inch times 19.68 inch. /// B3 = 16, /// /// Identifies a paper sheet size of 250 mm times 353 mm or 9.84 inch times 13.90 inch. /// B4 = 17, /// /// Identifies a paper sheet size of 176 mm times 250 mm or 6.93 inch times 9.84 inch. /// B5 = 18, #if false /// /// Identifies a paper sheet size of 917 mm times 1297 mm or 36.00 inch times 51.20 inch. /// C0 = 19, /// /// Identifies a paper sheet size of 648 mm times 917 mm or 25.60 inch times 36.00 inch. /// C1 = 20, /// /// Identifies a paper sheet size of 458 mm times 648 mm or 18.00 inch times 25.60 inch. /// C2 = 21, /// /// Identifies a paper sheet size of 324 mm times 458 mm or 12.80 inch times 18.00 inch. /// C3 = 22, /// /// Identifies a paper sheet size of 229 mm times 324 mm or 9.00 inch times 12.80 inch. /// C4 = 23, /// /// Identifies a paper sheet size of 162 mm times 229 mm or 6.40 inch times 9.0 inch. /// C5 = 24, #endif // Current U.S. loose paper sizes // see http://www.reference.com/browse/wiki/Paper_size /// /// Identifies a paper sheet size of 10 inch times 8 inch or 254 mm times 203 mm. /// Quarto = 100, /// /// Identifies a paper sheet size of 13 inch times 8 inch or 330 mm times 203 mm. /// Foolscap = 101, /// /// Identifies a paper sheet size of 10.5 inch times 7.25 inch or 267 mm times 184 mm. /// Executive = 102, /// /// Identifies a paper sheet size of 10.5 inch times 8 inch 267 mm times 203 mm. /// GovernmentLetter = 103, /// /// Identifies a paper sheet size of 11 inch times 8.5 inch 279 mm times 216 mm. /// Letter = 104, /// /// Identifies a paper sheet size of 14 inch times 8.5 inch 356 mm times 216 mm. /// Legal = 105, /// /// Identifies a paper sheet size of 17 inch times 11 inch or 432 mm times 279 mm. /// Ledger = 106, /// /// Identifies a paper sheet size of 17 inch times 11 inch or 432 mm times 279 mm. /// Tabloid = 107, /// /// Identifies a paper sheet size of 19.25 inch times 15.5 inch 489 mm times 394 mm. /// Post = 108, /// /// 20 Identifies a paper sheet size of 20 inch times 15 inch or 508 mm times 381 mm. /// Crown = 109, /// /// Identifies a paper sheet size of 21 inch times 16.5 inch 533 mm times 419 mm. /// LargePost = 110, /// /// Identifies a paper sheet size of 22.5 inch times 17.5 inch 572 mm times 445 mm. /// Demy = 111, /// /// Identifies a paper sheet size of 23 inch times 18 inch or 584 mm times 457 mm. /// Medium = 112, /// /// Identifies a paper sheet size of 25 inch times 20 inch or 635 mm times 508 mm. /// Royal = 113, /// /// Identifies a paper sheet size of 28 inch times 23 inch or 711 mm times 584 mm. /// Elephant = 114, /// /// Identifies a paper sheet size of 35 inch times 23.5 inch or 889 mm times 597 mm. /// DoubleDemy = 115, /// /// Identifies a paper sheet size of 45 inch times 35 inch 1143 times 889 mm. /// QuadDemy = 116, /// /// Identifies a paper sheet size of 8.5 inch times 5.5 inch or 216 mm times 396 mm. /// STMT = 117, /// /// Identifies a paper sheet size of 8.5 inch times 13 inch or 216 mm times 330 mm. /// Folio = 120, /// /// Identifies a paper sheet size of 5.5 inch times 8.5 inch or 396 mm times 216 mm. /// Statement = 121, /// /// Identifies a paper sheet size of 10 inch times 14 inch. /// Size10x14 = 122, //A 11 8.5 279 216 //B 17 11 432 279 //C 22 17 559 432 //D 34 22 864 559 //E 44 34 1118 864 } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp/PdfSharpException.cs0000644000175000001440000000456611435766646023045 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp { /// /// Base class of all exceptions in the PDFsharp frame work. /// public class PdfSharpException : Exception { // The class is not yet used /// /// Initializes a new instance of the class. /// public PdfSharpException() { } /// /// Initializes a new instance of the class. /// /// The exception message. public PdfSharpException(string message) : base(message) { } /// /// Initializes a new instance of the class. /// /// The exception message. /// The inner exception. public PdfSharpException(string message, Exception innerException) : base(message, innerException) { } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp/PSSR.cs0000644000175000001440000002704311435766646020241 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Resources; using System.Reflection; using System.Text.RegularExpressions; using PdfSharp.Drawing; using PdfSharp.Pdf; #pragma warning disable 1591 namespace PdfSharp { /// /// The Pdf-Sharp-String-Resources. /// static class PSSR { // How to use: // Create a function or property for each message text, depending on how much parameters are // part of the message. For the time beginning, type plain English text in the function or property. // The use of functions is save when a parameter must be changed. The compiler tells you all // places in your code that must be modified. // For localization, create a enum value for each function or property with the same name. Then // create localized message files with the enum values as messages identifiers. In the properties // and functions all text is replaced by Format or GetString functions with the according enum value // as first parameter. The use of enums ensures that typing errors in message resource names are // simply impossible. Use the TestResourceMessages function to ensure that each enum value has an // appropriate message text. #region Helper functions /// /// Loads the message from the resource associated with the enum type and formats it /// using 'String.Format'. Because this function is intended to be used during error /// handling it never raises an exception. /// /// The type of the parameter identifies the resource /// and the name of the enum identifies the message in the resource. /// Parameters passed through 'String.Format'. /// The formatted message. public static string Format(PSMsgID id, params object[] args) { string message; try { message = PSSR.GetString(id); message = message != null ? Format(message, args) : "INTERNAL ERROR: Message not found in resources."; return message; } catch (Exception ex) { message = String.Format("UNEXPECTED ERROR while formatting message with ID {0}: {1}", id.ToString(), ex.ToString()); } return message; } public static string Format(string format, params object[] args) { if (format == null) throw new ArgumentNullException("format"); string message; try { message = String.Format(format, args); } catch (Exception ex) { message = String.Format("UNEXPECTED ERROR while formatting message '{0}': {1}", format, ex); } return message; } /// /// Gets the localized message identified by the specified DomMsgID. /// public static string GetString(PSMsgID id) { return PSSR.ResMngr.GetString(id.ToString()); } #endregion #region General messages public static string IndexOutOfRange { get { return "The index is out of range."; } } public static string ListEnumCurrentOutOfRange { get { return "Enumeration out of range."; } } public static string PageIndexOutOfRange { get { return "The index of a page is out of range."; } } public static string OutlineIndexOutOfRange { get { return "The index of an outline is out of range."; } } public static string InvalidValue(int val, string name, int min, int max) { return Format("{0} is not a valid value for {1}. {1} should be greater than or equal to {2} and less than or equal to {3}.", val, name, min, max); } public static string ObsoleteFunktionCalled { get { return "The function is obsolete and must not be called."; } } public static string OwningDocumentRequired { get { return "The PDF object must belong to a PdfDocument, but property Document is null."; } } public static string FileNotFound(string path) { return Format("The file '{0}' does not exist.", path); } public static string FontDataReadOnly { get { return "Font data is read-only."; } } public static string ErrorReadingFontData { get { return "Error while parsing an OpenType font."; } } #endregion #region XGraphics specific messages // ----- XGraphics ---------------------------------------------------------------------------- public static string PointArrayEmpty { get { return "The PointF array must not be empty."; } } public static string PointArrayAtLeast(int count) { return Format("The point array must contain {0} or more points.", count); } public static string NeedPenOrBrush { get { return "XPen or XBrush or both must not be null."; } } public static string CannotChangeImmutableObject(string typename) { return String.Format("You cannot change this immutable {0} object.", typename); } #endregion #region PDF specific messages // ----- PDF ---------------------------------------------------------------------------------- public static string InvalidPdf { get { return "The file is not a valid PDF document."; } } public static string InvalidVersionNumber { get { return "Invalid version number. Valid values are 12, 13, and 14."; } } public static string CannotHandleXRefStreams { get { return "Cannot handle iref streams. The current implementation of PDFsharp cannot handle this PDF feature introduced with Acrobat 6."; } } public static string PasswordRequired { get { return "A password is required to open the PDF document."; } } public static string InvalidPassword { get { return "The specified password is invalid."; } } public static string OwnerPasswordRequired { get { return "To modify the document the owner password is required"; } } public static string UserOrOwnerPasswordRequired { get { return GetString(PSMsgID.UserOrOwnerPasswordRequired); } //get { return "At least a user or an owner password is required to encrypt the document."; } } public static string CannotModify { get { return "The document cannot be modified."; } } public static string NameMustStartWithSlash { //get { return GetString(PSMsgID.NameMustStartWithSlash); } get { return "A PDF name must start with a slash (/)."; } } public static string ImportPageNumberOutOfRange(int pageNumber, int maxPage, string path) { return String.Format("The page cannot be imported from document '{2}', because the page number is out of range. " + "The specified page number is {0}, but it must be in the range from 1 to {1}.", pageNumber, maxPage, path); } public static string MultiplePageInsert { get { return "The page cannot be added to this document because the document already owned this page."; } } public static string UnexpectedTokenInPdfFile { get { return "Unexpected token in PDF file. The PDF file may be corrupt. If it is not, please send us the file for service."; } } public static string InappropriateColorSpace(PdfColorMode colorMode, XColorSpace colorSpace) { string mode; switch (colorMode) { case PdfColorMode.Rgb: mode = "RGB"; break; case PdfColorMode.Cmyk: mode = "CMYK"; break; default: mode = "(undefined)"; break; } string space; switch (colorSpace) { case XColorSpace.Rgb: space = "RGB"; break; case XColorSpace.Cmyk: space = "CMYK"; break; case XColorSpace.GrayScale: space = "grayscale"; break; default: space = "(undefined)"; break; } return String.Format("The document requires color mode {0}, but a color is defined using {1}. " + "Use only colors that match the color mode of the PDF document", mode, space); } public static string CannotGetGlyphTypeface(string fontName) { return Format("Cannot get a matching glyph typeface for font '{0}'.", fontName); } // ----- PdfParser ---------------------------------------------------------------------------- public static string UnexpectedToken(string token) { return Format(PSMsgID.UnexpectedToken, token); //return Format("Token '{0}' was not expected.", token); } public static string UnknownEncryption { get { return GetString(PSMsgID.UnknownEncryption); } //get { return "The PDF document is protected with an encryption not supported by PDFsharp."; } } #endregion #region Resource manager /// /// Gets the resource manager for this module. /// public static ResourceManager ResMngr { get { if (PSSR.resmngr == null) { #if true_ // Force the English language, even on German Windows. System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.InvariantCulture; #endif PSSR.resmngr = new ResourceManager("PdfSharp.Resources.Messages", Assembly.GetExecutingAssembly()); } return PSSR.resmngr; } } static ResourceManager resmngr; /// /// Writes all messages defined by PSMsgID. /// [Conditional("DEBUG")] public static void TestResourceMessages() { #if !SILVERLIGHT string[] names = Enum.GetNames(typeof(PSMsgID)); foreach (string name in names) { string message = String.Format("{0}: '{1}'", name, ResMngr.GetString(name)); Debug.Assert(message != null); Debug.WriteLine(message); } #else #endif } static PSSR() { TestResourceMessages(); } #endregion } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp/VersionInfo.cs0000644000175000001440000000417611435766646021715 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp { /// /// Version info of this assembly. /// static class VersionInfo { public const string Title = ProductVersionInfo.Title; public const string Description = ProductVersionInfo.Description; public const string Producer = ProductVersionInfo.Producer; public const string Version = ProductVersionInfo.Version; public const string Url = ProductVersionInfo.Url; public const string Configuration = ""; public const string Company = ProductVersionInfo.Company; public const string Product = ProductVersionInfo.Product; public const string Copyright = ProductVersionInfo.Copyright; public const string Trademark = ProductVersionInfo.Trademark; public const string Culture = ""; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp/PageSizeConverter.cs0000644000175000001440000001257711435766646023057 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; #if GDI using System.Drawing; #endif #if WPF using System.Windows; #endif using PdfSharp.Drawing; namespace PdfSharp { /// /// Converter from to . /// public static class PageSizeConverter { /// /// Converts the specified page size enumeration to a pair of values in point. /// public static XSize ToSize(PageSize value) { // The international definitions are: // 1 inch == 25.4 mm // 1 inch == 72 point switch (value) { case PageSize.A0: return new XSize(2380, 3368); case PageSize.A1: return new XSize(1684, 2380); case PageSize.A2: return new XSize(1190, 1684); case PageSize.A3: return new XSize(842, 1190); case PageSize.A4: return new XSize(595, 842); case PageSize.A5: return new XSize(420, 595); case PageSize.RA0: return new XSize(2438, 3458); case PageSize.RA1: return new XSize(1729, 2438); case PageSize.RA2: return new XSize(1219, 1729); case PageSize.RA3: return new XSize(865, 1219); case PageSize.RA4: return new XSize(609, 865); case PageSize.RA5: return new XSize(343, 609); case PageSize.B0: return new XSize(2835, 4008); case PageSize.B1: return new XSize(2004, 2835); case PageSize.B2: return new XSize(4252, 1417); case PageSize.B3: return new XSize(1001, 1417); case PageSize.B4: return new XSize(729, 1032); case PageSize.B5: return new XSize(516, 729); // The strange sizes from overseas... case PageSize.Quarto: // 8 x 10 inch return new XSize(576, 720); case PageSize.Foolscap: // 8 x 13 inch return new XSize(576, 936); case PageSize.Executive: // 7.5 x 10 inch return new XSize(540, 720); case PageSize.GovernmentLetter: // 10.5 x 8 inch return new XSize(756, 576); case PageSize.Letter: // 8.5 x 11 inch return new XSize(612, 792); case PageSize.Legal: // 8.5 x 14 inch return new XSize(612, 1008); case PageSize.Ledger: // 17 x 11 inch return new XSize(1224, 792); case PageSize.Tabloid: // 11 x 17 inch return new XSize(792, 1224); case PageSize.Post: // 15.5 x 19.25 inch return new XSize(1126, 1386); case PageSize.Crown: // 20 x 15 inch return new XSize(1440, 1080); case PageSize.LargePost: // 16.5 x 21 inch return new XSize(1188, 1512); case PageSize.Demy: // 17.5 x 22 inch return new XSize(1260, 1584); case PageSize.Medium: // 18 x 23 inch return new XSize(1296, 1656); case PageSize.Royal: // 20 x 25 inch return new XSize(1440, 1800); case PageSize.Elephant: // 23 x 28 inch return new XSize(1565, 2016); case PageSize.DoubleDemy: // 23.5 x 35 inch return new XSize(1692, 2520); case PageSize.QuadDemy: // 35 x 45 inch return new XSize(2520, 3240); case PageSize.STMT: // 5.5 x 8.5 inch return new XSize(396, 612); case PageSize.Folio: // 8.5 x 13 inch return new XSize(612, 936); case PageSize.Statement: // 5.5 x 8.5 inch return new XSize(396, 612); case PageSize.Size10x14: // 8.5 x 13 inch return new XSize(720, 1008); } throw new ArgumentException("Invalid PageSize.", "value"); } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp/ProductVersionInfo.cs0000644000175000001440000001102011435766646023240 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp { /// /// Version info base for all PDFsharp related assemblies. /// public static class ProductVersionInfo { /// /// The title of the product. /// public const string Title = "PDFsharp"; /// /// A characteristic description of the product. /// public const string Description = "A .NET library for processing PDF."; /// /// The PDF producer information string. /// public const string Producer = Title + " " + VersionMajor + "." + VersionMinor + "." + VersionBuild + Technologie + " (" + Url + ")"; /// /// The full version number. /// public const string Version = VersionMajor + "." + VersionMinor + "." + VersionBuild + "." + VersionPatch; /// /// The full version string. /// public const string Version2 = VersionMajor + "." + VersionMinor + "." + VersionBuild + "." + VersionPatch + Technologie; /// /// The home page of this product. /// public const string Url = "www.pdfsharp.com"; /// /// /// public const string Configuration = ""; /// /// The company that created/owned the product. /// public const string Company = "empira Software GmbH, Cologne (Germany)"; /// /// The name the product. /// public const string Product = "PDFsharp"; /// /// The copyright information. /// public const string Copyright = "Copyright 2005-2009 empira Software GmbH."; /// /// The trademark the product. /// public const string Trademark = "PDFsharp"; /// /// Unused. /// public const string Culture = ""; /// /// The major version number of the product. /// public const string VersionMajor = "1"; /// /// The minor version number of the product. /// public const string VersionMinor = "31"; /// /// The build number of the product. /// public const string VersionBuild = "1789"; // Build = days since 2005-01-01 - change this values ONLY HERE /// /// The patch number of the product. /// public const string VersionPatch = "0"; #if DEBUG /// /// The calculated build number. /// public static int BuildNumber = (DateTime.Now - new DateTime(2005, 1, 1)).Days; #endif /// /// The technology tag of the product: /// -g: GDI+, /// -w: WPF, /// -h: Both GDI+ and WPF (hybrid). /// #if GDI && !WPF public const string Technologie = "-g"; #endif #if WPF && !GDI && !SILVERLIGHT public const string Technologie = "-w"; #endif #if WPF && GDI public const string Technologie = "-h"; #endif #if SILVERLIGHT public const string Technologie = "-ag"; #endif } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Filters/0000777000175000001440000000000011533760020021213 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Filters/ASCII85Decode.cs0000644000175000001440000002145711435766646023705 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Text; using PdfSharp.Internal; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Filters { /// /// Implements the ASCII85Decode filter. /// public class ASCII85Decode : Filter { /// /// Encodes the specified data. /// public override byte[] Encode(byte[] data) { if (data == null) throw new ArgumentNullException("data"); int length = data.Length; // length == 0 is must not be treated as a special case int words = length / 4; int rest = length - (words * 4); byte[] result = new byte[words * 5 + (rest == 0 ? 0 : rest + 1) + 2]; int idxIn = 0, idxOut = 0; int wCount = 0; while (wCount < words) { uint val = ((uint)data[idxIn++] << 24) + ((uint)data[idxIn++] << 16) + ((uint)data[idxIn++] << 8) + data[idxIn++]; if (val == 0) { result[idxOut++] = (byte)'z'; } else { byte c5 = (byte)(val % 85 + '!'); val /= 85; byte c4 = (byte)(val % 85 + '!'); val /= 85; byte c3 = (byte)(val % 85 + '!'); val /= 85; byte c2 = (byte)(val % 85 + '!'); val /= 85; byte c1 = (byte)(val + '!'); result[idxOut++] = c1; result[idxOut++] = c2; result[idxOut++] = c3; result[idxOut++] = c4; result[idxOut++] = c5; } wCount++; } if (rest == 1) { uint val = (uint)data[idxIn] << 24; val /= 85 * 85 * 85; byte c2 = (byte)(val % 85 + '!'); val /= 85; byte c1 = (byte)(val + '!'); result[idxOut++] = c1; result[idxOut++] = c2; } else if (rest == 2) { uint val = ((uint)data[idxIn++] << 24) + ((uint)data[idxIn] << 16); val /= 85 * 85; byte c3 = (byte)(val % 85 + '!'); val /= 85; byte c2 = (byte)(val % 85 + '!'); val /= 85; byte c1 = (byte)(val + '!'); result[idxOut++] = c1; result[idxOut++] = c2; result[idxOut++] = c3; } else if (rest == 3) { uint val = ((uint)data[idxIn++] << 24) + ((uint)data[idxIn++] << 16) + ((uint)data[idxIn] << 8); val /= 85; byte c4 = (byte)(val % 85 + '!'); val /= 85; byte c3 = (byte)(val % 85 + '!'); val /= 85; byte c2 = (byte)(val % 85 + '!'); val /= 85; byte c1 = (byte)(val + '!'); result[idxOut++] = c1; result[idxOut++] = c2; result[idxOut++] = c3; result[idxOut++] = c4; } result[idxOut++] = (byte)'~'; result[idxOut++] = (byte)'>'; if (idxOut < result.Length) Array.Resize(ref result, idxOut); return result; } /// /// Decodes the specified data. /// public override byte[] Decode(byte[] data, FilterParms parms) { if (data == null) throw new ArgumentNullException("data"); int idx; int length = data.Length; int zCount = 0; int idxOut = 0; for (idx = 0; idx < length; idx++) { char ch = (char)data[idx]; if (ch >= '!' && ch <= 'u') data[idxOut++] = (byte)ch; else if (ch == 'z') { data[idxOut++] = (byte)ch; zCount++; } else if (ch == '~') { if ((char)data[idx + 1] != '>') throw new ArgumentException("Illegal character.", "data"); break; } // ingnore unknown character } // Loop not ended with break? if (idx == length) throw new ArgumentException("Illegal character.", "data"); length = idxOut; int nonZero = length - zCount; int byteCount = 4 * (zCount + (nonZero / 5)); // full 4 byte blocks int remainder = nonZero % 5; if (remainder == 1) throw new InvalidOperationException("Illegal character."); if (remainder != 0) byteCount += remainder - 1; byte[] output = new byte[byteCount]; idxOut = 0; idx = 0; while (idx + 4 < length) { char ch = (char)data[idx]; if (ch == 'z') { idx++; idxOut += 4; } else { uint val = (uint)(data[idx++] - '!') * (85 * 85 * 85 * 85) + (uint)(data[idx++] - '!') * (85 * 85 * 85) + (uint)(data[idx++] - '!') * (85 * 85) + (uint)(data[idx++] - '!') * 85 + (uint)(data[idx++] - '!'); output[idxOut++] = (byte)(val >> 24); output[idxOut++] = (byte)(val >> 16); output[idxOut++] = (byte)(val >> 8); output[idxOut++] = (byte)val; } } // I've found no appropriate algorithm, so I write my own. In some rare cases the value must not // increased by one, but I cannot found a general formula or a proof. // All possible cases are tested programmatically. if (remainder == 2) // one byte { uint value = (uint)(data[idx++] - '!') * (85 * 85 * 85 * 85) + (uint)(data[idx] - '!') * (85 * 85 * 85); // Always increase if not zero (tried out) if (value != 0) value += 0x01000000; output[idxOut] = (byte)(value >> 24); } else if (remainder == 3) // two bytes { int idxIn = idx; uint value = (uint)(data[idx++] - '!') * (85 * 85 * 85 * 85) + (uint)(data[idx++] - '!') * (85 * 85 * 85) + (uint)(data[idx] - '!') * (85 * 85); if (value != 0) { value &= 0xFFFF0000; uint val = value / (85 * 85); byte c3 = (byte)(val % 85 + '!'); val /= 85; byte c2 = (byte)(val % 85 + '!'); val /= 85; byte c1 = (byte)(val + '!'); if (c1 != data[idxIn] || c2 != data[idxIn + 1] || c3 != data[idxIn + 2]) { value += 0x00010000; //Count2++; } } output[idxOut++] = (byte)(value >> 24); output[idxOut] = (byte)(value >> 16); } else if (remainder == 4) // three bytes { int idxIn = idx; uint value = (uint)(data[idx++] - '!') * (85 * 85 * 85 * 85) + (uint)(data[idx++] - '!') * (85 * 85 * 85) + (uint)(data[idx++] - '!') * (85 * 85) + (uint)(data[idx] - '!') * 85; if (value != 0) { value &= 0xFFFFFF00; uint val = value / 85; byte c4 = (byte)(val % 85 + '!'); val /= 85; byte c3 = (byte)(val % 85 + '!'); val /= 85; byte c2 = (byte)(val % 85 + '!'); val /= 85; byte c1 = (byte)(val + '!'); if (c1 != data[idxIn] || c2 != data[idxIn + 1] || c3 != data[idxIn + 2] || c4 != data[idxIn + 3]) { value += 0x00000100; //Count3++; } } output[idxOut++] = (byte)(value >> 24); output[idxOut++] = (byte)(value >> 16); output[idxOut] = (byte)(value >> 8); } return output; } //public static int Count1; //public static int Count2; //public static int Count3; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Filters/Filtering.cs0000644000175000001440000002021411435766646023505 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using PdfSharp.Internal; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Filters { /// /// Applies standard filters to streams. /// public static class Filtering { /// /// Gets the filter specified by the case sensitive name. /// public static Filter GetFilter(string filterName) { if (filterName.StartsWith("/")) filterName = filterName.Substring(1); // Some tools use abbreviations switch (filterName) { case "ASCIIHexDecode": case "AHx": if (Filtering.asciiHexDecode == null) Filtering.asciiHexDecode = new ASCIIHexDecode(); return Filtering.asciiHexDecode; case "ASCII85Decode": case "A85": if (Filtering.ascii85Decode == null) Filtering.ascii85Decode = new ASCII85Decode(); return Filtering.ascii85Decode; case "LZWDecode": case "LZW": if (Filtering.lzwDecode == null) Filtering.lzwDecode = new LzwDecode(); return Filtering.lzwDecode; case "FlateDecode": case "Fl": if (Filtering.flateDecode == null) Filtering.flateDecode = new FlateDecode(); return Filtering.flateDecode; //case "RunLengthDecode": // if (Filtering.RunLengthDecode == null) // Filtering.RunLengthDecode = new RunLengthDecode(); // return Filtering.RunLengthDecode; // //case "CCITTFaxDecode": // if (Filtering.CCITTFaxDecode == null) // Filtering.CCITTFaxDecode = new CCITTFaxDecode(); // return Filtering.CCITTFaxDecode; // //case "JBIG2Decode": // if (Filtering.JBIG2Decode == null) // Filtering.JBIG2Decode = new JBIG2Decode(); // return Filtering.JBIG2Decode; // //case "DCTDecode": // if (Filtering.DCTDecode == null) // Filtering.DCTDecode = new DCTDecode(); // return Filtering.DCTDecode; // //case "JPXDecode": // if (Filtering.JPXDecode == null) // Filtering.JPXDecode = new JPXDecode(); // return Filtering.JPXDecode; // //case "Crypt": // if (Filtering.Crypt == null) // Filtering.Crypt = new Crypt(); // return Filtering.Crypt; case "RunLengthDecode": case "CCITTFaxDecode": case "JBIG2Decode": case "DCTDecode": case "JPXDecode": case "Crypt": Debug.WriteLine("Filter not implemented: " + filterName.ToString()); return null; } throw new NotImplementedException("Unknown filter: " + filterName); } /// /// Gets the filter singleton. /// public static ASCIIHexDecode ASCIIHexDecode { get { if (Filtering.asciiHexDecode == null) Filtering.asciiHexDecode = new ASCIIHexDecode(); return Filtering.asciiHexDecode; } } static ASCIIHexDecode asciiHexDecode; /// /// Gets the filter singleton. /// public static ASCII85Decode ASCII85Decode { get { if (Filtering.ascii85Decode == null) Filtering.ascii85Decode = new ASCII85Decode(); return Filtering.ascii85Decode; } } static ASCII85Decode ascii85Decode; /// /// Gets the filter singleton. /// public static LzwDecode LzwDecode { get { if (Filtering.lzwDecode == null) Filtering.lzwDecode = new LzwDecode(); return Filtering.lzwDecode; } } static LzwDecode lzwDecode; /// /// Gets the filter singleton. /// public static FlateDecode FlateDecode { get { if (Filtering.flateDecode == null) Filtering.flateDecode = new FlateDecode(); return Filtering.flateDecode; } } static FlateDecode flateDecode; //runLengthDecode //ccittFaxDecode //jbig2Decode //dctDecode //jpxDecode //crypt /// /// Encodes the data with the specified filter. /// public static byte[] Encode(byte[] data, string filterName) { Filter filter = GetFilter(filterName); if (filter != null) return filter.Encode(data); return null; } /// /// Encodes a raw string with the specified filter. /// public static byte[] Encode(string rawString, string filterName) { Filter filter = GetFilter(filterName); if (filter != null) return filter.Encode(rawString); return null; } /// /// Decodes the data with the specified filter. /// public static byte[] Decode(byte[] data, string filterName, FilterParms parms) { Filter filter = GetFilter(filterName); if (filter != null) return filter.Decode(data, parms); return null; } /// /// Decodes the data with the specified filter. /// public static byte[] Decode(byte[] data, string filterName) { Filter filter = GetFilter(filterName); if (filter != null) return filter.Decode(data, null); return null; } /// /// Decodes the data with the specified filter. /// public static byte[] Decode(byte[] data, PdfItem filterItem) { byte[] result = null; if (filterItem is PdfName) { Filter filter = GetFilter(filterItem.ToString()); if (filter != null) result = filter.Decode(data); } else if (filterItem is PdfArray) { PdfArray array = (PdfArray)filterItem; foreach (PdfItem item in array) data = Filtering.Decode(data, item); result = data; } return result; } /// /// Decodes to a raw string with the specified filter. /// public static string DecodeToString(byte[] data, string filterName, FilterParms parms) { Filter filter = GetFilter(filterName); if (filter != null) return filter.DecodeToString(data, parms); return null; } /// /// Decodes to a raw string with the specified filter. /// public static string DecodeToString(byte[] data, string filterName) { Filter filter = GetFilter(filterName); if (filter != null) return filter.DecodeToString(data, null); return null; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Filters/ASCIIHexDecode.cs0000644000175000001440000000567011435766646024174 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using PdfSharp.Internal; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Filters { /// /// Implements the ASCIIHexDecode filter. /// public class ASCIIHexDecode : Filter { /// /// Encodes the specified data. /// public override byte[] Encode(byte[] data) { if (data == null) throw new ArgumentNullException("data"); int count = data.Length; byte[] bytes = new byte[2 * count]; for (int i = 0, j = 0; i < count; i++) { byte b = data[i]; bytes[j++] = (byte)((b >> 4) + ((b >> 4) < 10 ? (byte)'0' : (byte)('A' - 10))); bytes[j++] = (byte)((b & 0xF) + ((b & 0xF) < 10 ? (byte)'0' : (byte)('A' - 10))); } return bytes; } /// /// Decodes the specified data. /// public override byte[] Decode(byte[] data, FilterParms parms) { if (data == null) throw new ArgumentNullException("data"); data = RemoveWhiteSpace(data); int count = data.Length; if (count % 2 == 1) { count++; byte[] temp = data; data = new byte[count]; temp.CopyTo(data, 0); } count <<= 2; byte[] bytes = new byte[count]; for (int i = 0, j = 0; i < count; i++) { byte hi = data[j++]; byte lo = data[j++]; bytes[i] = (byte)((hi > '9' ? hi - 'A' : hi - '0') * 16 + (lo > '9' ? lo - 'A' : lo - '0')); } return bytes; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Filters/LzwDecode.cs0000644000175000001440000001204311435766646023443 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // David Stephensen (mailto:David.Stephensen@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Text; using System.IO; namespace PdfSharp.Pdf.Filters { /// /// Implements the LzwDecode filter. /// public class LzwDecode : Filter { /// /// Throws a NotImplementedException because the obsolete LZW encoding is not supported by PDFsharp. /// public override byte[] Encode(byte[] data) { throw new NotImplementedException("PDFsharp does not support LZW encoding."); } /// /// Decodes the specified data. /// public override byte[] Decode(byte[] data, FilterParms parms) { if (data[0] == 0x00 && data[1] == 0x01) throw new Exception("LZW flavour not supported."); MemoryStream outputStream = new MemoryStream(); InitializeDictionary(); this.data = data; bytePointer = 0; nextData = 0; nextBits = 0; int code, oldCode = 0; byte[] str; while ((code = NextCode) != 257) { if (code == 256) { InitializeDictionary(); code = NextCode; if (code == 257) { break; } outputStream.Write(stringTable[code], 0, stringTable[code].Length); oldCode = code; } else { if (code < tableIndex) { str = stringTable[code]; outputStream.Write(str, 0, str.Length); AddEntry(stringTable[oldCode], str[0]); oldCode = code; } else { str = stringTable[oldCode]; outputStream.Write(str, 0, str.Length); AddEntry(str, str[0]); oldCode = code; } } } if (outputStream.Length >= 0) { outputStream.Capacity = (int)outputStream.Length; return outputStream.GetBuffer(); } return null; } /// /// Initialize the dictionary. /// void InitializeDictionary() { stringTable = new byte[8192][]; for (int i = 0; i < 256; i++) { stringTable[i] = new byte[1]; stringTable[i][0] = (byte)i; } tableIndex = 258; bitsToGet = 9; } /// /// Add a new entry to the Dictionary. /// void AddEntry(byte[] oldstring, byte newstring) { int length = oldstring.Length; byte[] str = new byte[length + 1]; Array.Copy(oldstring, 0, str, 0, length); str[length] = newstring; stringTable[tableIndex++] = str; if (tableIndex == 511) bitsToGet = 10; else if (tableIndex == 1023) bitsToGet = 11; else if (tableIndex == 2047) bitsToGet = 12; } /// /// Returns the next set of bits. /// int NextCode { get { try { nextData = (nextData << 8) | (data[bytePointer++] & 0xff); nextBits += 8; if (nextBits < bitsToGet) { nextData = (nextData << 8) | (data[bytePointer++] & 0xff); nextBits += 8; } int code = (nextData >> (nextBits - bitsToGet)) & andTable[bitsToGet - 9]; nextBits -= bitsToGet; return code; } catch { return 257; } } } readonly int[] andTable = { 511, 1023, 2047, 4095 }; byte[][] stringTable; byte[] data; int tableIndex, bitsToGet = 9; int bytePointer; int nextData = 0; int nextBits = 0; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Filters/FlateDecode.cs0000644000175000001440000001642611435766646023733 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Text; using System.IO; #if NET_ZIP using System.IO.Compression; #else using PdfSharp.SharpZipLib.Zip.Compression; using PdfSharp.SharpZipLib.Zip.Compression.Streams; #endif namespace PdfSharp.Pdf.Filters { /// /// Implements the FlateDecode filter by wrapping SharpZipLib. /// public class FlateDecode : Filter { /// /// Encodes the specified data. /// public override byte[] Encode(byte[] data) { MemoryStream ms = new MemoryStream(); // DeflateStream/GZipStream does not work immediately and I have not the leisure to work it out. // So I keep on using SharpZipLib even with .NET 2.0. #if NET_ZIP // See http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=97064 // // Excerpt from the RFC 1950 specs for first byte: // // CMF (Compression Method and flags) // This byte is divided into a 4-bit compression method and a 4- // bit information field depending on the compression method. // // bits 0 to 3 CM Compression method // bits 4 to 7 CINFO Compression info // // CM (Compression method) // This identifies the compression method used in the file. CM = 8 // denotes the "deflate" compression method with a window size up // to 32K. This is the method used by gzip and PNG (see // references [1] and [2] in Chapter 3, below, for the reference // documents). CM = 15 is reserved. It might be used in a future // version of this specification to indicate the presence of an // extra field before the compressed data. // // CINFO (Compression info) // For CM = 8, CINFO is the base-2 logarithm of the LZ77 window // size, minus eight (CINFO=7 indicates a 32K window size). Values // of CINFO above 7 are not allowed in this version of the // specification. CINFO is not defined in this specification for // CM not equal to 8. ms.WriteByte(0x78); // Excerpt from the RFC 1950 specs for second byte: // // FLG (FLaGs) // This flag byte is divided as follows: // // bits 0 to 4 FCHECK (check bits for CMF and FLG) // bit 5 FDICT (preset dictionary) // bits 6 to 7 FLEVEL (compression level) // // The FCHECK value must be such that CMF and FLG, when viewed as // a 16-bit unsigned integer stored in MSB order (CMF*256 + FLG), // is a multiple of 31. // // FDICT (Preset dictionary) // If FDICT is set, a DICT dictionary identifier is present // immediately after the FLG byte. The dictionary is a sequence of // bytes which are initially fed to the compressor without // producing any compressed output. DICT is the Adler-32 checksum // of this sequence of bytes (see the definition of ADLER32 // below). The decompressor can use this identifier to determine // which dictionary has been used by the compressor. // // FLEVEL (Compression level) // These flags are available for use by specific compression // methods. The "deflate" method (CM = 8) sets these flags as // follows: // // 0 - compressor used fastest algorithm // 1 - compressor used fast algorithm // 2 - compressor used default algorithm // 3 - compressor used maximum compression, slowest algorithm // // The information in FLEVEL is not needed for decompression; it // is there to indicate if recompression might be worthwhile. ms.WriteByte(0x49); DeflateStream zip = new DeflateStream(ms, CompressionMode.Compress, true); zip.Write(data, 0, data.Length); zip.Close(); #else DeflaterOutputStream zip = new DeflaterOutputStream(ms, new Deflater(Deflater.DEFAULT_COMPRESSION, false)); zip.Write(data, 0, data.Length); zip.Finish(); #endif ms.Capacity = (int)ms.Length; return ms.GetBuffer(); } /// /// Decodes the specified data. /// public override byte[] Decode(byte[] data, FilterParms parms) { MemoryStream msInput = new MemoryStream(data); MemoryStream msOutput = new MemoryStream(); #if NET_ZIP // See http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=97064 // It seems to work when skipping the first two bytes. byte header; // 0x30 0x59 header = (byte)msInput.ReadByte(); //Debug.Assert(header == 48); header = (byte)msInput.ReadByte(); //Debug.Assert(header == 89); DeflateStream zip = new DeflateStream(msInput, CompressionMode.Decompress, true); int cbRead; byte[] abResult = new byte[1024]; do { cbRead = zip.Read(abResult, 0, abResult.Length); if (cbRead > 0) msOutput.Write(abResult, 0, cbRead); } while (cbRead > 0); zip.Close(); msOutput.Flush(); if (msOutput.Length >= 0) { msOutput.Capacity = (int)msOutput.Length; return msOutput.GetBuffer(); } return null; #else InflaterInputStream iis = new InflaterInputStream(msInput, new Inflater(false)); int cbRead; byte[] abResult = new byte[32768]; do { cbRead = iis.Read(abResult, 0, abResult.Length); if (cbRead > 0) msOutput.Write(abResult, 0, cbRead); } while (cbRead > 0); iis.Close(); msOutput.Flush(); if (msOutput.Length >= 0) { msOutput.Capacity = (int)msOutput.Length; return msOutput.GetBuffer(); } return null; #endif } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Filters/Filter.cs0000644000175000001440000000772111435766646023017 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using PdfSharp.Internal; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Filters { /// /// Reserved for future extension. /// public class FilterParms { // not yet used } /// /// Base class for all stream filters /// public abstract class Filter { /// /// When implemented in a derived class encodes the specified data. /// public abstract byte[] Encode(byte[] data); /// /// Encodes a raw string. /// public virtual byte[] Encode(string rawString) { byte[] bytes = PdfEncoders.RawEncoding.GetBytes(rawString); bytes = Encode(bytes); return bytes; } /// /// When implemented in a derived class decodes the specified data. /// public abstract byte[] Decode(byte[] data, FilterParms parms); /// /// Decodes the specified data. /// public byte[] Decode(byte[] data) { return Decode(data, null); } /// /// Decodes to a raw string. /// public virtual string DecodeToString(byte[] data, FilterParms parms) { byte[] bytes = Decode(data, parms); string text = PdfEncoders.RawEncoding.GetString(bytes, 0, bytes.Length); return text; } /// /// Decodes to a raw string. /// public string DecodeToString(byte[] data) { return DecodeToString(data, null); } /// /// Removes all white spaces from the data. The function assumes that the bytes are characters. /// protected byte[] RemoveWhiteSpace(byte[] data) { int count = data.Length; int j = 0; for (int i = 0; i < count; i++, j++) { switch (data[i]) { case (byte)Chars.NUL: // 0 Null case (byte)Chars.HT: // 9 Tab case (byte)Chars.LF: // 10 Line feed case (byte)Chars.FF: // 12 Form feed case (byte)Chars.CR: // 13 Carriage return case (byte)Chars.SP: // 32 Space j--; break; default: if (i != j) data[j] = data[i]; break; } if (j < count) { byte[] temp = data; data = new byte[j]; for (int idx = 0; idx < j; idx++) data[idx] = temp[idx]; } } return data; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.Rtf/0000777000175000001440000000000011533760020021220 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Drawing.Rtf/XGraphicsRtfRenderer.cs0000644000175000001440000002203111240370570025576 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2008 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.IO; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows.Media; #endif using PdfSharp.Internal; namespace PdfSharp.Drawing.Rtf { /// /// Represents a drawing surface for PdfPages. /// class XGraphicsRtfRenderer { public XGraphicsRtfRenderer() { } #if false // ----- DrawLine ----------------------------------------------------------------------------- public void DrawLine(XPen pen, float x1, float y1, float x2, float y2) { if (this.gfx != null) this.gfx.DrawLine(pen.RealizeGdiPen(), x1, y1, x2, y2); if (this.pdfPage != null) this.pdfPage.PageContent.DrawLines(pen, new PointF[2]{new PointF(x1, y1), new PointF(x2, y2)}); } // ----- DrawLines ---------------------------------------------------------------------------- public void DrawLines(XPen pen, PointF[] points) { if (this.gfx != null) this.gfx.DrawLines(pen.RealizeGdiPen(), points); if (this.pdfPage != null) this.pdfPage.PageContent.DrawLines(pen, points); } // ----- DrawRectangle ------------------------------------------------------------------------ public void DrawRectangle(XPen pen, XSolidBrush brush, float x, float y, float width, float height) { if (this.gfx != null) { this.gfx.FillRectangle(brush.RealizeGdiBrush(), x, y, width, height); this.gfx.DrawRectangle(pen.RealizeGdiPen(), x, y, width, height); } if (this.pdfPage != null) this.pdfPage.PageContent.DrawRectangle(pen, brush, x, y, width, height); } // ----- DrawRectangles ----------------------------------------------------------------------- //public void DrawRectangles(XPen pen, XSolidBrush brush, Rectangle[] rects) //{ // if (this.gfx != null) // { // this.gfx.FillRectangles(brush.RealizeGdiBrush(), rects); // this.gfx.DrawRectangles(pen.RealizeGdiPen(), rects); // } // if (this.pdfPage != null) // { // int count = rects.Length; // for (int idx = 0; idx < count; idx++) // { // Rectangle rect = rects[idx]; // this.pdfPage.PageContent.DrawRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); // } // } //} public void DrawRectangles(XPen pen, XSolidBrush brush, RectangleF[] rects) { if (this.gfx != null) { this.gfx.FillRectangles(brush.RealizeGdiBrush(), rects); this.gfx.DrawRectangles(pen.RealizeGdiPen(), rects); } if (this.pdfPage != null) { int count = rects.Length; for (int idx = 0; idx < count; idx++) { RectangleF rect = rects[idx]; this.pdfPage.PageContent.DrawRectangle(pen, brush, rect.X, rect.Y, rect.Width, rect.Height); } } } // ----- DrawEllipse -------------------------------------------------------------------------- //public void DrawEllipse(XPen pen, Rectangle rect); //public void DrawEllipse(XPen pen, RectangleF rect); //public void DrawEllipse(XPen pen, int x, int y, int width, int height); //public void DrawEllipse(XPen pen, float x, float y, float width, float height); // ----- DrawPolygon -------------------------------------------------------------------------- //public void DrawPolygon(XPen pen, Point[] points); //public void DrawPolygon(XPen pen, PointF[] points); // ----- DrawPath ----------------------------------------------------------------------------- public void DrawPath(XPen pen, XSolidBrush brush, XGraphicsPath path) { if (this.gfx != null) { this.gfx.FillPath(brush.RealizeGdiBrush(), path.RealizeGdiPath()); this.gfx.DrawPath(pen.RealizeGdiPen(), path.RealizeGdiPath()); } if (this.pdfPage != null) this.pdfPage.PageContent.DrawPath(pen, brush, path); } // ----- DrawImage ---------------------------------------------------------------------------- //public void DrawImage(Image image, Point point); //public void DrawImage(Image image, PointF point); //public void DrawImage(Image image, Point[] destPoints); //public void DrawImage(Image image, PointF[] destPoints); //public void DrawImage(Image image, Rectangle rect); //public void DrawImage(Image image, RectangleF rect); //public void DrawImage(Image image, int x, int y); //public void DrawImage(Image image, float x, float y); //public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit); //public void DrawImage(Image image, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit); //public void DrawImage(Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit); //public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit); //public void DrawImage(Image image, int x, int y, Rectangle srcRect, GraphicsUnit srcUnit); //public void DrawImage(Image image, float x, float y, RectangleF srcRect, GraphicsUnit srcUnit); //public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr); //public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr); //public void DrawImage(Image image, int x, int y, int width, int height); //public void DrawImage(Image image, float x, float y, float width, float height); //public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback); //public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback); //public void DrawImage(Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit); //public void DrawImage(Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit); //public void DrawImage(Image image, Point[] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData); //public void DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData); //public void DrawImage(Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr); //public void DrawImage(Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs); //public void DrawImage(Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback); //public void DrawImage(Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback); //public void DrawImage(Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData); //public void DrawImage(Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes // -------------------------------------------------------------------------------------------- #endif } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Annotations/0000777000175000001440000000000011533760020022100 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Annotations/PdfWidgetAnnotation.cs0000644000175000001440000000761611435766646026372 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.Diagnostics; using System.Collections; using PdfSharp.Internal; using PdfSharp.Drawing; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Annotations { /// /// Represents a text annotation. /// internal sealed class PdfWidgetAnnotation : PdfAnnotation { public PdfWidgetAnnotation() { Initialize(); } public PdfWidgetAnnotation(PdfDocument document) : base(document) { Initialize(); } void Initialize() { Elements.SetName(Keys.Subtype, "/Widget"); } /// /// Predefined keys of this dictionary. /// internal new class Keys : PdfAnnotation.Keys { /// /// (Optional) The annotations highlighting mode, the visual effect to be used when /// the mouse button is pressed or held down inside its active area: /// N (None) No highlighting. /// I (Invert) Invert the contents of the annotation rectangle. /// O (Outline) Invert the annotations border. /// P (Push) Display the annotations down appearance, if any. If no down appearance is defined, /// offset the contents of the annotation rectangle to appear as if it were being pushed below /// the surface of the page. /// T (Toggle) Same as P (which is preferred). /// A highlighting mode other than P overrides any down appearance defined for the annotation. /// Default value: I. /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string H = "/H"; /// /// (Optional) An appearance characteristics dictionary to be used in constructing a dynamic /// appearance stream specifying the annotations visual presentation on the page. /// The name MK for this entry is of historical significance only and has no direct meaning. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional)] public const string MK = "/MK"; public static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Annotations/PdfGenericAnnotation.cs0000644000175000001440000000512611435766646026515 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.Diagnostics; using System.Collections; using PdfSharp.Internal; using PdfSharp.Drawing; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Annotations { /// /// Represents a generic annotation. Used for annotation dictionaries unknown to PDFsharp. /// internal sealed class PdfGenericAnnotation : PdfAnnotation { //DMH 6/7/06 //Make this public so we can use it in PdfAnnotations to //get the Meta data from existings annotations. public PdfGenericAnnotation(PdfDictionary dict) : base(dict) { } /// /// Predefined keys of this dictionary. /// internal new class Keys : PdfAnnotation.Keys { public static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Annotations/PdfTextAnnotation.cs0000644000175000001440000001231311435766646026061 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.Diagnostics; using System.Collections; using PdfSharp.Internal; using PdfSharp.Drawing; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Annotations { /// /// Represents a text annotation. /// public sealed class PdfTextAnnotation : PdfAnnotation { /// /// Initializes a new instance of the class. /// public PdfTextAnnotation() { Initialize(); } /// /// Initializes a new instance of the class. /// public PdfTextAnnotation(PdfDocument document) : base(document) { Initialize(); } void Initialize() { Elements.SetName(Keys.Subtype, "/Text"); // By default make a yellow comment. Icon = PdfTextAnnotationIcon.Comment; //Color = XColors.Yellow; } // public static PdfTextAnnotation CreateDocumentLink(PdfRectangle rect, int destinatinPage) // { // PdfTextAnnotation link = new PdfTextAnnotation(); // //link.linkType = PdfTextAnnotation.LinkType.Document; // //link.Rectangle = rect; // //link.destPage = destinatinPage; // return link; // } /// /// Gets or sets a flag indicating whether the annotation should initially be displayed open. /// public bool Open { get { return Elements.GetBoolean(Keys.Open); } set { Elements.SetBoolean(Keys.Open, value); } } /// /// Gets or sets an icon to be used in displaying the annotation. /// public PdfTextAnnotationIcon Icon { get { string value = Elements.GetName(Keys.Name); if (value == "") return PdfTextAnnotationIcon.NoIcon; value = value.Substring(1); if (!Enum.IsDefined(typeof(PdfTextAnnotationIcon), value)) return PdfTextAnnotationIcon.NoIcon; return (PdfTextAnnotationIcon)Enum.Parse(typeof(PdfTextAnnotationIcon), value, false); } set { if (Enum.IsDefined(typeof(PdfTextAnnotationIcon), value) && PdfTextAnnotationIcon.NoIcon != value) { Elements.SetName(Keys.Name, "/" + value.ToString()); } else Elements.Remove(Keys.Name); } } /// /// Predefined keys of this dictionary. /// internal new class Keys : PdfAnnotation.Keys { /// /// (Optional) A flag specifying whether the annotation should initially be displayed open. /// Default value: false (closed). /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string Open = "/Open"; /// /// (Optional) The name of an icon to be used in displaying the annotation. Viewer /// applications should provide predefined icon appearances for at least the following /// standard names: /// Comment /// Help /// Insert /// Key /// NewParagraph /// Note /// Paragraph /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string Name = "/Name"; //State //StateModel public static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Annotations/PdfLinkAnnotation.cs0000644000175000001440000002002611435766646026032 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.Diagnostics; using System.Collections; using PdfSharp.Internal; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Annotations { /// /// Represents a link annotation. /// public sealed class PdfLinkAnnotation : PdfAnnotation { // Just a hack to make MigraDoc work with this code. enum LinkType { Document, Web, File } /// /// Initializes a new instance of the class. /// public PdfLinkAnnotation() { Elements.SetName(Keys.Subtype, "/Link"); } /// /// Initializes a new instance of the class. /// public PdfLinkAnnotation(PdfDocument document) : base(document) { Elements.SetName(Keys.Subtype, "/Link"); } /// /// Creates a link within the current document. /// /// The link area in default page coordinates. /// The one-based destination page number. public static PdfLinkAnnotation CreateDocumentLink(PdfRectangle rect, int destinationPage) { PdfLinkAnnotation link = new PdfLinkAnnotation(); link.linkType = PdfLinkAnnotation.LinkType.Document; link.Rectangle = rect; link.destPage = destinationPage; return link; } int destPage; LinkType linkType; string url; /// /// Creates a link to the web. /// public static PdfLinkAnnotation CreateWebLink(PdfRectangle rect, string url) { PdfLinkAnnotation link = new PdfLinkAnnotation(); link.linkType = PdfLinkAnnotation.LinkType.Web; link.Rectangle = rect; link.url = url; return link; } /// /// Creates a link to a file. /// public static PdfLinkAnnotation CreateFileLink(PdfRectangle rect, string fileName) { PdfLinkAnnotation link = new PdfLinkAnnotation(); link.linkType = PdfLinkAnnotation.LinkType.File; // TODO: Adjust bleed box here (if possible) link.Rectangle = rect; link.url = fileName; return link; } internal override void WriteObject(PdfWriter writer) { PdfPage dest = null; //pdf.AppendFormat(CultureInfo.InvariantCulture, // "{0} 0 obj\n<<\n/Type/Annot\n/Subtype/Link\n" + // "/Rect[{1} {2} {3} {4}]\n/BS<>\n/Border[0 0 0]\n/C[0 0 0]\n", // this.ObjectID.ObjectNumber, rect.X1, rect.Y1, rect.X2, rect.Y2); if (Elements[Keys.BS] == null) Elements[Keys.BS] = new PdfLiteral("<>"); if (Elements[Keys.Border] == null) Elements[Keys.Border] = new PdfLiteral("[0 0 0]"); switch (this.linkType) { case LinkType.Document: // destIndex > Owner.PageCount can happen rendering pages using PDFsharp directly int destIndex = this.destPage; if (destIndex > Owner.PageCount) destIndex = Owner.PageCount; destIndex--; dest = this.Owner.Pages[destIndex]; //pdf.AppendFormat("/Dest[{0} 0 R/XYZ null null 0]\n", dest.ObjectID); Elements[Keys.Dest] = new PdfLiteral("[{0} 0 R/XYZ null null 0]", dest.ObjectNumber); break; case LinkType.Web: //pdf.AppendFormat("/A<>\n", PdfEncoders.EncodeAsLiteral(this.url)); Elements[Keys.A] = new PdfLiteral("<>", //PdfEncoders.EncodeAsLiteral(this.url)); PdfEncoders.ToStringLiteral(this.url, PdfStringEncoding.WinAnsiEncoding, writer.SecurityHandler)); break; case LinkType.File: //pdf.AppendFormat("/A<> >>\n", // PdfEncoders.EncodeAsLiteral(this.url)); Elements[Keys.A] = new PdfLiteral("<> >>", //PdfEncoders.EncodeAsLiteral(this.url)); PdfEncoders.ToStringLiteral(this.url, PdfStringEncoding.WinAnsiEncoding, writer.SecurityHandler)); break; } base.WriteObject(writer); } /// /// Predefined keys of this dictionary. /// internal new class Keys : PdfAnnotation.Keys { // /// // /// (Required) The type of annotation that this dictionary describes; // /// must be Link for a link annotation. // /// // inherited from base class /// /// (Optional; not permitted if an A entry is present) A destination to be displayed /// when the annotation is activated. /// [KeyInfo(KeyType.ArrayOrNameOrString | KeyType.Optional)] public const string Dest = "/Dest"; /// /// (Optional; PDF 1.2) The annotations highlighting mode, the visual effect to be /// used when the mouse button is pressed or held down inside its active area: /// N (None) No highlighting. /// I (Invert) Invert the contents of the annotation rectangle. /// O (Outline) Invert the annotations border. /// P (Push) Display the annotation as if it were being pushed below the surface of the page. /// Default value: I. /// Note: In PDF 1.1, highlighting is always done by inverting colors inside the annotation rectangle. /// [KeyInfo("1.2", KeyType.Name | KeyType.Optional)] public const string H = "/H"; /// /// (Optional; PDF 1.3) A URI action formerly associated with this annotation. When Web /// Capture changes an annotation from a URI to a go-to action, it uses this entry to save /// the data from the original URI action so that it can be changed back in case the target page for /// the go-to action is subsequently deleted. /// [KeyInfo("1.3", KeyType.Dictionary | KeyType.Optional)] public const string PA = "/PA"; // QuadPoints /// /// Gets the KeysMeta for these keys. /// public static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Annotations/enums/0000777000175000001440000000000011533760020023227 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Annotations/enums/PdfTextAnnotationIcon.cs0000644000175000001440000000442411435766646030025 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Pdf.Annotations { /// /// Specifies the pre-defined icon names of text annotations. /// public enum PdfTextAnnotationIcon { /// /// A pre-defined annotation icon. /// NoIcon, /// /// A pre-defined annotation icon. /// Comment, /// /// A pre-defined annotation icon. /// Help, /// /// A pre-defined annotation icon. /// Insert, /// /// A pre-defined annotation icon. /// Key, /// /// A pre-defined annotation icon. /// NewParagraph, /// /// A pre-defined annotation icon. /// Note, /// /// A pre-defined annotation icon. /// Paragraph, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Annotations/enums/PdfAnnotationFlags.cs0000644000175000001440000001176611435766646027333 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Pdf.Annotations { /// /// Specifies the annotation flags. /// public enum PdfAnnotationFlags { /// /// If set, do not display the annotation if it does not belong to one of the standard /// annotation types and no annotation handler is available. If clear, display such an /// unknown annotation using an appearance stream specified by its appearancedictionary, /// if any. /// Invisible = 1 << (1 - 1), /// /// (PDF 1.2) If set, do not display or print the annotation or allow it to interact /// with the user, regardless of its annotation type or whether an annotation /// handler is available. In cases where screen space is limited, the ability to hide /// and show annotations selectively can be used in combination with appearance /// streams to display auxiliary pop-up information similar in function to online /// help systems. /// Hidden = 1 << (2 - 1), /// /// (PDF 1.2) If set, print the annotation when the page is printed. If clear, never /// print the annotation, regardless of whether it is displayed on the screen. This /// can be useful, for example, for annotations representing interactive pushbuttons, /// which would serve no meaningful purpose on the printed page. /// Print = 1 << (3 - 1), /// /// (PDF 1.3) If set, do not scale the annotations appearance to match the magnification /// of the page. The location of the annotation on the page (defined by the /// upper-left corner of its annotation rectangle) remains fixed, regardless of the /// page magnification. See below for further discussion. /// NoZoom = 1 << (4 - 1), /// /// (PDF 1.3) If set, do not rotate the annotations appearance to match the rotation /// of the page. The upper-left corner of the annotation rectangle remains in a fixed /// location on the page, regardless of the page rotation. See below for further discussion. /// NoRotate = 1 << (5 - 1), /// /// (PDF 1.3) If set, do not display the annotation on the screen or allow it to /// interact with the user. The annotation may be printed (depending on the setting /// of the Print flag) but should be considered hidden for purposes of on-screen /// display and user interaction. /// NoView = 1 << (6 - 1), /// /// (PDF 1.3) If set, do not allow the annotation to interact with the user. The /// annotation may be displayed or printed (depending on the settings of the /// NoView and Print flags) but should not respond to mouse clicks or change its /// appearance in response to mouse motions. /// Note: This flag is ignored for widget annotations; its function is subsumed by /// the ReadOnly flag of the associated form field. /// ReadOnly = 1 << (7 - 1), /// /// (PDF 1.4) If set, do not allow the annotation to be deleted or its properties /// (including position and size) to be modified by the user. However, this flag does /// not restrict changes to the annotations contents, such as the value of a form /// field. /// Locked = 1 << (8 - 1), /// /// (PDF 1.5) If set, invert the interpretation of the NoView flag for certain events. /// A typical use is to have an annotation that appears only when a mouse cursor is /// held over it. /// ToggleNoView = 1 << (9 - 1), } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Annotations/enums/PdfRubberStampAnnotationIcon.cs0000644000175000001440000000624611435766646031333 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Pdf.Annotations { /// /// Specifies the predefined icon names of rubber stamp annotations. /// public enum PdfRubberStampAnnotationIcon { /// /// A pre-defined rubber stamp annotation icon. /// NoIcon, /// /// A pre-defined rubber stamp annotation icon. /// Approved, /// /// A pre-defined rubber stamp annotation icon. /// AsIs, /// /// A pre-defined rubber stamp annotation icon. /// Confidential, /// /// A pre-defined rubber stamp annotation icon. /// Departmental, /// /// A pre-defined rubber stamp annotation icon. /// Draft, /// /// A pre-defined rubber stamp annotation icon. /// Experimental, /// /// A pre-defined rubber stamp annotation icon. /// Expired, /// /// A pre-defined rubber stamp annotation icon. /// Final, /// /// A pre-defined rubber stamp annotation icon. /// ForComment, /// /// A pre-defined rubber stamp annotation icon. /// ForPublicRelease, /// /// A pre-defined rubber stamp annotation icon. /// NotApproved, /// /// A pre-defined rubber stamp annotation icon. /// NotForPublicRelease, /// /// A pre-defined rubber stamp annotation icon. /// Sold, /// /// A pre-defined rubber stamp annotation icon. /// TopSecret, } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Annotations/PdfAnnotations.cs0000644000175000001440000001464511435766646025411 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using System.Text; using System.IO; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.IO; using System.Collections.Generic; namespace PdfSharp.Pdf.Annotations { /// /// Represents the annotations array of a page. /// public sealed class PdfAnnotations : PdfArray { internal PdfAnnotations(PdfDocument document) : base(document) { } internal PdfAnnotations(PdfArray array) : base(array) { } /// /// Adds the specified annotation. /// /// The annotation. public void Add(PdfAnnotation annotation) { annotation.Document = this.Owner; this.Owner.irefTable.Add(annotation); Elements.Add(annotation.Reference); } /// /// Removes an annotation from the document. /// public void Remove(PdfAnnotation annotation) { if (annotation.Owner != Owner) throw new InvalidOperationException("The annotation does not belong to this document."); Owner.Internals.RemoveObject(annotation); Elements.Remove(annotation.Reference); } /// /// Removes all the annotations from the current page. /// public void Clear() { for (int idx = Count - 1; idx >= 0; idx--) Page.Annotations.Remove(page.Annotations[idx]); } //public void Insert(int index, PdfAnnotation annotation) //{ // annotation.Document = this.Document; // this.annotations.Insert(index, annotation); //} /// /// Gets the number of annotations in this collection. /// public int Count { get { return Elements.Count; } } /// /// Gets the at the specified index. /// public PdfAnnotation this[int index] { get { PdfReference iref = null; PdfDictionary dict = null; PdfItem item = Elements[index]; if ((iref = item as PdfReference) != null) { Debug.Assert(iref.Value is PdfDictionary, "Reference to dictionary expected."); dict = (PdfDictionary)iref.Value; } else { Debug.Assert(item is PdfDictionary, "Dictionary expected."); dict = (PdfDictionary)item; } PdfAnnotation annotation = dict as PdfAnnotation; if (annotation == null) { annotation = new PdfGenericAnnotation(dict); if (iref == null) Elements[index] = annotation; } return annotation; } } //public PdfAnnotation this[int index] //{ // get // { // //DMH 6/7/06 // //Broke this out to simplfy debugging // //Use a generic annotation to access the Meta data // //Assign this as the parent of the annotation // PdfReference r = Elements[index] as PdfReference; // PdfDictionary d = r.Value as PdfDictionary; // PdfGenericAnnotation a = new PdfGenericAnnotation(d); // a.Collection = this; // return a; // } //} /// /// Gets the page the annotations belongs to. /// internal PdfPage Page { get { return this.page; } set { this.page = value; } } PdfPage page; /// /// Fixes the /P element in imported annotation. /// internal static void FixImportedAnnotation(PdfPage page) { PdfArray annots = page.Elements.GetArray(PdfPage.Keys.Annots); if (annots != null) { int count = annots.Elements.Count; for (int idx = 0; idx < count; idx++) { PdfDictionary annot = annots.Elements.GetDictionary(idx); if (annot != null && annot.Elements.ContainsKey("/P")) annot.Elements["/P"] = page.Reference; } } } /// /// Returns an enumerator that iterates through a collection. /// public override IEnumerator GetEnumerator() { return (IEnumerator)new AnnotationsIterator(this); } class AnnotationsIterator : IEnumerator { PdfAnnotations annotations; int index; public AnnotationsIterator(PdfAnnotations annotations) { this.annotations = annotations; this.index = -1; } public PdfAnnotation Current { get { return this.annotations[this.index]; } } object IEnumerator.Current { get { return Current; } } public bool MoveNext() { return ++this.index < this.annotations.Count; } public void Reset() { this.index = -1; } public void Dispose() { //throw new NotImplementedException(); } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Annotations/PdfRubberStampAnnotation.cs0000644000175000001440000001076311435766646027372 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; using System.Diagnostics; using System.Collections; using PdfSharp.Internal; using PdfSharp.Drawing; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Internal; namespace PdfSharp.Pdf.Annotations { /// /// Represents a rubber stamp annotation. /// public sealed class PdfRubberStampAnnotation : PdfAnnotation { /// /// Initializes a new instance of the class. /// public PdfRubberStampAnnotation() { Initialize(); } /// /// Initializes a new instance of the class. /// /// The document. public PdfRubberStampAnnotation(PdfDocument document) : base(document) { Initialize(); } void Initialize() { Elements.SetName(Keys.Subtype, "/Stamp"); Color = XColors.Yellow; } /// /// Gets or sets an icon to be used in displaying the annotation. /// public PdfRubberStampAnnotationIcon Icon { get { string value = Elements.GetName(Keys.Name); if (value == "") return PdfRubberStampAnnotationIcon.NoIcon; value = value.Substring(1); if (!Enum.IsDefined(typeof(PdfRubberStampAnnotationIcon), value)) return PdfRubberStampAnnotationIcon.NoIcon; return (PdfRubberStampAnnotationIcon)Enum.Parse(typeof(PdfRubberStampAnnotationIcon), value, false); } set { if (Enum.IsDefined(typeof(PdfRubberStampAnnotationIcon), value) && PdfRubberStampAnnotationIcon.NoIcon != value) { Elements.SetName(Keys.Name, "/" + value.ToString()); } else Elements.Remove(Keys.Name); } } /// /// Predefined keys of this dictionary. /// internal new class Keys : PdfAnnotation.Keys { /// /// (Optional) The name of an icon to be used in displaying the annotation. Viewer /// applications should provide predefined icon appearances for at least the following /// standard names: /// Approved /// AsIs /// Confidential /// Departmental /// Draft /// Experimental /// Expired /// Final /// ForComment /// ForPublicRelease /// NotApproved /// NotForPublicRelease /// Sold /// TopSecret /// [KeyInfo(KeyType.Name | KeyType.Optional)] public const string Name = "/Name"; public static DictionaryMeta Meta { get { if (Keys.meta == null) Keys.meta = CreateMeta(typeof(Keys)); return Keys.meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Annotations/PdfAnnotation.cs0000644000175000001440000003520211435766646025216 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf; using PdfSharp.Internal; using PdfSharp.Drawing; namespace PdfSharp.Pdf.Annotations { /// /// Represents the base class of all annotations. /// public abstract class PdfAnnotation : PdfDictionary { /// /// Initializes a new instance of the class. /// protected PdfAnnotation() { Initialize(); } /// /// Initializes a new instance of the class. /// protected PdfAnnotation(PdfDocument document) : base(document) { Initialize(); } /// /// Initializes a new instance of the class. /// internal PdfAnnotation(PdfDictionary dict) : base(dict) { } void Initialize() { Elements.SetName(Keys.Type, "/Annot"); Elements.SetString(Keys.NM, Guid.NewGuid().ToString("D")); Elements.SetDateTime(Keys.M, DateTime.Now); } //dmh - 6/7/06 added delete method /// /// Removes an annotation from the document /// /// [Obsolete("Use 'Parent.Remove(this)'")] public void Delete() { Parent.Remove(this); } /// /// Gets or sets the annotation flags of this instance. /// public PdfAnnotationFlags Flags { get { return (PdfAnnotationFlags)Elements.GetInteger(Keys.F); } set { Elements.SetInteger(Keys.F, (int)value); Elements.SetDateTime(Keys.M, DateTime.Now); } } /// /// Gets or sets the PdfAnnotations object that this annotation belongs to. /// public PdfAnnotations Parent { get { return this.parent; } set { this.parent = value; } } PdfAnnotations parent; /// /// Gets or sets the annotation rectangle, defining the location of the annotation /// on the page in default user space units. /// public PdfRectangle Rectangle { get { return Elements.GetRectangle(Keys.Rect, true); } set { Elements.SetRectangle(Keys.Rect, value); Elements.SetDateTime(Keys.M, DateTime.Now); } } /// /// Gets or sets the text label to be displayed in the title bar of the annotations /// pop-up window when open and active. By convention, this entry identifies /// the user who added the annotation. /// public string Title { get { return Elements.GetString(Keys.T, true); } set { Elements.SetString(Keys.T, value); Elements.SetDateTime(Keys.M, DateTime.Now); } } /// /// Gets or sets text representing a short description of the subject being /// addressed by the annotation. /// public string Subject { get { return Elements.GetString(Keys.Subj, true); } set { Elements.SetString(Keys.Subj, value); Elements.SetDateTime(Keys.M, DateTime.Now); } } /// /// Gets or sets the text to be displayed for the annotation or, if this type of /// annotation does not display text, an alternate description of the annotations /// contents in human-readable form. /// public string Contents { get { return Elements.GetString(Keys.Contents, true); } set { Elements.SetString(Keys.Contents, value); Elements.SetDateTime(Keys.M, DateTime.Now); } } /// /// Gets or sets the color representing the components of the annotation. If the color /// has an alpha value other than 1, it is ignored. Use property Opacity to get or set the /// opacity of an annotation. /// public XColor Color { get { PdfItem item = Elements[Keys.C]; if (item is PdfArray) // TODO: check for iref? { PdfArray array = (PdfArray)item; if (array.Elements.Count == 3) { // TODO: an array.GetColor() function may be useful here return XColor.FromArgb( (int)(array.Elements.GetReal(0) * 255), (int)(array.Elements.GetReal(1) * 255), (int)(array.Elements.GetReal(2) * 255)); } } return XColors.Black; } set { // TODO: an array.SetColor(clr) function may be useful here PdfArray array = new PdfArray(this.Owner, new PdfReal[] { new PdfReal(value.R / 255.0), new PdfReal(value.G / 255.0), new PdfReal(value.B / 255.0) }); Elements[Keys.C] = array; Elements.SetDateTime(Keys.M, DateTime.Now); } } /// /// Gets or sets the constant opacity value to be used in painting the annotation. /// This value applies to all visible elements of the annotation in its closed state /// (including its background and border) but not to the popup window that appears when /// the annotation is opened. /// public double Opacity { get { if (!Elements.ContainsKey(Keys.CA)) return 1; return Elements.GetReal(Keys.CA, true); } set { if (value < 0 || value > 1) throw new ArgumentOutOfRangeException("value", value, "Opacity must be a value in the range from 0 to 1."); Elements.SetReal(Keys.CA, value); Elements.SetDateTime(Keys.M, DateTime.Now); } } /// /// Predefined keys of this dictionary. /// public class Keys : KeysBase { /// /// (Optional) The type of PDF object that this dictionary describes; if present, /// must be Annot for an annotation dictionary. /// [KeyInfo(KeyType.Name | KeyType.Optional, FixedValue = "Annot")] public const string Type = "/Type"; /// /// (Required) The type of annotation that this dictionary describes. /// [KeyInfo(KeyType.Name | KeyType.Required)] public const string Subtype = "/Subtype"; /// /// (Required) The annotation rectangle, defining the location of the annotation /// on the page in default user space units. /// [KeyInfo(KeyType.Rectangle | KeyType.Required)] public const string Rect = "/Rect"; /// /// (Optional) Text to be displayed for the annotation or, if this type of annotation /// does not display text, an alternate description of the annotations contents /// in human-readable form. In either case, this text is useful when /// extracting the documents contents in support of accessibility to users with /// disabilities or for other purposes. /// [KeyInfo(KeyType.TextString | KeyType.Optional)] public const string Contents = "/Contents"; // P /// /// (Optional; PDF 1.4) The annotation name, a text string uniquely identifying it /// among all the annotations on its page. /// [KeyInfo(KeyType.TextString | KeyType.Optional)] public const string NM = "/NM"; /// /// (Optional; PDF 1.1) The date and time when the annotation was most recently /// modified. The preferred format is a date string, but viewer applications should be /// prepared to accept and display a string in any format. /// [KeyInfo(KeyType.Date | KeyType.Optional)] public const string M = "/M"; /// /// (Optional; PDF 1.1) A set of flags specifying various characteristics of the annotation. /// Default value: 0. /// [KeyInfo("1.1", KeyType.Integer | KeyType.Optional)] public const string F = "/F"; /// /// (Optional; PDF 1.2) A border style dictionary specifying the characteristics of /// the annotations border. /// [KeyInfo("1.2", KeyType.Dictionary | KeyType.Optional)] public const string BS = "/BS"; /// /// (Optional; PDF 1.2) An appearance dictionary specifying how the annotation /// is presented visually on the page. Individual annotation handlers may ignore /// this entry and provide their own appearances. /// [KeyInfo("1.2", KeyType.Dictionary | KeyType.Optional)] public const string AP = "/AP"; /// /// (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2) /// The annotations appearance state, which selects the applicable appearance stream from /// an appearance subdictionary. /// [KeyInfo("1.2", KeyType.Dictionary | KeyType.Optional)] public const string AS = "/AS"; /// /// (Optional) An array specifying the characteristics of the annotations border. /// The border is specified as a rounded rectangle. /// In PDF 1.0, the array consists of three numbers defining the horizontal corner /// radius, vertical corner radius, and border width, all in default user space units. /// If the corner radii are 0, the border has square (not rounded) corners; if the border /// width is 0, no border is drawn. /// In PDF 1.1, the array may have a fourth element, an optional dash array defining a /// pattern of dashes and gaps to be used in drawing the border. The dash array is /// specified in the same format as in the line dash pattern parameter of the graphics state. /// For example, a Border value of [0 0 1 [3 2]] specifies a border 1 unit wide, with /// square corners, drawn with 3-unit dashes alternating with 2-unit gaps. Note that no /// dash phase is specified; the phase is assumed to be 0. /// Note: In PDF 1.2 or later, this entry may be ignored in favor of the BS entry. /// [KeyInfo(KeyType.Array | KeyType.Optional)] public const string Border = "/Border"; /// /// (Optional; PDF 1.1) An array of three numbers in the range 0.0 to 1.0, representing /// the components of a color in the DeviceRGB color space. This color is used for the /// following purposes: /// The background of the annotations icon when closed /// The title bar of the annotations pop-up window /// The border of a link annotation /// [KeyInfo("1.1", KeyType.Array | KeyType.Optional)] public const string C = "/C"; /// /// (Optional; PDF 1.1) An action to be performed when the annotation is activated. /// Note: This entry is not permitted in link annotations if a Dest entry is present. /// Also note that the A entry in movie annotations has a different meaning. /// [KeyInfo("1.1", KeyType.Dictionary | KeyType.Optional)] public const string A = "/A"; // AA // StructParent // OC // ----- Excerpt of entries specific to markup annotations ---------------------------------- /// /// (Optional; PDF 1.1) The text label to be displayed in the title bar of the annotations /// pop-up window when open and active. By convention, this entry identifies /// the user who added the annotation. /// [KeyInfo(KeyType.TextString | KeyType.Optional)] public const string T = "/T"; /// /// (Optional; PDF 1.3) An indirect reference to a pop-up annotation for entering or /// editing the text associated with this annotation. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional)] public const string Popup = "/Popup"; /// /// (Optional; PDF 1.4) The constant opacity value to be used in painting the annotation. /// This value applies to all visible elements of the annotation in its closed state /// (including its background and border) but not to the popup window that appears when /// the annotation is opened. /// The specified value is not used if the annotation has an appearance stream; in that /// case, the appearance stream must specify any transparency. (However, if the viewer /// regenerates the annotations appearance stream, it may incorporate the CA value /// into the streams content.) /// The implicit blend mode is Normal. /// Default value: 1.0. /// [KeyInfo(KeyType.Real | KeyType.Optional)] public const string CA = "/CA"; //RC //CreationDate //IRT /// /// (Optional; PDF 1.5) Text representing a short description of the subject being /// addressed by the annotation. /// [KeyInfo("1.5", KeyType.TextString | KeyType.Optional)] public const string Subj = "/Subj"; //RT //IT } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Security/0000777000175000001440000000000011533760020021412 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Security/PdfSecurityHandler.cs0000644000175000001440000001561511435766646025531 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf; using PdfSharp.Internal; using PdfSharp.Drawing; namespace PdfSharp.Pdf.Security { /// /// Represents the base of all security handlers. /// public abstract class PdfSecurityHandler : PdfDictionary { internal PdfSecurityHandler(PdfDocument document) : base(document) { } internal PdfSecurityHandler(PdfDictionary dict) : base(dict) { } /// /// Predefined keys of this dictionary. /// internal class Keys : KeysBase { /// /// (Required) The name of the preferred security handler for this document. Typically, /// it is the name of the security handler that was used to encrypt the document. If /// SubFilter is not present, only this security handler should be used when opening /// the document. If it is present, consumer applications can use any security handler /// that implements the format specified by SubFilter. /// Standard is the name of the built-in password-based security handler. Names for other /// security handlers can be registered by using the procedure described in Appendix E. /// [KeyInfo(KeyType.Name | KeyType.Required)] public const string Filter = "/Filter"; /// /// (Optional; PDF 1.3) A name that completely specifies the format and interpretation of /// the contents of the encryption dictionary. It is needed to allow security handlers other /// than the one specified by Filter to decrypt the document. If this entry is absent, other /// security handlers should not be allowed to decrypt the document. /// [KeyInfo("1.3", KeyType.Name | KeyType.Optional)] public const string SubFilter = "/SubFilter"; /// /// (Optional but strongly recommended) A code specifying the algorithm to be used in encrypting /// and decrypting the document: /// 0 An algorithm that is undocumented and no longer supported, and whose use is strongly discouraged. /// 1 Algorithm 3.1, with an encryption key length of 40 bits. /// 2 (PDF 1.4) Algorithm 3.1, but permitting encryption key lengths greater than 40 bits. /// 3 (PDF 1.4) An unpublished algorithm that permits encryption key lengths ranging from 40 to 128 bits. /// 4 (PDF 1.5) The security handler defines the use of encryption and decryption in the document, using /// the rules specified by the CF, StmF, and StrF entries. /// The default value if this entry is omitted is 0, but a value of 1 or greater is strongly recommended. /// [KeyInfo(KeyType.Integer | KeyType.Optional)] public const string V = "/V"; /// /// (Optional; PDF 1.4; only if V is 2 or 3) The length of the encryption key, in bits. /// The value must be a multiple of 8, in the range 40 to 128. Default value: 40. /// [KeyInfo("1.4", KeyType.Integer | KeyType.Optional)] public const string Length = "/Length"; /// /// (Optional; meaningful only when the value of V is 4; PDF 1.5) /// A dictionary whose keys are crypt filter names and whose values are the corresponding /// crypt filter dictionaries. Every crypt filter used in the document must have an entry /// in this dictionary, except for the standard crypt filter names. /// [KeyInfo(KeyType.Dictionary | KeyType.Optional)] public const string CF = "/CF"; /// /// (Optional; meaningful only when the value of V is 4; PDF 1.5) /// The name of the crypt filter that is used by default when decrypting streams. /// The name must be a key in the CF dictionary or a standard crypt filter name. All streams /// in the document, except for cross-reference streams or streams that have a Crypt entry in /// their Filter array, are decrypted by the security handler, using this crypt filter. /// Default value: Identity. /// [KeyInfo("1.5", KeyType.Name | KeyType.Optional)] public const string StmF = "/StmF"; /// /// (Optional; meaningful only when the value of V is 4; PDF 1.) /// The name of the crypt filter that is used when decrypting all strings in the document. /// The name must be a key in the CF dictionary or a standard crypt filter name. /// Default value: Identity. /// [KeyInfo("1.5", KeyType.Name | KeyType.Optional)] public const string StrF = "/StrF"; /// /// (Optional; meaningful only when the value of V is 4; PDF 1.6) /// The name of the crypt filter that should be used by default when encrypting embedded /// file streams; it must correspond to a key in the CF dictionary or a standard crypt /// filter name. This entry is provided by the security handler. Applications should respect /// this value when encrypting embedded files, except for embedded file streams that have /// their own crypt filter specifier. If this entry is not present, and the embedded file /// stream does not contain a crypt filter specifier, the stream should be encrypted using /// the default stream crypt filter specified by StmF. /// [KeyInfo("1.6", KeyType.Name | KeyType.Optional)] public const string EFF = "/EFF"; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Security/enums/0000777000175000001440000000000011533760020022541 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Security/enums/PdfUserAccessPermission.cs0000644000175000001440000001000511435766646027650 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; namespace PdfSharp.Pdf.Security { /// /// Specifies which operations are permitted when the document is opened with user access. /// [Flags] internal enum PdfUserAccessPermission { /// /// Permits everything. This is the default value. /// PermitAll = -3, // = 0xFFFFFFFC, // Bit 12 Reserved; must be 0. // Bit 3 (Revision 2) Print the document. // (Revision 3 or greater) Print the document (possibly not at the highest // quality level, depending on whether bit 12 is also set). PermitPrint = 0x00000004, //1 << (3 - 1), // Bit 4 Modify the contents of the document by operations other than // those controlled by bits 6, 9, and 11. PermitModifyDocument = 0x00000008, //1 << (4 - 1), // Bit 5 (Revision 2) Copy or otherwise extract text and graphics from the // document, including extracting text and graphics (in support of accessibility // to users with disabilities or for other purposes). // (Revision 3 or greater) Copy or otherwise extract text and graphics // from the document by operations other than that controlled by bit 10. PermitExtractContent = 0x00000010, //1 << (5 - 1), // Bit 6 Add or modify text annotations, fill in interactive form fields, and, // if bit 4 is also set, create or modify interactive form fields (including // signature fields). PermitAnnotations = 0x00000020, //1 << (6 - 1), // Bit 78 Reserved; must be 1. // 9 (Revision 3 or greater) Fill in existing interactive form fields (including // signature fields), even if bit 6 is clear. PermitFormsFill = 0x00000100, //1 << (9 - 1), // Bit 10 (Revision 3 or greater) Extract text and graphics (in support of accessibility // to users with disabilities or for other purposes). PermitAccessibilityExtractContent = 0x00000200, //1 << (10 - 1), // Bit 11 (Revision 3 or greater) Assemble the document (insert, rotate, or delete // pages and create bookmarks or thumbnail images), even if bit 4 // is clear. PermitAssembleDocument = 0x00000400, //1 << (11 - 1), // Bit 12 (Revision 3 or greater) Print the document to a representation from // which a faithful digital copy of the PDF content could be generated. // When this bit is clear (and bit 3 is set), printing is limited to a lowlevel // representation of the appearance, possibly of degraded quality. // (See implementation note 24 in Appendix H.) PermitFullQualityPrint = 0x00000800, //1 << (12 - 1), //Bit 1332 (Revision 3 or greater) Reserved; must be 1. } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Security/enums/PdfDocumentSecurity.cs0000644000175000001440000000370411435766646027055 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace PdfSharp.Pdf.Security { /// /// Specifies the security level of the PDF document. /// public enum PdfDocumentSecurityLevel { /// /// Document is not protected. /// None, /// /// Document is protected with 40-bit security. This option is for compatibility with /// Acrobat 3 and 4 only. Use Encrypted128Bit whenever possible. /// Encrypted40Bit, /// /// Document is protected with 128-bit security. /// Encrypted128Bit, } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Security/PdfSecuritySettings.cs0000644000175000001440000002223111435766646025744 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections; using PdfSharp.Pdf; using PdfSharp.Pdf.Internal; using PdfSharp.Pdf.Security; using PdfSharp.Internal; using PdfSharp.Drawing; namespace PdfSharp.Pdf.Security { /// /// Encapsulates access to the security settings of a PDF document. /// public sealed class PdfSecuritySettings { internal PdfSecuritySettings(PdfDocument document) { this.document = document; } PdfDocument document; /// /// Indicates whether the granted access to the document is 'owner permission'. Returns true if the document /// is unprotected or was opened with the owner password. Returns false if the document was opened with the /// user password. /// public bool HasOwnerPermissions { get { return this.hasOwnerPermissions; } } internal bool hasOwnerPermissions = true; /// /// Gets or sets the document security level. If you set the security level to anything but PdfDocumentSecurityLevel.None /// you must also set a user and/or an owner password. Otherwise saving the document will fail. /// public PdfDocumentSecurityLevel DocumentSecurityLevel { get { return this.documentSecurityLevel; } set { this.documentSecurityLevel = value; } } PdfDocumentSecurityLevel documentSecurityLevel; /// /// Sets the user password of the document. Setting a password automatically sets the /// PdfDocumentSecurityLevel to PdfDocumentSecurityLevel.Encrypted128Bit if its current /// value is PdfDocumentSecurityLevel.None. /// public string UserPassword { set { SecurityHandler.UserPassword = value; } } /// /// Sets the owner password of the document. Setting a password automatically sets the /// PdfDocumentSecurityLevel to PdfDocumentSecurityLevel.Encrypted128Bit if its current /// value is PdfDocumentSecurityLevel.None. /// public string OwnerPassword { set { SecurityHandler.OwnerPassword = value; } } /// /// Determines whether the document can be saved. /// internal bool CanSave(ref string message) { if (this.documentSecurityLevel != PdfDocumentSecurityLevel.None) { if ((SecurityHandler.userPassword == null || SecurityHandler.userPassword.Length == 0) && (SecurityHandler.ownerPassword == null || SecurityHandler.ownerPassword.Length == 0)) { message = PSSR.UserOrOwnerPasswordRequired; return false; } } return true; } #region Permissions //TODO: Use documentation from our English Acrobat 6.0 version. /// /// Permits printing the document. Should be used in conjunction with PermitFullQualityPrint. /// public bool PermitPrint { get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitPrint) != 0; } set { PdfUserAccessPermission permission = SecurityHandler.Permission; if (value) permission |= PdfUserAccessPermission.PermitPrint; else permission &= ~PdfUserAccessPermission.PermitPrint; SecurityHandler.Permission = permission; } } /// /// Permits modifying the document. /// public bool PermitModifyDocument { get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitModifyDocument) != 0; } set { PdfUserAccessPermission permission = SecurityHandler.Permission; if (value) permission |= PdfUserAccessPermission.PermitModifyDocument; else permission &= ~PdfUserAccessPermission.PermitModifyDocument; SecurityHandler.Permission = permission; } } /// /// Permits content copying or extraction. /// public bool PermitExtractContent { get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitExtractContent) != 0; } set { PdfUserAccessPermission permission = SecurityHandler.Permission; if (value) permission |= PdfUserAccessPermission.PermitExtractContent; else permission &= ~PdfUserAccessPermission.PermitExtractContent; SecurityHandler.Permission = permission; } } /// /// Permits commenting the document. /// public bool PermitAnnotations { get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitAnnotations) != 0; } set { PdfUserAccessPermission permission = SecurityHandler.Permission; if (value) permission |= PdfUserAccessPermission.PermitAnnotations; else permission &= ~PdfUserAccessPermission.PermitAnnotations; SecurityHandler.Permission = permission; } } /// /// Permits filling of form fields. /// public bool PermitFormsFill { get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitFormsFill) != 0; } set { PdfUserAccessPermission permission = SecurityHandler.Permission; if (value) permission |= PdfUserAccessPermission.PermitFormsFill; else permission &= ~PdfUserAccessPermission.PermitFormsFill; SecurityHandler.Permission = permission; } } /// /// Permits content extraction for accessibility. /// public bool PermitAccessibilityExtractContent { get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitAccessibilityExtractContent) != 0; } set { PdfUserAccessPermission permission = SecurityHandler.Permission; if (value) permission |= PdfUserAccessPermission.PermitAccessibilityExtractContent; else permission &= ~PdfUserAccessPermission.PermitAccessibilityExtractContent; SecurityHandler.Permission = permission; } } /// /// Permits to insert, rotate, or delete pages and create bookmarks or thumbnail images even if /// PermitModifyDocument is not set. /// public bool PermitAssembleDocument { get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitAssembleDocument) != 0; } set { PdfUserAccessPermission permission = SecurityHandler.Permission; if (value) permission |= PdfUserAccessPermission.PermitAssembleDocument; else permission &= ~PdfUserAccessPermission.PermitAssembleDocument; SecurityHandler.Permission = permission; } } /// /// Permits to print in high quality. insert, rotate, or delete pages and create bookmarks or thumbnail images /// even if PermitModifyDocument is not set. /// public bool PermitFullQualityPrint { get { return (SecurityHandler.Permission & PdfUserAccessPermission.PermitFullQualityPrint) != 0; } set { PdfUserAccessPermission permission = SecurityHandler.Permission; if (value) permission |= PdfUserAccessPermission.PermitFullQualityPrint; else permission &= ~PdfUserAccessPermission.PermitFullQualityPrint; SecurityHandler.Permission = permission; } } #endregion /// /// PdfStandardSecurityHandler is the only implemented handler. /// internal PdfStandardSecurityHandler SecurityHandler { get { return this.document.trailer.SecurityHandler; } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Pdf.Security/PdfStandardSecurityHandler.cs0000644000175000001440000006025011435766646027205 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Collections; using PdfSharp.Drawing; using PdfSharp.Internal; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; using PdfSharp.Pdf.Advanced; using PdfSharp.Pdf.Internal; using System.Security.Cryptography; namespace PdfSharp.Pdf.Security { /// /// Represents the standard PDF security handler. /// public sealed class PdfStandardSecurityHandler : PdfSecurityHandler { internal PdfStandardSecurityHandler(PdfDocument document) : base(document) { } internal PdfStandardSecurityHandler(PdfDictionary dict) : base(dict) { } /// /// Sets the user password of the document. Setting a password automatically sets the /// PdfDocumentSecurityLevel to PdfDocumentSecurityLevel.Encrypted128Bit if its current /// value is PdfDocumentSecurityLevel.None. /// public string UserPassword { set { if (this.document.securitySettings.DocumentSecurityLevel == PdfDocumentSecurityLevel.None) this.document.securitySettings.DocumentSecurityLevel = PdfDocumentSecurityLevel.Encrypted128Bit; this.userPassword = value; } } internal string userPassword; /// /// Sets the owner password of the document. Setting a password automatically sets the /// PdfDocumentSecurityLevel to PdfDocumentSecurityLevel.Encrypted128Bit if its current /// value is PdfDocumentSecurityLevel.None. /// public string OwnerPassword { set { if (this.document.securitySettings.DocumentSecurityLevel == PdfDocumentSecurityLevel.None) this.document.securitySettings.DocumentSecurityLevel = PdfDocumentSecurityLevel.Encrypted128Bit; this.ownerPassword = value; } } internal string ownerPassword; /// /// Gets or sets the user access permission represented as an integer in the P key. /// internal PdfUserAccessPermission Permission { get { PdfUserAccessPermission permission = (PdfUserAccessPermission)Elements.GetInteger(Keys.P); if ((int)permission == 0) permission = PdfUserAccessPermission.PermitAll; return permission; } set { Elements.SetInteger(Keys.P, (int)value); } } /// /// Encrypts the whole document. /// public void EncryptDocument() { foreach (PdfReference iref in this.document.irefTable.AllReferences) { if (!ReferenceEquals(iref.Value, this)) EncryptObject(iref.Value); } } /// /// Encrypts an indirect object. /// internal void EncryptObject(PdfObject value) { Debug.Assert(value.Reference != null); SetHashKey(value.ObjectID); #if DEBUG if (value.ObjectID.ObjectNumber == 10) GetType(); #endif PdfDictionary dict; PdfArray array; PdfStringObject str; if ((dict = value as PdfDictionary) != null) EncryptDictionary(dict); else if ((array = value as PdfArray) != null) EncryptArray(array); else if ((str = value as PdfStringObject) != null) { if (str.Length != 0) { byte[] bytes = str.EncryptionValue; PrepareKey(); EncryptRC4(bytes); str.EncryptionValue = bytes; } } } /// /// Encrypts a dictionary. /// void EncryptDictionary(PdfDictionary dict) { PdfName[] names = dict.Elements.KeyNames; foreach (KeyValuePair item in dict.Elements) { PdfString value1; PdfDictionary value2; PdfArray value3; if ((value1 = item.Value as PdfString) != null) EncryptString(value1); else if ((value2 = item.Value as PdfDictionary) != null) EncryptDictionary(value2); else if ((value3 = item.Value as PdfArray) != null) EncryptArray(value3); } if (dict.Stream != null) { byte[] bytes = dict.Stream.Value; if (bytes.Length != 0) { PrepareKey(); EncryptRC4(bytes); dict.Stream.Value = bytes; } } } /// /// Encrypts an array. /// void EncryptArray(PdfArray array) { int count = array.Elements.Count; for (int idx = 0; idx < count; idx++) { PdfItem item = array.Elements[idx]; PdfString value1; PdfDictionary value2; PdfArray value3; if ((value1 = item as PdfString) != null) EncryptString(value1); else if ((value2 = item as PdfDictionary) != null) EncryptDictionary(value2); else if ((value3 = item as PdfArray) != null) EncryptArray(value3); } } /// /// Encrypts a string. /// void EncryptString(PdfString value) { if (value.Length != 0) { byte[] bytes = value.EncryptionValue; PrepareKey(); EncryptRC4(bytes); value.EncryptionValue = bytes; } } /// /// Encrypts an array. /// internal byte[] EncryptBytes(byte[] bytes) { if (bytes != null && bytes.Length != 0) { PrepareKey(); EncryptRC4(bytes); } return bytes; } #region Encryption Algorithms /// /// Checks the password. /// /// Password or null if no password is provided. public PasswordValidity ValidatePassword(string inputPassword) { // We can handle 40 and 128 bit standard encryption string filter = Elements.GetName(PdfSecurityHandler.Keys.Filter); int v = Elements.GetInteger(PdfSecurityHandler.Keys.V); if (filter != "/Standard" || !(v >= 1 && v <= 3)) throw new PdfReaderException(PSSR.UnknownEncryption); byte[] documentID = PdfEncoders.RawEncoding.GetBytes(Owner.Internals.FirstDocumentID); byte[] oValue = PdfEncoders.RawEncoding.GetBytes(Elements.GetString(Keys.O)); byte[] uValue = PdfEncoders.RawEncoding.GetBytes(Elements.GetString(Keys.U)); int pValue = Elements.GetInteger(Keys.P); int rValue = Elements.GetInteger(Keys.R); if (inputPassword == null) inputPassword = ""; bool strongEncryption = rValue == 3; int keyLength = strongEncryption ? 16 : 32; #if true // Try owner password first byte[] password = PdfEncoders.RawEncoding.GetBytes(inputPassword); InitWidhOwnerPassword(documentID, inputPassword, oValue, pValue, strongEncryption); if (EqualsKey(uValue, keyLength)) { this.document.SecuritySettings.hasOwnerPermissions = true; return PasswordValidity.OwnerPassword; } this.document.SecuritySettings.hasOwnerPermissions = false; // Now try user password password = PdfEncoders.RawEncoding.GetBytes(inputPassword); InitWidhUserPassword(documentID, inputPassword, oValue, pValue, strongEncryption); if (!EqualsKey(uValue, keyLength)) return PasswordValidity.Invalid; return PasswordValidity.UserPassword; #else password = PdfEncoders.RawEncoding.GetBytes(inputPassword); InitWidhUserPassword(documentID, inputPassword, oValue, pValue, strongEncryption); this.document.SecuritySettings.hasOwnerPermissions = false; if (!EqualsKey(uValue, keyLength)) { password = PdfEncoders.RawEncoding.GetBytes(inputPassword); // Compare owner password InitWidhOwnerPassword(documentID, inputPassword, oValue, pValue, strongEncryption); if (!EqualsKey(uValue, keyLength)) { //Compare user password InitWidhUserPassword(documentID, inputPassword, oValue, pValue, strongEncryption); if (!EqualsKey(uValue, keyLength)) return 0; return 1; } this.document.SecuritySettings.hasOwnerPermissions = true; return 2; } return 1; #endif } [Conditional("DEBUG")] static void DumpBytes(string tag, byte[] bytes) { string dump = tag + ": "; for (int idx = 0; idx < bytes.Length; idx++) dump += String.Format("{0:X2}", bytes[idx]); Debug.WriteLine(dump); } /// /// Pads a password to a 32 byte array. /// static byte[] PadPassword(string password) { byte[] padded = new byte[32]; if (password == null) Array.Copy(passwordPadding, 0, padded, 0, 32); else { int length = password.Length; Array.Copy(PdfEncoders.RawEncoding.GetBytes(password), 0, padded, 0, Math.Min(length, 32)); if (length < 32) Array.Copy(passwordPadding, 0, padded, length, 32 - length); } return padded; } static byte[] passwordPadding = // 32 bytes password padding defined by Adobe { 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08, 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A, }; /// /// Generates the user key based on the padded user password. /// void InitWidhUserPassword(byte[] documentID, string userPassword, byte[] ownerKey, int permissions, bool strongEncryption) { InitEncryptionKey(documentID, PadPassword(userPassword), ownerKey, permissions, strongEncryption); SetupUserKey(documentID); } /// /// Generates the user key based on the padded owner password. /// void InitWidhOwnerPassword(byte[] documentID, string ownerPassword, byte[] ownerKey, int permissions, bool strongEncryption) { byte[] userPad = ComputeOwnerKey(ownerKey, PadPassword(ownerPassword), strongEncryption); InitEncryptionKey(documentID, userPad, ownerKey, permissions, strongEncryption); SetupUserKey(documentID); } /// /// Computes the padded user password from the padded owner password. /// byte[] ComputeOwnerKey(byte[] userPad, byte[] ownerPad, bool strongEncryption) { byte[] ownerKey = new byte[32]; #if !SILVERLIGHT byte[] digest = this.md5.ComputeHash(ownerPad); if (strongEncryption) { byte[] mkey = new byte[16]; // Hash the pad 50 times for (int idx = 0; idx < 50; idx++) digest = this.md5.ComputeHash(digest); Array.Copy(userPad, 0, ownerKey, 0, 32); // Encrypt the key for (int i = 0; i < 20; i++) { for (int j = 0; j < mkey.Length; ++j) mkey[j] = (byte)(digest[j] ^ i); PrepareRC4Key(mkey); EncryptRC4(ownerKey); } } else { PrepareRC4Key(digest, 0, 5); EncryptRC4(userPad, ownerKey); } #endif return ownerKey; } /// /// Computes the encryption key. /// void InitEncryptionKey(byte[] documentID, byte[] userPad, byte[] ownerKey, int permissions, bool strongEncryption) { #if !SILVERLIGHT this.ownerKey = ownerKey; this.encryptionKey = new byte[strongEncryption ? 16 : 5]; this.md5.Initialize(); this.md5.TransformBlock(userPad, 0, userPad.Length, userPad, 0); this.md5.TransformBlock(ownerKey, 0, ownerKey.Length, ownerKey, 0); // Split permission into 4 bytes byte[] permission = new byte[4]; permission[0] = (byte)permissions; permission[1] = (byte)(permissions >> 8); permission[2] = (byte)(permissions >> 16); permission[3] = (byte)(permissions >> 24); this.md5.TransformBlock(permission, 0, 4, permission, 0); this.md5.TransformBlock(documentID, 0, documentID.Length, documentID, 0); this.md5.TransformFinalBlock(permission, 0, 0); byte[] digest = this.md5.Hash; this.md5.Initialize(); // Create the hash 50 times (only for 128 bit) if (this.encryptionKey.Length == 16) { for (int idx = 0; idx < 50; idx++) { digest = this.md5.ComputeHash(digest); this.md5.Initialize(); } } Array.Copy(digest, 0, this.encryptionKey, 0, this.encryptionKey.Length); #endif } /// /// Computes the user key. /// void SetupUserKey(byte[] documentID) { #if !SILVERLIGHT if (this.encryptionKey.Length == 16) { this.md5.TransformBlock(passwordPadding, 0, passwordPadding.Length, passwordPadding, 0); this.md5.TransformFinalBlock(documentID, 0, documentID.Length); byte[] digest = this.md5.Hash; this.md5.Initialize(); Array.Copy(digest, 0, this.userKey, 0, 16); for (int idx = 16; idx < 32; idx++) this.userKey[idx] = 0; //Encrypt the key for (int i = 0; i < 20; i++) { for (int j = 0; j < this.encryptionKey.Length; j++) digest[j] = (byte)(this.encryptionKey[j] ^ i); PrepareRC4Key(digest, 0, this.encryptionKey.Length); EncryptRC4(this.userKey, 0, 16); } } else { PrepareRC4Key(this.encryptionKey); EncryptRC4(passwordPadding, this.userKey); } #endif } /// /// Prepare the encryption key. /// void PrepareKey() { PrepareRC4Key(this.key, 0, this.keySize); } /// /// Prepare the encryption key. /// void PrepareRC4Key(byte[] key) { PrepareRC4Key(key, 0, key.Length); } /// /// Prepare the encryption key. /// void PrepareRC4Key(byte[] key, int offset, int length) { int idx1 = 0; int idx2 = 0; for (int idx = 0; idx < 256; idx++) this.state[idx] = (byte)idx; byte tmp; for (int idx = 0; idx < 256; idx++) { idx2 = (key[idx1 + offset] + this.state[idx] + idx2) & 255; tmp = this.state[idx]; this.state[idx] = this.state[idx2]; this.state[idx2] = tmp; idx1 = (idx1 + 1) % length; } } /// /// Encrypts the data. /// void EncryptRC4(byte[] data) { EncryptRC4(data, 0, data.Length, data); } /// /// Encrypts the data. /// void EncryptRC4(byte[] data, int offset, int length) { EncryptRC4(data, offset, length, data); } /// /// Encrypts the data. /// void EncryptRC4(byte[] inputData, byte[] outputData) { EncryptRC4(inputData, 0, inputData.Length, outputData); } /// /// Encrypts the data. /// void EncryptRC4(byte[] inputData, int offset, int length, byte[] outputData) { length += offset; int x = 0, y = 0; byte b; for (int idx = offset; idx < length; idx++) { x = (x + 1) & 255; y = (this.state[x] + y) & 255; b = this.state[x]; this.state[x] = this.state[y]; this.state[y] = b; outputData[idx] = (byte)(inputData[idx] ^ state[(this.state[x] + this.state[y]) & 255]); } } /// /// Checks whether the calculated key correct. /// bool EqualsKey(byte[] value, int length) { for (int idx = 0; idx < length; idx++) { if (this.userKey[idx] != value[idx]) return false; } return true; } /// /// Set the hash key for the specified object. /// internal void SetHashKey(PdfObjectID id) { #if !SILVERLIGHT byte[] objectId = new byte[5]; this.md5.Initialize(); // Split the object number and generation objectId[0] = (byte)id.ObjectNumber; objectId[1] = (byte)(id.ObjectNumber >> 8); objectId[2] = (byte)(id.ObjectNumber >> 16); objectId[3] = (byte)id.GenerationNumber; objectId[4] = (byte)(id.GenerationNumber >> 8); this.md5.TransformBlock(this.encryptionKey, 0, this.encryptionKey.Length, this.encryptionKey, 0); this.md5.TransformFinalBlock(objectId, 0, objectId.Length); this.key = this.md5.Hash; this.md5.Initialize(); this.keySize = this.encryptionKey.Length + 5; if (this.keySize > 16) this.keySize = 16; #endif } /// /// Prepares the security handler for encrypting the document. /// public void PrepareEncryption() { #if !SILVERLIGHT Debug.Assert(this.document.securitySettings.DocumentSecurityLevel != PdfDocumentSecurityLevel.None); int permissions = (int)this.Permission; bool strongEncryption = this.document.securitySettings.DocumentSecurityLevel == PdfDocumentSecurityLevel.Encrypted128Bit; PdfInteger vValue; PdfInteger length; PdfInteger rValue; if (strongEncryption) { vValue = new PdfInteger(2); length = new PdfInteger(128); rValue = new PdfInteger(3); } else { vValue = new PdfInteger(1); length = new PdfInteger(40); rValue = new PdfInteger(2); } if (String.IsNullOrEmpty(this.userPassword)) this.userPassword = ""; // Use user password twice if no owner password provided. if (String.IsNullOrEmpty(this.ownerPassword)) this.ownerPassword = this.userPassword; // Correct permission bits permissions |= (int)(strongEncryption ? (uint)0xfffff0c0 : (uint)0xffffffc0); permissions &= unchecked((int)0xfffffffc); PdfInteger pValue = new PdfInteger(permissions); Debug.Assert(this.ownerPassword.Length > 0, "Empty owner password."); byte[] userPad = PadPassword(this.userPassword); byte[] ownerPad = PadPassword(this.ownerPassword); this.md5.Initialize(); this.ownerKey = ComputeOwnerKey(userPad, ownerPad, strongEncryption); byte[] documentID = PdfEncoders.RawEncoding.GetBytes(this.document.Internals.FirstDocumentID); InitWidhUserPassword(documentID, this.userPassword, this.ownerKey, permissions, strongEncryption); PdfString oValue = new PdfString(PdfEncoders.RawEncoding.GetString(this.ownerKey)); PdfString uValue = new PdfString(PdfEncoders.RawEncoding.GetString(this.userKey)); Elements[Keys.Filter] = new PdfName("/Standard"); Elements[Keys.V] = vValue; Elements[Keys.Length] = length; Elements[Keys.R] = rValue; Elements[Keys.O] = oValue; Elements[Keys.U] = uValue; Elements[Keys.P] = pValue; #endif } /// /// The global encryption key. /// byte[] encryptionKey; #if !SILVERLIGHT /// /// The message digest algorithm MD5. /// MD5 md5 = new MD5CryptoServiceProvider(); #endif /// /// Bytes used for RC4 encryption. /// byte[] state = new byte[256]; /// /// The encryption key for the owner. /// byte[] ownerKey = new byte[32]; /// /// The encryption key for the user. /// byte[] userKey = new byte[32]; /// /// The encryption key for a particular object/generation. /// byte[] key; /// /// The encryption key length for a particular object/generation. /// int keySize; #endregion internal override void WriteObject(PdfWriter writer) { // Don't encypt myself PdfStandardSecurityHandler securityHandler = writer.SecurityHandler; writer.SecurityHandler = null; base.WriteObject(writer); writer.SecurityHandler = securityHandler; } #region Keys /// /// Predefined keys of this dictionary. /// internal sealed new class Keys : PdfSecurityHandler.Keys { /// /// (Required) A number specifying which revision of the standard security handler /// should be used to interpret this dictionary: /// 2 if the document is encrypted with a V value less than 2 and does not have any of /// the access permissions set (by means of the P entry, below) that are designated /// "Revision 3 or greater". /// 3 if the document is encrypted with a V value of 2 or 3, or has any "Revision 3 or /// greater" access permissions set. /// 4 if the document is encrypted with a V value of 4 /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string R = "/R"; /// /// (Required) A 32-byte string, based on both the owner and user passwords, that is /// used in computing the encryption key and in determining whether a valid owner /// password was entered. /// [KeyInfo(KeyType.String | KeyType.Required)] public const string O = "/O"; /// /// (Required) A 32-byte string, based on the user password, that is used in determining /// whether to prompt the user for a password and, if so, whether a valid user or owner /// password was entered. /// [KeyInfo(KeyType.String | KeyType.Required)] public const string U = "/U"; /// /// (Required) A set of flags specifying which operations are permitted when the document /// is opened with user access. /// [KeyInfo(KeyType.Integer | KeyType.Required)] public const string P = "/P"; /// /// (Optional; meaningful only when the value of V is 4; PDF 1.5) Indicates whether /// the document-level metadata stream is to be encrypted. Applications should respect this value. /// Default value: true. /// [KeyInfo(KeyType.Boolean | KeyType.Optional)] public const string EncryptMetadata = "/EncryptMetadata"; /// /// Gets the KeysMeta for these keys. /// public static DictionaryMeta Meta { get { if (meta == null) meta = CreateMeta(typeof(Keys)); return meta; } } static DictionaryMeta meta; } /// /// Gets the KeysMeta of this dictionary type. /// internal override DictionaryMeta Meta { get { return Keys.Meta; } } #endregion } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/0000777000175000001440000000000011533760020021726 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/IndexToLocationTable.cs0000644000175000001440000002421211435766646026312 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #define VERBOSE_ using System; using System.Diagnostics; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using System.IO; using PdfSharp.Drawing; using PdfSharp.Internal; using Fixed = System.Int32; using FWord = System.Int16; using UFWord = System.UInt16; namespace PdfSharp.Fonts.OpenType { /// <summary> /// The indexToLoc table stores the offsets to the locations of the glyphs in the font, /// relative to the beginning of the glyphData table. In order to compute the length of /// the last glyph element, there is an extra entry after the last valid index. /// </summary> internal class IndexToLocationTable : OpenTypeFontTable { public const string Tag = TableTagNames.Loca; internal int[] locaTable; public IndexToLocationTable() : base(null, Tag) { DirectoryEntry.Tag = TableTagNames.Loca; } public IndexToLocationTable(FontData fontData) : base(fontData, Tag) { DirectoryEntry = this.fontData.tableDictionary[TableTagNames.Loca]; Read(); } public bool ShortIndex; /// <summary> /// Converts the bytes in a handy representation /// </summary> public void Read() { try { ShortIndex = this.fontData.head.indexToLocFormat == 0; this.fontData.Position = DirectoryEntry.Offset; if (ShortIndex) { int entries = DirectoryEntry.Length / 2; Debug.Assert(this.fontData.maxp.numGlyphs + 1 == entries, "For your information only: Number of glyphs mismatch in font. You can ignore this assertion."); this.locaTable = new int[entries]; for (int idx = 0; idx < entries; idx++) locaTable[idx] = 2 * this.fontData.ReadUFWord(); } else { int entries = DirectoryEntry.Length / 4; Debug.Assert(this.fontData.maxp.numGlyphs + 1 == entries, "For your information only: Number of glyphs mismatch in font. You can ignore this assertion."); this.locaTable = new int[entries]; for (int idx = 0; idx < entries; idx++) locaTable[idx] = this.fontData.ReadLong(); } } catch (Exception ex) { throw ex; } } /// <summary> /// Prepares the font table to be compiled into its binary representation. /// </summary> public override void PrepareForCompilation() { DirectoryEntry.Offset = 0; if (ShortIndex) DirectoryEntry.Length = this.locaTable.Length * 2; else DirectoryEntry.Length = this.locaTable.Length * 4; this.bytes = new byte[DirectoryEntry.PaddedLength]; int length = this.locaTable.Length; int byteIdx = 0; if (ShortIndex) { for (int idx = 0; idx < length; idx++) { int value = this.locaTable[idx] / 2; this.bytes[byteIdx++] = (byte)(value >> 8); this.bytes[byteIdx++] = (byte)(value); } } else { for (int idx = 0; idx < length; idx++) { int value = this.locaTable[idx]; this.bytes[byteIdx++] = (byte)(value >> 24); this.bytes[byteIdx++] = (byte)(value >> 16); this.bytes[byteIdx++] = (byte)(value >> 8); this.bytes[byteIdx++] = (byte)value; } } DirectoryEntry.CheckSum = CalcChecksum(this.bytes); } byte[] bytes; /// <summary> /// Converts the font into its binary representation. /// </summary> public override void Write(OpenTypeFontWriter writer) { writer.Write(this.bytes, 0, DirectoryEntry.PaddedLength); } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/FontData.cs0000644000175000001440000014174011435766646024005 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #define VERBOSE_ using System; using System.Diagnostics; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using System.IO; #if WPF using System.Windows.Media; #endif using PdfSharp.Drawing; using PdfSharp.Internal; using Fixed = System.Int32; using FWord = System.Int16; using UFWord = System.UInt16; namespace PdfSharp.Fonts.OpenType { /// <summary> /// Represents an Open Type Font font in memory. /// </summary> class FontData { /// <summary> /// Shallow copy for font subset. /// </summary> FontData(FontData fontData) { this.offsetTable = fontData.offsetTable; } /// <summary> /// Initializes a new instance of the <see cref="FontData"/> class. /// </summary> public FontData(XFont font, XPdfFontOptions options) { #if GDI && !WPF CreateGdiFontImage(font, options); #endif #if WPF && !GDI CreateWpfFontData(font, options); #endif #if WPF && GDI System.Drawing.Font gdiFont = font.RealizeGdiFont(); if (font.font != null) CreateGdiFontImage(font, options); else if (font.typeface != null) CreateWpfFontData(font, options); #endif if (this.data == null) throw new InvalidOperationException("Cannot allocate font data."); Read(); } /// <summary> /// Initializes a new instance of the <see cref="FontData"/> class. /// </summary> public FontData(byte[] data) { // Always save a copy of the font bytes int length = data.Length; byte[] copy = new byte[length]; Array.Copy(data, copy, length); this.data = copy; Read(); } #if GDI /// <summary> /// Create the font image using GDI+ functionality. /// </summary> void CreateGdiFontImage(XFont font, XPdfFontOptions options/*, XPrivateFontCollection privateFontCollection*/) { System.Drawing.Font gdiFont = font.RealizeGdiFont(); NativeMethods.LOGFONT logFont; #if DEBUG_ logFont = new NativeMethods.LOGFONT(); gdiFont.ToLogFont(logFont); Debug.WriteLine("FontData: " + logFont.lfFaceName); #endif this.data = null; // PFC //if (privateFontCollection != null) //{ // //XPrivateFont privateFont = privateFontCollection.FindFont(logFont.lfFaceName, logFont.lfWeight >= 700, logFont.lfItalic > 0); // XGlyphTypeface privateFont = privateFontCollection.FindFont(font.Name, font.Bold, font.Italic); // if (privateFont != null) // { // //////int size = privateFont.GetData(ref this.data); // //////if (size > 0) // //////{ // ////// this.data = new byte[size]; // ////// privateFont.GetData(ref this.data, size); // //////} // } //} if (this.data == null) { int error; IntPtr hfont = gdiFont.ToHfont(); IntPtr hdc = NativeMethods.GetDC(IntPtr.Zero); error = Marshal.GetLastWin32Error(); IntPtr oldFont = NativeMethods.SelectObject(hdc, hfont); error = Marshal.GetLastWin32Error(); // size is exactly the size of the font file. int size = NativeMethods.GetFontData(hdc, 0, 0, null, 0); error = Marshal.GetLastWin32Error(); if (size > 0) { this.data = new byte[size]; int effectiveSize = NativeMethods.GetFontData(hdc, 0, 0, this.data, this.data.Length); Debug.Assert(size == effectiveSize); NativeMethods.SelectObject(hdc, oldFont); NativeMethods.ReleaseDC(IntPtr.Zero, hdc); error.GetType(); } else { // Sometimes size is -1 (GDI_ERROR), but I cannot determine why. It happens only with the font 'Symbol'. // The issue occurs the first time in early 2005, when I start writing PDFsharp. I could not fix it and after // some code refactoring the problem disappears. // There was never a report from anyone about this issue. // Now I get it again (while debugging QBX 2006). Maybe it is a problem with my PC at my home office. // As a work-around I create a new font handle with a different height value. This works. Maybe the // font file gets locked somewhere. Very very strange. // IF SOMEONE ELSE COMES HERE PLEASE LET ME KNOW! // Clean up old handles NativeMethods.SelectObject(hdc, oldFont); NativeMethods.ReleaseDC(IntPtr.Zero, hdc); // Try again with new font handle logFont = new NativeMethods.LOGFONT(); gdiFont.ToLogFont(logFont); logFont.lfHeight += 1; // force new handle IntPtr hfont2 = NativeMethods.CreateFontIndirect(logFont); hdc = NativeMethods.GetDC(IntPtr.Zero); error = Marshal.GetLastWin32Error(); oldFont = NativeMethods.SelectObject(hdc, hfont2); error = Marshal.GetLastWin32Error(); // size is exactly the size of the font file. size = NativeMethods.GetFontData(hdc, 0, 0, null, 0); error = Marshal.GetLastWin32Error(); if (size > 0) { this.data = new byte[size]; int effectiveSize = NativeMethods.GetFontData(hdc, 0, 0, this.data, this.data.Length); Debug.Assert(size == effectiveSize); } NativeMethods.SelectObject(hdc, oldFont); NativeMethods.ReleaseDC(IntPtr.Zero, hdc); NativeMethods.DeleteObject(hfont2); error.GetType(); } } if (this.data == null) throw new InvalidOperationException("Internal error. Font data could not retrieved."); } #endif #if WPF /// <summary> /// Create the font image using WPF functionality. /// </summary> void CreateWpfFontData(XFont font, XPdfFontOptions options) { #if !SILVERLIGHT GlyphTypeface glyphTypeface; if (!font.typeface.TryGetGlyphTypeface(out glyphTypeface)) throw new InvalidOperationException(PSSR.CannotGetGlyphTypeface(font.Name)); Stream fontStream = null; try { fontStream = glyphTypeface.GetFontStream(); int size = (int)fontStream.Length; Debug.Assert(size > 0); this.data = new byte[size]; fontStream.Read(this.data, 0, size); } finally { if (fontStream != null) fontStream.Close(); } #else // AGHACK #endif } #endif /// <summary> /// Gets the bytes that represents the font data. /// </summary> public byte[] Data { get { return this.data; } } byte[] data; internal FontTechnology fontTechnology; internal OffsetTable offsetTable; /// <summary> /// The dictionary of all font tables. /// </summary> internal Dictionary<string, TableDirectoryEntry> tableDictionary = new Dictionary<string, TableDirectoryEntry>(); internal CMapTable cmap; internal ControlValueTable cvt; internal FontProgram fpgm; internal MaximumProfileTable maxp; internal NameTable name; internal ControlValueProgram prep; internal FontHeaderTable head; internal HorizontalHeaderTable hhea; internal HorizontalMetricsTable hmtx; internal OS2Table os2; internal PostScriptTable post; internal GlyphDataTable glyf; internal IndexToLocationTable loca; internal GlyphSubstitutionTable gsub; internal VerticalHeaderTable vhea; // TODO internal VerticalMetricsTable vmtx; // TODO public bool CanRead { get { return this.data != null; } } public bool CanWrite { get { return this.data == null; } } /// <summary> /// Adds the specified table to this font image. /// </summary> public void AddTable(OpenTypeFontTable fontTable) { if (!CanWrite) throw new InvalidOperationException("Font image cannot be modified."); if (fontTable == null) throw new ArgumentNullException("fontTable"); if (fontTable.fontData == null) { fontTable.fontData = this; } else { Debug.Assert(fontTable.fontData.CanRead); // Create a reference to this font table fontTable = new IRefFontTable(this, fontTable); } //Debug.Assert(fontTable.FontData == null); //fontTable.fontData = this; this.tableDictionary[fontTable.DirectoryEntry.Tag] = fontTable.DirectoryEntry; switch (fontTable.DirectoryEntry.Tag) { case TableTagNames.CMap: this.cmap = fontTable as CMapTable; break; case TableTagNames.Cvt: this.cvt = fontTable as ControlValueTable; break; case TableTagNames.Fpgm: this.fpgm = fontTable as FontProgram; break; case TableTagNames.MaxP: this.maxp = fontTable as MaximumProfileTable; break; case TableTagNames.Name: this.name = fontTable as NameTable; break; case TableTagNames.Head: this.head = fontTable as FontHeaderTable; break; case TableTagNames.HHea: this.hhea = fontTable as HorizontalHeaderTable; break; case TableTagNames.HMtx: this.hmtx = fontTable as HorizontalMetricsTable; break; case TableTagNames.OS2: this.os2 = fontTable as OS2Table; break; case TableTagNames.Post: this.post = fontTable as PostScriptTable; break; case TableTagNames.Glyf: this.glyf = fontTable as GlyphDataTable; break; case TableTagNames.Loca: this.loca = fontTable as IndexToLocationTable; break; case TableTagNames.GSUB: this.gsub = fontTable as GlyphSubstitutionTable; break; case TableTagNames.Prep: this.prep = fontTable as ControlValueProgram; break; } } /// <summary> /// Reads all required tables from the font data. /// </summary> internal void Read() { try { // Read offset table this.offsetTable.Version = ReadULong(); this.offsetTable.TableCount = ReadUShort(); this.offsetTable.SearchRange = ReadUShort(); this.offsetTable.EntrySelector = ReadUShort(); this.offsetTable.RangeShift = ReadUShort(); // Move to table dictionary at position 12 Debug.Assert(this.pos == 12); //this.tableDictionary = (this.offsetTable.TableCount); // ReSharper disable InconsistentNaming // Determine font technology const uint OTTO = 0x4f54544f; // Adobe OpenType CFF data, tag: 'OTTO' const uint TTCF = 0x74746366; // TrueType Collection tag: 'ttcf' // ReSharper restore InconsistentNaming if (this.offsetTable.Version == TTCF) { this.fontTechnology = FontTechnology.TrueTypeCollection; throw new InvalidOperationException("TrueType collection fonts are not supported by PDFsharp."); } else if (this.offsetTable.Version == OTTO) this.fontTechnology = FontTechnology.PostscriptOutlines; else this.fontTechnology = FontTechnology.TrueTypeOutlines; for (int idx = 0; idx < this.offsetTable.TableCount; idx++) { TableDirectoryEntry entry = TableDirectoryEntry.ReadFrom(this); this.tableDictionary.Add(entry.Tag, entry); #if VERBOSE Debug.WriteLine(String.Format("Font table: {0}", entry.Tag)); #endif } // PDFlib checks this, but it is not part of the OpenType spec anymore if (this.tableDictionary.ContainsKey("bhed")) throw new NotSupportedException("Bitmap fonts are not supported by PDFsharp."); // Read required tables if (Seek(CMapTable.Tag) != -1) this.cmap = new CMapTable(this); if (Seek(ControlValueTable.Tag) != -1) this.cvt = new ControlValueTable(this); if (Seek(FontProgram.Tag) != -1) this.fpgm = new FontProgram(this); if (Seek(MaximumProfileTable.Tag) != -1) this.maxp = new MaximumProfileTable(this); if (Seek(NameTable.Tag) != -1) this.name = new NameTable(this); if (Seek(FontHeaderTable.Tag) != -1) this.head = new FontHeaderTable(this); if (Seek(HorizontalHeaderTable.Tag) != -1) this.hhea = new HorizontalHeaderTable(this); if (Seek(HorizontalMetricsTable.Tag) != -1) this.hmtx = new HorizontalMetricsTable(this); if (Seek(OS2Table.Tag) != -1) this.os2 = new OS2Table(this); if (Seek(PostScriptTable.Tag) != -1) this.post = new PostScriptTable(this); if (Seek(GlyphDataTable.Tag) != -1) this.glyf = new GlyphDataTable(this); if (Seek(IndexToLocationTable.Tag) != -1) this.loca = new IndexToLocationTable(this); if (Seek(GlyphSubstitutionTable.Tag) != -1) this.gsub = new GlyphSubstitutionTable(this); if (Seek(ControlValueProgram.Tag) != -1) this.prep = new ControlValueProgram(this); } catch (Exception) { GetType(); throw; } } /// <summary> /// Creates a new font image that is a subset of this font image containing only the specified glyphs. /// </summary> public FontData CreateFontSubSet(Dictionary<int, object> glyphs, bool cidFont) { // Create new font image FontData fontData = new FontData(this); // Create new loca and glyf table IndexToLocationTable loca = new IndexToLocationTable(); loca.ShortIndex = this.loca.ShortIndex; GlyphDataTable glyf = new GlyphDataTable(); // Add all required tables //fontData.AddTable(this.os2); if (!cidFont) fontData.AddTable(this.cmap); if (this.cvt != null) fontData.AddTable(this.cvt); if (this.fpgm != null) fontData.AddTable(this.fpgm); fontData.AddTable(glyf); fontData.AddTable(this.head); fontData.AddTable(this.hhea); fontData.AddTable(this.hmtx); fontData.AddTable(loca); if (this.maxp != null) fontData.AddTable(this.maxp); //fontData.AddTable(this.name); if (this.prep != null) fontData.AddTable(this.prep); // Get closure of used glyphs this.glyf.CompleteGlyphClosure(glyphs); // Create a sorted array of all used glyphs int glyphCount = glyphs.Count; int[] glyphArray = new int[glyphCount]; glyphs.Keys.CopyTo(glyphArray, 0); Array.Sort<int>(glyphArray); // Calculate new size of glyph table. int size = 0; for (int idx = 0; idx < glyphCount; idx++) size += this.glyf.GetGlyphSize(glyphArray[idx]); glyf.DirectoryEntry.Length = size; // Create new loca table int numGlyphs = this.maxp.numGlyphs; loca.locaTable = new int[numGlyphs + 1]; // Create new glyf table glyf.glyphTable = new byte[glyf.DirectoryEntry.PaddedLength]; // Fill new glyf and loca table int glyphOffset = 0; int glyphIndex = 0; for (int idx = 0; idx < numGlyphs; idx++) { loca.locaTable[idx] = glyphOffset; if (glyphIndex < glyphCount && glyphArray[glyphIndex] == idx) { glyphIndex++; byte[] bytes = this.glyf.GetGlyphData(idx); int length = bytes.Length; if (length > 0) { Buffer.BlockCopy(bytes, 0, glyf.glyphTable, glyphOffset, length); glyphOffset += length; } } } loca.locaTable[numGlyphs] = glyphOffset; // Compile font tables into byte array fontData.Compile(); return fontData; } /// <summary> /// Compiles the font to its binary representation. /// </summary> void Compile() { MemoryStream stream = new MemoryStream(); OpenTypeFontWriter writer = new OpenTypeFontWriter(stream); int tableCount = this.tableDictionary.Count; int selector = entrySelectors[tableCount]; this.offsetTable.Version = 0x00010000; this.offsetTable.TableCount = tableCount; this.offsetTable.SearchRange = (ushort)((1 << selector) * 16); this.offsetTable.EntrySelector = (ushort)selector; this.offsetTable.RangeShift = (ushort)((tableCount - (1 << selector)) * 16); this.offsetTable.Write(writer); // Sort tables by tag name string[] tags = new string[tableCount]; this.tableDictionary.Keys.CopyTo(tags, 0); Array.Sort(tags, StringComparer.Ordinal); #if VERBOSE Debug.WriteLine("Start Compile"); #endif // Write tables in alphabetical order int tablePosition = 12 + 16 * tableCount; for (int idx = 0; idx < tableCount; idx++) { TableDirectoryEntry entry = this.tableDictionary[tags[idx]]; #if DEBUG if (entry.Tag == "glyf" || entry.Tag == "loca") GetType(); #endif entry.FontTable.PrepareForCompilation(); entry.Offset = tablePosition; writer.Position = tablePosition; entry.FontTable.Write(writer); int endPosition = writer.Position; tablePosition = endPosition; writer.Position = 12 + 16 * idx; entry.Write(writer); #if VERBOSE Debug.WriteLine(String.Format(" Write Table '{0}', offset={1}, length={2}, checksum={3}, ", entry.Tag, entry.Offset, entry.Length, entry.CheckSum)); #endif } #if VERBOSE Debug.WriteLine("End Compile"); #endif writer.Stream.Flush(); int l = (int)writer.Stream.Length; l.GetType(); this.data = stream.ToArray(); } // 2^entrySelector[n] <= n static readonly int[] entrySelectors = { 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; public int Position { get { return this.pos; } set { this.pos = value; } } int pos; //public int Seek(int position) //{ // this.pos = position; // return this.pos; //} public int Seek(string tag) { if (this.tableDictionary.ContainsKey(tag)) { this.pos = this.tableDictionary[tag].Offset; return this.pos; } return -1; } public int SeekOffset(int offset) { this.pos += offset; return this.pos; } /// <summary> /// Reads a System.Byte. /// </summary> public byte ReadByte() { return this.data[this.pos++]; } /// <summary> /// Reads a System.Int16. /// </summary> public short ReadShort() { int pos = this.pos; this.pos += 2; return (short)((this.data[pos] << 8) | (this.data[pos + 1])); } /// <summary> /// Reads a System.UInt16. /// </summary> public ushort ReadUShort() { int pos = this.pos; this.pos += 2; return (ushort)((this.data[pos] << 8) | (this.data[pos + 1])); } /// <summary> /// Reads a System.Int32. /// </summary> public int ReadLong() { int pos = this.pos; this.pos += 4; return (int)((this.data[pos] << 24) | (this.data[pos + 1] << 16) | (this.data[pos + 2] << 8) | (this.data[pos + 3])); } /// <summary> /// Reads a System.UInt32. /// </summary> public uint ReadULong() { int pos = this.pos; this.pos += 4; return (uint)((this.data[pos] << 24) | (this.data[pos + 1] << 16) | (this.data[pos + 2] << 8) | (this.data[pos + 3])); } /// <summary> /// Reads a System.Int32. /// </summary> public Fixed ReadFixed() { int pos = this.pos; this.pos += 4; return (int)((this.data[pos] << 24) | (this.data[pos + 1] << 16) | (this.data[pos + 2] << 8) | (this.data[pos + 3])); } /// <summary> /// Reads a System.Int16. /// </summary> public short ReadFWord() { int pos = this.pos; this.pos += 2; return (short)((this.data[pos] << 8) | (this.data[pos + 1])); } /// <summary> /// Reads a System.UInt16. /// </summary> public ushort ReadUFWord() { int pos = this.pos; this.pos += 2; return (ushort)((this.data[pos] << 8) | (this.data[pos + 1])); } /// <summary> /// Reads a System.Int64. /// </summary> public long ReadLongDate() { int pos = this.pos; this.pos += 8; return (int)((this.data[pos] << 56) | (this.data[pos + 1] << 48) | (this.data[pos + 2] << 40) | (this.data[pos + 32]) | (this.data[pos + 4] << 24) | (this.data[pos + 5] << 16) | (this.data[pos + 5] << 8) | (this.data[pos + 7])); } /// <summary> /// Reads a System.String with the specified size. /// </summary> public string ReadString(int size) { char[] chars = new char[size]; for (int idx = 0; idx < size; idx++) chars[idx] = (char)this.data[this.pos++]; return new string(chars); } /// <summary> /// Reads a System.Byte[] with the specified size. /// </summary> public byte[] ReadBytes(int size) { byte[] bytes = new byte[size]; for (int idx = 0; idx < size; idx++) bytes[idx] = this.data[this.pos++]; return bytes; } /// <summary> /// Reads the specified buffer. /// </summary> public void Read(byte[] buffer) { Read(buffer, 0, buffer.Length); } /// <summary> /// Reads the specified buffer. /// </summary> public void Read(byte[] buffer, int offset, int length) { Buffer.BlockCopy(this.data, this.pos, buffer, offset, length); this.pos += length; } /// <summary> /// Reads a System.Char[4] as System.String. /// </summary> public string ReadTag() { return ReadString(4); } /// <summary> /// Represents the font offset table. /// </summary> internal struct OffsetTable { /// <summary> /// 0x00010000 for version 1.0. /// </summary> public uint Version; /// <summary> /// Number of tables. /// </summary> public int TableCount; /// <summary> /// (Maximum power of 2 d" numTables) x 16. /// </summary> public ushort SearchRange; /// <summary> /// Log2(maximum power of 2 d" numTables). /// </summary> public ushort EntrySelector; /// <summary> /// NumTables x 16-searchRange. /// </summary> public ushort RangeShift; /// <summary> /// Writes the offset table. /// </summary> public void Write(OpenTypeFontWriter writer) { writer.WriteUInt(Version); writer.WriteShort(TableCount); writer.WriteUShort(SearchRange); writer.WriteUShort(EntrySelector); writer.WriteUShort(RangeShift); } } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/IRefFontTable.cs0000644000175000001440000000653111435766646024727 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Runtime.InteropServices; using PdfSharp.Drawing; using PdfSharp.Internal; using Fixed = System.Int32; using FWord = System.Int16; using UFWord = System.UInt16; namespace PdfSharp.Fonts.OpenType { /// /// Represents an indirect reference to an existing font table in a font image. /// Used to create binary copies of an existing font table that is not modified. /// internal class IRefFontTable : OpenTypeFontTable { public IRefFontTable(FontData fontData, OpenTypeFontTable fontTable) : base(null, fontTable.DirectoryEntry.Tag) { this.fontData = fontData; this.irefDirectoryEntry = fontTable.DirectoryEntry; } TableDirectoryEntry irefDirectoryEntry; /// /// Prepares the font table to be compiled into its binary representation. /// public override void PrepareForCompilation() { base.PrepareForCompilation(); DirectoryEntry.Length = this.irefDirectoryEntry.Length; DirectoryEntry.CheckSum = this.irefDirectoryEntry.CheckSum; #if DEBUG // Check the checksum algorithm if (DirectoryEntry.Tag != TableTagNames.Head) { byte[] bytes = new byte[DirectoryEntry.PaddedLength]; Buffer.BlockCopy(this.irefDirectoryEntry.FontTable.fontData.Data, this.irefDirectoryEntry.Offset, bytes, 0, DirectoryEntry.PaddedLength); uint checkSum1 = DirectoryEntry.CheckSum; uint checkSum2 = CalcChecksum(bytes); // TODO: Sometimes this Assert fails, //Debug.Assert(checkSum1 == checkSum2, "Bug in checksum algorithm."); } #endif } /// /// Converts the font into its binary representation. /// public override void Write(OpenTypeFontWriter writer) { writer.Write(this.irefDirectoryEntry.FontTable.fontData.Data, this.irefDirectoryEntry.Offset, this.irefDirectoryEntry.PaddedLength); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/enums/0000777000175000001440000000000011533760020023055 5ustar00gabeusers00000000000000pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/enums/FontTechnology.cs0000644000175000001440000000356711435766646026402 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; namespace PdfSharp.Fonts.OpenType { /// /// Identifies the technology of an OpenType font file. /// enum FontTechnology { /// /// Font is Adobe Postscript font in CFF. /// PostscriptOutlines, /// /// Font is a TrueType font. /// TrueTypeOutlines, /// /// Font is a TrueType font collection. /// TrueTypeCollection } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/enums/TableTag.cs0000644000175000001440000000273211435766646025114 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; namespace PdfSharp.Fonts.OpenType { //enum TableTag //{ //} }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/enums/TableTagNames.cs0000644000175000001440000001260711435766646026102 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; namespace PdfSharp.Fonts.OpenType { /// /// TrueType font table names. /// static class TableTagNames { // --- Required Tables --- /// /// Character to glyph mapping. /// public const string CMap = "cmap"; /// /// Font header . /// public const string Head = "head"; /// /// Horizontal header. /// public const string HHea = "hhea"; /// /// Horizontal metrics. /// public const string HMtx = "hmtx"; /// /// Maximum profile. /// public const string MaxP = "maxp"; /// /// Naming table. /// public const string Name = "name"; /// /// OS/2 and Windows specific metrics. /// public const string OS2 = "OS/2"; /// /// PostScript information. /// public const string Post = "post"; // --- Tables Related to TrueType Outlines --- /// /// Control Value Table. /// public const string Cvt = "cvt "; /// /// Font program. /// public const string Fpgm = "fpgm"; /// /// Glyph data. /// public const string Glyf = "glyf"; /// /// Index to location. /// public const string Loca = "loca"; /// /// CVT Program. /// public const string Prep = "prep"; // --- Tables Related to PostScript Outlines --- /// /// PostScript font program (compact font format). /// public const string Cff = "CFF"; /// /// Vertical Origin. /// public const string VOrg = "VORG"; // --- Tables Related to Bitmap Glyphs --- /// /// Embedded bitmap data. /// public const string EBDT = "EBDT"; /// /// Embedded bitmap location data. /// public const string EBLC = "EBLC"; /// /// Embedded bitmap scaling data. /// public const string EBSC = "EBSC"; // --- Advanced Typographic Tables --- /// /// Baseline data. /// public const string BASE = "BASE"; /// /// Glyph definition data. /// public const string GDEF = "GDEF"; /// /// Glyph positioning data. /// public const string GPOS = "GPOS"; /// /// Glyph substitution data. /// public const string GSUB = "GSUB"; /// /// Justification data. /// public const string JSTF = "JSTF"; // --- Other OpenType Tables --- /// /// Digital signature. /// public const string DSIG = "DSIG"; /// /// Grid-fitting/Scan-conversion. /// public const string Gasp = "gasp"; /// /// Horizontal device metrics. /// public const string Hdmx = "hdmx"; /// /// Kerning. /// public const string Kern = "kern"; /// /// Linear threshold data. /// public const string LTSH = "LTSH"; /// /// PCL 5 data. /// public const string PCLT = "PCLT"; /// /// Vertical device metrics. /// public const string VDMX = "VDMX"; /// /// Vertical Header. /// public const string VHea = "vhea"; /// /// Vertical Metrics. /// public const string VMtx = "vmtx"; } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/GlyphDataTable.cs0000644000175000001440000003024211435766646025124 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #define VERBOSE_ using System; using System.Diagnostics; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using System.IO; using PdfSharp.Drawing; using PdfSharp.Internal; using Fixed = System.Int32; using FWord = System.Int16; using UFWord = System.UInt16; namespace PdfSharp.Fonts.OpenType { /// <summary> /// This table contains information that describes the glyphs in the font in the TrueType outline format. /// Information regarding the rasterizer (scaler) refers to the TrueType rasterizer. /// </summary> internal class GlyphDataTable : OpenTypeFontTable { public const string Tag = TableTagNames.Glyf; public byte[] glyphTable; public GlyphDataTable() : base(null, Tag) { DirectoryEntry.Tag = TableTagNames.Glyf; } public GlyphDataTable(FontData fontData) : base(fontData, Tag) { DirectoryEntry.Tag = TableTagNames.Glyf; Read(); } /// <summary> /// Converts the bytes in a handy representation /// </summary> public void Read() { try { // not yet needed... } catch (Exception ex) { throw ex; } } /// <summary> /// Gets the data of the specified glyph. /// </summary> public byte[] GetGlyphData(int glyph) { IndexToLocationTable loca = this.fontData.loca; int start = GetOffset(glyph); int next = GetOffset(glyph + 1); int count = next - start; byte[] bytes = new byte[count]; Buffer.BlockCopy(this.fontData.Data, start, bytes, 0, count); return bytes; } /// <summary> /// Gets the size of the byte array that defines the glyph. /// </summary> public int GetGlyphSize(int glyph) { IndexToLocationTable loca = this.fontData.loca; return GetOffset(glyph + 1) - GetOffset(glyph); } /// <summary> /// Gets the offset of the specified glyph relative to the first byte of the font image. /// </summary> public int GetOffset(int glyph) { return DirectoryEntry.Offset + this.fontData.loca.locaTable[glyph]; } /// <summary> /// Adds for all composite glyphs the glyphs the composite one is made of. /// </summary> public void CompleteGlyphClosure(Dictionary<int, object> glyphs) { int count = glyphs.Count; int[] glyphArray = new int[glyphs.Count]; glyphs.Keys.CopyTo(glyphArray, 0); if (!glyphs.ContainsKey(0)) glyphs.Add(0, null); for (int idx = 0; idx < count; idx++) AddCompositeGlyphs(glyphs, glyphArray[idx]); } /// <summary> /// If the specified glyph is a composite glyph add the glyphs it is made of to the glyph table. /// </summary> void AddCompositeGlyphs(Dictionary<int, object> glyphs, int glyph) { //int start = this.fontData.loca.GetOffset(glyph); int start = GetOffset(glyph); // Has no contour? if (start == GetOffset(glyph + 1)) return; this.fontData.Position = start; int numContours = this.fontData.ReadShort(); // Is not a composite glyph? if (numContours >= 0) return; this.fontData.SeekOffset(8); for (; ; ) { int flags = this.fontData.ReadUFWord(); int cGlyph = this.fontData.ReadUFWord(); if (!glyphs.ContainsKey(cGlyph)) glyphs.Add(cGlyph, null); if ((flags & MORE_COMPONENTS) == 0) return; int offset = (flags & ARG_1_AND_2_ARE_WORDS) == 0 ? 2 : 4; if ((flags & WE_HAVE_A_SCALE) != 0) offset += 2; else if ((flags & WE_HAVE_AN_X_AND_Y_SCALE) != 0) offset += 4; if ((flags & WE_HAVE_A_TWO_BY_TWO) != 0) offset += 8; this.fontData.SeekOffset(offset); } } /// <summary> /// Prepares the font table to be compiled into its binary representation. /// </summary> public override void PrepareForCompilation() { base.PrepareForCompilation(); if (DirectoryEntry.Length == 0) DirectoryEntry.Length = this.glyphTable.Length; DirectoryEntry.CheckSum = CalcChecksum(this.glyphTable); } /// <summary> /// Converts the font into its binary representation. /// </summary> public override void Write(OpenTypeFontWriter writer) { writer.Write(this.glyphTable, 0, DirectoryEntry.PaddedLength); } // Constants from OpenType spec. const int ARG_1_AND_2_ARE_WORDS = 1; const int WE_HAVE_A_SCALE = 8; const int MORE_COMPONENTS = 32; const int WE_HAVE_AN_X_AND_Y_SCALE = 64; const int WE_HAVE_A_TWO_BY_TWO = 128; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/FontDataStock.cs0000644000175000001440000001015511435766646025004 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections.Generic; using PdfSharp.Drawing; using PdfSharp.Fonts.OpenType; namespace PdfSharp.Fonts.OpenType { /// /// Global table of TrueType font faces. /// class FontDataStock // TODO: rename { FontDataStock() { this.fontDataTable = new Dictionary(); } public FontData RegisterFontData(byte[] data) { uint checksum = CalcChecksum(data); string key = String.Format("??{0:X}", checksum); FontData fontData; if (!this.fontDataTable.TryGetValue(key, out fontData)) { lock (typeof(FontDataStock)) { // may be created by other thread meanwhile if (!this.fontDataTable.TryGetValue(key, out fontData)) { fontData = new FontData(data); this.fontDataTable.Add(key, fontData); this.lastEntry = fontData; } } } return fontData; } private FontData lastEntry; public bool UnregisterFontData(FontData fontData) { Debug.Assert(false); return false; } internal FontData[] GetFontDataList() { int count = fontDataTable.Values.Count; FontData[] fontDataArray = new FontData[count]; fontDataTable.Values.CopyTo(fontDataArray, 0); return fontDataArray; } //internal FontData FindFont(XTypefaceHack typeface) //{ // // HACK: // if (this.fontDataTable.Count > 1) // return this.lastEntry; // return null; //} /// /// Calculates an Adler32 checksum. /// static uint CalcChecksum(byte[] buffer) { if (buffer == null) throw new ArgumentNullException("buffer"); const uint BASE = 65521; // largest prime smaller than 65536 uint s1 = 0; uint s2 = 0; int length = buffer.Length; int offset = 0; while (length > 0) { int n = 3800; if (n > length) n = length; length -= n; while (--n >= 0) { s1 = s1 + (uint)(buffer[offset++] & 0xFF); s2 = s2 + s1; } s1 %= BASE; s2 %= BASE; } return (s2 << 16) | s1; } /// /// Gets the singleton. /// public static FontDataStock Global { get { if (global == null) { lock (typeof(FontDataStock)) { if (global == null) global = new FontDataStock(); } } return global; } } static FontDataStock global; Dictionary fontDataTable; } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/OpenTypeFontTable.cs0000644000175000001440000000752611435766646025652 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Runtime.InteropServices; using PdfSharp.Drawing; using PdfSharp.Internal; using Fixed = System.Int32; using FWord = System.Int16; using UFWord = System.UInt16; namespace PdfSharp.Fonts.OpenType { /// /// Base class for all OpenType fonts. /// internal class OpenTypeFontTable : ICloneable { public OpenTypeFontTable(FontData fontData, string tag) { this.fontData = fontData; if (fontData != null && fontData.tableDictionary.ContainsKey(tag)) this.DirectoryEntry = fontData.tableDictionary[tag]; else this.DirectoryEntry = new TableDirectoryEntry(tag); this.DirectoryEntry.FontTable = this; } /// /// Creates a deep copy of the current instance. /// public object Clone() { return DeepCopy(); } protected virtual OpenTypeFontTable DeepCopy() { OpenTypeFontTable fontTable = (OpenTypeFontTable)MemberwiseClone(); fontTable.DirectoryEntry.Offset = 0; fontTable.DirectoryEntry.FontTable = fontTable; return fontTable; } /// /// Gets the font image the table belongs to. /// public FontData FontData { get { return this.fontData; } } internal FontData fontData; public TableDirectoryEntry DirectoryEntry; /// /// When overridden in a derived class, prepares the font table to be compiled into its binary representation. /// public virtual void PrepareForCompilation() { } /// /// When overridden in a derived class, converts the font into its binary representation. /// public virtual void Write(OpenTypeFontWriter writer) { } /// /// Calculates the checksum of a table represented by its bytes. /// public static uint CalcChecksum(byte[] bytes) { Debug.Assert((bytes.Length & 3) == 0); // Cannot use Buffer.BlockCopy because 32-bit values are Big-endian uint byte3, byte2, byte1, byte0; byte3 = byte2 = byte1 = byte0 = 0; int length = bytes.Length; for (int idx = 0; idx < length;) { byte3 += bytes[idx++]; byte2 += bytes[idx++]; byte1 += bytes[idx++]; byte0 += bytes[idx++]; } return (byte3 << 24) + (byte2 << 16) + (byte1 << 8) + byte0; } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/ExternalHelper.cs0000644000175000001440000000514511435766646025225 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.Text; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Pdf; using PdfSharp.Pdf.Internal; using PdfSharp.Drawing; namespace PdfSharp.Fonts.OpenType { /// /// PDFsharp internal stuff. /// For more information see Andrew Schulman "Undocumented PDFsharp" :-)) /// public static class ExternalHelper { /// /// This is an external helper function. /// public static byte[] F74167FFE4044F53B28A4AF049E9EF25(XFont font, XPdfFontOptions options, bool subset) { byte[] data = null; if (subset) { OpenTypeDescriptor descriptor = new OpenTypeDescriptor(font, options); FontData image = descriptor.fontData; CMapInfo cmapInfo = new CMapInfo(descriptor); cmapInfo.AddAnsiChars(); image = image.CreateFontSubSet(cmapInfo.GlyphIndices, false); data = image.Data; } else { FontData fontData = new FontData(font, options); data = fontData.Data; } return data; } } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/OpenTypeDescriptor.cs0000644000175000001440000003022611435766646026103 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Globalization; using System.Runtime.InteropServices; using System.Text; #if GDI using System.Drawing; using System.Drawing.Drawing2D; #endif #if WPF using System.Windows; using System.Windows.Media; #endif using PdfSharp.Pdf.Internal; using PdfSharp.Drawing; namespace PdfSharp.Fonts.OpenType { /// /// The OpenType font descriptor. /// internal sealed class OpenTypeDescriptor : FontDescriptor { public OpenTypeDescriptor(XFont font, XPdfFontOptions options) { try { this.fontData = new FontData(font, options); this.fontName = font.Name; Initialize(); } catch { throw; } } //#if WPF // public TrueTypeDescriptor(XFont font, XPdfFontOptions options) // { // try // { // this.fontData = new FontData(font, options); // this.fontName = font.Name; // Initialize(); // } // catch (Exception ex) // { // throw ex; // } // } //#endif //internal TrueTypeDescriptor(FontSelector selector) //{ // throw new NotImplementedException("TrueTypeDescriptor(FontSelector selector)"); //} internal OpenTypeDescriptor(XFont font) : this(font, font.PdfOptions) { } internal OpenTypeDescriptor(string idName, byte[] fontData) { try { this.fontData = new FontData(fontData); // Try to get real name form name table if (idName.Contains("XPS-Font-") && this.fontData.name != null && this.fontData.name.Name.Length != 0) { string tag = String.Empty; if (idName.IndexOf('+') == 6) tag = idName.Substring(0, 6); idName = tag + "+" + this.fontData.name.Name; if (this.fontData.name.Style.Length != 0) idName += "," + this.fontData.name.Style; idName = idName.Replace(" ", ""); } this.fontName = idName; Initialize(); } catch (Exception ex) { throw ex; } } internal OpenTypeDescriptor(byte[] fontData) { try { this.fontData = new FontData(fontData); // Try to get real name form name table string name = this.fontData.name.Name; if (this.fontData.name.Style.Length != 0) name += "," + this.fontData.name.Style; name = name.Replace(" ", ""); this.fontName = name; Initialize(); } catch { throw; } } internal FontData fontData; void Initialize() { //bool embeddingRestricted = this.fontData.os2.fsType == 0x0002; //this.fontName = image.n this.italicAngle = this.fontData.post.italicAngle; this.xMin = this.fontData.head.xMin; this.yMin = this.fontData.head.yMin; this.xMax = this.fontData.head.xMax; this.yMax = this.fontData.head.yMax; this.underlinePosition = this.fontData.post.underlinePosition; this.underlineThickness = this.fontData.post.underlineThickness; this.strikeoutPosition = this.fontData.os2.yStrikeoutPosition; this.strikeoutSize = this.fontData.os2.yStrikeoutSize; // No documetation found how to get the set vertical stems width from the // TrueType tables. // The following formula comes from PDFlib Lite source code. Acrobat 5.0 sets // /StemV to 0 always. I think the value doesn't matter. //float weight = (float)(this.image.os2.usWeightClass / 65.0f); //this.stemV = (int)(50 + weight * weight); // MAGIC this.stemV = 0; // PDFlib states that some Apple fonts miss the OS/2 table. Debug.Assert(fontData.os2 != null, "TrueType font has no OS/2 table."); this.unitsPerEm = fontData.head.unitsPerEm; // PDFlib takes sTypoAscender and sTypoDescender from OS/2 tabel, but GDI+ uses usWinAscent and usWinDescent if (fontData.os2.sTypoAscender != 0) this.ascender = fontData.os2.usWinAscent; else this.ascender = fontData.hhea.ascender; Debug.Assert(this.ascender > 0, "PDFsharp internal: Ascender should be greater than 0."); if (fontData.os2.sTypoDescender != 0) { this.descender = fontData.os2.usWinDescent; Debug.Assert(this.descender > 0, "PDFsharp internal: Font with non positive ascender value found."); #if true_ Debug.WriteLine(String.Format(CultureInfo.InvariantCulture, "os2.usWinDescent={0}, hhea.descender={1}, os2.sTypoDescender={2}", fontData.os2.usWinDescent, fontData.hhea.descender, fontData.os2.sTypoDescender)); #endif // Force sign from hhea.descender // TODO: this.descender = Math.Abs(this.descender) * Math.Sign(fontData.hhea.descender); } else this.descender = fontData.hhea.descender; Debug.Assert(this.descender < 0, "PDFsharp internal: Ascender should be less than 0."); this.leading = fontData.hhea.lineGap; // sCapHeight and sxHeight are only valid if version >= 2 if (fontData.os2.version >= 2 && fontData.os2.sCapHeight != 0) this.capHeight = fontData.os2.sCapHeight; else this.capHeight = fontData.hhea.ascender; if (fontData.os2.version >= 2 && fontData.os2.sxHeight != 0) this.xHeight = fontData.os2.sxHeight; else this.xHeight = (int)(0.66f * this.ascender); //this.flags = this.image. Encoding ansi = PdfEncoders.WinAnsiEncoding; // System.Text.Encoding.Default; Encoding unicode = Encoding.Unicode; byte[] bytes = new byte[256]; bool symbol = this.fontData.cmap.symbol; this.widths = new int[256]; for (int idx = 0; idx < 256; idx++) { bytes[idx] = (byte)idx; // PDFlib handles some font flaws here... // We wait for bug reports. char ch = (char)idx; string s = ansi.GetString(bytes, idx, 1); if (s.Length != 0) { if (s[0] != ch) ch = s[0]; } #if DEBUG if (idx == 'S') GetType(); #endif int glyphIndex; if (symbol) { glyphIndex = idx + (this.fontData.os2.usFirstCharIndex & 0xFF00); glyphIndex = CharCodeToGlyphIndex((char)glyphIndex); } else { //Debug.Assert(idx + (this.fontData.os2.usFirstCharIndex & 0xFF00) == idx); //glyphIndex = CharCodeToGlyphIndex((char)idx); glyphIndex = CharCodeToGlyphIndex(ch); } this.widths[idx] = GlyphIndexToPdfWidth(glyphIndex); } } public int[] widths; /// /// Gets a value indicating whether this instance belongs to a bold font. /// public override bool IsBoldFace { get { // usWeightClass 700 is Bold //Debug.Assert((this.fontData.os2.usWeightClass >= 700) == ((this.fontData.os2.fsSelection & (ushort)OS2Table.FontSelectionFlags.Bold) != 0)); return (this.fontData.os2.fsSelection & (ushort)OS2Table.FontSelectionFlags.Bold) != 0; } } /// /// Gets a value indicating whether this instance belongs to an italic font. /// public override bool IsItalicFace { get { return (this.fontData.os2.fsSelection & (ushort)OS2Table.FontSelectionFlags.Italic) != 0; } } internal int DesignUnitsToPdf(double value) { return (int)Math.Round(value * 1000.0 / this.fontData.head.unitsPerEm); } /// /// Maps a unicode to the index of the corresponding glyph. /// See OpenType spec "cmap - Character To Glyph Index Mapping Table / Format 4: Segment mapping to delta values" /// for details about this a little bit strange looking algorithm. /// public int CharCodeToGlyphIndex(char value) { try { CMap4 cmap = this.fontData.cmap.cmap4; int segCount = cmap.segCountX2 / 2; int seg; for (seg = 0; seg < segCount; seg++) { if (value <= cmap.endCount[seg]) break; } Debug.Assert(seg < segCount); if (value < cmap.startCount[seg]) return 0; if (cmap.idRangeOffs[seg] == 0) return (value + cmap.idDelta[seg]) & 0xFFFF; int idx = cmap.idRangeOffs[seg] / 2 + (value - cmap.startCount[seg]) - (segCount - seg); Debug.Assert(idx >= 0 && idx < cmap.glyphCount); if (cmap.glyphIdArray[idx] == 0) return 0; return (cmap.glyphIdArray[idx] + cmap.idDelta[seg]) & 0xFFFF; } catch { throw; } } /// /// Converts the width of a glyph identified by its index to PDF design units. /// public int GlyphIndexToPdfWidth(int glyphIndex) { try { int numberOfHMetrics = this.fontData.hhea.numberOfHMetrics; int unitsPerEm = this.fontData.head.unitsPerEm; // glyphIndex >= numberOfHMetrics means the font is mono-spaced and all glyphs have the same width if (glyphIndex >= numberOfHMetrics) glyphIndex = numberOfHMetrics - 1; int width = this.fontData.hmtx.metrics[glyphIndex].advanceWidth; // Sometimes the unitsPerEm is 1000, sometimes a power of 2. if (unitsPerEm == 1000) return width; return width * 1000 / unitsPerEm; // normalize } catch (Exception ex) { throw ex; } } public int PdfWidthFromCharCode(char ch) { int idx = CharCodeToGlyphIndex(ch); int width = GlyphIndexToPdfWidth(idx); return width; } #if DEBUG_ public static void Test() { Font font = new Font("Times New Roman", 10); FontData image = new FontData(font); // Font font = new Font("Isabelle", 12); // LOGFONT logFont = new LOGFONT(); // font.ToLogFont(logFont); // // IntPtr hfont = CreateFontIndirect(logFont); //// IntPtr hfont2 = font.ToHfont(); //// System.Windows.Forms.MessageBox.Show(hfont2.ToString()); // // Graphics gfx = Graphics.FromHwnd(IntPtr.Zero); // IntPtr hdc = gfx.GetHdc(); // IntPtr oldFont = SelectObject(hdc, hfont); // int size = GetFontData(hdc, 0, 0, null, 0); // // byte[] fontbits = new byte[size]; // int xx = GetFontData(hdc, 0, 0, fontbits, size); // SelectObject(hdc, oldFont); // DeleteObject(hfont); // gfx.ReleaseHdc(hdc); // // FontData image = new FontData(fontbits); // //image.Read(); // // // //HandleRef // // font.GetType(); } #endif } }pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/OpenTypeFontWriter.cs0000644000175000001440000000421111435766646026063 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Collections.Generic; using System.Text; using System.IO; namespace PdfSharp.Fonts.OpenType { /// /// Represents a writer for True Type font files. /// internal class OpenTypeFontWriter : FontWriter { /// /// Initializes a new instance of the class. /// public OpenTypeFontWriter(Stream stream) : base(stream) { } /// /// Writes a table name. /// public void WriteTag(string tag) { Debug.Assert(tag.Length == 4); WriteByte((byte)(tag[0])); WriteByte((byte)(tag[1])); WriteByte((byte)(tag[2])); WriteByte((byte)(tag[3])); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/TableDirectoryEntry.cs0000644000175000001440000002003611435766646026235 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #define VERBOSE_ using System; using System.Diagnostics; using System.Collections.Generic; using System.Runtime.InteropServices; using System.IO; using PdfSharp.Drawing; using PdfSharp.Internal; using Fixed = System.Int32; using FWord = System.Int16; using UFWord = System.UInt16; namespace PdfSharp.Fonts.OpenType { /// <summary> /// Represents an entry in the fonts table dictionary. /// </summary> class TableDirectoryEntry { /// <summary> /// Initializes a new instance of the <see cref="TableDirectoryEntry"/> class. /// </summary> public TableDirectoryEntry() { } /// <summary> /// Initializes a new instance of the <see cref="TableDirectoryEntry"/> class. /// </summary> public TableDirectoryEntry(string tag) { Debug.Assert(tag.Length == 4); Tag = tag; //CheckSum = 0; //Offset = 0; //Length = 0; //FontTable = null; } /// <summary> /// 4 -byte identifier. /// </summary> public string Tag; /// <summary> /// CheckSum for this table. /// </summary> public uint CheckSum; /// <summary> /// Offset from beginning of TrueType font file. /// </summary> public int Offset; /// <summary> /// Actual length of this table in bytes. /// </summary> public int Length; /// <summary> /// Gets the length rounded up to a multiple of four bytes. /// </summary> public int PaddedLength { get { return (Length + 3) & ~3; } } /// <summary> /// Associated font table. /// </summary> public OpenTypeFontTable FontTable; /// <summary> /// Creates and reads a TableDirectoryEntry from the font image. /// </summary> public static TableDirectoryEntry ReadFrom(FontData fontData) { TableDirectoryEntry entry = new TableDirectoryEntry(); entry.Tag = fontData.ReadTag(); entry.CheckSum = fontData.ReadULong(); entry.Offset = fontData.ReadLong(); entry.Length = (int)fontData.ReadULong(); return entry; } public void Read(FontData fontData) { this.Tag = fontData.ReadTag(); this.CheckSum = fontData.ReadULong(); this.Offset = fontData.ReadLong(); this.Length = (int)fontData.ReadULong(); } public void Write(OpenTypeFontWriter writer) { Debug.Assert(this.Tag.Length == 4); Debug.Assert(this.Offset != 0); Debug.Assert(this.Length != 0); writer.WriteTag(this.Tag); writer.WriteUInt(this.CheckSum); writer.WriteInt(this.Offset); writer.WriteUInt((uint)this.Length); } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/OpenTypeStructures.cs0000644000175000001440000021326611435766646026157 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #define VERBOSE_ using System; using System.Diagnostics; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using System.IO; using System.Text; using PdfSharp.Drawing; using PdfSharp.Internal; using Fixed = System.Int32; using FWord = System.Int16; using UFWord = System.UInt16; namespace PdfSharp.Fonts.OpenType { internal enum PlatformId { Apple, Mac, Iso, Win } /// <summary> /// Only Symbol and Unicode is used by PDFsharp. /// </summary> internal enum WinEncodingId { Symbol, Unicode } /// <summary> /// CMap format 4: Segment mapping to delta values. /// The Windows standard format. /// </summary> internal class CMap4 : OpenTypeFontTable { public WinEncodingId encodingId; // Windows encoding ID. public ushort format; // Format number is set to 4. public ushort length; // This is the length in bytes of the subtable. public ushort language; // This field must be set to zero for all cmap subtables whose platform IDs are other than Macintosh (platform ID 1). public ushort segCountX2; // 2 x segCount. public ushort searchRange; // 2 x (2**floor(log2(segCount))) public ushort entrySelector; // log2(searchRange/2) public ushort rangeShift; public ushort[] endCount; // [segCount] / End characterCode for each segment, last=0xFFFF. public ushort[] startCount; // [segCount] / Start character code for each segment. public short[] idDelta; // [segCount] / Delta for all character codes in segment. public ushort[] idRangeOffs; // [segCount] / Offsets into glyphIdArray or 0 public int glyphCount; // = (length - (16 + 4 * 2 * segCount)) / 2; public ushort[] glyphIdArray; // Glyph index array (arbitrary length) public CMap4(FontData fontData, WinEncodingId encodingId) : base(fontData, "----") { this.encodingId = encodingId; Read(); } internal void Read() { try { // m_EncodingID = encID; this.format = this.fontData.ReadUShort(); Debug.Assert(this.format == 4, "Only format 4 expected."); this.length = this.fontData.ReadUShort(); this.language = this.fontData.ReadUShort(); // Always null in Windows this.segCountX2 = this.fontData.ReadUShort(); this.searchRange = this.fontData.ReadUShort(); this.entrySelector = this.fontData.ReadUShort(); this.rangeShift = this.fontData.ReadUShort(); int segCount = this.segCountX2 / 2; this.glyphCount = (this.length - (16 + 8 * segCount)) / 2; //ASSERT_CONDITION(0 <= m_NumGlyphIds && m_NumGlyphIds < m_Length, "Invalid Index"); this.endCount = new ushort[segCount]; this.startCount = new ushort[segCount]; this.idDelta = new short[segCount]; this.idRangeOffs = new ushort[segCount]; this.glyphIdArray = new ushort[this.glyphCount]; for (int idx = 0; idx < segCount; idx++) this.endCount[idx] = this.fontData.ReadUShort(); //ASSERT_CONDITION(m_EndCount[segs - 1] == 0xFFFF, "Out of Index"); // Read reserved pad. this.fontData.ReadUShort(); for (int idx = 0; idx < segCount; idx++) this.startCount[idx] = this.fontData.ReadUShort(); for (int idx = 0; idx < segCount; idx++) this.idDelta[idx] = this.fontData.ReadShort(); for (int idx = 0; idx < segCount; idx++) this.idRangeOffs[idx] = this.fontData.ReadUShort(); for (int idx = 0; idx < this.glyphCount; idx++) this.glyphIdArray[idx] = this.fontData.ReadUShort(); } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } /// <summary> /// This table defines the mapping of character codes to the glyph index values used in the font. /// It may contain more than one subtable, in order to support more than one character encoding scheme. /// </summary> internal class CMapTable : OpenTypeFontTable { public const string Tag = TableTagNames.CMap; public ushort version; public ushort numTables; /// <summary> /// Is true for symbol font encoding. /// </summary> public bool symbol; public CMap4 cmap4; /// <summary> /// Initializes a new instance of the <see cref="CMapTable"/> class. /// </summary> public CMapTable(FontData fontData) : base(fontData, Tag) { Read(); } internal void Read() { try { int tableOffset = this.fontData.Position; this.version = this.fontData.ReadUShort(); this.numTables = this.fontData.ReadUShort(); bool success = false; for (int idx = 0; idx < this.numTables; idx++) { PlatformId platformId = (PlatformId)this.fontData.ReadUShort(); WinEncodingId encodingId = (WinEncodingId)this.fontData.ReadUShort(); int offset = this.fontData.ReadLong(); int currentPosition = this.fontData.Position; // Just read Windows stuff if (platformId == PlatformId.Win && (encodingId == WinEncodingId.Symbol || encodingId == WinEncodingId.Unicode)) { this.symbol = encodingId == WinEncodingId.Symbol; this.fontData.Position = tableOffset + offset; this.cmap4 = new CMap4(this.fontData, encodingId); this.fontData.Position = currentPosition; // We have found what we are looking for, so break. success = true; break; } } if (!success) throw new InvalidOperationException("Font has no usable platform or encoding ID. It cannot be used with PDFsharp."); } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } /// <summary> /// This table gives global information about the font. The bounding box values should be computed using /// only glyphs that have contours. Glyphs with no contours should be ignored for the purposes of these calculations. /// </summary> internal class FontHeaderTable : OpenTypeFontTable { public const string Tag = TableTagNames.Head; public Fixed version; // 0x00010000 for version 1.0. public Fixed fontRevision; public uint checkSumAdjustment; public uint magicNumber; // Set to 0x5F0F3CF5 public ushort flags; public ushort unitsPerEm; // Valid range is from 16 to 16384. This value should be a power of 2 for fonts that have TrueType outlines. public long created; public long modified; public short xMin, yMin; // For all glyph bounding boxes. public short xMax, yMax; // For all glyph bounding boxes. public ushort macStyle; public ushort lowestRecPPEM; public short fontDirectionHint; public short indexToLocFormat; // 0 for short offsets, 1 for long public short glyphDataFormat; // 0 for current format public FontHeaderTable(FontData fontData) : base(fontData, Tag) { Read(); } public void Read() { try { this.version = this.fontData.ReadFixed(); this.fontRevision = this.fontData.ReadFixed(); this.checkSumAdjustment = this.fontData.ReadULong(); this.magicNumber = this.fontData.ReadULong(); this.flags = this.fontData.ReadUShort(); this.unitsPerEm = this.fontData.ReadUShort(); this.created = this.fontData.ReadLongDate(); this.modified = this.fontData.ReadLongDate(); this.xMin = this.fontData.ReadShort(); this.yMin = this.fontData.ReadShort(); this.xMax = this.fontData.ReadShort(); this.yMax = this.fontData.ReadShort(); this.macStyle = this.fontData.ReadUShort(); this.lowestRecPPEM = this.fontData.ReadUShort(); this.fontDirectionHint = this.fontData.ReadShort(); this.indexToLocFormat = this.fontData.ReadShort(); this.glyphDataFormat = this.fontData.ReadShort(); } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } /// <summary> /// This table contains information for horizontal layout. The values in the minRightSidebearing, /// minLeftSideBearing and xMaxExtent should be computed using only glyphs that have contours. /// Glyphs with no contours should be ignored for the purposes of these calculations. /// All reserved areas must be set to 0. /// </summary> internal class HorizontalHeaderTable : OpenTypeFontTable { public const string Tag = TableTagNames.HHea; public Fixed version; // 0x00010000 for version 1.0. public FWord ascender; // Typographic ascent. (Distance from baseline of highest ascender) public FWord descender; // Typographic descent. (Distance from baseline of lowest descender) public FWord lineGap; // Typographic line gap. Negative LineGap values are treated as zero in Windows 3.1, System 6, and System 7. public UFWord advanceWidthMax; public FWord minLeftSideBearing; public FWord minRightSideBearing; public FWord xMaxExtent; public short caretSlopeRise; public short caretSlopeRun; public short reserved1; public short reserved2; public short reserved3; public short reserved4; public short reserved5; public short metricDataFormat; public ushort numberOfHMetrics; public HorizontalHeaderTable(FontData fontData) : base(fontData, Tag) { Read(); } public void Read() { try { this.version = this.fontData.ReadFixed(); this.ascender = this.fontData.ReadFWord(); this.descender = this.fontData.ReadFWord(); this.lineGap = this.fontData.ReadFWord(); this.advanceWidthMax = this.fontData.ReadUFWord(); this.minLeftSideBearing = this.fontData.ReadFWord(); this.minRightSideBearing = this.fontData.ReadFWord(); this.xMaxExtent = this.fontData.ReadFWord(); this.caretSlopeRise = this.fontData.ReadShort(); this.caretSlopeRun = this.fontData.ReadShort(); this.reserved1 = this.fontData.ReadShort(); this.reserved2 = this.fontData.ReadShort(); this.reserved3 = this.fontData.ReadShort(); this.reserved4 = this.fontData.ReadShort(); this.reserved5 = this.fontData.ReadShort(); this.metricDataFormat = this.fontData.ReadShort(); this.numberOfHMetrics = this.fontData.ReadUShort(); } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } internal class HorizontalMetrics : OpenTypeFontTable { public const string Tag = "----"; public ushort advanceWidth; public short lsb; public HorizontalMetrics(FontData fontData) : base(fontData, Tag) { Read(); } public void Read() { try { this.advanceWidth = this.fontData.ReadUFWord(); this.lsb = this.fontData.ReadFWord(); } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } /// <summary> /// The type longHorMetric is defined as an array where each element has two parts: /// the advance width, which is of type USHORT, and the left side bearing, which is of type SHORT. /// These fields are in font design units. /// </summary> internal class HorizontalMetricsTable : OpenTypeFontTable { public const string Tag = TableTagNames.HMtx; public HorizontalMetrics[] metrics; public FWord[] leftSideBearing; public HorizontalMetricsTable(FontData fontData) : base(fontData, Tag) { Read(); } public void Read() { try { HorizontalHeaderTable hhea = this.fontData.hhea; MaximumProfileTable maxp = this.fontData.maxp; if (hhea != null && maxp != null) { int numMetrics = hhea.numberOfHMetrics; //->NumberOfHMetrics(); int numLsbs = maxp.numGlyphs - numMetrics; Debug.Assert(numMetrics != 0); Debug.Assert(numLsbs >= 0); this.metrics = new HorizontalMetrics[numMetrics]; for (int idx = 0; idx < numMetrics; idx++) this.metrics[idx] = new HorizontalMetrics(this.fontData); if (numLsbs > 0) { this.leftSideBearing = new FWord[numLsbs]; for (int idx = 0; idx < numLsbs; idx++) this.leftSideBearing[idx] = this.fontData.ReadFWord(); } } } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } // UNDONE internal class VerticalHeaderTable : OpenTypeFontTable { public const string Tag = TableTagNames.VHea; // code comes from HorizontalHeaderTable public Fixed version; // 0x00010000 for version 1.0. public FWord ascender; // Typographic ascent. (Distance from baseline of highest ascender) public FWord descender; // Typographic descent. (Distance from baseline of lowest descender) public FWord lineGap; // Typographic line gap. Negative LineGap values are treated as zero in Windows 3.1, System 6, and System 7. public UFWord advanceWidthMax; public FWord minLeftSideBearing; public FWord minRightSideBearing; public FWord xMaxExtent; public short caretSlopeRise; public short caretSlopeRun; public short reserved1; public short reserved2; public short reserved3; public short reserved4; public short reserved5; public short metricDataFormat; public ushort numberOfHMetrics; public VerticalHeaderTable(FontData fontData) : base(fontData, Tag) { Read(); } public void Read() { try { this.version = this.fontData.ReadFixed(); this.ascender = this.fontData.ReadFWord(); this.descender = this.fontData.ReadFWord(); this.lineGap = this.fontData.ReadFWord(); this.advanceWidthMax = this.fontData.ReadUFWord(); this.minLeftSideBearing = this.fontData.ReadFWord(); this.minRightSideBearing = this.fontData.ReadFWord(); this.xMaxExtent = this.fontData.ReadFWord(); this.caretSlopeRise = this.fontData.ReadShort(); this.caretSlopeRun = this.fontData.ReadShort(); this.reserved1 = this.fontData.ReadShort(); this.reserved2 = this.fontData.ReadShort(); this.reserved3 = this.fontData.ReadShort(); this.reserved4 = this.fontData.ReadShort(); this.reserved5 = this.fontData.ReadShort(); this.metricDataFormat = this.fontData.ReadShort(); this.numberOfHMetrics = this.fontData.ReadUShort(); } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } internal class VerticalMetrics : OpenTypeFontTable { public const string Tag = "----"; // code comes from HorizontalMetrics public ushort advanceWidth; public short lsb; public VerticalMetrics(FontData fontData) : base(fontData, Tag) { Read(); } public void Read() { try { this.advanceWidth = this.fontData.ReadUFWord(); this.lsb = this.fontData.ReadFWord(); } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } /// <summary> /// The vertical metrics table allows you to specify the vertical spacing for each glyph in a /// vertical font. This table consists of either one or two arrays that contain metric /// information (the advance heights and top sidebearings) for the vertical layout of each /// of the glyphs in the font. /// </summary> internal class VerticalMetricsTable : OpenTypeFontTable { // UNDONE public const string Tag = TableTagNames.VMtx; // code comes from HorizontalMetricsTable public HorizontalMetrics[] metrics; public FWord[] leftSideBearing; public VerticalMetricsTable(FontData fontData) : base(fontData, Tag) { Read(); throw new NotImplementedException("VerticalMetricsTable"); } public void Read() { try { HorizontalHeaderTable hhea = this.fontData.hhea; MaximumProfileTable maxp = this.fontData.maxp; if (hhea != null && maxp != null) { int numMetrics = hhea.numberOfHMetrics; //->NumberOfHMetrics(); int numLsbs = maxp.numGlyphs - numMetrics; Debug.Assert(numMetrics != 0); Debug.Assert(numLsbs >= 0); this.metrics = new HorizontalMetrics[numMetrics]; for (int idx = 0; idx < numMetrics; idx++) this.metrics[idx] = new HorizontalMetrics(this.fontData); if (numLsbs > 0) { this.leftSideBearing = new FWord[numLsbs]; for (int idx = 0; idx < numLsbs; idx++) this.leftSideBearing[idx] = this.fontData.ReadFWord(); } } } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } /// <summary> /// This table establishes the memory requirements for this font. /// Fonts with CFF data must use Version 0.5 of this table, specifying only the numGlyphs field. /// Fonts with TrueType outlines must use Version 1.0 of this table, where all data is required. /// Both formats of OpenType require a 'maxp' table because a number of applications call the /// Windows GetFontData() API on the 'maxp' table to determine the number of glyphs in the font. /// </summary> internal class MaximumProfileTable : OpenTypeFontTable { public const string Tag = TableTagNames.MaxP; public Fixed version; public ushort numGlyphs; public ushort maxPoints; public ushort maxContours; public ushort maxCompositePoints; public ushort maxCompositeContours; public ushort maxZones; public ushort maxTwilightPoints; public ushort maxStorage; public ushort maxFunctionDefs; public ushort maxInstructionDefs; public ushort maxStackElements; public ushort maxSizeOfInstructions; public ushort maxComponentElements; public ushort maxComponentDepth; public MaximumProfileTable(FontData fontData) : base(fontData, Tag) { Read(); } public void Read() { try { this.version = this.fontData.ReadFixed(); this.numGlyphs = this.fontData.ReadUShort(); this.maxPoints = this.fontData.ReadUShort(); this.maxContours = this.fontData.ReadUShort(); this.maxCompositePoints = this.fontData.ReadUShort(); this.maxCompositeContours = this.fontData.ReadUShort(); this.maxZones = this.fontData.ReadUShort(); this.maxTwilightPoints = this.fontData.ReadUShort(); this.maxStorage = this.fontData.ReadUShort(); this.maxFunctionDefs = this.fontData.ReadUShort(); this.maxInstructionDefs = this.fontData.ReadUShort(); this.maxStackElements = this.fontData.ReadUShort(); this.maxSizeOfInstructions = this.fontData.ReadUShort(); this.maxComponentElements = this.fontData.ReadUShort(); this.maxComponentDepth = this.fontData.ReadUShort(); } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } /// <summary> /// The naming table allows multilingual strings to be associated with the OpenTypeTM font file. /// These strings can represent copyright notices, font names, family names, style names, and so on. /// To keep this table short, the font manufacturer may wish to make a limited set of entries in some /// small set of languages; later, the font can be "localized" and the strings translated or added. /// Other parts of the OpenType font file that require these strings can then refer to them simply by /// their index number. Clients that need a particular string can look it up by its platform ID, character /// encoding ID, language ID and name ID. Note that some platforms may require single byte character /// strings, while others may require double byte strings. /// /// For historical reasons, some applications which install fonts perform version control using Macintosh /// platform (platform ID 1) strings from the 'name' table. Because of this, we strongly recommend that /// the 'name' table of all fonts include Macintosh platform strings and that the syntax of the version /// number (name id 5) follows the guidelines given in this document. /// </summary> internal class NameTable : OpenTypeFontTable { public const string Tag = TableTagNames.Name; public string Name = String.Empty; public string Style = String.Empty; public ushort format; public ushort count; public ushort stringOffset; byte[] bytes; public NameTable(FontData fontData) : base(fontData, Tag) { Read(); } public void Read() { try { #if DEBUG this.fontData.Position = DirectoryEntry.Offset; #endif this.bytes = new byte[DirectoryEntry.PaddedLength]; Buffer.BlockCopy(this.fontData.Data, DirectoryEntry.Offset, bytes, 0, DirectoryEntry.Length); this.format = this.fontData.ReadUShort(); this.count = this.fontData.ReadUShort(); this.stringOffset = this.fontData.ReadUShort(); for (int idx = 0; idx < this.count; idx++) { NameRecord nrec = ReadNameRecord(); byte[] value = new byte[nrec.length]; Buffer.BlockCopy(this.fontData.Data, DirectoryEntry.Offset + this.stringOffset + nrec.offset, value, 0, nrec.length); //Debug.WriteLine(nrec.platformID.ToString()); // Read font name and style if (nrec.platformID == 0 || nrec.platformID == 3) { if (nrec.nameID == 1 && nrec.languageID == 0x0409) { if (String.IsNullOrEmpty(Name)) Name = Encoding.BigEndianUnicode.GetString(value, 0, value.Length); } if (nrec.nameID == 2 && nrec.languageID == 0x0409) { if (String.IsNullOrEmpty(Style)) Style = Encoding.BigEndianUnicode.GetString(value, 0, value.Length); } } //string s1 = Encoding.Default.GetString(name); //string s2 = Encoding.BigEndianUnicode.GetString(name); //Debug.WriteLine(s1); //Debug.WriteLine(s2); } Debug.Assert(!String.IsNullOrEmpty(Name)); } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } NameRecord ReadNameRecord() { NameRecord nrec = new NameRecord(); nrec.platformID = this.fontData.ReadUShort(); nrec.encodingID = this.fontData.ReadUShort(); nrec.languageID = this.fontData.ReadUShort(); nrec.nameID = this.fontData.ReadUShort(); nrec.length = this.fontData.ReadUShort(); nrec.offset = this.fontData.ReadUShort(); return nrec; } class NameRecord { public ushort platformID; public ushort encodingID; public ushort languageID; public ushort nameID; public ushort length; public ushort offset; } } /// <summary> /// The OS/2 table consists of a set of metrics that are required in OpenType fonts. /// </summary> internal class OS2Table : OpenTypeFontTable { public const string Tag = TableTagNames.OS2; [Flags] public enum FontSelectionFlags : ushort { Italic = 1 << 0, Bold = 1 << 5, Regular = 1 << 6, } public ushort version; public short xAvgCharWidth; public ushort usWeightClass; public ushort usWidthClass; public ushort fsType; public short ySubscriptXSize; public short ySubscriptYSize; public short ySubscriptXOffset; public short ySubscriptYOffset; public short ySuperscriptXSize; public short ySuperscriptYSize; public short ySuperscriptXOffset; public short ySuperscriptYOffset; public short yStrikeoutSize; public short yStrikeoutPosition; public short sFamilyClass; public byte[] panose; // = new byte[10]; public uint ulUnicodeRange1; // Bits 0-31 public uint ulUnicodeRange2; // Bits 32-63 public uint ulUnicodeRange3; // Bits 64-95 public uint ulUnicodeRange4; // Bits 96-127 public string achVendID; // = ""; public ushort fsSelection; public ushort usFirstCharIndex; public ushort usLastCharIndex; public short sTypoAscender; public short sTypoDescender; public short sTypoLineGap; public ushort usWinAscent; public ushort usWinDescent; // version >= 1 public uint ulCodePageRange1; // Bits 0-31 public uint ulCodePageRange2; // Bits 32-63 // version >= 2 public short sxHeight; public short sCapHeight; public ushort usDefaultChar; public ushort usBreakChar; public ushort usMaxContext; public OS2Table(FontData fontData) : base(fontData, Tag) { Read(); } public void Read() { try { this.version = this.fontData.ReadUShort(); this.xAvgCharWidth = this.fontData.ReadShort(); this.usWeightClass = this.fontData.ReadUShort(); this.usWidthClass = this.fontData.ReadUShort(); this.fsType = this.fontData.ReadUShort(); this.ySubscriptXSize = this.fontData.ReadShort(); this.ySubscriptYSize = this.fontData.ReadShort(); this.ySubscriptXOffset = this.fontData.ReadShort(); this.ySubscriptYOffset = this.fontData.ReadShort(); this.ySuperscriptXSize = this.fontData.ReadShort(); this.ySuperscriptYSize = this.fontData.ReadShort(); this.ySuperscriptXOffset = this.fontData.ReadShort(); this.ySuperscriptYOffset = this.fontData.ReadShort(); this.yStrikeoutSize = this.fontData.ReadShort(); this.yStrikeoutPosition = this.fontData.ReadShort(); this.sFamilyClass = this.fontData.ReadShort(); this.panose = this.fontData.ReadBytes(10); this.ulUnicodeRange1 = this.fontData.ReadULong(); this.ulUnicodeRange2 = this.fontData.ReadULong(); this.ulUnicodeRange3 = this.fontData.ReadULong(); this.ulUnicodeRange4 = this.fontData.ReadULong(); this.achVendID = this.fontData.ReadString(4); this.fsSelection = this.fontData.ReadUShort(); this.usFirstCharIndex = this.fontData.ReadUShort(); this.usLastCharIndex = this.fontData.ReadUShort(); this.sTypoAscender = this.fontData.ReadShort(); this.sTypoDescender = this.fontData.ReadShort(); this.sTypoLineGap = this.fontData.ReadShort(); this.usWinAscent = this.fontData.ReadUShort(); this.usWinDescent = this.fontData.ReadUShort(); if (this.version >= 1) { this.ulCodePageRange1 = this.fontData.ReadULong(); this.ulCodePageRange2 = this.fontData.ReadULong(); if (this.version >= 2) { this.sxHeight = this.fontData.ReadShort(); this.sCapHeight = this.fontData.ReadShort(); this.usDefaultChar = this.fontData.ReadUShort(); this.usBreakChar = this.fontData.ReadUShort(); this.usMaxContext = this.fontData.ReadUShort(); } } } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } /// <summary> /// This table contains additional information needed to use TrueType or OpenTypeTM fonts /// on PostScript printers. /// </summary> internal class PostScriptTable : OpenTypeFontTable { public const string Tag = TableTagNames.Post; public Fixed formatType; public float italicAngle; public FWord underlinePosition; public FWord underlineThickness; public ulong isFixedPitch; public ulong minMemType42; public ulong maxMemType42; public ulong minMemType1; public ulong maxMemType1; public PostScriptTable(FontData fontData) : base(fontData, Tag) { Read(); } public void Read() { try { this.formatType = this.fontData.ReadFixed(); this.italicAngle = this.fontData.ReadFixed() / 65536f; this.underlinePosition = this.fontData.ReadFWord(); this.underlineThickness = this.fontData.ReadFWord(); this.isFixedPitch = this.fontData.ReadULong(); this.minMemType42 = this.fontData.ReadULong(); this.maxMemType42 = this.fontData.ReadULong(); this.minMemType1 = this.fontData.ReadULong(); this.maxMemType1 = this.fontData.ReadULong(); } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } /// <summary> /// This table contains a list of values that can be referenced by instructions. /// They can be used, among other things, to control characteristics for different glyphs. /// The length of the table must be an integral number of FWORD units. /// </summary> internal class ControlValueTable : OpenTypeFontTable { public const string Tag = TableTagNames.Cvt; FWord[] array; // List of n values referenceable by instructions. n is the number of FWORD items that fit in the size of the table. public ControlValueTable(FontData fontData) : base(fontData, Tag) { DirectoryEntry.Tag = TableTagNames.Cvt; DirectoryEntry = fontData.tableDictionary[TableTagNames.Cvt]; Read(); } public void Read() { try { int length = DirectoryEntry.Length / 2; this.array = new FWord[length]; for (int idx = 0; idx < length; idx++) this.array[idx] = this.fontData.ReadFWord(); } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } /// <summary> /// This table is similar to the CVT Program, except that it is only run once, when the font is first used. /// It is used only for FDEFs and IDEFs. Thus the CVT Program need not contain function definitions. /// However, the CVT Program may redefine existing FDEFs or IDEFs. /// </summary> internal class FontProgram : OpenTypeFontTable { public const string Tag = TableTagNames.Fpgm; byte[] bytes; // Instructions. n is the number of BYTE items that fit in the size of the table. public FontProgram(FontData fontData) : base(fontData, Tag) { DirectoryEntry.Tag = TableTagNames.Fpgm; DirectoryEntry = fontData.tableDictionary[TableTagNames.Fpgm]; Read(); } public void Read() { try { int length = DirectoryEntry.Length; this.bytes = new byte[length]; for (int idx = 0; idx < length; idx++) this.bytes[idx] = this.fontData.ReadByte(); } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } /// <summary> /// The Control Value Program consists of a set of TrueType instructions that will be executed whenever the font or /// point size or transformation matrix change and before each glyph is interpreted. Any instruction is legal in the /// CVT Program but since no glyph is associated with it, instructions intended to move points within a particular /// glyph outline cannot be used in the CVT Program. The name 'prep' is anachronistic. /// </summary> internal class ControlValueProgram : OpenTypeFontTable { public const string Tag = TableTagNames.Prep; byte[] bytes; // Set of instructions executed whenever point size or font or transformation change. n is the number of BYTE items that fit in the size of the table. public ControlValueProgram(FontData fontData) : base(fontData, Tag) { DirectoryEntry.Tag = TableTagNames.Prep; DirectoryEntry = fontData.tableDictionary[TableTagNames.Prep]; Read(); } public void Read() { try { int length = DirectoryEntry.Length; this.bytes = new byte[length]; for (int idx = 0; idx < length; idx++) this.bytes[idx] = this.fontData.ReadByte(); } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } /// <summary> /// This table contains information that describes the glyphs in the font in the TrueType outline format. /// Information regarding the rasterizer (scaler) refers to the TrueType rasterizer. /// </summary> internal class GlyphSubstitutionTable : OpenTypeFontTable { public const string Tag = TableTagNames.GSUB; public GlyphSubstitutionTable(FontData fontData) : base(fontData, Tag) { DirectoryEntry.Tag = TableTagNames.GSUB; DirectoryEntry = fontData.tableDictionary[TableTagNames.GSUB]; Read(); } public void Read() { try { } catch (Exception ex) { throw new PdfSharpException(PSSR.ErrorReadingFontData, ex); } } } } pdfmod-0.9.1/lib/PdfSharp/PdfSharp.Fonts.OpenType/GenericFontTable.cs0000644000175000001440000000500511435766646025451 0ustar00gabeusers00000000000000#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange (mailto:Stefan.Lange@pdfsharp.com) // // Copyright (c) 2005-2009 empira Software GmbH, Cologne (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Diagnostics; using System.Runtime.InteropServices; using PdfSharp.Drawing; using PdfSharp.Internal; using Fixed = System.Int32; using FWord = System.Int16; using UFWord = System.UInt16; namespace PdfSharp.Fonts.OpenType { /// /// Generic font table. Not yet used /// internal class GenericFontTable : OpenTypeFontTable { public GenericFontTable(OpenTypeFontTable fontTable) : base(null, "xxxx") { DirectoryEntry.Tag = fontTable.DirectoryEntry.Tag; int length = fontTable.DirectoryEntry.Length; if (length > 0) { this.table = new byte[length]; Buffer.BlockCopy(fontTable.FontData.Data, fontTable.DirectoryEntry.Offset, this.table, 0, length); } } public GenericFontTable(FontData fontData, string tag) : base(fontData, tag) { this.fontData = fontData; } protected override OpenTypeFontTable DeepCopy() { GenericFontTable fontTable = (GenericFontTable)base.DeepCopy(); fontTable.table = (byte[])this.table.Clone(); return fontTable; } byte[] table; } } pdfmod-0.9.1/aclocal.m40000644000175000001440000017523011533760013014756 0ustar00gabeusers00000000000000# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(AC_AUTOCONF_VERSION, [2.63],, [m4_warning([this file was generated for autoconf 2.63. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 1995-2002 Free Software Foundation, Inc. # Copyright (C) 2001-2003,2004 Red Hat, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # # Macro to add for using GNU gettext. # Ulrich Drepper , 1995, 1996 # # Modified to never use included libintl. # Owen Taylor , 12/15/1998 # # Major rework to remove unused code # Owen Taylor , 12/11/2002 # # Added better handling of ALL_LINGUAS from GNU gettext version # written by Bruno Haible, Owen Taylor 5/30/3002 # # Modified to require ngettext # Matthias Clasen 08/06/2004 # # We need this here as well, since someone might use autoconf-2.5x # to configure GLib then an older version to configure a package # using AM_GLIB_GNU_GETTEXT AC_PREREQ(2.53) dnl dnl We go to great lengths to make sure that aclocal won't dnl try to pull in the installed version of these macros dnl when running aclocal in the glib directory. dnl m4_copy([AC_DEFUN],[glib_DEFUN]) m4_copy([AC_REQUIRE],[glib_REQUIRE]) dnl dnl At the end, if we're not within glib, we'll define the public dnl definitions in terms of our private definitions. dnl # GLIB_LC_MESSAGES #-------------------- glib_DEFUN([GLIB_LC_MESSAGES], [AC_CHECK_HEADERS([locale.h]) if test $ac_cv_header_locale_h = yes; then AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) if test $am_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi fi]) # GLIB_PATH_PROG_WITH_TEST #---------------------------- dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], [# Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in /*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) # GLIB_WITH_NLS #----------------- glib_DEFUN([GLIB_WITH_NLS], dnl NLS is obligatory [USE_NLS=yes AC_SUBST(USE_NLS) gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= AC_CHECK_HEADER(libintl.h, [gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" # # First check in libc # AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, [AC_TRY_LINK([ #include ], [return !ngettext ("","", 1)], gt_cv_func_ngettext_libc=yes, gt_cv_func_ngettext_libc=no) ]) if test "$gt_cv_func_ngettext_libc" = "yes" ; then AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, [AC_TRY_LINK([ #include ], [return !dgettext ("","")], gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no) ]) fi if test "$gt_cv_func_ngettext_libc" = "yes" ; then AC_CHECK_FUNCS(bind_textdomain_codeset) fi # # If we don't have everything we want, check in libintl # if test "$gt_cv_func_dgettext_libc" != "yes" \ || test "$gt_cv_func_ngettext_libc" != "yes" \ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then AC_CHECK_LIB(intl, bindtextdomain, [AC_CHECK_LIB(intl, ngettext, [AC_CHECK_LIB(intl, dgettext, gt_cv_func_dgettext_libintl=yes)])]) if test "$gt_cv_func_dgettext_libintl" != "yes" ; then AC_MSG_CHECKING([if -liconv is needed to use gettext]) AC_MSG_RESULT([]) AC_CHECK_LIB(intl, ngettext, [AC_CHECK_LIB(intl, dcgettext, [gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv], :,-liconv)], :,-liconv) fi # # If we found libintl, then check in it for bind_textdomain_codeset(); # we'll prefer libc if neither have bind_textdomain_codeset(), # and both have dgettext and ngettext # if test "$gt_cv_func_dgettext_libintl" = "yes" ; then glib_save_LIBS="$LIBS" LIBS="$LIBS -lintl $libintl_extra_libs" unset ac_cv_func_bind_textdomain_codeset AC_CHECK_FUNCS(bind_textdomain_codeset) LIBS="$glib_save_LIBS" if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then gt_cv_func_dgettext_libc=no else if test "$gt_cv_func_dgettext_libc" = "yes" \ && test "$gt_cv_func_ngettext_libc" = "yes"; then gt_cv_func_dgettext_libintl=no fi fi fi fi if test "$gt_cv_func_dgettext_libc" = "yes" \ || test "$gt_cv_func_dgettext_libintl" = "yes"; then gt_cv_have_gettext=yes fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then INTLLIBS="-lintl $libintl_extra_libs" fi if test "$gt_cv_have_gettext" = "yes"; then AC_DEFINE(HAVE_GETTEXT,1, [Define if the GNU gettext() function is already present or preinstalled.]) GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl if test "$MSGFMT" != "no"; then glib_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" AC_CHECK_FUNCS(dcgettext) MSGFMT_OPTS= AC_MSG_CHECKING([if msgfmt accepts -c]) GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: test 1.0\n" "PO-Revision-Date: 2007-02-15 12:01+0100\n" "Last-Translator: test \n" "Language-Team: C \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" ], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) AC_SUBST(MSGFMT_OPTS) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr], [CATOBJEXT=.gmo DATADIRNAME=share], [case $host in *-*-solaris*) dnl On Solaris, if bind_textdomain_codeset is in libc, dnl GNU format message catalog is always supported, dnl since both are added to the libc all together. dnl Hence, we'd like to go with DATADIRNAME=share and dnl and CATOBJEXT=.gmo in this case. AC_CHECK_FUNC(bind_textdomain_codeset, [CATOBJEXT=.gmo DATADIRNAME=share], [CATOBJEXT=.mo DATADIRNAME=lib]) ;; *) CATOBJEXT=.mo DATADIRNAME=lib ;; esac]) LIBS="$glib_save_LIBS" INSTOBJEXT=.mo else gt_cv_have_gettext=no fi fi ]) if test "$gt_cv_have_gettext" = "yes" ; then AC_DEFINE(ENABLE_NLS, 1, [always defined to indicate that i18n is enabled]) fi dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is not GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po AC_OUTPUT_COMMANDS( [case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac]) dnl These rules are solely for the distribution goal. While doing this dnl we only have to keep exactly one list of the available catalogs dnl in configure.in. for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done dnl Make all variables we use known to autoconf. AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) AC_SUBST(DATADIRNAME) AC_SUBST(GMOFILES) AC_SUBST(INSTOBJEXT) AC_SUBST(INTLLIBS) AC_SUBST(PO_IN_DATADIR_TRUE) AC_SUBST(PO_IN_DATADIR_FALSE) AC_SUBST(POFILES) AC_SUBST(POSUB) ]) # AM_GLIB_GNU_GETTEXT # ------------------- # Do checks necessary for use of gettext. If a suitable implementation # of gettext is found in either in libintl or in the C library, # it will set INTLLIBS to the libraries needed for use of gettext # and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable # gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() # on various variables needed by the Makefile.in.in installed by # glib-gettextize. dnl glib_DEFUN([GLIB_GNU_GETTEXT], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_HEADER_STDC])dnl GLIB_LC_MESSAGES GLIB_WITH_NLS if test "$gt_cv_have_gettext" = "yes"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else AC_MSG_CHECKING(for catalogs to be installed) NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS AC_MSG_RESULT($LINGUAS) fi dnl Construct list of names of catalog files to be constructed. if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi dnl Generate list of files to be processed by xgettext which will dnl be included in po/Makefile. test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES ]) # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) # ------------------------------- # Define VARIABLE to the location where catalog files will # be installed by po/Makefile. glib_DEFUN([GLIB_DEFINE_LOCALEDIR], [glib_REQUIRE([GLIB_GNU_GETTEXT])dnl glib_save_prefix="$prefix" glib_save_exec_prefix="$exec_prefix" glib_save_datarootdir="$datarootdir" test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix=$prefix datarootdir=`eval echo "${datarootdir}"` if test "x$CATOBJEXT" = "x.mo" ; then localedir=`eval echo "${libdir}/locale"` else localedir=`eval echo "${datadir}/locale"` fi prefix="$glib_save_prefix" exec_prefix="$glib_save_exec_prefix" datarootdir="$glib_save_datarootdir" AC_DEFINE_UNQUOTED($1, "$localedir", [Define the location where the catalogs will be installed]) ]) dnl dnl Now the definitions that aclocal will find dnl ifdef(glib_configure_in,[],[ AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) ])dnl # GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL]) # # Create a temporary file with TEST-FILE as its contents and pass the # file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with # 0 and perform ACTION-IF-FAIL for any other exit status. AC_DEFUN([GLIB_RUN_PROG], [cat >conftest.foo <<_ACEOF $2 _ACEOF if AC_RUN_LOG([$1 conftest.foo]); then m4_ifval([$3], [$3], [:]) m4_ifvaln([$4], [else $4])dnl echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD fi]) dnl Do not call GNOME_DOC_DEFINES directly. It is split out from dnl GNOME_DOC_INIT to allow gnome-doc-utils to bootstrap off itself. AC_DEFUN([GNOME_DOC_DEFINES], [ AC_ARG_WITH([help-dir], AC_HELP_STRING([--with-help-dir=DIR], [path to help docs]),, [with_help_dir='${datadir}/gnome/help']) HELP_DIR="$with_help_dir" AC_SUBST(HELP_DIR) AC_ARG_WITH([omf-dir], AC_HELP_STRING([--with-omf-dir=DIR], [path to OMF files]),, [with_omf_dir='${datadir}/omf']) OMF_DIR="$with_omf_dir" AC_SUBST(OMF_DIR) AC_ARG_WITH([help-formats], AC_HELP_STRING([--with-help-formats=FORMATS], [list of formats]),, [with_help_formats='']) DOC_USER_FORMATS="$with_help_formats" AC_SUBST(DOC_USER_FORMATS) AC_ARG_ENABLE([scrollkeeper], [AC_HELP_STRING([--disable-scrollkeeper], [do not make updates to the scrollkeeper database])],, enable_scrollkeeper=yes) AM_CONDITIONAL([ENABLE_SK],[test "$gdu_cv_have_gdu" = "yes" -a "$enable_scrollkeeper" = "yes"]) dnl disable scrollkeeper automatically for distcheck DISTCHECK_CONFIGURE_FLAGS="--disable-scrollkeeper $DISTCHECK_CONFIGURE_FLAGS" AC_SUBST(DISTCHECK_CONFIGURE_FLAGS) AM_CONDITIONAL([HAVE_GNOME_DOC_UTILS],[test "$gdu_cv_have_gdu" = "yes"]) ]) # GNOME_DOC_INIT ([MINIMUM-VERSION],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) # AC_DEFUN([GNOME_DOC_INIT], [AC_REQUIRE([AC_PROG_LN_S])dnl ifelse([$1],,[gdu_cv_version_required=0.3.2],[gdu_cv_version_required=$1]) AC_MSG_CHECKING([gnome-doc-utils >= $gdu_cv_version_required]) PKG_CHECK_EXISTS([gnome-doc-utils >= $gdu_cv_version_required], [gdu_cv_have_gdu=yes],[gdu_cv_have_gdu=no]) if test "$gdu_cv_have_gdu" = "yes"; then AC_MSG_RESULT([yes]) ifelse([$2],,[:],[$2]) else AC_MSG_RESULT([no]) ifelse([$3],,[AC_MSG_ERROR([gnome-doc-utils >= $gdu_cv_version_required not found])],[$3]) fi GNOME_DOC_DEFINES ]) dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) # serial 40 IT_PROG_INTLTOOL AC_DEFUN([IT_PROG_INTLTOOL], [ AC_PREREQ([2.50])dnl AC_REQUIRE([AM_NLS])dnl case "$am__api_version" in 1.[01234]) AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool]) ;; *) ;; esac if test -n "$1"; then AC_MSG_CHECKING([for intltool >= $1]) INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` [INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` ] AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found]) test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.]) fi AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update]) AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge]) AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract]) if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.]) fi INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@' INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@' INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' AC_SUBST(INTLTOOL_DESKTOP_RULE) AC_SUBST(INTLTOOL_DIRECTORY_RULE) AC_SUBST(INTLTOOL_KEYS_RULE) AC_SUBST(INTLTOOL_PROP_RULE) AC_SUBST(INTLTOOL_OAF_RULE) AC_SUBST(INTLTOOL_PONG_RULE) AC_SUBST(INTLTOOL_SERVER_RULE) AC_SUBST(INTLTOOL_SHEET_RULE) AC_SUBST(INTLTOOL_SOUNDLIST_RULE) AC_SUBST(INTLTOOL_UI_RULE) AC_SUBST(INTLTOOL_XAM_RULE) AC_SUBST(INTLTOOL_KBD_RULE) AC_SUBST(INTLTOOL_XML_RULE) AC_SUBST(INTLTOOL_XML_NOMERGE_RULE) AC_SUBST(INTLTOOL_CAVES_RULE) AC_SUBST(INTLTOOL_SCHEMAS_RULE) AC_SUBST(INTLTOOL_THEME_RULE) AC_SUBST(INTLTOOL_SERVICE_RULE) AC_SUBST(INTLTOOL_POLICY_RULE) # Check the gettext tools to make sure they are GNU AC_PATH_PROG(XGETTEXT, xgettext) AC_PATH_PROG(MSGMERGE, msgmerge) AC_PATH_PROG(MSGFMT, msgfmt) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) fi xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) fi AC_PATH_PROG(INTLTOOL_PERL, [perl]) if test -z "$INTLTOOL_PERL"; then AC_MSG_ERROR([perl not found; required for intltool]) fi if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then AC_MSG_ERROR([perl 5.x required for intltool]) fi if test "x$2" != "xno-xml"; then AC_MSG_CHECKING([for XML::Parser]) if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then AC_MSG_RESULT([ok]) else AC_MSG_ERROR([XML::Parser perl module is required for intltool]) fi fi # Substitute ALL_LINGUAS so we can use it in po/Makefile AC_SUBST(ALL_LINGUAS) # Set DATADIRNAME correctly if it is not set yet # (copied from glib-gettext.m4) if test -z "$DATADIRNAME"; then AC_LINK_IFELSE( [AC_LANG_PROGRAM([[]], [[extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr]])], [DATADIRNAME=share], [case $host in *-*-solaris*) dnl On Solaris, if bind_textdomain_codeset is in libc, dnl GNU format message catalog is always supported, dnl since both are added to the libc all together. dnl Hence, we'd like to go with DATADIRNAME=share dnl in this case. AC_CHECK_FUNC(bind_textdomain_codeset, [DATADIRNAME=share], [DATADIRNAME=lib]) ;; *) [DATADIRNAME=lib] ;; esac]) fi AC_SUBST(DATADIRNAME) IT_PO_SUBDIR([po]) ]) # IT_PO_SUBDIR(DIRNAME) # --------------------- # All po subdirs have to be declared with this macro; the subdir "po" is # declared by IT_PROG_INTLTOOL. # AC_DEFUN([IT_PO_SUBDIR], [AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS. dnl dnl The following CONFIG_COMMANDS should be exetuted at the very end dnl of config.status. AC_CONFIG_COMMANDS_PRE([ AC_CONFIG_COMMANDS([$1/stamp-it], [ if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" ]; then AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.]) fi rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp" >"$1/stamp-it.tmp" [sed '/^#/d s/^[[].*] *// /^[ ]*$/d '"s|^| $ac_top_srcdir/|" \ "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" ] [sed '/^POTFILES =/,/[^\\]$/ { /^POTFILES =/!d r $1/POTFILES } ' "$1/Makefile.in" >"$1/Makefile"] rm -f "$1/Makefile.tmp" mv "$1/stamp-it.tmp" "$1/stamp-it" ]) ])dnl ]) # deprecated macros AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL]) # A hint is needed for aclocal from Automake <= 1.9.4: # AC_DEFUN([AC_PROG_INTLTOOL], ...) # nls.m4 serial 3 (gettext-0.15) dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ(2.50) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # # Similar to PKG_CHECK_MODULES, make sure that the first instance of # this or PKG_CHECK_MODULES is called, or make sure to call # PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_ifval([$2], [$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT ])], [AC_MSG_RESULT([no]) $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 13 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR pdfmod-0.9.1/src/0000777000175000001440000000000011533760020013677 5ustar00gabeusers00000000000000pdfmod-0.9.1/src/Resources/0000777000175000001440000000000011533760020015651 5ustar00gabeusers00000000000000pdfmod-0.9.1/src/Resources/UIManager.xml0000644000175000001440000000565611443752367020232 0ustar00gabeusers00000000000000 pdfmod-0.9.1/src/Makefile.in0000644000175000001440000005566011533760015015760 0ustar00gabeusers00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : @USE_BUNDLED_POPPLER_TRUE@am__append_1 = ../bin/poppler-sharp.dll @USE_BUNDLED_POPPLER_TRUE@am__append_2 = $(POPPLER_SHARP_DLL_CONFIG) @USE_BUNDLED_POPPLER_FALSE@am__append_3 = -pkg:poppler-sharp DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/pdfmod.in $(top_srcdir)/Makefile.include subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = pdfmod am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibdir)" \ "$(DESTDIR)$(programfilesdir)" binSCRIPT_INSTALL = $(INSTALL_SCRIPT) pkglibSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) $(pkglib_SCRIPTS) SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; programfilesDATA_INSTALL = $(INSTALL_DATA) DATA = $(programfiles_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUNDLE_ASSEMBLIES = @BUNDLE_ASSEMBLIES@ BUNDLE_FILES = @BUNDLE_FILES@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GCONF_SHARP_20_CFLAGS = @GCONF_SHARP_20_CFLAGS@ GCONF_SHARP_20_LIBS = @GCONF_SHARP_20_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ HELP_DIR = @HELP_DIR@ HYENA_ASSEMBLIES = @HYENA_ASSEMBLIES@ HYENA_CFLAGS = @HYENA_CFLAGS@ HYENA_FILES = @HYENA_FILES@ HYENA_GUI_ASSEMBLIES = @HYENA_GUI_ASSEMBLIES@ HYENA_GUI_CFLAGS = @HYENA_GUI_CFLAGS@ HYENA_GUI_FILES = @HYENA_GUI_FILES@ HYENA_GUI_LIBS = @HYENA_GUI_LIBS@ HYENA_LIBS = @HYENA_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@ INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@ INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@ INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@ INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@ INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@ INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@ INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@ INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@ INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@ INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@ INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@ INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@ INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POPPLER_ASSEMBLIES = @POPPLER_ASSEMBLIES@ POPPLER_CFLAGS = @POPPLER_CFLAGS@ POPPLER_LIBS = @POPPLER_LIBS@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Warning: This is an automatically generated file, do not edit! # EXTRA_DIST = $(build_sources) $(build_resx_files) \ $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) \ $(DATA_FILES) $(build_culture_res_files) ASSEMBLY_COMPILER_COMMAND = $(MCS) ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug "-define:DEBUG" ASSEMBLY = ../bin/PdfMod.exe ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = exe PROJECT_REFERENCES = ../bin/PdfSharp.dll $(am__append_1) BUILD_DIR = ../bin PDFMOD_EXE_MDB_SOURCE = ../bin/PdfMod.exe.mdb AL = al2 SATELLITE_ASSEMBLY_NAME = $(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = $(PDFMOD_EXE_MDB) $(am__append_2) BINARIES = \ $(PDFMOD) RESGEN = resgen2 FILES = \ PdfMod/Core/AssemblyInfo.cs \ PdfMod/Core/Client.cs \ PdfMod/Core/Configuration.cs \ PdfMod/Core/Defines.cs \ PdfMod/Gui/Actions.cs \ PdfMod/Gui/BookmarkView.cs \ PdfMod/Gui/CairoCell.cs \ PdfMod/Gui/Client.cs \ PdfMod/Gui/DocumentIconView.cs \ PdfMod/Gui/MetadataEditorBox.cs \ PdfMod/Gui/PageCell.cs \ PdfMod/Gui/PageListStore.cs \ PdfMod/Gui/SelectMatchingBox.cs \ PdfMod/Gui/ZoomSlider.cs \ PdfMod/Main.cs \ PdfMod/Pdf/Actions/BaseAction.cs \ PdfMod/Pdf/Actions/BasePageAction.cs \ PdfMod/Pdf/Actions/ExportImagesAction.cs \ PdfMod/Pdf/Actions/MoveAction.cs \ PdfMod/Pdf/Actions/RemoveAction.cs \ PdfMod/Pdf/Actions/RotateAction.cs \ PdfMod/Pdf/Document.cs \ PdfMod/Pdf/Page.cs \ PdfMod/Pdf/PageLabels.cs \ PdfMod/Pdf/PageThumbnail.cs DATA_FILES = RESOURCES = Resources/UIManager.xml EXTRAS = \ pdfmod.in REFERENCES = Mono.Cairo Mono.Posix -pkg:gconf-sharp-2.0 \ -pkg:glib-sharp-2.0 -pkg:gtk-sharp-2.0 -pkg:hyena \ -pkg:hyena.gui System System.Core -r:../bin/PdfSharp.dll \ $(am__append_3) CLEANFILES = $(PROGRAMFILES) $(BINARIES) $(ASSEMBLY) $(ASSEMBLY).mdb \ $(BINARIES) $(build_resx_resources) \ $(build_satellite_assembly_list) VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q = $(subst \ ,?,$1) q2s = $(subst ?,\ ,$1) # use this when result will be quoted unesc2 = $(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc = $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed = $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__ = , get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC = $(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2 = $(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target = $(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets = $(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) DLL_REFERENCES_EXPANDED = $(foreach reference, $(DLL_REFERENCES), $(addprefix $(srcdir)/, $(reference))) build_references_ref = $(call q2s,$(foreach ref, $(call \ s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), \ $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) $(call \ q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES_EXPANDED)), \ -r:$(ref))) $(call q2s,$(foreach ref, $(call \ s2q,$(PROJECT_REFERENCES)), -r:$(ref))) s2q2s = $(call unesc2,$(call s2q,$1)) cp_actual = test -z $1 || cp $1 $2 cp = $(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual = test -z '$1' || rm -f '$2' rm = $(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* pkglib_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) PDFSHARP_DLL = $(BUILD_DIR)/PdfSharp.dll PDFSHARP_DLL_MDB = $(BUILD_DIR)/PdfSharp.dll.mdb POPPLER_SHARP_DLL = $(BUILD_DIR)/poppler-sharp.dll POPPLER_SHARP_DLL_CONFIG = $(BUILD_DIR)/poppler-sharp.dll.config PDFMOD_EXE_MDB = $(BUILD_DIR)/PdfMod.exe.mdb PDFMOD = $(BUILD_DIR)/pdfmod all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.include $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh pdfmod: $(top_builddir)/config.status $(srcdir)/pdfmod.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done install-pkglibSCRIPTS: $(pkglib_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(pkglibSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(pkglibSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ else :; fi; \ done uninstall-pkglibSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(pkglib_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done install-programfilesDATA: $(programfiles_DATA) @$(NORMAL_INSTALL) test -z "$(programfilesdir)" || $(MKDIR_P) "$(DESTDIR)$(programfilesdir)" @list='$(programfiles_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(programfilesDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(programfilesdir)/$$f'"; \ $(programfilesDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(programfilesdir)/$$f"; \ done uninstall-programfilesDATA: @$(NORMAL_UNINSTALL) @list='$(programfiles_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(programfilesdir)/$$f'"; \ rm -f "$(DESTDIR)$(programfilesdir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(programfilesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-programfilesDATA install-dvi: install-dvi-am install-exec-am: install-binSCRIPTS install-pkglibSCRIPTS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-pkglibSCRIPTS \ uninstall-programfilesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibSCRIPTS install-programfilesDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-binSCRIPTS uninstall-pkglibSCRIPTS \ uninstall-programfilesDATA all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) $(eval $(call emit-deploy-wrapper,PDFMOD,pdfmod,x)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) cp $(BUNDLE_ASSEMBLIES) $(BUILD_DIR) cp $(BUNDLE_FILES) $(BUILD_DIR) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pdfmod-0.9.1/src/pdfmod.in0000644000175000001440000000010311240370571015471 0ustar00gabeusers00000000000000#!/bin/sh exec mono "@expanded_libdir@/@PACKAGE@/PdfMod.exe" "$@" pdfmod-0.9.1/src/PdfMod/0000777000175000001440000000000011533760020015050 5ustar00gabeusers00000000000000pdfmod-0.9.1/src/PdfMod/Pdf/0000777000175000001440000000000011533760020015561 5ustar00gabeusers00000000000000pdfmod-0.9.1/src/PdfMod/Pdf/Document.cs0000644000175000001440000003524011533753115017675 0ustar00gabeusers00000000000000// Copyright (C) 2009-2010 Novell, Inc. // Copyright (C) 2009 Julien Rebetez // Copyright (C) 2009 Michael McKinley // // 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. using System; using System.Linq; using System.Collections.Generic; using Mono.Unix; using Hyena; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; namespace PdfMod.Pdf { public class Document : IDisposable { PdfDocument pdf_document; List pages = new List (); string tmp_path; string tmp_uri; PageLabels page_labels; Poppler.Document poppler_doc; uint save_timeout_id = 0; internal string CurrentStateUri { get { return tmp_uri ?? Uri; } } public PageLabels Labels { get { return page_labels; } } public string SuggestedSavePath { get; set; } public string Uri { get; private set; } public string Path { get; private set; } public PdfDocument Pdf { get { return pdf_document; } } public int Count { get { return pages.Count; } } public IEnumerable Pages { get { foreach (var page in pages) yield return page; } } public Page this [int index] { get { return pages[index]; } } public string Title { get { var title = Pdf.Info.Title; return String.IsNullOrEmpty (title) ? null : title; } set { if (value.Trim () == "") value = null; if (value == Title) return; Pdf.Info.Title = value; StartSaveTempTimeout (); } } public string Author { get { return Pdf.Info.Author; } set { if (value.Trim () == "") value = null; if (value == Author) return; Pdf.Info.Author = value; StartSaveTempTimeout (); } } public string Keywords { get { return Pdf.Info.Keywords; } set { if (value.Trim () == "") value = null; if (value == Keywords) return; Pdf.Info.Keywords = value; StartSaveTempTimeout (); } } public string Subject { get { return Pdf.Info.Subject; } set { if (value.Trim () == "") value = null; if (value == Subject) return; Pdf.Info.Subject = value; StartSaveTempTimeout (); } } public string Filename { get { return System.IO.Path.GetFileName (SuggestedSavePath); } } public string Password { get; set; } public event System.Action Changed; public event System.Action PagesMoved; public event Action PagesRemoved; public event Action PagesAdded; public event Action PagesChanged; public Document () { } public void Load (string uri, PdfPasswordProvider passwordProvider, bool isAlreadyTmp) { if (isAlreadyTmp) { tmp_uri = new Uri (uri).AbsoluteUri; tmp_path = new Uri (uri).LocalPath; } var safe_uri = new Hyena.SafeUri (uri); var uri_obj = new Uri (safe_uri.AbsoluteUri); Uri = uri_obj.AbsoluteUri; SuggestedSavePath = Path = uri_obj.LocalPath; pdf_document = PdfSharp.Pdf.IO.PdfReader.Open (Path, PdfDocumentOpenMode.Modify, passwordProvider); for (int i = 0; i < pdf_document.PageCount; i++) { var page = new Page (pdf_document.Pages[i]) { Document = this, Index = i }; pages.Add (page); } page_labels = new PageLabels (pdf_document); ExpireThumbnails (pages); OnChanged (); } public bool HasUnsavedChanges { get { return UnsavedChanges > 0 || tmp_uri != null || save_timeout_id != 0; } } int unsaved_changes = 0; public int UnsavedChanges { get { return unsaved_changes; } set { unsaved_changes = value; OnChanged (); } } public long FileSize { get { return new System.IO.FileInfo (tmp_path ?? Path).Length; } } public void Dispose () { if (pdf_document != null) { pdf_document.Dispose (); pdf_document = null; } if (tmp_path != null) { System.IO.File.Delete (tmp_path); tmp_path = tmp_uri = null; } } public IEnumerable FindPagesMatching (string text) { using (var doc = Poppler.Document.NewFromFile (tmp_uri ?? Uri, Password ?? "")) { for (int i = 0; i < doc.NPages; i++) { using (var page = doc.GetPage (i)) { var list = page.FindText (text); if (list != null && list.Count > 0) { yield return pages[i]; list.Dispose (); } } } } } public void Move (int to_index, Page [] move_pages, int [] new_indexes) { // Remove all the pages foreach (var page in move_pages) { pages.Remove (page); } if (new_indexes == null) { new_indexes = move_pages.Select (p => to_index++).ToArray (); } // Add back at the right index for (int i = 0; i < move_pages.Length; i++) { pages.Insert (new_indexes[i], move_pages[i]); } // Do the actual move in the document foreach (var page in move_pages) { pdf_document.Pages.MovePage (page.Index, IndexOf (page)); } Reindex (); SaveTemp (); var handler = PagesMoved; if (handler != null) { handler (); } } public int IndexOf (Page page) { return pages.IndexOf (page); } public void Remove (params Page [] remove_pages) { foreach (var page in remove_pages) { pdf_document.Pages.Remove (page.Pdf); pages.Remove (page); } Reindex (); SaveTemp (); var handler = PagesRemoved; if (handler != null) { handler (remove_pages); } } public void Rotate (Page [] rotate_pages, int rotate_by) { foreach (var page in rotate_pages) { page.Pdf.Rotate += rotate_by; } OnPagesChanged (rotate_pages); } public void Save (string uri) { Pdf.Save (uri); UnsavedChanges = 0; Log.DebugFormat ("Saved to {0}", uri); var uri_obj = new Uri (uri); Uri = uri; SuggestedSavePath = Path = uri_obj.LocalPath; if (tmp_uri != null) { try { System.IO.File.Delete (tmp_path); } catch (Exception e) { Log.Exception ("Couldn't delete tmp file after saving", e); } finally { tmp_uri = tmp_path = null; } } OnChanged (); } public void AppendFromUri (Uri uri) { AddFromUri (uri, Count); } public void AddFromUri (Uri uri) { AddFromUri (uri, 0); } public void AddFromUri (Uri uri, int to_index) { AddFromUri (uri, to_index, null); } public void AddFromUri (Uri uri, int to_index, int [] pages_to_import) { Log.DebugFormat ("Inserting pages from {0} to index {1}", uri, to_index); using (var doc = PdfSharp.Pdf.IO.PdfReader.Open (uri.LocalPath, null, PdfSharp.Pdf.IO.PdfDocumentOpenMode.Import)) { var pages = new List (); for (int i = 0; i < doc.PageCount; i++) { if (pages_to_import == null || pages_to_import.Contains (i)) { pages.Add (new Page (doc.Pages [i])); } } Add (to_index, pages.ToArray ()); to_index += pages.Count; } } public void Add (int to_index, params Page [] add_pages) { int i = to_index; foreach (var page in add_pages) { var pdf = pdf_document.Pages.Insert (i, page.Pdf); page.Pdf = pdf; page.Document = this; pages.Insert (i, page); i++; } Reindex (); SaveTemp (); ExpireThumbnails (add_pages); var handler = PagesAdded; if (handler != null) { handler (to_index, add_pages); } } Poppler.Document PopplerDoc { get { if (poppler_doc == null) { poppler_doc = Poppler.Document.NewFromFile (tmp_uri ?? Uri, Password ?? ""); } return poppler_doc; } } void ExpireThumbnails (IEnumerable update_pages) { if (poppler_doc != null) { poppler_doc.Dispose (); poppler_doc = null; } foreach (var page in update_pages) { page.SurfaceDirty = true; } } public PageThumbnail GetSurface (Page page, int w, int h, int min_width) { if (w < min_width || h < min_width) { return null; } using (var ppage = PopplerDoc.GetPage (page.Index)) { double pw, ph; ppage.GetSize (out pw, out ph); double scale = Math.Min (w / pw, h / ph); var surface = new Cairo.ImageSurface (Cairo.Format.Argb32, (int)(scale * pw), (int)(scale * ph)); var cr = new Cairo.Context (surface); cr.Scale (scale, scale); ppage.Render (cr); page.SurfaceDirty = false; return new PageThumbnail () { Surface = surface, Context = cr }; } } void Reindex () { for (int i = 0; i < pages.Count; i++) { pages[i].Index = i; } } void StartSaveTempTimeout () { if (save_timeout_id != 0) { GLib.Source.Remove (save_timeout_id); } save_timeout_id = GLib.Timeout.Add (100, OnSaveTempTimeout); } bool OnSaveTempTimeout () { save_timeout_id = 0; SaveTemp (); return false; } void SaveTemp () { try { if (tmp_path == null) { tmp_path = Core.Client.GetTmpFilename (); if (System.IO.File.Exists (tmp_path)) { System.IO.File.Delete (tmp_path); } tmp_uri = new Uri (tmp_path).AbsoluteUri; } pdf_document.Save (tmp_path); Log.DebugFormat ("Saved tmp file to {0}", tmp_path); OnChanged (); } catch (Exception e) { Log.Exception ("Failed to save tmp document", e); // TODO tell user, shutdown } } void OnPagesChanged (Page [] changed_pages) { Reindex (); SaveTemp (); ExpireThumbnails (changed_pages); var handler = PagesChanged; if (handler != null) { handler (changed_pages); } OnChanged (); } void OnChanged () { var handler = Changed; if (handler != null) { handler (); } } // Return a simple, nice string describing the selected pages // e.g. Page 1, or Page 3 - 6, or Page 2, 4, 6 public static string GetPageSummary (List pages, int maxListed) { string pages_summary = null; if (pages.Count == 1) { // Translators: {0} is the number of pages (always 1), and {1} is the page number, eg Page 1, or Page 5 pages_summary = String.Format (Catalog.GetPluralString ("Page {1}", "Page {1}", pages.Count), pages.Count, pages[0].Index + 1); } else if (pages[0].Index + pages.Count - 1 == pages[pages.Count - 1].Index) { // Translators: {0} is the number of pages, and {1} is the first page, {2} is the last page, // eg Pages 3 - 7 pages_summary = String.Format (Catalog.GetPluralString ("Pages {1} - {2}", "Pages {1} - {2}", pages.Count), pages.Count, pages[0].Index + 1, pages[pages.Count - 1].Index + 1); } else if (pages.Count < maxListed) { string page_nums = String.Join (", ", pages.Select (p => (p.Index + 1).ToString ()).ToArray ()); // Translators: {0} is the number of pages, {1} is a comma separated list of page numbers, eg Pages 1, 4, 9 pages_summary = String.Format (Catalog.GetPluralString ("Pages {1}", "Pages {1}", pages.Count), pages.Count, page_nums); } else { // Translators: {0} is the number of pages, eg 12 Pages pages_summary = String.Format (Catalog.GetPluralString ("{0} Page", "{0} Pages", pages.Count), pages.Count); } return pages_summary; } } } pdfmod-0.9.1/src/PdfMod/Pdf/Actions/0000777000175000001440000000000011533760020017161 5ustar00gabeusers00000000000000pdfmod-0.9.1/src/PdfMod/Pdf/Actions/RotateAction.cs0000644000175000001440000000137011255256312022106 0ustar00gabeusers00000000000000 using System; using System.Collections.Generic; using Mono.Unix; namespace PdfMod.Pdf.Actions { public class RotateAction : BasePageAction { int rotation; public RotateAction (Document document, IEnumerable pages, int rotation) : base (document, pages) { this.rotation = rotation; Description = String.Format (Catalog.GetPluralString ("Rotate {1}", "Rotate {1}", Pages.Count), Pages.Count, Document.GetPageSummary (Pages, 5)); } public override void Undo () { Document.Rotate (Pages.ToArray (), -rotation); } public override void Redo () { Document.Rotate (Pages.ToArray (), rotation); } } } pdfmod-0.9.1/src/PdfMod/Pdf/Actions/ExportImagesAction.cs0000644000175000001440000001635511533751277023301 0ustar00gabeusers00000000000000// // ExportImagesAction.cs // // Based on the PDFSharp example, "Based on GDI+/ExportImages/Program.cs" // // Authors: // PDFsharp Team (mailto:PDFsharpSupport@pdfsharp.de) // // Modified by: // Gabriel Burt // // Copyright (c) 2005-2008 empira Software GmbH, Cologne (Germany) // Copyright (C) 2009 Novell, Inc. // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. using System; using System.IO; using System.Text; using System.Collections.Generic; using System.Linq; using Mono.Unix; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; namespace PdfMod.Pdf.Actions { public class ExportImagesAction { List image_objects; int max_page_index; public ExportImagesAction (Document document, IEnumerable pages) { var page_list = pages.ToList (); max_page_index = page_list.Last ().Index; image_objects = GetImageObjectsFrom (page_list).ToList (); } public int ExportableImageCount { get { return image_objects.Count; } } public void Do (string to_path) { foreach (var img_obj in image_objects) { Export (img_obj, to_path); } } IEnumerable GetImageObjectsFrom (IEnumerable pages) { foreach (var page in pages) { var resources = page.Pdf.Elements.GetDictionary ("/Resources"); if (resources == null) continue; var x_objects = resources.Elements.GetDictionary ("/XObject"); if (x_objects == null) continue; int i = 0; var items = x_objects.Elements.Values.ToList (); foreach (var item in items) { var reference = item as PdfReference; if (reference == null) continue; var x_object = reference.Value as PdfDictionary; // Put this in a variable to pass to GetString so that it's not pulled out as a translation string var subtype = "/Subtype"; if (x_object != null && x_object.Elements.GetString (subtype) == "/Image") { var img = new ImageInfo () { Page = page, ImageObject = x_object, PageIndex = i++, PageCount = items.Count }; if (IsExportable (img)) { yield return img; } else { i--; } } } } } bool IsExportable (ImageInfo image) { var filter_obj = image.ImageObject.Elements["/Filter"]; var filter = filter_obj == null ? "" : filter_obj.ToString (); return filter == "/DCTDecode" || filter == "/FlateDecode"; } /// /// Currently extracts only JPEG images. /// void Export (ImageInfo image, string to_path) { var filter_obj = image.ImageObject.Elements["/Filter"]; var filter = filter_obj == null ? "" : filter_obj.ToString (); switch (filter) { case "/DCTDecode": ExportJpegImage (image, GetFilename (image, to_path, "jpg")); break; case "/FlateDecode": ExportAsPngImage (image, GetFilename (image, to_path, "png")); break; } } string GetFilename (ImageInfo image, string to_path, string ext) { string name = image.ImageObject.Elements.GetName ("/Name"); if (name == "/X") { name = null; } var name_fragment = String.IsNullOrEmpty (name) ? null : String.Format (" ({0})", name); var path = Path.Combine ( to_path, Hyena.StringUtil.EscapeFilename (String.Format ( "{0} - {1}{2}.{3}", String.Format (Catalog.GetString ("Page {0}"), SortableNumberString (image.Page.Index + 1, max_page_index + 1)), SortableNumberString (image.PageIndex + 1, image.PageCount), name_fragment, ext )) ); return path; } static string SortableNumberString (int num, int count) { var fmt = new StringBuilder ("{0:"); int places = count.ToString ().Length; for (int i = 0; i < places; i++) { fmt.Append ('0'); } fmt.Append ('}'); return String.Format (fmt.ToString (), num); } /// /// Exports a JPEG image. /// static void ExportJpegImage (ImageInfo image, string path) { // Fortunately JPEG has native support in PDF and exporting an image is just writing the stream to a file. var fs = new FileStream (path, FileMode.Create, FileAccess.Write); byte[] stream = image.ImageObject.Stream.Value; using (var bw = new BinaryWriter (fs)) { bw.Write (stream); } } /// /// Exports image in PNG format. /// static void ExportAsPngImage (ImageInfo image, string path) { int width = image.ImageObject.Elements.GetInteger (PdfImage.Keys.Width); int height = image.ImageObject.Elements.GetInteger (PdfImage.Keys.Height); try { byte [] data = image.ImageObject.Stream.UnfilteredValue; using (var pixbuf = new Gdk.Pixbuf (data, Gdk.Colorspace.Rgb, false, 8, width, height, width*3)) { pixbuf.Save (path, "png"); } } catch (Exception e) { Hyena.Log.Exception ("Unable to load PNG from embedded PDF object", e); } } class ImageInfo { public Page Page { get; set; } public PdfDictionary ImageObject { get; set; } public int PageIndex { get; set; } public int PageCount { get; set; } } } } pdfmod-0.9.1/src/PdfMod/Pdf/Actions/BaseAction.cs0000644000175000001440000000426611442002462021522 0ustar00gabeusers00000000000000// Copyright (C) 2009-2010 Novell, Inc. // // 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. using System; using System.Collections.Generic; using Hyena; namespace PdfMod.Pdf.Actions { public interface IDescribedUndoAction : IUndoAction { string Description { get; } } public abstract class BaseAction : IDescribedUndoAction { protected Document Document { get; private set; } public string Description { get; set; } public BaseAction (Document document) : this (document, null) {} public BaseAction (Document document, string description) { Document = document; Description = description; } public void Do () { Redo (); } #region IUndoAction implementation public abstract void Undo (); public abstract void Redo (); public virtual void Merge (IUndoAction action) { throw new System.NotImplementedException(); } public virtual bool CanMerge (IUndoAction action) { return false; } #endregion } public class DelegateAction : BaseAction { public DelegateAction (Document document) : base (document) {} public System.Action UndoAction { get; set; } public System.Action RedoAction { get; set; } public override void Undo () { UndoAction (); } public override void Redo () { RedoAction (); } } } pdfmod-0.9.1/src/PdfMod/Pdf/Actions/MoveAction.cs0000644000175000001440000000257311352452723021566 0ustar00gabeusers00000000000000 using System; using System.Linq; using System.Collections.Generic; using Mono.Unix; using Hyena; using Hyena.Gui; using PdfMod; namespace PdfMod.Pdf.Actions { public class MoveAction : BasePageAction { int [] old_indices; int to_index; public MoveAction (Document document, IEnumerable pages, int to_index) : base (document, pages) { this.to_index = to_index; // Translators: {0} is the # of pages, {1} is a translated string summarizing the pages, eg "page 1" Description = String.Format (Catalog.GetPluralString ("Move {1}", "Move {1}", Pages.Count), Pages.Count, Document.GetPageSummary (Pages, 5)); } public override void Undo () { if (old_indices == null) { throw new InvalidOperationException (Catalog.GetString ("Error trying to unmove pages")); } Document.Move (to_index, Pages.ToArray (), old_indices); old_indices = null; } public override void Redo () { if (old_indices != null) { throw new InvalidOperationException (Catalog.GetString ("Error trying to move pages")); } old_indices = Pages.Select (Document.IndexOf).ToArray (); Document.Move (to_index, Pages.ToArray (), null); } } } pdfmod-0.9.1/src/PdfMod/Pdf/Actions/BasePageAction.cs0000644000175000001440000000217411442002462022313 0ustar00gabeusers00000000000000// Copyright (C) 2009-2010 Novell, Inc. // // 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. using System; using System.Collections.Generic; using Hyena; namespace PdfMod.Pdf.Actions { public abstract class BasePageAction : BaseAction { protected List Pages { get; private set; } public BasePageAction (Document document, IEnumerable to_remove) : base (document) { Pages = new List (to_remove); } } } pdfmod-0.9.1/src/PdfMod/Pdf/Actions/RemoveAction.cs0000644000175000001440000000221711533753325022113 0ustar00gabeusers00000000000000 using System; using System.Linq; using System.Collections.Generic; using Mono.Unix; using Hyena; using Hyena.Gui; using PdfMod; namespace PdfMod.Pdf.Actions { public class RemoveAction : BasePageAction { //int [] old_indices; Page [] pages; public RemoveAction (Document document, IEnumerable pages) : base (document, pages) { this.pages = pages.ToArray (); } public override void Undo () { Hyena.Log.Error ("Undo for the RemoveAction is not yet implemented"); // Currently fails in PdfSharp /*if (old_indices == null) { throw new InvalidOperationException (Catalog.GetString ("Error trying to unremove pages from document")); } for (int i = 0; i < old_indices.Length; i++) { Console.WriteLine ("Trying to add back page {0} at index {1}", Pages[i], old_indices[i]); Document.Add (old_indices[i], Pages[i]); } old_indices = null;*/ } public override void Redo () { Document.Remove (pages); } } } pdfmod-0.9.1/src/PdfMod/Pdf/Page.cs0000644000175000001440000000270311450442737016774 0ustar00gabeusers00000000000000// Copyright (C) 2009 Novell, Inc. // // 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. using System; using Mono.Unix; using PdfSharp.Pdf; namespace PdfMod.Pdf { public class Page { internal PdfPage Pdf { get; set; } public Document Document { get; internal set; } public int Index { get; internal set; } public bool SurfaceDirty { get; internal set; } public string Name { get { var label = Document.Labels[this]; string page_num = String.Format (Catalog.GetString ("Page {0}"), Index + 1); return label == null ? page_num : String.Format ("{0} ({1})", label, page_num); } } public Page (PdfPage pdf_page) { Pdf = pdf_page; } } } pdfmod-0.9.1/src/PdfMod/Pdf/PageThumbnail.cs0000644000175000001440000000247011251762716020642 0ustar00gabeusers00000000000000// Copyright (C) 2009 Novell, Inc. // // 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. using System; namespace PdfMod.Pdf { public class PageThumbnail : IDisposable { public Cairo.ImageSurface Surface { get; internal set; } internal Cairo.Context Context { get; set; } public void Dispose () { if (Surface != null && Surface.Handle != IntPtr.Zero) { ((IDisposable)Surface).Dispose (); } Surface = null; if (Context != null) { Hyena.Gui.CairoExtensions.DisposeContext (Context); Context = null; } } } } pdfmod-0.9.1/src/PdfMod/Pdf/PageLabels.cs0000644000175000001440000002421511435771263020123 0ustar00gabeusers00000000000000// Copyright (C) 2009 Michael McKinley // // 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. using System; using System.Linq; using System.Text; using System.Collections.Generic; using PdfSharp; using PdfSharp.Pdf; using PdfSharp.Pdf.Advanced; namespace PdfMod.Pdf { struct PageLabelFormat { public string number_style; public string prefix; public int first_number; } public class PageLabels { const string name_labels = "/PageLabels"; const string name_numtree = "/Nums"; // Keys (PdfNames) for formatting attributes const string name_fmt = "/S"; const string name_start_at = "/St"; const string name_prefix = "/P"; // Possible values for the numbering style const string alpha_upper = "/A"; const string alpha_lower = "/a"; const string roman_upper = "/R"; const string roman_lower = "/r"; const string arabic = "/D"; SortedDictionary page_labels; PdfDictionary.DictionaryElements pdf_elements; PdfDocument pdf_document; bool edited; public string this[Page page] { get { return this[page.Index]; } } public string this[int index] { get { if (index < 0 || index > pdf_document.PageCount) { throw new IndexOutOfRangeException (); } if (page_labels.Count == 0) { return null; } int range_base = GetFormat (index); try { PageLabelFormat cur_format = page_labels[range_base]; string label = cur_format.prefix; // Restart numbering for each range of pages int vindex = index + cur_format.first_number - range_base; if (cur_format.number_style == roman_upper || cur_format.number_style == alpha_upper) { label += RenderVal (vindex, cur_format.number_style).ToUpper (); } else { label += RenderVal (vindex, cur_format.number_style).ToLower (); } return label; } catch (KeyNotFoundException) { } return null; } } internal PageLabels (PdfDocument document) { page_labels = new SortedDictionary (); pdf_elements = document.Internals.Catalog.Elements; pdf_document = document; edited = false; // Ignore documents that don't have labelling stuff defined if (!pdf_elements.ContainsKey (name_labels)) { return; } // Ignore documents that don't have a properly-defined PageLabelFmt section PdfDictionary my_labels = pdf_elements.GetDictionary (name_labels); if (!my_labels.Elements.ContainsKey (name_numtree)) { return; } /* The number tree (not my term) is a PdfArray arranged as follows: [##, dict, ##, dict, ##, dict ...] * ## represents the starting index of the page (0-based) and the following dict is a PdfDictionary * containing formatting information regarding the range */ PdfArray number_tree = my_labels.Elements.GetArray (name_numtree); for (int i = 0; i < number_tree.Elements.Count / 2; ++i) { Console.WriteLine ("Range # {0}", i); PageLabelFormat temp_label = new PageLabelFormat (); int range_start = number_tree.Elements.GetInteger (i * 2); PdfDictionary label_data = number_tree.Elements.GetDictionary (i * 2 + 1); // Set the prefix, default to "" if (label_data.Elements.ContainsKey (name_prefix)) { temp_label.prefix = label_data.Elements.GetString (name_prefix); } else { temp_label.prefix = ""; } // Set the start number, default to 1 if (label_data.Elements.ContainsKey (name_start_at)) { temp_label.first_number = label_data.Elements.GetInteger (name_start_at); } else { temp_label.first_number = 1; } // Set the format type, default to no numbering (only show the prefix) if (label_data.Elements.ContainsKey (name_fmt)) { temp_label.number_style = label_data.Elements.GetString (name_fmt); } else { temp_label.number_style = ""; } page_labels.Add (range_start, temp_label); } } // Determine which formatting rules apply to page index. Returns the start of the formatting range int GetFormat (int index) { // TODO: find the correct range using a binary search int last = -1; foreach (int range_start in page_labels.Keys) { if (range_start > index) { break; } last = range_start; } return last; } // Render the value index in the proper format (case-agnostic) string RenderVal (int index, string fmt) { if (arabic == fmt) { return index.ToString (); } else if (roman_upper == fmt || roman_lower == fmt) { return ToRoman (index); } else if (alpha_lower == fmt || alpha_upper == fmt) { return ToAlpha (index); } else { return ""; } } // Convert val into Roman numerals string ToRoman (int val) { StringBuilder roman_val = new StringBuilder (); // TODO: see if there's a more elegant conversion if (val >= 1000) { roman_val.Append ('M', val / 1000); val -= (1000 * (val / 1000)); } if (val >= 900) { roman_val.Append ("CM"); val -= 900; } if (val >= 500) { roman_val.Append ('D', val / 500); val -= (500 * (val / 500)); } if (val >= 400) { roman_val.Append ("CD"); val -= 400; } if (val >= 100) { roman_val.Append ('C', val / 100); val -= (100 * (val / 100)); } if (val >= 90) { roman_val.Append ("XC"); val -= 90; } if (val >= 50) { roman_val.Append ('L', val / 50); val -= (50 * (val / 50)); } if (val >= 40) { roman_val.Append ("XL"); val -= 40; } if (val >= 10) { roman_val.Append ('X', val / 10); val -= (10 * (val / 10)); } if (val >= 9) { roman_val.Append ("IX"); val -= 9; } if (val >= 5) { roman_val.Append ('V', val / 5); val -= (5 * (val / 5)); } if (val >= 4) { roman_val.Append ("IV"); val -= 4; } roman_val.Append ('I', val); return roman_val.ToString (); } // Convert val into the alpha representation. 1 -> a, 2 -> b, ... 26 -> z, 27 -> aa, 28 -> bb, etc. string ToAlpha (int val) { char letter = (char)((val - 1) % 26 + 'a'); int rep_count = (val - 1)/26 + 1; StringBuilder s = new StringBuilder (rep_count); s.Append (letter, rep_count); return s.ToString (); } // Write labels to the PDF internal void WriteLabels () { if (!edited) { return; } // Grab the labels element, creating it if necessary PdfDictionary labels_dict; if (!pdf_elements.ContainsKey (name_labels)) { labels_dict = new PdfDictionary (pdf_document); pdf_elements.Add (name_labels, labels_dict); } else { labels_dict = pdf_elements.GetDictionary (name_labels); } labels_dict.Elements.Clear (); // Create the number tree PdfArray number_tree = new PdfArray (pdf_document); // Add the range-start, attrib-dict pairs foreach (int range_start in page_labels.Keys) { number_tree.Elements.Add (new PdfInteger (range_start)); PageLabelFormat label_format = page_labels[range_start]; PdfDictionary r_attribs = new PdfDictionary (pdf_document); if (label_format.number_style.Length > 0) { r_attribs.Elements.Add (name_fmt, new PdfName (label_format.number_style)); } if (label_format.first_number > 1) { r_attribs.Elements.Add (name_start_at, new PdfInteger (label_format.first_number)); } if (label_format.prefix.Length > 0) { r_attribs.Elements.Add (name_prefix, new PdfString (label_format.prefix)); } number_tree.Elements.Add (r_attribs); } labels_dict.Elements.Add (name_numtree, number_tree); } } } pdfmod-0.9.1/src/PdfMod/Core/0000777000175000001440000000000011533760020015740 5ustar00gabeusers00000000000000pdfmod-0.9.1/src/PdfMod/Core/Configuration.cs0000644000175000001440000000402511437262652021106 0ustar00gabeusers00000000000000// Copyright (C) 2009-2010 Novell, Inc. // // 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. using System; namespace PdfMod.Core { public class Configuration { GConf.Client client = new GConf.Client (); string ns = "/apps/pdfmod/"; public Configuration() { } T Get (string key, T fallback) { try { return (T) client.Get (ns + key); } catch { return fallback; } } void Set (string key, T val) { client.Set (ns + key, val); } public bool ShowToolbar { get { return Get ("show_toolbar", true); } set { Set ("show_toolbar", value); } } public bool ShowBookmarks { get { return Get ("show_bookmarks", false); } set { Set ("show_bookmarks", value); } } public string LastOpenFolder { get { return Get ("last_folder", System.Environment.GetFolderPath (System.Environment.SpecialFolder.Desktop)); } set { if (value != null && value.StartsWith ("file:/") && !value.StartsWith ("file://")) { value = "file://" + value.Substring (6); } Set ("last_folder", value); } } } } pdfmod-0.9.1/src/PdfMod/Core/Client.cs0000644000175000001440000001010011453150300017464 0ustar00gabeusers00000000000000// Copyright (C) 2009 Novell, Inc. // // 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. using System; using System.Collections.Generic; using System.IO; using Mono.Unix; using Hyena; using PdfMod.Pdf; namespace PdfMod.Core { public abstract class Client { static readonly string old_cache_dir = Path.Combine (System.Environment.GetFolderPath (System.Environment.SpecialFolder.ApplicationData), "pdfmod"); static readonly string CacheDir = Path.Combine (XdgBaseDirectorySpec.GetUserDirectory ("XDG_CACHE_HOME", ".cache"), "pdfmod"); public Document Document { get; protected set; } public static Configuration Configuration { get; private set; } public event EventHandler DocumentLoaded; static Client () { Configuration = new Configuration (); InitCache (); } public Client () { } protected void OnDocumentLoaded () { var handler = DocumentLoaded; if (handler != null) { handler (this, EventArgs.Empty); } } protected void LoadFiles () { // This variable should probably be marked volatile Hyena.Log.Debugging = true; LoadFiles (ApplicationContext.CommandLine.Files); } public abstract void LoadFiles (IList files); public void LoadPath (string path) { LoadPath (path, null); } public void LoadPath (string path, string suggestedFilename) { LoadPath (path, suggestedFilename, null); Log.DebugFormat ("Loaded {0}", path); } public abstract void LoadPath (string path, string suggestedFilename, System.Action finishedCallback); static void InitCache () { // Remove the old "cache" dir that really ended up being ~/.config/ if (Directory.Exists (old_cache_dir)) { try { foreach (string file in Directory.GetFiles (CacheDir)) { if (file.Contains ("tmpfile-")) { File.Delete (file); } } } catch {} } // Make sure the new one exists try { Directory.CreateDirectory (CacheDir); Log.DebugFormat ("Cache directory set to {0}", CacheDir); // Remove any tmp files that haven't been touched in three days var too_old = DateTime.Now; too_old.AddDays (-3); foreach (string file in Directory.GetFiles (CacheDir)) { if (file.Contains ("tmpfile-")) { if (File.GetLastAccessTime (file) < too_old) { File.Delete (file); } } } } catch (Exception e) { Log.Exception (String.Format ("Unable to create cache directory: {0}", CacheDir), e); } } public static string GetTmpFilename () { string filename = null; int i = 0; while (filename == null) { filename = Path.Combine (CacheDir, "tmpfile-" + i++); if (File.Exists (filename)) { filename = null; } } return filename; } } } pdfmod-0.9.1/src/PdfMod/Core/Defines.cs0000644000175000001440000000162411533760017017651 0ustar00gabeusers00000000000000// Copyright (C) 2009 Łukasz Jernaś // // 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. using System; namespace PdfMod.Core { public class Defines { public const string VERSION = "0.9.1"; public const string PREFIX = "/usr/local"; } } pdfmod-0.9.1/src/PdfMod/Core/AssemblyInfo.cs0000644000175000001440000000327511251762466020702 0ustar00gabeusers00000000000000// Copyright (C) 2009 Novell, Inc. // // 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. using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("PdfMod")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] pdfmod-0.9.1/src/PdfMod/Core/Defines.cs.in0000644000175000001440000000162611251764376020271 0ustar00gabeusers00000000000000// Copyright (C) 2009 Łukasz Jernaś // // 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. using System; namespace PdfMod.Core { public class Defines { public const string VERSION = "@VERSION@"; public const string PREFIX = "@prefix@"; } } pdfmod-0.9.1/src/PdfMod/Main.cs0000644000175000001440000000371411533726177016303 0ustar00gabeusers00000000000000// Copyright (C) 2009 Novell, Inc. // Copyright (C) 2009 Łukasz Jernaś // // 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. using System; using System.IO; using Mono.Unix; using Hyena; namespace PdfMod { public static class PdfMod { public static void Main (string[] args) { ApplicationContext.TrySetProcessName ("pdfmod"); Gdk.Global.ProgramClass = "pdfmod"; Log.Debugging = true; Log.DebugFormat ("Starting PdfMod {0}", Core.Defines.VERSION); InitCatalog ("/usr/local/share/locale/", Core.Defines.PREFIX + "/share/locale/"); // TODO could have a command line client here by checking CommandLine.Contains ("--headless") or something, // and implementing a subclass of Core.Client that does the rotate/remove/extract actions new Gui.Client (true); } static void InitCatalog (params string [] dirs) { foreach (var dir in dirs) { var test_file = Path.Combine (dir, "fr/LC_MESSAGES/pdfmod.mo"); if (File.Exists (test_file)) { Log.DebugFormat ("Initializing i18n catalog from {0}", dir); Catalog.Init ("pdfmod", dir); break; } } } } } pdfmod-0.9.1/src/PdfMod/Gui/0000777000175000001440000000000011533760020015574 5ustar00gabeusers00000000000000pdfmod-0.9.1/src/PdfMod/Gui/DocumentIconView.cs0000644000175000001440000005435411533734425021366 0ustar00gabeusers00000000000000// Copyright (C) 2009-2011 Novell, Inc. // Copyright (C) 2009 Julien Rebetez // Copyright (C) 2009 Igor Vatavuk // // 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. using System; using System.Collections.Generic; using System.Linq; using Gtk; using Gdk; using PdfSharp.Pdf; using PdfMod.Pdf; using PdfMod.Pdf.Actions; namespace PdfMod.Gui { public enum PageSelectionMode { None, Evens, Odds, Matching, Inverse, All } public class DocumentIconView : Gtk.IconView, IDisposable { public const int MIN_WIDTH = 128; public const int MAX_WIDTH = 2054; enum Target { UriSrc, UriDest, MoveInternal, MoveExternal } static readonly TargetEntry uri_src_target = new TargetEntry ("text/uri-list", 0, (uint)Target.UriSrc); static readonly TargetEntry uri_dest_target = new TargetEntry ("text/uri-list", TargetFlags.OtherApp, (uint)Target.UriDest); static readonly TargetEntry move_internal_target = new TargetEntry ("pdfmod/page-list", TargetFlags.Widget, (uint)Target.MoveInternal); static readonly TargetEntry move_external_target = new TargetEntry ("pdfmod/page-list-external", 0, (uint)Target.MoveExternal); Client app; Document document; PageListStore store; PageCell page_renderer; PageSelectionMode page_selection_mode = PageSelectionMode.None; bool highlighted; public PageListStore Store { get { return store; } } public bool CanZoomIn { get; private set; } public bool CanZoomOut { get; private set; } public IEnumerable SelectedPages { get { var pages = new List (); foreach (var path in SelectedItems) { TreeIter iter; store.GetIter (out iter, path); pages.Add (store.GetValue (iter, PageListStore.PageColumn) as Page); } pages.Sort ((a, b) => { return a.Index < b.Index ? -1 : 1; }); return pages; } } public event System.Action ZoomChanged; public DocumentIconView (Client app) : base () { this.app = app; TooltipColumn = PageListStore.TooltipColumn; SelectionMode = SelectionMode.Multiple; ColumnSpacing = RowSpacing = Margin; Model = store = new PageListStore (); Reorderable = false; Spacing = 0; Orientation = Orientation.Vertical; // Properties not bound in Gtk# SetProperty ("item-padding", new GLib.Value ((int)0)); CanZoomIn = CanZoomOut = true; page_renderer = new PageCell (this); PackStart (page_renderer, false); AddAttribute (page_renderer, "page", PageListStore.PageColumn); // TODO enable uri-list as drag source target for drag-out-of-pdfmod-to-extract feature EnableModelDragSource (Gdk.ModifierType.None, new TargetEntry [] { move_internal_target, move_external_target, uri_src_target }, Gdk.DragAction.Default | Gdk.DragAction.Move); EnableModelDragDest (new TargetEntry [] { move_internal_target, move_external_target, uri_dest_target }, Gdk.DragAction.Default | Gdk.DragAction.Move); SizeAllocated += HandleSizeAllocated; PopupMenu += HandlePopupMenu; ButtonPressEvent += HandleButtonPressEvent; SelectionChanged += HandleSelectionChanged; DragDataReceived += HandleDragDataReceived; DragDataGet += HandleDragDataGet; DragBegin += HandleDragBegin; DragLeave += HandleDragLeave; } public override void Dispose () { page_renderer.Dispose (); base.Dispose (); } #region Gtk.Widget event handlers/overrides protected override bool OnScrollEvent (Gdk.EventScroll evnt) { if ((evnt.State & Gdk.ModifierType.ControlMask) != 0) { Zoom (evnt.Direction == ScrollDirection.Down ? -20 : 20); return true; } else { return base.OnScrollEvent (evnt); } } void HandleSizeAllocated (object o, EventArgs args) { if (!zoom_manually_set) { ZoomFit (); } } void HandleSelectionChanged (object o, EventArgs args) { if (!refreshing_selection) { page_selection_mode = PageSelectionMode.None; } } void HandleButtonPressEvent (object o, ButtonPressEventArgs args) { if (args.Event.Button == 3) { var path = GetPathAtPos ((int)args.Event.X, (int)args.Event.Y); if (path != null) { if (!PathIsSelected (path)) { bool ctrl = (args.Event.State & Gdk.ModifierType.ControlMask) != 0; bool shift = (args.Event.State & Gdk.ModifierType.ShiftMask) != 0; if (ctrl) { SelectPath (path); } else if (shift) { TreePath cursor; CellRenderer cell; if (GetCursor (out cursor, out cell)) { TreePath first = cursor.Compare (path) < 0 ? cursor : path; do { SelectPath (first); first.Next (); } while (first != path && first != cursor && first != null); } else { SelectPath (path); } } else { UnselectAll (); SelectPath (path); } } HandlePopupMenu (null, null); args.RetVal = true; } } } void HandlePopupMenu (object o, PopupMenuArgs args) { app.Actions["PageContextMenu"].Activate (); } #endregion #region Drag and Drop event handling void HandleDragBegin (object o, DragBeginArgs args) { // Set the drag icon, otherwise it will be a whole page cell rendering, // which can be quite large and obscure the drop points bool single = SelectedItems.Length == 1; Gtk.Drag.SetIconStock (args.Context, single ? Stock.Dnd : Stock.DndMultiple, 0, 0); } void HandleDragLeave (object o, DragLeaveArgs args) { if (highlighted) { Gtk.Drag.Unhighlight (this); highlighted = false; } args.RetVal = true; } protected override bool OnDragMotion (Gdk.DragContext context, int x, int y, uint time_) { // Scroll if within 20 pixels of the top or bottom var parent = Parent.Parent as Gtk.ScrolledWindow; double rel_y = y - parent.Vadjustment.Value; if (rel_y < 20) { parent.Vadjustment.Value -= 30; } else if ((parent.Allocation.Height - rel_y) < 20) { parent.Vadjustment.Value = Math.Min (parent.Vadjustment.Upper - parent.Allocation.Height, parent.Vadjustment.Value + 30); } var targets = context.Targets.Select (t => (string)t); if (targets.Contains (move_internal_target.Target) || targets.Contains (move_external_target.Target)) { bool ret = base.OnDragMotion (context, x, y, time_); SetDestInfo (x, y); return ret; } else if (targets.Contains (uri_dest_target.Target)) { // TODO could do this (from Gtk+ docs) to make sure the uris are all .pdfs (or mime-sniffed as pdfs): /* If the decision whether the drop will be accepted or rejected can't be made based solely on the cursor position and the type of the data, the handler may inspect the dragged data by calling gtk_drag_get_data() and defer the gdk_drag_status() call to the "drag-data-received" handler. Note that you cannot not pass GTK_DEST_DEFAULT_DROP, GTK_DEST_DEFAULT_MOTION or GTK_DEST_DEFAULT_ALL to gtk_drag_dest_set() when using the drag-motion signal that way. */ Gdk.Drag.Status (context, DragAction.Copy, time_); if (!highlighted) { Gtk.Drag.Highlight (this); highlighted = true; } SetDestInfo (x, y); return true; } Gdk.Drag.Abort (context, time_); return false; } void SetDestInfo (int x, int y) { TreePath path; IconViewDropPosition pos; GetCorrectedPathAndPosition (x, y, out path, out pos); SetDragDestItem (path, pos); } void HandleDragDataGet(object o, DragDataGetArgs args) { if (args.Info == move_internal_target.Info) { var pages = new Hyena.Gui.DragDropList (); pages.AddRange (SelectedPages); pages.AssignToSelection (args.SelectionData, Gdk.Atom.Intern (move_internal_target.Target, false)); args.RetVal = true; } else if (args.Info == move_external_target.Info) { string doc_and_pages = String.Format ("{0}{1}{2}", document.CurrentStateUri, newline[0], String.Join (",", SelectedPages.Select (p => p.Index.ToString ()).ToArray ())); byte [] data = System.Text.Encoding.UTF8.GetBytes (doc_and_pages); args.SelectionData.Set (Gdk.Atom.Intern (move_external_target.Target, false), 8, data); args.RetVal = true; } else if (args.Info == uri_src_target.Info) { // TODO implement page extraction via DnD? Console.WriteLine ("HandleDragDataGet, wants a uri list..."); } } void GetCorrectedPathAndPosition (int x, int y, out TreePath path, out IconViewDropPosition pos) { GetDestItemAtPos (x, y, out path, out pos); // Convert drop above/below/into into DropLeft or DropRight based on the x coordinate if (path != null && (pos == IconViewDropPosition.DropAbove || pos == IconViewDropPosition.DropBelow || pos == IconViewDropPosition.DropInto)) { if (!path.Equals (GetPathAtPos (x + ItemSize/2, y))) { pos = IconViewDropPosition.DropRight; } else { pos = IconViewDropPosition.DropLeft; } } } int GetDropIndex (int x, int y) { TreePath path; TreeIter iter; IconViewDropPosition pos; GetCorrectedPathAndPosition (x, y, out path, out pos); if (path == null) { return -1; } store.GetIter (out iter, path); if (TreeIter.Zero.Equals (iter)) return -1; var to_index = (store.GetValue (iter, PageListStore.PageColumn) as Page).Index; if (pos == IconViewDropPosition.DropRight) { to_index++; } return to_index; } static string [] newline = new string [] { "\r\n" }; void HandleDragDataReceived (object o, DragDataReceivedArgs args) { args.RetVal = false; string target = (string)args.SelectionData.Target; if (target == move_internal_target.Target) { // Move pages within the document int to_index = GetDropIndex (args.X, args.Y); if (to_index < 0) return; var pages = args.SelectionData.Data as Hyena.Gui.DragDropList; to_index -= pages.Count (p => p.Index < to_index); var action = new MoveAction (document, pages, to_index); action.Do (); app.Actions.UndoManager.AddUndoAction (action); args.RetVal = true; } else if (target == move_external_target.Target) { int to_index = GetDropIndex (args.X, args.Y); if (to_index < 0) return; string doc_and_pages = System.Text.Encoding.UTF8.GetString (args.SelectionData.Data); var pieces = doc_and_pages.Split (newline, StringSplitOptions.RemoveEmptyEntries); string uri = pieces[0]; int [] pages = pieces[1].Split (',').Select (p => Int32.Parse (p)).ToArray (); document.AddFromUri (new Uri (uri), to_index, pages); args.RetVal = true; } else if (target == uri_src_target.Target) { var uris = System.Text.Encoding.UTF8.GetString (args.SelectionData.Data).Split (newline, StringSplitOptions.RemoveEmptyEntries); if (uris.Length == 1 && app.Document == null) { app.LoadPath (uris[0]); args.RetVal = true; } else { int to_index = GetDropIndex (args.X, args.Y); int uri_i = 0; var add_pages = new System.Action (delegate { // TODO somehow ask user for which pages of the docs to insert? // TODO pwd handling - keyring#? // TODO make action/undoable for (; uri_i < uris.Length; uri_i++) { var before_count = document.Count; document.AddFromUri (new Uri (uris[uri_i]), to_index); to_index += document.Count - before_count; } }); if (document == null || to_index < 0) { // Load the first page, then add the other pages to it app.LoadPath (uris[uri_i++], null, delegate { if (document != null) { to_index = document.Count; add_pages (); } }); } else { add_pages (); } args.RetVal = true; } } Gtk.Drag.Finish (args.Context, (bool)args.RetVal, false, args.Time); } #endregion #region Document event handling public void SetDocument (Document new_doc) { if (document != null) { document.PagesAdded -= OnPagesAdded; document.PagesChanged -= OnPagesChanged; document.PagesRemoved -= OnPagesRemoved; document.PagesMoved -= OnPagesMoved; } document = new_doc; document.PagesAdded += OnPagesAdded; document.PagesChanged += OnPagesChanged; document.PagesRemoved += OnPagesRemoved; document.PagesMoved += OnPagesMoved; store.SetDocument (document); page_selection_mode = PageSelectionMode.None; Refresh (); GrabFocus (); } void OnPagesAdded (int index, Page [] pages) { foreach (var page in pages) { store.InsertWithValues (index, store.GetValuesForPage (page)); } UpdateAllPages (); Refresh (); } void OnPagesChanged (Page [] pages) { Refresh (); } void OnPagesRemoved (Page [] pages) { foreach (var page in pages) { var iter = store.GetIterForPage (page); if (!TreeIter.Zero.Equals (iter)) { store.Remove (ref iter); } } UpdateAllPages (); Refresh (); } void OnPagesMoved () { UpdateAllPages (); Refresh (); } void Refresh () { if (!zoom_manually_set) { ZoomFit (); } RefreshSelection (); } void UpdateAllPages () { foreach (var page in document.Pages) { var iter = store.GetIterForPage (page); if (!TreeIter.Zero.Equals (iter)) { store.UpdateForPage (iter, page); store.EmitRowChanged (store.GetPath (iter), iter); } } } #endregion bool zoom_manually_set; public void Zoom (int pixels) { Zoom (pixels, false); } public void Zoom (int pixels, bool absolute) { CanZoomIn = CanZoomOut = true; if (!zoom_manually_set) { zoom_manually_set = true; (app.Actions["ZoomFit"] as ToggleAction).Active = false; } int new_width = absolute ? pixels : ItemSize + pixels; if (new_width <= MIN_WIDTH) { CanZoomOut = false; new_width = MIN_WIDTH; } else if (new_width >= MAX_WIDTH) { CanZoomIn = false; new_width = MAX_WIDTH; } if (ItemSize == new_width) { return; } SetItemSize (new_width); var handler = ZoomChanged; if (handler != null) { handler (); } } int last_zoom, before_last_zoom; public void ZoomFit () { if (document == null) return; if ((app.Actions["ZoomFit"] as ToggleAction).Active == false) return; zoom_manually_set = false; // Try to fit all pages into the view, with a minimum size var n = (double)document.Count; var width = (double)(Parent.Allocation.Width - 2 * (Margin + BorderWidth + 8)); // HACK this + 8 is total hack var height = (double)(Parent.Allocation.Height - 2 * (Margin + BorderWidth + 8)); // same var n_across = (int)Math.Ceiling (Math.Sqrt (width * n / height)); var best_width = (int)Math.Floor ((width - (n_across + 1)*ColumnSpacing - n_across*2*FocusLineWidth) / n_across); // restrict to min/max best_width = Math.Min (MAX_WIDTH, Math.Max (MIN_WIDTH, best_width)); if (best_width == ItemSize) { return; } // Total hack to avoid infinite SizeAllocate/ZoomFit loop if (best_width == before_last_zoom || best_width == last_zoom) { return; } before_last_zoom = last_zoom; last_zoom = ItemSize; SetItemSize (best_width); CanZoomOut = ItemSize > MIN_WIDTH; CanZoomIn = ItemSize < MAX_WIDTH; var handler = ZoomChanged; if (handler != null) { handler (); } } public int ItemSize { get { return page_renderer.ItemSize; } set { page_renderer.ItemSize = value; } } private void SetItemSize (int w) { ItemSize = w; // HACK trigger gtk_icon_view_invalidate_sizes and queue_layout Orientation = Orientation.Horizontal; Orientation = Orientation.Vertical; } #region Selection string selection_match_query; public void SetSelectionMatchQuery (string query) { selection_match_query = query; SetPageSelectionMode (PageSelectionMode.Matching); } public void SetPageSelectionMode (PageSelectionMode mode) { page_selection_mode = mode; RefreshSelection (); } bool refreshing_selection; void RefreshSelection () { refreshing_selection = true; if (page_selection_mode == PageSelectionMode.All) { SelectAll (); } else if (page_selection_mode != PageSelectionMode.None) { List matches = null; if (page_selection_mode == PageSelectionMode.Matching) { matches = new List (app.Document.FindPagesMatching (selection_match_query)); } int i = 1; foreach (var iter in store.TreeIters) { var path = store.GetPath (iter); bool select = false; switch (page_selection_mode) { case PageSelectionMode.Evens: select = (i % 2) == 0; break; case PageSelectionMode.Odds: select = (i % 2) == 1; break; case PageSelectionMode.Matching: select = matches.Contains (store.GetValue (iter, PageListStore.PageColumn) as Page); break; case PageSelectionMode.Inverse: select = !PathIsSelected (path); break; } if (select) { SelectPath (path); } else { UnselectPath (path); } i++; } } refreshing_selection = false; QueueDraw (); } #endregion } } pdfmod-0.9.1/src/PdfMod/Gui/Actions.cs0000644000175000001440000006525011533735260017537 0ustar00gabeusers00000000000000// Copyright (C) 2009-2010 Novell, Inc. // Copyright (C) 2009 Julien Rebetez // Copyright (C) 2009 Łukasz Jernaś // Copyright (C) 2009 Andreu Correa Casablanca // // 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. using System; using System.IO; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Linq; using Mono.Unix; using Gtk; using Hyena; using Hyena.Gui; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; using PdfMod.Pdf; using PdfMod.Pdf.Actions; namespace PdfMod.Gui { public class Actions : HyenaActionGroup { Client app; UndoManager undo_manager; const string WIKI_URL = "http://live.gnome.org/PdfMod"; const string DOCS_URL = "http://library.gnome.org/users/pdfmod/"; static string [] require_doc_actions = new string[] { "Save", "SaveAs", "Properties", "Undo", "Redo", "ZoomFit", "OpenInViewer", "SelectAll", "SelectEvens", "SelectOdds", "SelectMatching", "SelectInverse", "InsertFrom", "ViewBookmarks", "AddBookmark", "EditBookmarks" }; static string [] require_page_actions = new string[] { "Remove", "Extract", "RotateRight", "RotateLeft", "ExportImages" }; public UndoManager UndoManager { get { return undo_manager; } } public Actions (Client app, ActionManager action_manager) : base (action_manager, "Global") { this.app = app; undo_manager = new UndoManager (); AddImportant ( new ActionEntry ("FileMenu", null, Catalog.GetString ("_File"), null, null, null), new ActionEntry ("Open", Gtk.Stock.Open, null, "O", Catalog.GetString ("Open a document"), OnOpen), new ActionEntry ("Save", Gtk.Stock.Save, null, "S", Catalog.GetString ("Save changes to this document, overwriting the existing file"), OnSave), new ActionEntry ("SaveAs", Gtk.Stock.SaveAs, null, "S", Catalog.GetString ("Save this document to a new file"), OnSaveAs), new ActionEntry ("RecentMenu", null, Catalog.GetString ("Recent _Files"), null, null, null), new ActionEntry ("InsertFrom", Gtk.Stock.Add, Catalog.GetString("_Insert From..."), null, Catalog.GetString("Insert pages from another document"), OnInsertFrom), new ActionEntry ("Close", Gtk.Stock.Close, null, "W", null, OnClose), new ActionEntry ("EditMenu", null, Catalog.GetString ("_Edit"), null, null, null), new ActionEntry ("Undo", Stock.Undo, null, "z", null, OnUndo), new ActionEntry ("Redo", Stock.Redo, null, "y", null, OnRedo), new ActionEntry ("Extract", Gtk.Stock.New, null, null, null, OnExtractPages), new ActionEntry ("Remove", Gtk.Stock.Remove, null, "Delete", null, OnRemove), new ActionEntry ("RotateLeft", null, Catalog.GetString ("Rotate Left"), "bracketleft", Catalog.GetString ("Rotate left"), OnRotateLeft), new ActionEntry ("RotateRight", null, Catalog.GetString ("Rotate Right"), "bracketright", Catalog.GetString ("Rotate right"), OnRotateRight), new ActionEntry ("ExportImages", null, null, null, null, OnExportImages), new ActionEntry ("SelectAll", Stock.SelectAll, null, "A", null, OnSelectAll), new ActionEntry ("SelectOdds", null, Catalog.GetString ("Select Odd Pages"), null, null, OnSelectOdds), new ActionEntry ("SelectEvens", null, Catalog.GetString ("Select Even Pages"), null, null, OnSelectEvens), new ActionEntry ("SelectMatching", null, Catalog.GetString ("Select Matching..."), "F", null, OnSelectMatching), new ActionEntry ("SelectInverse", null, Catalog.GetString ("_Invert Selection"), "I", null, OnSelectInverse), new ActionEntry ("ViewMenu", null, Catalog.GetString ("_View"), null, null, null), new ActionEntry ("ZoomIn", Stock.ZoomIn, null, "plus", null, OnZoomIn), new ActionEntry ("ZoomOut", Stock.ZoomOut, null, "minus", null, OnZoomOut), new ActionEntry ("OpenInViewer", null, Catalog.GetString ("Open in Viewer"), "F5", Catalog.GetString ("Open in viewer"), OnOpenInViewer), new ActionEntry ("BookmarksMenu", null, Catalog.GetString ("_Bookmarks"), null, null, null), new ActionEntry ("AddBookmark", null, Catalog.GetString ("_Add Bookmark"), "d", null, null), new ActionEntry ("RenameBookmark", null, Catalog.GetString ("Re_name Bookmark"), "F2", null, null), new ActionEntry ("ChangeBookmarkDest", null, Catalog.GetString ("_Change Bookmark Destination"), null, null, null), new ActionEntry ("RemoveBookmarks", Stock.Remove, Catalog.GetString ("_Remove Bookmark"), null, null, null), new ActionEntry ("EditBookmarks", null, Catalog.GetString ("_Edit Bookmarks"), "B", null, OnEditBookmarks), new ActionEntry ("HelpMenu", null, Catalog.GetString ("_Help"), null, null, null), new ActionEntry ("Help", Stock.Help, Catalog.GetString ("_Contents"), "F1", null, OnHelp), new ActionEntry ("About", Stock.About, null, null, null, OnAbout), new ActionEntry ("PageContextMenu", null, "", null, null, OnPageContextMenu), new ActionEntry ("BookmarkContextMenu", null, "", null, null, OnBookmarkContextMenu) ); this["AddBookmark"].ShortLabel = Catalog.GetString ("_Add"); this["RemoveBookmarks"].ShortLabel = Catalog.GetString ("_Remove"); AddImportant ( new ToggleActionEntry ("Properties", Stock.Properties, null, "Return", Catalog.GetString ("View and edit the title, keywords, and more for this document"), OnProperties, false), new ToggleActionEntry ("ZoomFit", Stock.ZoomFit, null, "0", null, OnZoomFit, true), new ToggleActionEntry ("ViewToolbar", null, Catalog.GetString ("Toolbar"), null, null, OnViewToolbar, Client.Configuration.ShowToolbar), new ToggleActionEntry ("ViewBookmarks", null, Catalog.GetString ("Bookmarks"), "F9", null, OnViewBookmarks, Client.Configuration.ShowBookmarks), new ToggleActionEntry ("FullScreenView", null, Catalog.GetString ("Fullscreen"), "F11", null, OnFullScreenView, false) ); this["RotateRight"].IconName = "object-rotate-right"; this["RotateLeft"].IconName = "object-rotate-left"; this["ExportImages"].IconName = "image-x-generic"; this["ViewBookmarks"].IconName = "user-bookmarks"; this["AddBookmark"].IconName = "bookmark-new"; UpdateAction ("Help", true); Update (); app.IconView.SelectionChanged += OnChanged; app.IconView.ZoomChanged += delegate { Update (); }; app.DocumentLoaded += (o, a) => { app.Document.Changed += () => Update (); Update (); }; undo_manager.UndoChanged += OnChanged; AddUiFromFile ("UIManager.xml"); Register (); // Add additional menu item keybindings AddAccel ("/MainMenu/ViewMenu/ZoomIn", Gdk.ModifierType.ControlMask, Gdk.Key.KP_Add, Gdk.Key.equal); AddAccel ("/MainMenu/ViewMenu/ZoomOut", Gdk.ModifierType.ControlMask, Gdk.Key.KP_Subtract, Gdk.Key.underscore); AddAccel ("/MainMenu/FileMenu/Close", Gdk.ModifierType.ControlMask, Gdk.Key.q); AddAccel ("/MainMenu/EditMenu/Redo", Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask, Gdk.Key.z); // Set up recent documents menu MenuItem recent_item = ActionManager.UIManager.GetWidget ("/MainMenu/FileMenu/RecentMenu") as MenuItem; var recent_chooser_item = new RecentChooserMenu (RecentManager.Default) { Filter = new RecentFilter (), SortType = RecentSortType.Mru }; recent_chooser_item.Filter.AddPattern ("*.pdf"); recent_chooser_item.ItemActivated += delegate { Client.RunIdle (delegate { app.LoadPath (recent_chooser_item.CurrentUri); }); }; recent_item.Submenu = recent_chooser_item; } private void AddAccel (string path, Gdk.ModifierType modifier, params Gdk.Key [] keys) { var item = ActionManager.UIManager.GetWidget (path); foreach (var key in keys) { item.AddAccelerator ("activate", ActionManager.UIManager.AccelGroup, (uint)key, modifier, Gtk.AccelFlags.Visible); } } void OnChanged (object o, EventArgs args) { Update (); } void Update () { bool have_doc = app.Document != null; foreach (string action in require_doc_actions) UpdateAction (action, true, have_doc); bool have_page = have_doc && app.IconView.SelectedItems.Length > 0; foreach (string action in require_page_actions) UpdateAction (action, true, have_page); int exportable_imgs = 0; if (have_page) { exportable_imgs = new ExportImagesAction (app.Document, app.IconView.SelectedPages).ExportableImageCount; } UpdateAction ("ExportImages", true, exportable_imgs > 0); this["ExportImages"].Label = String.Format (Catalog.GetPluralString ( "Export Image", "Export {0} Images", exportable_imgs), exportable_imgs); this["ExportImages"].Tooltip = String.Format (Catalog.GetPluralString ( "Save image from the selected pages to a new folder", "Save {0} images from the selected pages to a new folder", exportable_imgs), exportable_imgs); UpdateAction ("Undo", true, have_doc && undo_manager.CanUndo); UpdateAction ("Redo", true, have_doc && undo_manager.CanRedo); var undo = undo_manager.UndoAction as IDescribedUndoAction; this["Undo"].Label = undo == null ? Catalog.GetString ("_Undo") : String.Format (Catalog.GetString ("Undo {0}"), undo.Description); var redo = undo_manager.RedoAction as IDescribedUndoAction; this["Redo"].Label = redo == null ? Catalog.GetString ("_Redo") : String.Format (Catalog.GetString ("Redo {0}"), redo.Description); UpdateAction ("Save", true, have_doc && app.Document.HasUnsavedChanges); UpdateAction ("ZoomIn", true, have_doc && app.IconView.CanZoomIn); UpdateAction ("ZoomOut", true, have_doc && app.IconView.CanZoomOut); int selection_count = app.IconView.SelectedItems.Length; this["Remove"].Label = String.Format (Catalog.GetPluralString ( "Remove Page", "Remove {0} Pages", selection_count), selection_count); this["Remove"].Tooltip = String.Format (Catalog.GetPluralString ( "Remove the selected page", "Remove the {0} selected pages", selection_count), selection_count); this["Extract"].Label = String.Format (Catalog.GetPluralString ( "Extract Page", "Extract {0} Pages", selection_count), selection_count); this["Extract"].Tooltip = String.Format (Catalog.GetPluralString ( "Extract the selected page", "Extract the {0} selected pages", selection_count), selection_count); } #region Action Handlers // File menu actions void OnOpen (object o, EventArgs args) { var chooser = app.CreateChooser (Catalog.GetString ("Select PDF"), FileChooserAction.Open); chooser.SelectMultiple = true; chooser.AddButton (Stock.Open, ResponseType.Ok); if (app.Document != null) { chooser.SetCurrentFolder (System.IO.Path.GetDirectoryName (app.Document.SuggestedSavePath)); } else { chooser.SetCurrentFolder (Client.Configuration.LastOpenFolder); } var response = chooser.Run (); var filenames = chooser.Filenames; chooser.Destroy (); if (response == (int)ResponseType.Ok) { Client.RunIdle (delegate { foreach (var file in filenames) { app.LoadPath (file); } }); } } void OnSave (object o, EventArgs args) { try { app.Document.Save (app.Document.SuggestedSavePath); undo_manager.Clear (); } catch (Exception e) { Log.Error (Catalog.GetString ("Unable to Save Document"), e.Message, true); } } void OnSaveAs (object o, EventArgs args) { var chooser = app.CreateChooser (Catalog.GetString ("Save as..."), FileChooserAction.Save); chooser.SelectMultiple = false; chooser.DoOverwriteConfirmation = true; chooser.CurrentName = System.IO.Path.GetFileName (app.Document.SuggestedSavePath); chooser.AddButton (Stock.SaveAs, ResponseType.Ok); chooser.SetCurrentFolder (System.IO.Path.GetDirectoryName (app.Document.SuggestedSavePath)); var response = chooser.Run (); string filename = chooser.Filename; chooser.Destroy (); if (response == (int)ResponseType.Ok) { Log.DebugFormat ("Saving {0} to {1}", app.Document.Uri, filename); app.Document.Save (filename); undo_manager.Clear (); } } void OnExportImages (object o, EventArgs args) { var pages = app.IconView.SelectedPages.ToList (); var action = new ExportImagesAction (app.Document, pages); if (action.ExportableImageCount == 0) { Log.Information ("Found zero exportable images in the selected pages"); return; } var export_path_base = Path.Combine ( Path.GetDirectoryName (app.Document.SuggestedSavePath), Hyena.StringUtil.EscapeFilename (String.Format ("{0} [{1}]", Path.GetFileNameWithoutExtension (app.Document.SuggestedSavePath), GLib.Markup.EscapeText (Document.GetPageSummary (pages, 10)))) ); var export_path = export_path_base; int i = 1; while (Directory.Exists (export_path) && i < 100) { export_path = String.Format ("{0} ({1})", export_path_base, i++); } try { Directory.CreateDirectory (export_path); } catch (Exception e) { Hyena.Log.Exception (e); } action.Do (export_path); System.Diagnostics.Process.Start (export_path); } void OnInsertFrom (object o, EventArgs args) { var chooser = app.CreateChooser (Catalog.GetString ("Select PDF"), FileChooserAction.Open); chooser.SelectMultiple = false; chooser.SetCurrentFolder (System.IO.Path.GetDirectoryName (app.Document.SuggestedSavePath)); chooser.AddButton (Stock.Open, ResponseType.Ok); // TODO will uncomment this later; don't want to break string freeze now //chooser.AddButton (Catalog.GetString ("_Insert"), ResponseType.Ok); var response = chooser.Run (); string filename = chooser.Filename; chooser.Destroy(); if (response == (int)ResponseType.Ok) { try { app.Document.AddFromUri (new Uri (filename)); } catch (Exception e) { Hyena.Log.Exception (e); Hyena.Log.Error ( Catalog.GetString ("Error Loading Document"), String.Format (Catalog.GetString ("There was an error loading {0}"), GLib.Markup.EscapeText (filename ?? "")), true ); } } } void OnProperties (object o, EventArgs args) { app.EditorBox.Visible = (this["Properties"] as ToggleAction).Active; if (app.EditorBox.Visible) { app.EditorBox.GrabFocus (); } } void OnClose (object o, EventArgs args) { app.Quit (); } // Edit menu actions void OnUndo (object o, EventArgs args) { undo_manager.Undo (); } void OnRedo (object o, EventArgs args) { undo_manager.Redo (); } void OnExtractPages (object o, EventArgs args) { var to_doc = new PdfDocument (); var from_doc = PdfSharp.Pdf.IO.PdfReader.Open (new Uri (app.Document.CurrentStateUri).LocalPath, PdfDocumentOpenMode.Import, null); var pages = app.IconView.SelectedPages.ToList (); foreach (var index in pages.Select (p => p.Index)) { to_doc.AddPage (from_doc.Pages[index]); } var path = Client.GetTmpFilename (); to_doc.Save (path); to_doc.Dispose (); app.LoadPath (path, Path.Combine ( Path.GetDirectoryName (app.Document.SuggestedSavePath), Hyena.StringUtil.EscapeFilename (String.Format ("{0} [{1}].pdf", Path.GetFileNameWithoutExtension (app.Document.SuggestedSavePath), GLib.Markup.EscapeText (Document.GetPageSummary (pages, 10)))) )); } void OnRemove (object o, EventArgs args) { var action = new RemoveAction (app.Document, app.IconView.SelectedPages); action.Do (); // Undo isn't working yet //undo_manager.AddUndoAction (action); } void OnRotateLeft (object o, EventArgs args) { Rotate (-90); } void OnRotateRight (object o, EventArgs args) { Rotate (90); } void OnSelectAll (object o, EventArgs args) { app.IconView.SetPageSelectionMode (PageSelectionMode.All); } void OnSelectOdds (object o, EventArgs args) { app.IconView.SetPageSelectionMode (PageSelectionMode.Odds); } void OnSelectEvens (object o, EventArgs args) { app.IconView.SetPageSelectionMode (PageSelectionMode.Evens); } void OnSelectMatching (object o, EventArgs args) { app.ToggleMatchQuery (); } void OnSelectInverse (object o, EventArgs args) { app.IconView.SetPageSelectionMode (PageSelectionMode.Inverse); } // View menu actions void OnZoomIn (object o, EventArgs args) { app.IconView.Zoom (10); } void OnZoomOut (object o, EventArgs args) { app.IconView.Zoom (-10); } void OnZoomFit (object o, EventArgs args) { app.IconView.ZoomFit (); } void OnOpenInViewer (object o, EventArgs args) { System.Diagnostics.Process.Start (app.Document.CurrentStateUri); } void OnFullScreenView (object o, EventArgs args) { bool fullscreen = (this["FullScreenView"] as ToggleAction).Active; if (fullscreen) { app.Window.Fullscreen (); } else { app.Window.Unfullscreen (); } } void OnViewToolbar (object o, EventArgs args) { bool show = (this["ViewToolbar"] as ToggleAction).Active; Client.Configuration.ShowToolbar = app.HeaderToolbar.Visible = show; } void OnViewBookmarks (object o, EventArgs args) { bool show = (this["ViewBookmarks"] as ToggleAction).Active; Client.Configuration.ShowBookmarks = app.BookmarkView.Visible = show; if (app.BookmarkView.Visible) { app.BookmarkView.GrabFocus (); } } // Help menu actions void OnHelp (object o, EventArgs args) { bool shown = false; try { IntPtr lang_ptr = g_get_language_names (); var langs = GLib.Marshaller.NullTermPtrToStringArray (lang_ptr, false); string help_dir = null; foreach (var dir in new string [] { Core.Defines.PREFIX + "/share/gnome/help/", "/usr/local/share/gnome/help/", "docs/" }) { help_dir = dir; if (System.IO.Directory.Exists (dir + "pdfmod/")) { break; } } foreach (var lang in langs) { var help_path = CombinePaths (help_dir, "pdfmod", lang, "pdfmod.xml"); if (System.IO.File.Exists (help_path)) { System.Diagnostics.Process.Start (String.Format ("ghelp://{0}", help_path)); shown = true; break; } } } catch (Exception e) { Hyena.Log.Exception ("Error opening help", e); } if (!shown) { var message_dialog = new Hyena.Widgets.HigMessageDialog ( app.Window, DialogFlags.Modal, MessageType.Warning, ButtonsType.None, Catalog.GetString ("Error opening help"), Catalog.GetString ("Would you like to open PDF Mod's online documentation?") ); message_dialog.AddButton (Stock.No, ResponseType.No, false); message_dialog.AddButton (Stock.Yes, ResponseType.Yes, true); var response = (ResponseType) message_dialog.Run (); message_dialog.Destroy (); if (response == ResponseType.Yes) { System.Diagnostics.Process.Start (DOCS_URL); } } } void OnAbout (object o, EventArgs args) { Gtk.AboutDialog.SetUrlHook ((dlg, link) => { System.Diagnostics.Process.Start (link); }); var dialog = new Gtk.AboutDialog () { ProgramName = "PDF Mod", Version = Core.Defines.VERSION, Website = WIKI_URL, WebsiteLabel = Catalog.GetString ("Visit Website"), Authors = new string [] { Catalog.GetString ("Primary Development:"), "\tGabriel Burt", "", Catalog.GetString ("Contributors:"), "\tSandy Armstrong", "\tAaron Bockover", "\tOlivier Le Thanh Duong", "\tJulien Rebetez", "\tIgor Vatavuk", "\tBertrand Lorentz", "\tMichael McKinley", "\tŁukasz Jernaś", "\tRomain Tartière", "\tRobert Dyer", "\tAndreu Correa Casablanca", "\tChow Loong Jin", "\tRobson Roberto Souza Peixoto", "\tThomas Klausner" }, Documenters = new string [] { "Gabriel Burt" }, Artists = new string [] { "Kalle Persson" }, Copyright = String.Format ( // Translators: {0} and {1} are the years the copyright assertion covers; put into // variables so you don't have to re-translate this every year Catalog.GetString ("Copyright {0} Novell Inc.\nCopyright {1} Other PDF Mod Contributors"), "2009-2011", "2009-2011" ), TranslatorCredits = Catalog.GetString ("translator-credits") }; try { dialog.Logo = Gtk.IconTheme.Default.LoadIcon ("pdfmod", 256, 0); } catch {} string [] license_paths = new string [] { Core.Defines.PREFIX + "/share/doc/packages/pdfmod/COPYING", "/usr/local/share/doc/packages/pdfmod/COPYING", "COPYING", "../COPYING" }; foreach (var path in license_paths) { try { dialog.License = System.IO.File.ReadAllText (path); break; } catch {} } dialog.Run (); dialog.Destroy (); } void OnPageContextMenu (object o, EventArgs args) { ShowContextMenu ("/PageContextMenu"); } // Bookmark actions void OnEditBookmarks (object o, EventArgs args) { if (!app.BookmarkView.Visible) { (this["ViewBookmarks"] as ToggleAction).Active = true; } } void OnBookmarkContextMenu (object o, EventArgs args) { ShowContextMenu ("/BookmarkContextMenu"); } #endregion #region Utility methods void Rotate (int degrees) { if (!(app.Window.Focus is Gtk.Entry)) { var action = new RotateAction (app.Document, app.IconView.SelectedPages, degrees); action.Do (); undo_manager.AddUndoAction (action); } } string CombinePaths (params string [] parts) { string path = parts[0]; for (int i = 1; i < parts.Length; i++) { path = System.IO.Path.Combine (path, parts[i]); } return path; } [DllImport ("glib-2.0.dll")] static extern IntPtr g_get_language_names (); #endregion } public static class ActionExtensions { public static Hyena.Widgets.ImageButton CreateImageButton (this Gtk.Action action) { var button = new Hyena.Widgets.ImageButton (action.ShortLabel, action.IconName); action.ConnectProxy (button); return button; } } } pdfmod-0.9.1/src/PdfMod/Gui/PageCell.cs0000644000175000001440000001357511450450174017612 0ustar00gabeusers00000000000000// Copyright (C) 2009 Novell, Inc. // // 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. using System; using System.Linq; using Gtk; using Cairo; using Hyena; using Hyena.Collections; using PdfMod.Pdf; namespace PdfMod.Gui { public class PageCell : CairoCell, IDisposable { const int scale_every = 400; ThumbnailLruCache surface_cache; public PageCell (IconView parent) { surface_cache = new ThumbnailLruCache (); } [GLib.Property ("page")] public Page Page { get; set; } public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) { x_offset = y_offset = 0; width = height = ItemSize; } public override void Dispose () { var keys = surface_cache.Select (e => e.Key).ToList (); foreach (var key in keys) { surface_cache.Remove (key); } base.Dispose (); } int item_size = DocumentIconView.MIN_WIDTH; public int ItemSize { get { return item_size; } set { item_size = value; SetFixedSize (value, value); } } protected override void Render (Cairo.Context cr, double width, double height, CellRendererState state) { // Scale the border size w/ the cell size var border_width = width / 128.0; width -= 2 * border_width; height -= 2 * border_width; if (width < 0 || height < 0) { return; } //Console.WriteLine ("SurfaceCache has HitRatio = {0:0.00} ({1} hits, {2} misses, max_count = {3})", surface_cache.HitRatio, surface_cache.Hits, surface_cache.Misses, surface_cache.MaxCount); PageThumbnail cache_obj; ImageSurface surface = null; if (surface_cache.TryGetValue (Page, out cache_obj)) { // Don't use if not big enough, dirty, or corrupt surface = cache_obj.Surface; if (Page.SurfaceDirty || surface == null || surface.Handle == IntPtr.Zero || (surface.Width < width && surface.Height < height)) { surface_cache.Remove (Page); cache_obj = null; surface = null; } } if (surface == null) { // Create a new thumbnail surface, but only on 200px boundaries, then we scale down if needed var w = width + (width % scale_every); var h = height + (height % scale_every); cache_obj = Page.Document.GetSurface (Page, (int)w, (int)h, DocumentIconView.MIN_WIDTH); if (cache_obj == null) { return; } surface = cache_obj.Surface; // Put it in the cache surface_cache.Add (Page, cache_obj); } double scale = Math.Min (width / (double)surface.Width, height / (double)surface.Height); double doc_width = scale * surface.Width; double doc_height = scale * surface.Height; // Center the thumbnail if either dimension is smaller than the cell's if (doc_width < width || doc_height < height) { var x = ((width - doc_width) / 2.0) - border_width; var y = ((height - doc_height) / 2.0) - border_width; cr.Translate (x, y); } PaintDocumentBorder (cr, doc_width, doc_height, border_width); // Scale down the surface if it's not exactly the right size if (scale < 1) { cr.Scale (scale, scale); } // Paint the scaled/translated thumbnail cr.SetSource (surface); cr.Paint (); } void PaintDocumentBorder (Context cr, double doc_width, double doc_height, double border_width) { // Paint a nice document-like border around it var thin = 0.25 * border_width; var thick = 0.75 * border_width; cr.Rectangle (thick + thin/2, thick + thin/2, doc_width, doc_height); cr.Color = new Color (1, 1, 1); cr.FillPreserve (); cr.Color = new Color (0, 0, 0); cr.LineWidth = thin; cr.Stroke (); var offset = .02 * doc_width; cr.LineWidth = thick; cr.MoveTo (doc_width + 1.5*thick + thin, offset); cr.LineTo (doc_width + 1.5*thick + thin, doc_height + 1.5*thick + 2*thin); cr.Stroke (); cr.LineWidth = thick; cr.MoveTo (offset, doc_height + 1.5*thick + thin); cr.LineTo (doc_width + 1.5*thick + 2*thin, doc_height + 1.5*thick + thin); cr.Stroke (); cr.Translate (border_width, border_width); } class ThumbnailLruCache : LruCache { public ThumbnailLruCache () : base (60, 0.8) { } protected override void ExpireItem (PageThumbnail thumb) { thumb.Dispose (); } } } } pdfmod-0.9.1/src/PdfMod/Gui/BookmarkView.cs0000644000175000001440000005016411533730237020534 0ustar00gabeusers00000000000000// Copyright (C) 2010 Novell, Inc. // // 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. using System; using System.Linq; using Gtk; using PdfSharp.Pdf; using PdfMod.Pdf; using PdfMod.Pdf.Actions; using System.Collections.Generic; using Mono.Unix; using PdfSharp.Pdf.Advanced; namespace PdfMod.Gui { public class BookmarkView : VBox { Client app; TreeView tree_view; TreeStore model; Document document; public BookmarkView (Client app) { this.app = app; BuildTreeView (); BuildButtonBar (); WidthRequest = 200; Spacing = 6; ShowAll (); app.Actions["AddBookmark"].Activated += OnAdd; app.Actions["RenameBookmark"].Activated += OnRename; app.Actions["ChangeBookmarkDest"].Activated += OnChangeDest; app.Actions["RemoveBookmarks"].Activated += OnRemove; } public void SetDocument (Document new_doc) { if (document != null) { document.PagesAdded -= OnPagesAdded; document.PagesChanged -= OnPagesChanged; document.PagesRemoved -= OnPagesRemoved; document.PagesMoved -= OnPagesMoved; } document = new_doc; document.PagesAdded += OnPagesAdded; document.PagesChanged += OnPagesChanged; document.PagesRemoved += OnPagesRemoved; document.PagesMoved += OnPagesMoved; model.Clear (); AddOutlineCollection (document, document.Pdf.Outlines, TreeIter.Zero); UpdateActions (); Visible = Client.Configuration.ShowBookmarks; } // Bookmark action handlers void OnAdd (object o, EventArgs args) { // Figure out if there's a parent to put it under TreeIter parent_iter = TreeIter.Zero; if (tree_view.Selection.CountSelectedRows () > 0) { TreePath parent_path; TreeViewColumn col; tree_view.GetCursor (out parent_path, out col); model.GetIter (out parent_iter, parent_path); } // Add it to the PDF document var outline = new PdfOutline (Catalog.GetString ("New bookmark"), document.Pages.First ().Pdf, true); if (!TreeIter.Zero.Equals (parent_iter)) { var parent = GetOutline (parent_iter); SetDestIndex (outline, GetDestIndex (parent) + 1); parent.Outlines.Add (outline); } else { document.Pdf.Outlines.Add (outline); } // Add it to our TreeView var iter = AddOutline (parent_iter, outline); // Make sure it is visible tree_view.ExpandToPath (model.GetPath (iter)); MarkModified (); // Begin editing its name tree_view.SetCursor (model.GetPath (iter), tree_view.Columns[0], true); Hyena.Log.Debug ("Added bookmark"); // Create an IUndo action so it can be undone var action = CreateAddRemoveAction (true, iter); action.Description = Catalog.GetString ("Add Bookmark"); app.Actions.UndoManager.AddUndoAction (action); } void OnRename (object o, EventArgs args) { tree_view.SetCursor (tree_view.Selection.GetSelectedRows ().First (), tree_view.Columns[0], true); } void OnChangeDest (object o, EventArgs args) { tree_view.SetCursor (tree_view.Selection.GetSelectedRows ().First (), tree_view.Columns[1], true); } void OnRemove (object o, EventArgs args) { TreeIter iter; var parent_iters = tree_view.Selection .GetSelectedRows () .Select (p => { model.GetIter (out iter, p); return iter; }); var iters = parent_iters.Concat (parent_iters.SelectMany (i => model.IterChildrenOf (i, true))).Distinct ().ToArray (); var action = CreateAddRemoveAction (false, iters); // Translators: {0} is available for you to use; contains the number of bookmarks action.Description = String.Format (Catalog.GetPluralString ("Remove Bookmark", "Remove Bookmarks", iters.Length), iters.Length); action.Do (); app.Actions.UndoManager.AddUndoAction (action); } class ActionContext { public TreeIter Iter; public PdfOutline Bookmark; public PdfOutline Parent; // TODO Save/restore the precise position this bookmark was at beneath its parent //public int Position; } TreeIter IterForBookmark (PdfOutline bookmark) { return model.IterFor (bookmark); } DelegateAction CreateAddRemoveAction (bool added, params TreeIter [] iters) { TreeIter iter; var items = iters.Select (i => { var parent = model.IterParent (out iter, i) ? GetOutline (iter) : null; var bookmark = GetOutline (i); return new ActionContext () { Iter = i, Bookmark = bookmark, Parent = parent }; }).ToList (); var add_action = new System.Action (() => { for (int i = 0; i < items.Count; i++) { var item = items[i]; TreeIter parent_iter = TreeIter.Zero; if (item.Parent != null) { item.Parent.Outlines.Add (item.Bookmark); parent_iter = IterForBookmark (item.Parent); } else { document.Pdf.Outlines.Add (item.Bookmark); } // Add it to our TreeView, and all its children item.Iter = AddOutline (parent_iter, item.Bookmark); tree_view.ExpandToPath (model.GetPath (item.Iter)); Hyena.Log.DebugFormat ("Added back bookmark '{0}'", item.Bookmark.Title); } }); var remove_action = new System.Action (() => { items.Reverse (); foreach (var item in items) { item.Bookmark.Remove (); model.Remove (ref item.Iter); Hyena.Log.DebugFormat ("Removed bookmark '{0}'", item.Bookmark.Title); } items.Reverse (); }); return new DelegateAction (document) { UndoAction = delegate { if (added) remove_action (); else add_action (); RemoveModifiedMark (); }, RedoAction = delegate { if (added) add_action (); else remove_action (); MarkModified (); } }; } // Document event handlers void OnPagesAdded (int index, Page [] pages) { UpdateModel (); } void OnPagesChanged (Page [] pages) { UpdateModel (); } void OnPagesRemoved (Page [] pages) { var pdf_pages = pages.Select (p => p.Pdf).ToList (); // Remove bookmarks that point to removed pages var to_remove = new List (); model.Foreach ((m, path, iter) => { var outline = GetOutline (iter); if (pdf_pages.Contains (outline.DestinationPage)) { to_remove.Add (iter); } return false; }); while (to_remove.Count > 0) { var iter = to_remove[0]; to_remove.Remove (iter); var outline = GetOutline (iter); outline.Remove (); model.Remove (ref iter); Hyena.Log.DebugFormat ("Removed bookmark '{0}' since its page was removed", outline.Title); } UpdateModel (); } void OnPagesMoved () { UpdateModel (); } // Widget construction utility methods void BuildTreeView () { // outline, expanded/opened, title, page # destination, tooltip model = new TreeStore (typeof(PdfSharp.Pdf.PdfOutline), typeof(bool), typeof(string), typeof(int), typeof(string)); tree_view = new BookmarkTreeView () { App = app, Model = model, SearchColumn = (int)ModelColumns.Title, TooltipColumn = (int)ModelColumns.Tooltip, EnableSearch = true, EnableTreeLines = true, HeadersVisible = false, Reorderable = false, ShowExpanders = true }; tree_view.Selection.Mode = SelectionMode.Multiple; var title = new CellRendererText () { Editable = true, Ellipsize = Pango.EllipsizeMode.End }; title.Edited += delegate(object o, EditedArgs args) { TreeIter iter; if (model.GetIterFromString (out iter, args.Path)) { if (!String.IsNullOrEmpty (args.NewText)) { var bookmark = GetOutline (iter); string new_name = args.NewText; string old_name = bookmark.Title; var action = new DelegateAction (document) { Description = Catalog.GetString ("Rename Bookmark"), UndoAction = delegate { var i = IterForBookmark (bookmark); bookmark.Title = old_name; model.SetValue (i, (int)ModelColumns.Title, bookmark.Title); RemoveModifiedMark (); }, RedoAction = delegate { var i = IterForBookmark (bookmark); bookmark.Title = new_name; model.SetValue (i, (int)ModelColumns.Title, bookmark.Title); MarkModified (); } }; action.Do (); app.Actions.UndoManager.AddUndoAction (action); } else { args.RetVal = false; } } }; var title_col = tree_view.AppendColumn ("", title, "text", ModelColumns.Title); title_col.Expand = true; var page = new CellRendererText () { Editable = true, Style = Pango.Style.Italic }; page.Edited += delegate(object o, EditedArgs args) { TreeIter iter; if (model.GetIterFromString (out iter, args.Path)) { var bookmark = GetOutline (iter); int i = -1; if (Int32.TryParse (args.NewText, out i) && i >= 1 && i <= document.Count && i != (GetDestIndex (bookmark) + 1)) { int old_dest = GetDestIndex (bookmark); int new_dest = i - 1; var action = new DelegateAction (document) { Description = Catalog.GetString ("Rename Bookmark"), UndoAction = delegate { SetDestIndex (bookmark, old_dest); model.SetValue (iter, (int)ModelColumns.PageNumber, old_dest + 1); RemoveModifiedMark (); }, RedoAction = delegate { SetDestIndex (bookmark, new_dest); model.SetValue (iter, (int)ModelColumns.PageNumber, new_dest + 1); MarkModified (); } }; action.Do (); app.Actions.UndoManager.AddUndoAction (action); } else { args.RetVal = false; } } }; var num_col = tree_view.AppendColumn ("", page, "text", ModelColumns.PageNumber); num_col.Alignment = 1.0f; num_col.Expand = false; var label = new Label (Catalog.GetString ("_Bookmarks")) { Xalign = 0f, MnemonicWidget = tree_view }; PackStart (label, false, false, 0); var sw = new Gtk.ScrolledWindow () { HscrollbarPolicy = PolicyType.Never, VscrollbarPolicy = PolicyType.Automatic }; sw.AddWithViewport (tree_view); PackStart (sw, true, true, 0); } void BuildButtonBar () { var box = new HBox () { Spacing = 6 }; var add_action = app.Actions["AddBookmark"]; var add_button = add_action.CreateImageButton (); var remove_action = app.Actions["RemoveBookmarks"]; var remove_button = remove_action.CreateImageButton (); tree_view.Selection.Changed += (o, a) => UpdateActions (); UpdateActions (); box.PackStart (add_button, false, false, 0); box.PackStart (remove_button, false, false, 0); PackStart (box, false, false, 0); } string [] selection_actions = new string [] { "RenameBookmark", "RemoveBookmarks", "ChangeBookmarkDest" }; void UpdateActions () { int count = tree_view.Selection.CountSelectedRows (); bool have_doc_and_selection = count > 0 && document != null; foreach (var action in selection_actions) { app.Actions.UpdateAction (action, true, have_doc_and_selection); } // Translators: {0} is available for you to use; contains the number of bookmarks app.Actions["RemoveBookmarks"].Label = String.Format (Catalog.GetPluralString ("_Remove Bookmark", "_Remove Bookmarks", count), count); } void UpdateModel () { model.Foreach ((m, path, iter) => { model.SetValues (iter, GetValuesFor (GetOutline (iter))); return false; }); UpdateActions (); } void RemoveModifiedMark () { document.UnsavedChanges--; } void MarkModified () { document.UnsavedChanges++; } TreeIter AddOutline (TreeIter parent, PdfOutline outline) { return TreeIter.Zero.Equals (parent) ? model.AppendValues (GetValuesFor (outline)) : model.AppendValues (parent, GetValuesFor (outline)); } object [] GetValuesFor (PdfOutline outline) { int dest_num = GetDestIndex (outline); return new object [] { outline, outline.Opened, outline.Title, dest_num + 1, String.Format (Catalog.GetString ("Bookmark links to page {0}"), dest_num + 1) }; } int GetDestIndex (PdfOutline outline) { if (outline.DestinationPage == null) return -1; else return document.Pages.Select (p => p.Pdf).IndexOf (outline.DestinationPage); } void SetDestIndex (PdfOutline outline, int i) { if (i >= 0 && i < document.Count) { outline.DestinationPage = document.Pages.Skip (i).First ().Pdf; } } void AddOutlineCollection (Document document, PdfOutline.PdfOutlineCollection outlines, TreeIter parent) { if (outlines != null) { foreach (PdfOutline outline in outlines) { var iter = AddOutline (parent, outline); if (outline.Opened) { tree_view.ExpandRow (model.GetPath (iter), false); } // Recursively add this item's children, if any AddOutlineCollection (document, outline.Outlines, iter); } } } PdfOutline GetOutline (TreeIter iter) { return model.Get (iter); } enum ModelColumns : int { Bookmark, IsExpanded, Title, PageNumber, Tooltip }; class BookmarkTreeView : TreeView { public Client App; protected override bool OnButtonPressEvent (Gdk.EventButton press) { TreePath path; if (!GetPathAtPos ((int)press.X, (int)press.Y, out path)) { Selection.UnselectAll (); } bool call_parent = true; if (press.Button == 3 && path != null && Selection.PathIsSelected (path)) { // Calling the parent in this case would unselect any other items than // this path, which we don't want to do - they should stay selected and the // context menu should pop up. call_parent = false; } bool ret = false; if (call_parent) { ret = base.OnButtonPressEvent (press); } if (press.Button == 3) { ret = OnPopupMenu (); } return ret; } protected override bool OnPopupMenu () { App.Actions["BookmarkContextMenu"].Activate (); return true; } } } internal static class Extensions { public static int IndexOf (this IEnumerable enumerable, T item) { int i = 0; foreach (var a in enumerable) { if (item.Equals (a)) { return i; } else { i++; } } return -1; } public static T Get (this TreeStore model, TreeIter iter) { // NOTE: assumes object is stored in model column 0 return (T) model.GetValue (iter, 0); } public static TreeIter IterFor (this TreeStore model, T item) { var iter = TreeIter.Zero; model.Foreach ((m, path, i) => { if (model.Get (i).Equals (item)) { iter = i; return true; } return false; }); return iter; } public static IEnumerable ObjectChildrenOf (this TreeStore model, TreeIter iter, bool recursive) { foreach (var child in IterChildrenOf (model, iter, recursive)) { yield return model.Get (child); } } public static IEnumerable IterChildrenOf (this TreeStore model, TreeIter iter, bool recursive) { TreeIter child; if (model.IterChildren (out child, iter)) { do { yield return child; if (recursive) { foreach (var subchild in model.IterChildrenOf (child, recursive)) { yield return subchild; } } } while (model.IterNext (ref child)); } } } } pdfmod-0.9.1/src/PdfMod/Gui/CairoCell.cs0000644000175000001440000000516111443472731017770 0ustar00gabeusers00000000000000// Copyright (C) 2009 Novell, Inc. // // 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. using System; using Gtk; using Cairo; using Hyena.Gui; using Hyena.Gui.Theming; namespace PdfMod.Gui { public abstract class CairoCell : CellRenderer { protected Theme Theme { get; private set; } public CairoCell () { Mode = CellRendererMode.Inert; Xpad = Ypad = 0; } protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState state) { if (Theme == null) { Theme = Hyena.Gui.Theming.ThemeEngine.CreateTheme (widget); Theme.Context.Radius = 3; } Context cr = Gdk.CairoHelper.Create (window); // Setup the drawing boundaries/positioning cr.Rectangle (cell_area.X, cell_area.Y, cell_area.Width, cell_area.Height); cr.Clip (); cr.Translate (cell_area.X, cell_area.Y); // Clear any existing drawing cr.Rectangle (0, 0, cell_area.Width, cell_area.Height); cr.Color = Theme.ViewFill; cr.Fill (); if (state == CellRendererState.Selected) { Theme.DrawRowSelection (cr, 0, 0, cell_area.Width, cell_area.Height, true); } else if (state == CellRendererState.Focused) { Theme.DrawRowSelection (cr, 0, 0, cell_area.Width, cell_area.Height, false); } var border = Theme.TotalBorderWidth; cr.Translate (border, border); var width = cell_area.Width - 2 * border; var height = cell_area.Height - 2 * border; Render (cr, width, height, state); Hyena.Gui.CairoExtensions.DisposeContext (cr); } protected abstract void Render (Cairo.Context context, double width, double height, CellRendererState state); } } pdfmod-0.9.1/src/PdfMod/Gui/ZoomSlider.cs0000644000175000001440000000525511444200173020214 0ustar00gabeusers00000000000000// Copyright (C) 2010 Novell, Inc. // // 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. using System; using System.Linq; using System.Collections.Generic; using System.IO; using Gtk; using Mono.Unix; using Hyena; using Hyena.Gui; using PdfSharp; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; using PdfMod.Pdf; namespace PdfMod.Gui { public class ZoomSlider : Alignment { public ZoomSlider (Client app) : base (1f, 0.5f, 0f, 0f) { RightPadding = 16; var box = new HBox () { Spacing = 2 }; // Zoom in/out buttons var zoom_out = new Button (new Image (Stock.ZoomOut, IconSize.Button)) { Relief = ReliefStyle.None }; app.Actions["ZoomOut"].ConnectProxy (zoom_out); var zoom_in = new Button (new Image (Stock.ZoomIn, IconSize.Button)) { Relief = ReliefStyle.None }; app.Actions["ZoomIn"].ConnectProxy (zoom_in); // Slider var slider = new HScale (DocumentIconView.MIN_WIDTH, DocumentIconView.MAX_WIDTH, 1) { WidthRequest = 100, DrawValue = false, Sensitive = false }; bool setting_via_slider = false; slider.ValueChanged += (o, a) => { if (!setting_via_slider) { setting_via_slider = true; app.IconView.Zoom ((int)slider.Value, true); setting_via_slider = false; } }; app.IconView.ZoomChanged += () => { if (!setting_via_slider) { setting_via_slider = true; slider.Value = app.IconView.ItemSize; setting_via_slider = false; } }; app.DocumentLoaded += (o, a) => slider.Sensitive = app.Document != null; box.PackStart (zoom_out, false, false, 0); box.PackStart (slider, false, false, 0); box.PackStart (zoom_in, false, false, 0); Child = box; } } } pdfmod-0.9.1/src/PdfMod/Gui/Client.cs0000644000175000001440000004205111457621042017344 0ustar00gabeusers00000000000000// Copyright (C) 2009-2010 Novell, Inc. // Copyright (C) 2009 Robert Dyer // // 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. using System; using System.Linq; using System.Collections.Generic; using System.IO; using Gtk; using Mono.Unix; using Hyena; using Hyena.Gui; using PdfSharp; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; using PdfMod.Pdf; namespace PdfMod.Gui { public class Client : Core.Client { static int app_count = 0; static string accel_map_file = Path.Combine (Path.Combine ( XdgBaseDirectorySpec.GetUserDirectory ("XDG_CONFIG_HOME", ".config"), "pdfmod"), "gtk_accel_map"); Gtk.MenuBar menu_bar; Gtk.Label status_label; QueryBox query_box; bool loading; long original_size; string original_size_string = null; public ActionManager ActionManager { get; private set; } public Gtk.Toolbar HeaderToolbar { get; private set; } public Actions Actions { get; private set; } public Gtk.Statusbar StatusBar { get; private set; } public Gtk.Window Window { get; private set; } public DocumentIconView IconView { get; private set; } public MetadataEditorBox EditorBox { get; private set; } public BookmarkView BookmarkView { get; private set; } static Client () { Gtk.Application.Init (); ThreadAssist.InitializeMainThread (); ThreadAssist.ProxyToMainHandler = RunIdle; Hyena.Log.Notify += OnLogNotify; Gtk.Window.DefaultIconName = "pdfmod"; try { if (System.IO.File.Exists (accel_map_file)) { Gtk.AccelMap.Load (accel_map_file); Hyena.Log.DebugFormat ("Loaded custom AccelMap from {0}", accel_map_file); } } catch (Exception e) { Hyena.Log.Exception ("Failed to load custom AccelMap", e); } } public Client () : this (false) { } internal Client (bool loadFiles) { app_count++; Window = new Gtk.Window (Gtk.WindowType.Toplevel) { Title = Catalog.GetString ("PDF Mod") }; Window.SetSizeRequest (640, 480); Window.DeleteEvent += delegate (object o, DeleteEventArgs args) { Quit (); args.RetVal = true; }; // PDF Icon View IconView = new DocumentIconView (this); var iconview_sw = new Gtk.ScrolledWindow (); iconview_sw.AddWithViewport (IconView); query_box = new QueryBox (this) { NoShowAll = true }; query_box.Hide (); // ActionManager ActionManager = new Hyena.Gui.ActionManager (); Window.AddAccelGroup (ActionManager.UIManager.AccelGroup); Actions = new Actions (this, ActionManager); // Status bar StatusBar = new Gtk.Statusbar () { HasResizeGrip = true }; status_label = new Label () { Xalign = 0.0f }; StatusBar.PackStart (status_label, true, true, 6); StatusBar.ReorderChild (status_label, 0); var zoom_slider = new ZoomSlider (this); StatusBar.PackEnd (zoom_slider, false, false, 0); StatusBar.ReorderChild (zoom_slider, 1); // Properties editor box EditorBox = new MetadataEditorBox (this) { NoShowAll = true }; EditorBox.Hide (); // Menubar menu_bar = ActionManager.UIManager.GetWidget ("/MainMenu") as MenuBar; // Toolbar HeaderToolbar = ActionManager.UIManager.GetWidget ("/HeaderToolbar") as Gtk.Toolbar; HeaderToolbar.ShowArrow = false; HeaderToolbar.ToolbarStyle = ToolbarStyle.Icons; HeaderToolbar.Tooltips = true; HeaderToolbar.NoShowAll = true; HeaderToolbar.Visible = Configuration.ShowToolbar; // BookmarksView BookmarkView = new BookmarkView (this); BookmarkView.NoShowAll = true; BookmarkView.Visible = false; var vbox = new VBox (); vbox.PackStart (menu_bar, false, false, 0); vbox.PackStart (HeaderToolbar, false, false, 0); vbox.PackStart (EditorBox, false, false, 0); vbox.PackStart (query_box, false, false, 0); var hbox = new HPaned (); hbox.Add1 (BookmarkView); hbox.Add2 (iconview_sw); vbox.PackStart (hbox, true, true, 0); vbox.PackStart (StatusBar, false, true, 0); Window.Add (vbox); Window.ShowAll (); if (loadFiles) { RunIdle (LoadFiles); Application.Run (); } } public void ToggleMatchQuery () { if (query_box.Entry.HasFocus) { query_box.Hide (); } else { query_box.Show (); query_box.Entry.GrabFocus (); } } public void Quit () { if (Window == null) { return; } if (PromptIfUnsavedChanges ()) { return; } if (Document != null) { Document.Dispose (); } if (IconView != null) { IconView.Dispose (); IconView = null; } Window.Destroy (); Window = null; if (--app_count == 0) { try { Directory.CreateDirectory (Path.GetDirectoryName (accel_map_file)); Gtk.AccelMap.Save (accel_map_file); } catch (Exception e) { Hyena.Log.Exception ("Failed to save custom AccelMap", e); } Application.Quit (); } } bool PromptIfUnsavedChanges () { if (Document != null && Document.HasUnsavedChanges) { var dialog = new Hyena.Widgets.HigMessageDialog ( Window, DialogFlags.Modal, MessageType.Warning, ButtonsType.None, Catalog.GetString ("Save the changes made to this document?"), String.Empty ); dialog.AddButton (Catalog.GetString ("Close _Without Saving"), ResponseType.Close, false); dialog.AddButton (Stock.Cancel, ResponseType.Cancel, false); dialog.AddButton (Stock.SaveAs, ResponseType.Ok, true); var response = (ResponseType) dialog.Run (); dialog.Destroy (); switch (response) { case ResponseType.Ok: Actions["SaveAs"].Activate (); return PromptIfUnsavedChanges (); case ResponseType.Close: return false; case ResponseType.Cancel: case ResponseType.DeleteEvent: return true; } } return false; } public override void LoadFiles (IList files) { if (files.Count == 1) { LoadPath (files[0]); } else if (files.Count > 1) { // Make sure the user wants to open N windows var dialog = new Hyena.Widgets.HigMessageDialog ( Window, DialogFlags.Modal, MessageType.Question, ButtonsType.None, String.Format (Catalog.GetPluralString ( "Continue, opening {0} document in separate windows?", "Continue, opening all {0} documents in separate windows?", files.Count), files.Count), String.Empty); dialog.AddButton (Stock.Cancel, ResponseType.Cancel, false); dialog.AddButton (Catalog.GetString ("Open _First"), ResponseType.Accept, false); dialog.AddButton (Catalog.GetString ("Open _All"), ResponseType.Ok, true); var response = dialog.Run (); dialog.Destroy (); if ((Gtk.ResponseType)response == Gtk.ResponseType.Ok) { foreach (string file in files) { LoadPath (file); } } else if ((Gtk.ResponseType)response == Gtk.ResponseType.Accept) { LoadPath (files[0]); } } } public override void LoadPath (string path, string suggestedFilename, System.Action finishedCallback) { lock (this) { // One document per window if (loading || Document != null) { new Client ().LoadPath (path, suggestedFilename); return; } loading = true; } if (!path.StartsWith ("file://")) { path = System.IO.Path.GetFullPath (path); } Configuration.LastOpenFolder = System.IO.Path.GetDirectoryName (suggestedFilename ?? path); status_label.Text = Catalog.GetString ("Loading document..."); ThreadAssist.SpawnFromMain (delegate { try { Document = new Document (); Document.Load (path, PasswordProvider, suggestedFilename != null); if (suggestedFilename != null) { Document.SuggestedSavePath = suggestedFilename; } ThreadAssist.BlockingProxyToMain (delegate { IconView.SetDocument (Document); BookmarkView.SetDocument (Document); RecentManager.Default.AddItem (Document.Uri); Document.Changed += UpdateForDocument; UpdateForDocument (); OnDocumentLoaded (); }); } catch (Exception e) { Document = null; ThreadAssist.BlockingProxyToMain (delegate { status_label.Text = ""; if (e is System.IO.FileNotFoundException) { try { RecentManager.Default.RemoveItem (new Uri(path).AbsoluteUri); } catch {} } }); Hyena.Log.Exception (e); Hyena.Log.Error ( Catalog.GetString ("Error Loading Document"), String.Format (Catalog.GetString ("There was an error loading {0}"), GLib.Markup.EscapeText (path ?? "")), true ); } finally { lock (this) { loading = false; } if (finishedCallback != null) finishedCallback (); } }); } void UpdateForDocument () { ThreadAssist.AssertInMainThread (); var current_size = Document.FileSize; string size_str = null; if (original_size_string == null) { size_str = original_size_string = new Hyena.Query.FileSizeQueryValue (current_size).ToUserQuery (); original_size = current_size; } else if (current_size == original_size) { size_str = original_size_string; } else { string current_size_string = new Hyena.Query.FileSizeQueryValue (current_size).ToUserQuery (); if (current_size_string == original_size_string) { size_str = original_size_string; } else { // Translators: this string is used to show current/original file size, eg "2 MB (originally 1 MB)" size_str = String.Format (Catalog.GetString ("{0} (originally {1})"), current_size_string, original_size_string); } } status_label.Text = String.Format ("{0} \u2013 {1}", String.Format (Catalog.GetPluralString ("{0} page", "{0} pages", Document.Count), Document.Count), size_str ); var title = Document.Title; var filename = Document.Filename; if (Document.HasUnsavedChanges) { filename = "*" + filename; } Window.Title = title == null ? filename : String.Format ("{0} - {1}", filename, title); } public void PasswordProvider (PdfPasswordProviderArgs args) { // This method is called from some random thread, but we need // to do the dialog on the GUI thread; use the reset_event // to block this thread until the user is done with the dialog. ThreadAssist.BlockingProxyToMain (delegate { Log.Debug ("Password requested to open document"); var dialog = new Hyena.Widgets.HigMessageDialog ( Window, DialogFlags.Modal, MessageType.Question, ButtonsType.None, Catalog.GetString ("Document is Encrypted"), Catalog.GetString ("Enter the document's password to open it:") ); dialog.Image = Gtk.IconTheme.Default.LoadIcon ("dialog-password", 48, 0); var password_entry = new Entry () { Visibility = false }; password_entry.Show (); dialog.LabelVBox.PackStart (password_entry, false, false, 12); dialog.AddButton (Stock.Cancel, ResponseType.Cancel, false); dialog.AddButton (Stock.Ok, ResponseType.Ok, true); var response = (ResponseType)dialog.Run (); string password = password_entry.Text; dialog.Destroy (); if (response == ResponseType.Ok) { args.Password = Document.Password = password; } else { Log.Information ("Password dialog cancelled"); args.Abort = true; } }); } public Gtk.FileChooserDialog CreateChooser (string title, FileChooserAction action) { var chooser = new Gtk.FileChooserDialog (title, this.Window, action) { DefaultResponse = ResponseType.Ok }; chooser.AddButton (Stock.Cancel, ResponseType.Cancel); chooser.AddFilter (GtkUtilities.GetFileFilter (Catalog.GetString ("PDF Documents"), new string [] {"pdf"})); chooser.AddFilter (GtkUtilities.GetFileFilter (Catalog.GetString ("All Files"), new string [] {"*"})); var dirs = new string [] { "DOWNLOAD", "DOCUMENTS" }.Select (s => GetXdgDir (s)) .Where (d => d != null) .ToArray (); Hyena.Gui.GtkUtilities.SetChooserShortcuts (chooser, dirs); return chooser; } private string GetXdgDir (string type) { try { return XdgBaseDirectorySpec.GetXdgDirectoryUnderHome (String.Format ("XDG_{0}_DIR", type), null); } catch { return null; } } static void OnLogNotify (LogNotifyArgs args) { ThreadAssist.ProxyToMain (delegate { Gtk.MessageType mtype = Gtk.MessageType.Error; var entry = args.Entry; switch (entry.Type) { case LogEntryType.Warning: mtype = Gtk.MessageType.Warning; break; case LogEntryType.Information: mtype = Gtk.MessageType.Info; break; case LogEntryType.Error: default: mtype = Gtk.MessageType.Error; break; } Hyena.Widgets.HigMessageDialog dialog = new Hyena.Widgets.HigMessageDialog ( null, Gtk.DialogFlags.Modal, mtype, Gtk.ButtonsType.Close, entry.Message, entry.Details); dialog.Title = String.Empty; dialog.Run (); dialog.Destroy (); }); } public static void RunIdle (InvokeHandler handler) { GLib.Idle.Add (delegate { handler (); return false; }); } } } pdfmod-0.9.1/src/PdfMod/Gui/SelectMatchingBox.cs0000644000175000001440000000564111255256312021475 0ustar00gabeusers00000000000000// Copyright (C) 2009 Novell, Inc. // Copyright (C) 2009 Igor Vatavuk // // 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. using System; using Mono.Unix; using Gtk; namespace PdfMod.Gui { public class QueryBox : EventBox { Client app; HBox hbox; public Entry Entry { get; private set; } public QueryBox (Client app) { this.app = app; AppPaintable = true; hbox = new HBox () { BorderWidth = 6 }; Entry = new Gtk.Entry () { WidthChars = 40 }; Entry.Activated += OnActivated; var query_button = new Hyena.Widgets.ImageButton (Catalog.GetString ("Select Matching"), Gtk.Stock.Find); query_button.Clicked += OnActivated; var close_button = new Hyena.Widgets.ImageButton (null, Gtk.Stock.Close); close_button.Clicked += delegate { Hide (); }; hbox.PackStart (Entry, true, true, 0); hbox.PackStart (query_button, false, false, 0); hbox.PackStart (close_button, false, false, 0); Child = hbox; KeyPressEvent += delegate (object o, KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Escape) { Hide (); } }; ShowAll (); } public new void Hide () { base.Hide (); app.IconView.GrabFocus (); } void OnActivated (object o, EventArgs args) { Hide (); if (!String.IsNullOrEmpty (Entry.Text.Trim ())) { app.IconView.SetSelectionMatchQuery (Entry.Text); } } bool changing_style; protected override void OnStyleSet (Style style) { if (!changing_style) { changing_style = true; ModifyBg (StateType.Normal, Style.Background (StateType.Selected)); changing_style = false; } } protected override bool OnExposeEvent (Gdk.EventExpose evnt) { GdkWindow.DrawRectangle (Style.ForegroundGC (StateType.Normal), false, 0, 0, Allocation.Width - 1, Allocation.Height - 1); return base.OnExposeEvent (evnt); } } } pdfmod-0.9.1/src/PdfMod/Gui/PageListStore.cs0000644000175000001440000000467411533751455020673 0ustar00gabeusers00000000000000// Copyright (C) 2009 Novell, Inc. // Copyright (C) 2009 Michael McKinley // // 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. using System; using System.Collections.Generic; using System.Linq; using Gtk; using PdfMod.Pdf; namespace PdfMod.Gui { public class PageListStore : ListStore { public const int SortColumn = 0; public const int TooltipColumn = 1; public const int PageColumn = 2; public PageListStore () : base (typeof (int), typeof (string), typeof (Page)) { SetSortColumnId (SortColumn, SortType.Ascending); } public void SetDocument (Document document) { Clear (); foreach (var page in document.Pages) { AppendValues (GetValuesForPage (page)); } } public TreeIter GetIterForPage (Page page) { return TreeIters.FirstOrDefault (iter => { return GetValue (iter, PageColumn) == page; }); } public IEnumerable TreeIters { get { TreeIter iter; if (GetIterFirst (out iter)) { do { yield return iter; } while (IterNext (ref iter)); } } } string GetPageTooltip (Page page) { return page.Name; } public void UpdateForPage (TreeIter iter, Page page) { SetValue (iter, SortColumn, page.Index); SetValue (iter, TooltipColumn, GetPageTooltip(page)); SetValue (iter, PageColumn, page); } internal object [] GetValuesForPage (Page page) { return new object[] { page.Index, GetPageTooltip(page), page }; } } } pdfmod-0.9.1/src/PdfMod/Gui/MetadataEditorBox.cs0000644000175000001440000002011511450450174021462 0ustar00gabeusers00000000000000// Copyright (C) 2009 Novell, Inc. // // 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. using System; using Mono.Unix; using Gtk; using PdfMod.Pdf; namespace PdfMod.Gui { public class MetadataEditorBox : EventBox { Client app; Table table; Button revert_button; Document doc; TextProperty [] properties; TextProperty title, author, keywords, subject; public MetadataEditorBox (Client app) { this.app = app; app.DocumentLoaded += HandleDocumentLoaded; Child = table = new Table (2, 5, false) { RowSpacing = 6, ColumnSpacing = 6, BorderWidth = 6 }; BuildEditor (); BuildButtons (); KeyPressEvent += (o, args) => { if (args.Event.Key == Gdk.Key.Escape) { Hide (); } }; UpdateSensitivity (); ShowAll (); } void BuildEditor () { title = new TextProperty (Catalog.GetString ("_Title:"), t => doc.Title = t); author = new TextProperty (Catalog.GetString ("_Author:"), t => doc.Author = t); keywords = new TextProperty (Catalog.GetString ("_Keywords:"), t => doc.Keywords = t); subject = new TextProperty (Catalog.GetString ("_Subject:"), t => doc.Subject = t); properties = new TextProperty [] { title, author, keywords, subject }; uint row = 0, column = 0; foreach (var property in properties) { table.Attach (property.Label, column++, column, row, row + 1, AttachOptions.Fill, 0, 0, 0); table.Attach (property.Entry, column++, column, row, row + 1, AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0); if (column == 4) { column = 0; row++; } property.Entry.Changed += delegate { UpdateSensitivity (); }; } } void BuildButtons () { revert_button = new Hyena.Widgets.ImageButton (Catalog.GetString ("_Revert Properties"), "revert"); revert_button.TooltipText = Catalog.GetString ("Change the document's properties back to the original values"); revert_button.Clicked += HandleRevert; var close_button = new Hyena.Widgets.ImageButton (Catalog.GetString ("_Close"), Gtk.Stock.Close); close_button.TooltipText = Catalog.GetString ("Hide the document's properties"); close_button.Clicked += delegate { Hide (); }; table.Attach (revert_button, 4, 5, 0, 1, AttachOptions.Fill, 0, 0, 0); table.Attach (close_button, 4, 5, 1, 2, AttachOptions.Fill, 0, 0, 0); } void UpdateSensitivity () { Sensitive = app.Document != null; bool have_changes = false; foreach (var prop in properties) { have_changes |= prop.HasChanges; } revert_button.Sensitive = have_changes; } #region Event handlers void HandleDocumentLoaded (object o, EventArgs e) { doc = app.Document; /*var pdf = app.Document.Pdf; var info = pdf.Info; Console.WriteLine ("Author = {0}", info.Author); Console.WriteLine ("CreationDate = {0}", info.CreationDate); Console.WriteLine ("Creator = {0}", info.Creator); Console.WriteLine ("Keywords = {0}", info.Keywords); Console.WriteLine ("ModificationDate = {0}", info.ModificationDate); Console.WriteLine ("Producer = {0}", info.Producer); Console.WriteLine ("Subject = {0}", info.Subject); Console.WriteLine ("Title = {0}", info.Title); Console.WriteLine ("Page Layout = {0}", pdf.PageLayout); Console.WriteLine ("Page Mode = {0}", pdf.PageMode); Console.WriteLine ("SecurityLevel = {0}", pdf.SecuritySettings.DocumentSecurityLevel); //Console.WriteLine ("OwnerPassword = {0}", pdf.SecuritySettings.OwnerPassword); //Console.WriteLine ("UserPassword = {0}", pdf.SecuritySettings.UserPassword); Console.WriteLine ("Settings.TrimMgns= {0}", pdf.Settings.TrimMargins); Console.WriteLine ("Version = {0}", pdf.Version); Console.WriteLine ("# Outlines = {0}", pdf.Outlines.Count); Console.WriteLine ("NoCompression = {0}", pdf.Options.NoCompression); //Console.WriteLine ("CompressionMode = {0}", pdf.CustomValues.CompressionMode); var prefs = pdf.ViewerPreferences; Console.WriteLine ("\nViewPreferences:"); Console.WriteLine ("CenterWindow = {0}", prefs.CenterWindow); Console.WriteLine ("Direction = {0}", prefs.Direction); Console.WriteLine ("DisplayDocTitle = {0}", prefs.DisplayDocTitle); Console.WriteLine ("FitWindow = {0}", prefs.FitWindow); Console.WriteLine ("HideMenubar = {0}", prefs.HideMenubar); Console.WriteLine ("HideToolbar = {0}", prefs.HideToolbar); Console.WriteLine ("HideWindowUI = {0}", prefs.HideWindowUI);*/ title.SetDefault (doc.Title); author.SetDefault (doc.Author); keywords.SetDefault (doc.Keywords); subject.SetDefault (doc.Subject); UpdateSensitivity (); } void HandleRevert (object o, EventArgs args) { foreach (var prop in properties) { prop.Revert (); } revert_button.Sensitive = false; } #endregion #region Gtk.Widget overrides public new void Hide () { (app.Actions["Properties"] as Gtk.ToggleAction).Active = false; base.Hide (); app.IconView.GrabFocus (); } public new void GrabFocus () { title.Entry.GrabFocus (); } #endregion class TextProperty { public Entry Entry { get; private set; } public Label Label { get; private set; } string initial_value; Hyena.Gui.EditableUndoAdapter undo_adapter; Action on_updated; public TextProperty (string label, Action onUpdated) { this.on_updated = onUpdated; Entry = new Entry (); Entry.Changed += (o, a) => { on_updated (Entry.Text); }; undo_adapter = new Hyena.Gui.EditableUndoAdapter (Entry); undo_adapter.Connect (); Label = new Label (label) { MnemonicWidget = Entry, Xalign = 1.0f }; } public void SetDefault (string default_value) { this.initial_value = default_value; Entry.Text = default_value ?? ""; undo_adapter.UndoManager.Clear (); } public void Revert () { Entry.Text = initial_value ?? ""; undo_adapter.UndoManager.Clear (); } public bool HasChanges { get { return undo_adapter.UndoManager.CanUndo; } } } } } pdfmod-0.9.1/src/Makefile.am0000644000175000001440000000535511452674220015745 0ustar00gabeusers00000000000000 # Warning: This is an automatically generated file, do not edit! # EXTRA_DIST = ASSEMBLY_COMPILER_COMMAND = $(MCS) ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug "-define:DEBUG" ASSEMBLY = ../bin/PdfMod.exe ASSEMBLY_MDB = $(ASSEMBLY).mdb COMPILE_TARGET = exe PROJECT_REFERENCES = BUILD_DIR = ../bin PDFMOD_EXE_MDB_SOURCE=../bin/PdfMod.exe.mdb AL=al2 SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll PROGRAMFILES = $(PDFMOD_EXE_MDB) BINARIES = \ $(PDFMOD) RESGEN=resgen2 all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) FILES = \ PdfMod/Core/AssemblyInfo.cs \ PdfMod/Core/Client.cs \ PdfMod/Core/Configuration.cs \ PdfMod/Core/Defines.cs \ PdfMod/Gui/Actions.cs \ PdfMod/Gui/BookmarkView.cs \ PdfMod/Gui/CairoCell.cs \ PdfMod/Gui/Client.cs \ PdfMod/Gui/DocumentIconView.cs \ PdfMod/Gui/MetadataEditorBox.cs \ PdfMod/Gui/PageCell.cs \ PdfMod/Gui/PageListStore.cs \ PdfMod/Gui/SelectMatchingBox.cs \ PdfMod/Gui/ZoomSlider.cs \ PdfMod/Main.cs \ PdfMod/Pdf/Actions/BaseAction.cs \ PdfMod/Pdf/Actions/BasePageAction.cs \ PdfMod/Pdf/Actions/ExportImagesAction.cs \ PdfMod/Pdf/Actions/MoveAction.cs \ PdfMod/Pdf/Actions/RemoveAction.cs \ PdfMod/Pdf/Actions/RotateAction.cs \ PdfMod/Pdf/Document.cs \ PdfMod/Pdf/Page.cs \ PdfMod/Pdf/PageLabels.cs \ PdfMod/Pdf/PageThumbnail.cs DATA_FILES = RESOURCES = Resources/UIManager.xml EXTRAS = \ pdfmod.in REFERENCES = \ Mono.Cairo \ Mono.Posix \ -pkg:gconf-sharp-2.0 \ -pkg:glib-sharp-2.0 \ -pkg:gtk-sharp-2.0 \ -pkg:hyena \ -pkg:hyena.gui \ System \ System.Core \ -r:../bin/PdfSharp.dll PROJECT_REFERENCES = ../bin/PdfSharp.dll if USE_BUNDLED_POPPLER PROJECT_REFERENCES += ../bin/poppler-sharp.dll PROGRAMFILES += $(POPPLER_SHARP_DLL_CONFIG) else REFERENCES += -pkg:poppler-sharp endif CLEANFILES = $(PROGRAMFILES) $(BINARIES) include $(top_srcdir)/Makefile.include PDFSHARP_DLL = $(BUILD_DIR)/PdfSharp.dll PDFSHARP_DLL_MDB = $(BUILD_DIR)/PdfSharp.dll.mdb POPPLER_SHARP_DLL = $(BUILD_DIR)/poppler-sharp.dll POPPLER_SHARP_DLL_CONFIG = $(BUILD_DIR)/poppler-sharp.dll.config PDFMOD_EXE_MDB = $(BUILD_DIR)/PdfMod.exe.mdb PDFMOD = $(BUILD_DIR)/pdfmod $(eval $(call emit-deploy-wrapper,PDFMOD,pdfmod,x)) $(eval $(call emit_resgen_targets)) $(build_xamlg_list): %.xaml.g.cs: %.xaml xamlg '$<' $(ASSEMBLY_MDB): $(ASSEMBLY) $(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) mkdir -p $(shell dirname $(ASSEMBLY)) cp $(BUNDLE_ASSEMBLIES) $(BUILD_DIR) cp $(BUNDLE_FILES) $(BUILD_DIR) $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) pdfmod-0.9.1/Makefile.include0000644000175000001440000001521611261513367016203 0ustar00gabeusers00000000000000VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT s2q=$(subst \ ,?,$1) q2s=$(subst ?,\ ,$1) # use this when result will be quoted unesc2=$(subst ?, ,$1) build_sources = $(FILES) $(GENERATED_FILES) build_sources_esc= $(call s2q,$(build_sources)) # use unesc2, as build_sources_embed is quoted build_sources_embed= $(call unesc2,$(build_sources_esc:%='$(srcdir)/%')) comma__=, get_resource_name = $(firstword $(subst $(comma__), ,$1)) get_culture = $(lastword $(subst ., ,$(basename $1))) is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1))))) RESOURCES_ESC=$(call s2q,$(RESOURCES)) build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),)) build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res))) build_others_list = $(build_non_culture_others_list) build_xamlg_list = $(filter %.xaml.g.cs, $(FILES)) # resgen all .resx resources build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res))) build_resx_resources_esc = $(build_resx_files:.resx=.resources) build_resx_resources = $(call q2s,$(build_resx_resources_esc)) # embed resources for the main assembly build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list)) # use unesc2, as build_resx_resources_embed is quoted build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%')) build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res)))) build_others_resources = $(build_others_files) # use unesc2, as build_others_resources_embed is quoted build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%')) build_resources = $(build_resx_resources) $(build_others_resources) build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed) # -usesourcepath is available only for resgen2 emit_resgen_target_1=$(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')' emit_resgen_target_2=$(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@' emit_resgen_target=$(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1)) emit_resgen_targets=$(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res)))) DLL_REFERENCES_EXPANDED = $(foreach reference, $(DLL_REFERENCES), $(addprefix $(srcdir)/, $(reference))) build_references_ref = $(call q2s,$(foreach ref, $(call s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref))))) build_references_ref += $(call q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES_EXPANDED)), -r:$(ref))) build_references_ref += $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), -r:$(ref))) s2q2s=$(call unesc2,$(call s2q,$1)) cp_actual=test -z $1 || cp $1 $2 cp=$(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)') rm_actual=test -z '$1' || rm -f '$2' rm=$(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)')) EXTRA_DIST += $(build_sources) $(build_resx_files) $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) $(DATA_FILES) $(build_culture_res_files) CLEANFILES += $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) $(build_satellite_assembly_list) DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/* pkglib_SCRIPTS = $(ASSEMBLY) bin_SCRIPTS = $(BINARIES) programfilesdir = @libdir@/@PACKAGE@ programfiles_DATA = $(PROGRAMFILES) # macros # $(call emit-deploy-target,deploy-variable-name) define emit-deploy-target $($1): $($1_SOURCE) mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' endef # $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x) # assumes that for a wrapper foo.pc its source template is foo.pc.in # if $3 is non-empty then wrapper is marked exec define emit-deploy-wrapper $($1): $2 mkdir -p '$$(shell dirname '$$@')' cp '$$<' '$$@' $(if $3,chmod +x '$$@') endef # generating satellite assemblies culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res))) cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res))))) culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)) culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)') build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))) build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res)))) install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list)) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res)))))) $(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res))))) $(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME): mkdir -p '$(@D)' $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*) $(install_satellite_assembly_list): mkdir -p '$(@D)' cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@ install-satellite-assemblies: $(install_satellite_assembly_list) uninstall-satellite-assemblies: rm -rf $(install_satellite_assembly_list) pdfmod-0.9.1/Makefile.am0000644000175000001440000000270011261513367015147 0ustar00gabeusers00000000000000 #Warning: This is an automatically generated file, do not edit! if ENABLE_DEBUG SUBDIRS = lib/PdfSharp lib/poppler-sharp src po docs data endif if ENABLE_RELEASE SUBDIRS = lib/PdfSharp lib/poppler-sharp src po docs data endif INSTALL_DIR_RESOLVED = $(firstword $(subst , $(pkglibdir), $(INSTALL_DIR))) run: cd bin; mono --debug PdfMod.exe; install-data-hook: for ASM in $(BUNDLE_ASSEMBLIES); do \ $(INSTALL) -m 0755 $$ASM $(DESTDIR)$(INSTALL_DIR_RESOLVED); \ done; \ for ASM in $(BUNDLE_FILES); do \ $(INSTALL) -m 0644 $$ASM $(DESTDIR)$(INSTALL_DIR_RESOLVED); \ done; uninstall-hook: for ASM in $(BUNDLE_ASSEMBLIES); do \ rm -f $(DESTDIR)$(INSTALL_DIR_RESOLVED)/`basename $$ASM`; \ done; for ASM in $(BUNDLE_FILES); do \ rm -f $(DESTDIR)$(INSTALL_DIR_RESOLVED)/`basename $$ASM`; \ done; clean-local: rm -rf $(top_builddir)/bin EXTRA_DIST = \ lib/poppler-sharp/poppler-sharp/poppler-sharp.dll.config \ gnome-doc-utils.make \ icon-theme-installer \ intltool-extract.in \ intltool-merge.in \ intltool-update.in \ AUTHORS \ HACKING CLEANFILES = \ intltool-extract \ intltool-update \ intltool-merge DISTCLEANFILES = \ gnome-doc-utils.make \ *.bak \ *~ \ *.pidb MAINTAINERCLEANFILES = \ compile \ INSTALL \ config.h.in \ aclocal.m4 \ ltmain.sh \ Makefile.in \ depcomp \ missing \ install-sh \ configure \ config.sub \ config.guess \ intltool-extract.in \ intltool-merge.in \ intltool-update.in \ mkinstalldirs pdfmod-0.9.1/intltool-update.in0000644000175000001440000000000011453151740016552 0ustar00gabeusers00000000000000pdfmod-0.9.1/configure.ac0000644000175000001440000001024111533757667015417 0ustar00gabeusers00000000000000dnl Warning: This is an automatically generated file, do not edit! dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.54]) AC_INIT([pdfmod], [0.9.1]) AM_INIT_AUTOMAKE([foreign dist-bzip2 tar-ustar]) AM_MAINTAINER_MODE AC_SUBST([ACLOCAL_AMFLAGS], ["-I . \${ACLOCAL_FLAGS}"]) dnl pkg-config AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test "x$PKG_CONFIG" = "xno"; then AC_MSG_ERROR([You need to install pkg-config]) fi GNOME_DOC_INIT AC_DEFUN([SHAMROCK_EXPAND_LIBDIR], [ expanded_libdir=`( case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac eval echo $libdir )` AC_SUBST(expanded_libdir) ]) AC_DEFUN([SHAMROCK_EXPAND_BINDIR], [ expanded_bindir=`( case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac eval echo $bindir )` AC_SUBST(expanded_bindir) ]) AC_DEFUN([SHAMROCK_EXPAND_DATADIR], [ case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac expanded_datadir=`(eval echo $datadir)` expanded_datadir=`(eval echo $expanded_datadir)` AC_SUBST(expanded_datadir) ]) SHAMROCK_EXPAND_LIBDIR SHAMROCK_EXPAND_BINDIR SHAMROCK_EXPAND_DATADIR IT_PROG_INTLTOOL([0.35.0]) AC_PROG_INSTALL AC_PATH_PROG(MCS, gmcs, no) if test "x$MCS" = "xno"; then AC_MSG_ERROR([gmcs Not found]) fi AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Use 'DEBUG' Configuration [default=NO]]), enable_debug=yes, enable_debug=no) AM_CONDITIONAL(ENABLE_DEBUG, test x$enable_debug = xyes) if test "x$enable_debug" = "xyes" ; then CONFIG_REQUESTED="yes" fi AC_ARG_ENABLE(release, AC_HELP_STRING([--enable-release], [Use 'RELEASE' Configuration [default=YES]]), enable_release=yes, enable_release=no) AM_CONDITIONAL(ENABLE_RELEASE, test x$enable_release = xyes) if test "x$enable_release" = "xyes" ; then CONFIG_REQUESTED="yes" fi if test -z "$CONFIG_REQUESTED" ; then AM_CONDITIONAL(ENABLE_RELEASE, true) enable_release=yes fi dnl localisation GETTEXT_PACKAGE=pdfmod AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name]) AM_GLIB_GNU_GETTEXT dnl package checks, common for all configs PKG_CHECK_MODULES([GTK_SHARP_20], [gtk-sharp-2.0]) PKG_CHECK_MODULES([GLIB_SHARP_20], [glib-sharp-2.0]) PKG_CHECK_MODULES([GCONF_SHARP_20], [gconf-sharp-2.0]) dnl package checks, per config PKG_CHECK_MODULES(HYENA, hyena >= 0.5) HYENA_ASSEMBLIES="`$PKG_CONFIG --variable=Assemblies hyena`" HYENA_FILES="`$PKG_CONFIG --variable=Files hyena`" AC_SUBST(HYENA_ASSEMBLIES) AC_SUBST(HYENA_FILES) PKG_CHECK_MODULES(HYENA_GUI, hyena.gui >= 0.5) HYENA_GUI_ASSEMBLIES="`$PKG_CONFIG --variable=Assemblies hyena.gui`" HYENA_GUI_FILES="`$PKG_CONFIG --variable=Files hyena.gui`" AC_SUBST(HYENA_GUI_ASSEMBLIES) AC_SUBST(HYENA_GUI_FILES) dnl choose between bundled or system poppler-sharp AC_ARG_ENABLE([external-poppler-sharp], AC_HELP_STRING([--enable-external-poppler-sharp], [Enable using the external poppler-sharp. [[default=auto]]]),, enable_external_poppler_sharp=auto) if test "$enable_external_poppler_sharp" = "auto"; then PKG_CHECK_MODULES(POPPLER, poppler-sharp, enable_external_poppler_sharp=yes, enable_external_poppler_sharp=no) elif test "$enable_external_poppler_sharp" = "yes"; then PKG_CHECK_MODULES(POPPLER, poppler-sharp) fi if test "$enable_external_poppler_sharp" = "yes"; then POPPLER_ASSEMBLIES="`$PKG_CONFIG --variable=Libraries poppler-sharp`" AC_SUBST(POPPLER_ASSEMBLIES) fi AM_CONDITIONAL(USE_BUNDLED_POPPLER, test "$enable_external_poppler_sharp" = "no") BUNDLE_ASSEMBLIES="$HYENA_ASSEMBLIES $HYENA_GUI_ASSEMBLIES $POPPLER_ASSEMBLIES" BUNDLE_FILES="$HYENA_FILES $HYENA_GUI_FILES" AC_SUBST(BUNDLE_ASSEMBLIES) AC_SUBST(BUNDLE_FILES) dnl How to configure for distcheck DISTCHECK_CONFIGURE_FLAGS="" AC_SUBST(DISTCHECK_CONFIGURE_FLAGS) AC_CONFIG_FILES([ po/Makefile.in docs/Makefile data/Makefile data/pdfmod.desktop.in data/icons/Makefile lib/PdfSharp/Makefile lib/poppler-sharp/Makefile src/PdfMod/Core/Defines.cs src/pdfmod src/Makefile Makefile ]) AC_OUTPUT pdfmod-0.9.1/configure0000755000175000001440000101472211533760014015025 0ustar00gabeusers00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.63 for pdfmod 0.9.1. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell bug-autoconf@gnu.org about your system, echo including any error possibly output before this message. echo This can help us improve future autoconf versions. echo Configuration will now proceed without shell functions. } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='pdfmod' PACKAGE_TARNAME='pdfmod' PACKAGE_VERSION='0.9.1' PACKAGE_STRING='pdfmod 0.9.1' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS BUNDLE_FILES BUNDLE_ASSEMBLIES USE_BUNDLED_POPPLER_FALSE USE_BUNDLED_POPPLER_TRUE POPPLER_ASSEMBLIES POPPLER_LIBS POPPLER_CFLAGS HYENA_GUI_FILES HYENA_GUI_ASSEMBLIES HYENA_GUI_LIBS HYENA_GUI_CFLAGS HYENA_FILES HYENA_ASSEMBLIES HYENA_LIBS HYENA_CFLAGS GCONF_SHARP_20_LIBS GCONF_SHARP_20_CFLAGS GLIB_SHARP_20_LIBS GLIB_SHARP_20_CFLAGS GTK_SHARP_20_LIBS GTK_SHARP_20_CFLAGS POSUB POFILES PO_IN_DATADIR_FALSE PO_IN_DATADIR_TRUE INTLLIBS INSTOBJEXT GMOFILES CATOBJEXT CATALOGS MSGFMT_OPTS EGREP GREP CPP GETTEXT_PACKAGE ENABLE_RELEASE_FALSE ENABLE_RELEASE_TRUE ENABLE_DEBUG_FALSE ENABLE_DEBUG_TRUE MCS DATADIRNAME am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC ALL_LINGUAS INTLTOOL_PERL GMSGFMT MSGFMT MSGMERGE XGETTEXT INTLTOOL_POLICY_RULE INTLTOOL_SERVICE_RULE INTLTOOL_THEME_RULE INTLTOOL_SCHEMAS_RULE INTLTOOL_CAVES_RULE INTLTOOL_XML_NOMERGE_RULE INTLTOOL_XML_RULE INTLTOOL_KBD_RULE INTLTOOL_XAM_RULE INTLTOOL_UI_RULE INTLTOOL_SOUNDLIST_RULE INTLTOOL_SHEET_RULE INTLTOOL_SERVER_RULE INTLTOOL_PONG_RULE INTLTOOL_OAF_RULE INTLTOOL_PROP_RULE INTLTOOL_KEYS_RULE INTLTOOL_DIRECTORY_RULE INTLTOOL_DESKTOP_RULE INTLTOOL_EXTRACT INTLTOOL_MERGE INTLTOOL_UPDATE USE_NLS expanded_datadir expanded_bindir expanded_libdir HAVE_GNOME_DOC_UTILS_FALSE HAVE_GNOME_DOC_UTILS_TRUE DISTCHECK_CONFIGURE_FLAGS ENABLE_SK_FALSE ENABLE_SK_TRUE DOC_USER_FORMATS OMF_DIR HELP_DIR LN_S PKG_CONFIG ACLOCAL_AMFLAGS MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode with_help_dir with_omf_dir with_help_formats enable_scrollkeeper enable_nls enable_dependency_tracking enable_debug enable_release enable_external_poppler_sharp ' ac_precious_vars='build_alias host_alias target_alias PKG_CONFIG CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP GTK_SHARP_20_CFLAGS GTK_SHARP_20_LIBS GLIB_SHARP_20_CFLAGS GLIB_SHARP_20_LIBS GCONF_SHARP_20_CFLAGS GCONF_SHARP_20_LIBS HYENA_CFLAGS HYENA_LIBS HYENA_GUI_CFLAGS HYENA_GUI_LIBS POPPLER_CFLAGS POPPLER_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 { (exit 1); exit 1; }; } ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures pdfmod 0.9.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/pdfmod] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of pdfmod 0.9.1:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-scrollkeeper do not make updates to the scrollkeeper database --disable-nls do not use Native Language Support --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-debug Use 'DEBUG' Configuration default=NO --enable-release Use 'RELEASE' Configuration default=YES --enable-external-poppler-sharp Enable using the external poppler-sharp. [default=auto] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-help-dir=DIR path to help docs --with-omf-dir=DIR path to OMF files --with-help-formats=FORMATS list of formats Some influential environment variables: PKG_CONFIG path to pkg-config utility CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor GTK_SHARP_20_CFLAGS C compiler flags for GTK_SHARP_20, overriding pkg-config GTK_SHARP_20_LIBS linker flags for GTK_SHARP_20, overriding pkg-config GLIB_SHARP_20_CFLAGS C compiler flags for GLIB_SHARP_20, overriding pkg-config GLIB_SHARP_20_LIBS linker flags for GLIB_SHARP_20, overriding pkg-config GCONF_SHARP_20_CFLAGS C compiler flags for GCONF_SHARP_20, overriding pkg-config GCONF_SHARP_20_LIBS linker flags for GCONF_SHARP_20, overriding pkg-config HYENA_CFLAGS C compiler flags for HYENA, overriding pkg-config HYENA_LIBS linker flags for HYENA, overriding pkg-config HYENA_GUI_CFLAGS C compiler flags for HYENA_GUI, overriding pkg-config HYENA_GUI_LIBS linker flags for HYENA_GUI, overriding pkg-config POPPLER_CFLAGS C compiler flags for POPPLER, overriding pkg-config POPPLER_LIBS linker flags for POPPLER, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF pdfmod configure 0.9.1 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by pdfmod $as_me 0.9.1, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 $as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.10' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 $as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 $as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 $as_echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:$LINENO: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 $as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='pdfmod' VERSION='0.9.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} { $as_echo "$as_me:$LINENO: checking how to create a ustar tar archive" >&5 $as_echo_n "checking how to create a ustar tar archive... " >&6; } # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar plaintar pax cpio none' _am_tools=${am_cv_prog_tar_ustar-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x ustar -w "$$tardir"' am__tar_='pax -L -x ustar -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H ustar -L' am__tar_='find "$tardir" -print | cpio -o -H ustar -L' am__untar='cpio -i -H ustar -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_ustar}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if test "${am_cv_prog_tar_ustar+set}" = set; then $as_echo_n "(cached) " >&6 else am_cv_prog_tar_ustar=$_am_tool fi { $as_echo "$as_me:$LINENO: result: $am_cv_prog_tar_ustar" >&5 $as_echo "$am_cv_prog_tar_ustar" >&6; } { $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ACLOCAL_AMFLAGS="-I . \${ACLOCAL_FLAGS}" # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$PKG_CONFIG" = "xno"; then { { $as_echo "$as_me:$LINENO: error: You need to install pkg-config" >&5 $as_echo "$as_me: error: You need to install pkg-config" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi gdu_cv_version_required=0.3.2 { $as_echo "$as_me:$LINENO: checking gnome-doc-utils >= $gdu_cv_version_required" >&5 $as_echo_n "checking gnome-doc-utils >= $gdu_cv_version_required... " >&6; } if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gnome-doc-utils >= \$gdu_cv_version_required\"") >&5 ($PKG_CONFIG --exists --print-errors "gnome-doc-utils >= $gdu_cv_version_required") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then gdu_cv_have_gdu=yes else gdu_cv_have_gdu=no fi if test "$gdu_cv_have_gdu" = "yes"; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } : else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:$LINENO: error: gnome-doc-utils >= $gdu_cv_version_required not found" >&5 $as_echo "$as_me: error: gnome-doc-utils >= $gdu_cv_version_required not found" >&2;} { (exit 1); exit 1; }; } fi # Check whether --with-help-dir was given. if test "${with_help_dir+set}" = set; then withval=$with_help_dir; else with_help_dir='${datadir}/gnome/help' fi HELP_DIR="$with_help_dir" # Check whether --with-omf-dir was given. if test "${with_omf_dir+set}" = set; then withval=$with_omf_dir; else with_omf_dir='${datadir}/omf' fi OMF_DIR="$with_omf_dir" # Check whether --with-help-formats was given. if test "${with_help_formats+set}" = set; then withval=$with_help_formats; else with_help_formats='' fi DOC_USER_FORMATS="$with_help_formats" # Check whether --enable-scrollkeeper was given. if test "${enable_scrollkeeper+set}" = set; then enableval=$enable_scrollkeeper; else enable_scrollkeeper=yes fi if test "$gdu_cv_have_gdu" = "yes" -a "$enable_scrollkeeper" = "yes"; then ENABLE_SK_TRUE= ENABLE_SK_FALSE='#' else ENABLE_SK_TRUE='#' ENABLE_SK_FALSE= fi DISTCHECK_CONFIGURE_FLAGS="--disable-scrollkeeper $DISTCHECK_CONFIGURE_FLAGS" if test "$gdu_cv_have_gdu" = "yes"; then HAVE_GNOME_DOC_UTILS_TRUE= HAVE_GNOME_DOC_UTILS_FALSE='#' else HAVE_GNOME_DOC_UTILS_TRUE='#' HAVE_GNOME_DOC_UTILS_FALSE= fi expanded_libdir=`( case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac eval echo $libdir )` expanded_bindir=`( case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac eval echo $bindir )` case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac expanded_datadir=`(eval echo $datadir)` expanded_datadir=`(eval echo $expanded_datadir)` { $as_echo "$as_me:$LINENO: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { $as_echo "$as_me:$LINENO: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { $as_echo "$as_me:$LINENO: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 $as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi fi fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi case "$am__api_version" in 1.01234) { { $as_echo "$as_me:$LINENO: error: Automake 1.5 or newer is required to use intltool" >&5 $as_echo "$as_me: error: Automake 1.5 or newer is required to use intltool" >&2;} { (exit 1); exit 1; }; } ;; *) ;; esac if test -n "0.35.0"; then { $as_echo "$as_me:$LINENO: checking for intltool >= 0.35.0" >&5 $as_echo_n "checking for intltool >= 0.35.0... " >&6; } INTLTOOL_REQUIRED_VERSION_AS_INT=`echo 0.35.0 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` { $as_echo "$as_me:$LINENO: result: $INTLTOOL_APPLIED_VERSION found" >&5 $as_echo "$INTLTOOL_APPLIED_VERSION found" >&6; } test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || { { $as_echo "$as_me:$LINENO: error: Your intltool is too old. You need intltool 0.35.0 or later." >&5 $as_echo "$as_me: error: Your intltool is too old. You need intltool 0.35.0 or later." >&2;} { (exit 1); exit 1; }; } fi # Extract the first word of "intltool-update", so it can be a program name with args. set dummy intltool-update; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_INTLTOOL_UPDATE+set}" = set; then $as_echo_n "(cached) " >&6 else case $INTLTOOL_UPDATE in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_UPDATE="$INTLTOOL_UPDATE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_INTLTOOL_UPDATE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_UPDATE=$ac_cv_path_INTLTOOL_UPDATE if test -n "$INTLTOOL_UPDATE"; then { $as_echo "$as_me:$LINENO: result: $INTLTOOL_UPDATE" >&5 $as_echo "$INTLTOOL_UPDATE" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "intltool-merge", so it can be a program name with args. set dummy intltool-merge; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_INTLTOOL_MERGE+set}" = set; then $as_echo_n "(cached) " >&6 else case $INTLTOOL_MERGE in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_MERGE="$INTLTOOL_MERGE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_INTLTOOL_MERGE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_MERGE=$ac_cv_path_INTLTOOL_MERGE if test -n "$INTLTOOL_MERGE"; then { $as_echo "$as_me:$LINENO: result: $INTLTOOL_MERGE" >&5 $as_echo "$INTLTOOL_MERGE" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "intltool-extract", so it can be a program name with args. set dummy intltool-extract; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_INTLTOOL_EXTRACT+set}" = set; then $as_echo_n "(cached) " >&6 else case $INTLTOOL_EXTRACT in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_EXTRACT="$INTLTOOL_EXTRACT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_INTLTOOL_EXTRACT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_EXTRACT=$ac_cv_path_INTLTOOL_EXTRACT if test -n "$INTLTOOL_EXTRACT"; then { $as_echo "$as_me:$LINENO: result: $INTLTOOL_EXTRACT" >&5 $as_echo "$INTLTOOL_EXTRACT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then { { $as_echo "$as_me:$LINENO: error: The intltool scripts were not found. Please install intltool." >&5 $as_echo "$as_me: error: The intltool scripts were not found. Please install intltool." >&2;} { (exit 1); exit 1; }; } fi INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< $@' INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< $@' INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' # Check the gettext tools to make sure they are GNU # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then $as_echo_n "(cached) " >&6 else case $XGETTEXT in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XGETTEXT=$ac_cv_path_XGETTEXT if test -n "$XGETTEXT"; then { $as_echo "$as_me:$LINENO: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MSGMERGE+set}" = set; then $as_echo_n "(cached) " >&6 else case $MSGMERGE in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MSGMERGE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MSGMERGE=$ac_cv_path_MSGMERGE if test -n "$MSGMERGE"; then { $as_echo "$as_me:$LINENO: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then $as_echo_n "(cached) " >&6 else case $MSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MSGFMT=$ac_cv_path_MSGFMT if test -n "$MSGFMT"; then { $as_echo "$as_me:$LINENO: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:$LINENO: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then { { $as_echo "$as_me:$LINENO: error: GNU gettext tools not found; required for intltool" >&5 $as_echo "$as_me: error: GNU gettext tools not found; required for intltool" >&2;} { (exit 1); exit 1; }; } fi xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then { { $as_echo "$as_me:$LINENO: error: GNU gettext tools not found; required for intltool" >&5 $as_echo "$as_me: error: GNU gettext tools not found; required for intltool" >&2;} { (exit 1); exit 1; }; } fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_INTLTOOL_PERL+set}" = set; then $as_echo_n "(cached) " >&6 else case $INTLTOOL_PERL in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_PERL="$INTLTOOL_PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_INTLTOOL_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_PERL=$ac_cv_path_INTLTOOL_PERL if test -n "$INTLTOOL_PERL"; then { $as_echo "$as_me:$LINENO: result: $INTLTOOL_PERL" >&5 $as_echo "$INTLTOOL_PERL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$INTLTOOL_PERL"; then { { $as_echo "$as_me:$LINENO: error: perl not found; required for intltool" >&5 $as_echo "$as_me: error: perl not found; required for intltool" >&2;} { (exit 1); exit 1; }; } fi if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then { { $as_echo "$as_me:$LINENO: error: perl 5.x required for intltool" >&5 $as_echo "$as_me: error: perl 5.x required for intltool" >&2;} { (exit 1); exit 1; }; } fi if test "x" != "xno-xml"; then { $as_echo "$as_me:$LINENO: checking for XML::Parser" >&5 $as_echo_n "checking for XML::Parser... " >&6; } if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then { $as_echo "$as_me:$LINENO: result: ok" >&5 $as_echo "ok" >&6; } else { { $as_echo "$as_me:$LINENO: error: XML::Parser perl module is required for intltool" >&5 $as_echo "$as_me: error: XML::Parser perl module is required for intltool" >&2;} { (exit 1); exit 1; }; } fi fi # Substitute ALL_LINGUAS so we can use it in po/Makefile # Set DATADIRNAME correctly if it is not set yet # (copied from glib-gettext.m4) if test -z "$DATADIRNAME"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then DATADIRNAME=share else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 case $host in *-*-solaris*) { $as_echo "$as_me:$LINENO: checking for bind_textdomain_codeset" >&5 $as_echo_n "checking for bind_textdomain_codeset... " >&6; } if test "${ac_cv_func_bind_textdomain_codeset+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define bind_textdomain_codeset to an innocuous variant, in case declares bind_textdomain_codeset. For example, HP-UX 11i declares gettimeofday. */ #define bind_textdomain_codeset innocuous_bind_textdomain_codeset /* System header to define __stub macros and hopefully few prototypes, which can conflict with char bind_textdomain_codeset (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef bind_textdomain_codeset /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char bind_textdomain_codeset (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_bind_textdomain_codeset || defined __stub___bind_textdomain_codeset choke me #endif int main () { return bind_textdomain_codeset (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_bind_textdomain_codeset=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_bind_textdomain_codeset=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_bind_textdomain_codeset" >&5 $as_echo "$ac_cv_func_bind_textdomain_codeset" >&6; } if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then DATADIRNAME=share else DATADIRNAME=lib fi ;; *) DATADIRNAME=lib ;; esac fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "gmcs", so it can be a program name with args. set dummy gmcs; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MCS+set}" = set; then $as_echo_n "(cached) " >&6 else case $MCS in [\\/]* | ?:[\\/]*) ac_cv_path_MCS="$MCS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MCS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MCS" && ac_cv_path_MCS="no" ;; esac fi MCS=$ac_cv_path_MCS if test -n "$MCS"; then { $as_echo "$as_me:$LINENO: result: $MCS" >&5 $as_echo "$MCS" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$MCS" = "xno"; then { { $as_echo "$as_me:$LINENO: error: gmcs Not found" >&5 $as_echo "$as_me: error: gmcs Not found" >&2;} { (exit 1); exit 1; }; } fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then enableval=$enable_debug; enable_debug=yes else enable_debug=no fi if test x$enable_debug = xyes; then ENABLE_DEBUG_TRUE= ENABLE_DEBUG_FALSE='#' else ENABLE_DEBUG_TRUE='#' ENABLE_DEBUG_FALSE= fi if test "x$enable_debug" = "xyes" ; then CONFIG_REQUESTED="yes" fi # Check whether --enable-release was given. if test "${enable_release+set}" = set; then enableval=$enable_release; enable_release=yes else enable_release=no fi if test x$enable_release = xyes; then ENABLE_RELEASE_TRUE= ENABLE_RELEASE_FALSE='#' else ENABLE_RELEASE_TRUE='#' ENABLE_RELEASE_FALSE= fi if test "x$enable_release" = "xyes" ; then CONFIG_REQUESTED="yes" fi if test -z "$CONFIG_REQUESTED" ; then if true; then ENABLE_RELEASE_TRUE= ENABLE_RELEASE_FALSE='#' else ENABLE_RELEASE_TRUE='#' ENABLE_RELEASE_FALSE= fi enable_release=yes fi GETTEXT_PACKAGE=pdfmod cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE "$GETTEXT_PACKAGE" _ACEOF ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:$LINENO: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:$LINENO: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in locale.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test $ac_cv_header_locale_h = yes; then { $as_echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 $as_echo_n "checking for LC_MESSAGES... " >&6; } if test "${am_cv_val_LC_MESSAGES+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return LC_MESSAGES ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then am_cv_val_LC_MESSAGES=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_val_LC_MESSAGES=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 $as_echo "$am_cv_val_LC_MESSAGES" >&6; } if test $am_cv_val_LC_MESSAGES = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LC_MESSAGES 1 _ACEOF fi fi USE_NLS=yes gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= if test "${ac_cv_header_libintl_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for libintl.h" >&5 $as_echo_n "checking for libintl.h... " >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 $as_echo "$ac_cv_header_libintl_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking libintl.h usability" >&5 $as_echo_n "checking libintl.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking libintl.h presence" >&5 $as_echo_n "checking libintl.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for libintl.h" >&5 $as_echo_n "checking for libintl.h... " >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_libintl_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 $as_echo "$ac_cv_header_libintl_h" >&6; } fi if test "x$ac_cv_header_libintl_h" = x""yes; then gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" # # First check in libc # { $as_echo "$as_me:$LINENO: checking for ngettext in libc" >&5 $as_echo_n "checking for ngettext in libc... " >&6; } if test "${gt_cv_func_ngettext_libc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return !ngettext ("","", 1) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then gt_cv_func_ngettext_libc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_ngettext_libc=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $gt_cv_func_ngettext_libc" >&5 $as_echo "$gt_cv_func_ngettext_libc" >&6; } if test "$gt_cv_func_ngettext_libc" = "yes" ; then { $as_echo "$as_me:$LINENO: checking for dgettext in libc" >&5 $as_echo_n "checking for dgettext in libc... " >&6; } if test "${gt_cv_func_dgettext_libc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return !dgettext ("","") ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then gt_cv_func_dgettext_libc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_dgettext_libc=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $gt_cv_func_dgettext_libc" >&5 $as_echo "$gt_cv_func_dgettext_libc" >&6; } fi if test "$gt_cv_func_ngettext_libc" = "yes" ; then for ac_func in bind_textdomain_codeset do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi # # If we don't have everything we want, check in libintl # if test "$gt_cv_func_dgettext_libc" != "yes" \ || test "$gt_cv_func_ngettext_libc" != "yes" \ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then { $as_echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5 $as_echo_n "checking for bindtextdomain in -lintl... " >&6; } if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char bindtextdomain (); int main () { return bindtextdomain (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_intl_bindtextdomain=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_bindtextdomain=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5 $as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; } if test "x$ac_cv_lib_intl_bindtextdomain" = x""yes; then { $as_echo "$as_me:$LINENO: checking for ngettext in -lintl" >&5 $as_echo_n "checking for ngettext in -lintl... " >&6; } if test "${ac_cv_lib_intl_ngettext+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ngettext (); int main () { return ngettext (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_intl_ngettext=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_ngettext=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_ngettext" >&5 $as_echo "$ac_cv_lib_intl_ngettext" >&6; } if test "x$ac_cv_lib_intl_ngettext" = x""yes; then { $as_echo "$as_me:$LINENO: checking for dgettext in -lintl" >&5 $as_echo_n "checking for dgettext in -lintl... " >&6; } if test "${ac_cv_lib_intl_dgettext+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dgettext (); int main () { return dgettext (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_intl_dgettext=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_dgettext=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_dgettext" >&5 $as_echo "$ac_cv_lib_intl_dgettext" >&6; } if test "x$ac_cv_lib_intl_dgettext" = x""yes; then gt_cv_func_dgettext_libintl=yes fi fi fi if test "$gt_cv_func_dgettext_libintl" != "yes" ; then { $as_echo "$as_me:$LINENO: checking if -liconv is needed to use gettext" >&5 $as_echo_n "checking if -liconv is needed to use gettext... " >&6; } { $as_echo "$as_me:$LINENO: result: " >&5 $as_echo "" >&6; } { $as_echo "$as_me:$LINENO: checking for ngettext in -lintl" >&5 $as_echo_n "checking for ngettext in -lintl... " >&6; } if test "${ac_cv_lib_intl_ngettext+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ngettext (); int main () { return ngettext (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_intl_ngettext=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_ngettext=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_ngettext" >&5 $as_echo "$ac_cv_lib_intl_ngettext" >&6; } if test "x$ac_cv_lib_intl_ngettext" = x""yes; then { $as_echo "$as_me:$LINENO: checking for dcgettext in -lintl" >&5 $as_echo_n "checking for dcgettext in -lintl... " >&6; } if test "${ac_cv_lib_intl_dcgettext+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dcgettext (); int main () { return dcgettext (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_intl_dcgettext=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_dcgettext=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_dcgettext" >&5 $as_echo "$ac_cv_lib_intl_dcgettext" >&6; } if test "x$ac_cv_lib_intl_dcgettext" = x""yes; then gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv else : fi else : fi fi # # If we found libintl, then check in it for bind_textdomain_codeset(); # we'll prefer libc if neither have bind_textdomain_codeset(), # and both have dgettext and ngettext # if test "$gt_cv_func_dgettext_libintl" = "yes" ; then glib_save_LIBS="$LIBS" LIBS="$LIBS -lintl $libintl_extra_libs" unset ac_cv_func_bind_textdomain_codeset for ac_func in bind_textdomain_codeset do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done LIBS="$glib_save_LIBS" if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then gt_cv_func_dgettext_libc=no else if test "$gt_cv_func_dgettext_libc" = "yes" \ && test "$gt_cv_func_ngettext_libc" = "yes"; then gt_cv_func_dgettext_libintl=no fi fi fi fi if test "$gt_cv_func_dgettext_libc" = "yes" \ || test "$gt_cv_func_dgettext_libintl" = "yes"; then gt_cv_have_gettext=yes fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then INTLLIBS="-lintl $libintl_extra_libs" fi if test "$gt_cv_have_gettext" = "yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_GETTEXT 1 _ACEOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then $as_echo_n "(cached) " >&6 else case "$MSGFMT" in /*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then ac_cv_path_MSGFMT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != "no"; then { $as_echo "$as_me:$LINENO: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "$MSGFMT" != "no"; then glib_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" for ac_func in dcgettext do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done MSGFMT_OPTS= { $as_echo "$as_me:$LINENO: checking if msgfmt accepts -c" >&5 $as_echo_n "checking if msgfmt accepts -c... " >&6; } cat >conftest.foo <<_ACEOF msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: test 1.0\n" "PO-Revision-Date: 2007-02-15 12:01+0100\n" "Last-Translator: test \n" "Language-Team: C \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" _ACEOF if { ($as_echo "$as_me:$LINENO: \$MSGFMT -c -o /dev/null conftest.foo") >&5 ($MSGFMT -c -o /dev/null conftest.foo) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then MSGFMT_OPTS=-c; { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } echo "$as_me: failed input was:" >&5 sed 's/^/| /' conftest.foo >&5 fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:$LINENO: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in /*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then ac_cv_path_XGETTEXT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:$LINENO: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then CATOBJEXT=.gmo DATADIRNAME=share else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 case $host in *-*-solaris*) { $as_echo "$as_me:$LINENO: checking for bind_textdomain_codeset" >&5 $as_echo_n "checking for bind_textdomain_codeset... " >&6; } if test "${ac_cv_func_bind_textdomain_codeset+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define bind_textdomain_codeset to an innocuous variant, in case declares bind_textdomain_codeset. For example, HP-UX 11i declares gettimeofday. */ #define bind_textdomain_codeset innocuous_bind_textdomain_codeset /* System header to define __stub macros and hopefully few prototypes, which can conflict with char bind_textdomain_codeset (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef bind_textdomain_codeset /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char bind_textdomain_codeset (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_bind_textdomain_codeset || defined __stub___bind_textdomain_codeset choke me #endif int main () { return bind_textdomain_codeset (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_bind_textdomain_codeset=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_bind_textdomain_codeset=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_bind_textdomain_codeset" >&5 $as_echo "$ac_cv_func_bind_textdomain_codeset" >&6; } if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then CATOBJEXT=.gmo DATADIRNAME=share else CATOBJEXT=.mo DATADIRNAME=lib fi ;; *) CATOBJEXT=.mo DATADIRNAME=lib ;; esac fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$glib_save_LIBS" INSTOBJEXT=.mo else gt_cv_have_gettext=no fi fi fi if test "$gt_cv_have_gettext" = "yes" ; then cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else { $as_echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 $as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po ac_config_commands="$ac_config_commands default-1" for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done if test "$gt_cv_have_gettext" = "yes"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else { $as_echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 $as_echo_n "checking for catalogs to be installed... " >&6; } NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS { $as_echo "$as_me:$LINENO: result: $LINGUAS" >&5 $as_echo "$LINGUAS" >&6; } fi if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES pkg_failed=no { $as_echo "$as_me:$LINENO: checking for GTK_SHARP_20" >&5 $as_echo_n "checking for GTK_SHARP_20... " >&6; } if test -n "$GTK_SHARP_20_CFLAGS"; then pkg_cv_GTK_SHARP_20_CFLAGS="$GTK_SHARP_20_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk-sharp-2.0\"") >&5 ($PKG_CONFIG --exists --print-errors "gtk-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_GTK_SHARP_20_CFLAGS=`$PKG_CONFIG --cflags "gtk-sharp-2.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTK_SHARP_20_LIBS"; then pkg_cv_GTK_SHARP_20_LIBS="$GTK_SHARP_20_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk-sharp-2.0\"") >&5 ($PKG_CONFIG --exists --print-errors "gtk-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_GTK_SHARP_20_LIBS=`$PKG_CONFIG --libs "gtk-sharp-2.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTK_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gtk-sharp-2.0" 2>&1` else GTK_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --print-errors "gtk-sharp-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTK_SHARP_20_PKG_ERRORS" >&5 { { $as_echo "$as_me:$LINENO: error: Package requirements (gtk-sharp-2.0) were not met: $GTK_SHARP_20_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GTK_SHARP_20_CFLAGS and GTK_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 $as_echo "$as_me: error: Package requirements (gtk-sharp-2.0) were not met: $GTK_SHARP_20_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GTK_SHARP_20_CFLAGS and GTK_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GTK_SHARP_20_CFLAGS and GTK_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&5 $as_echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GTK_SHARP_20_CFLAGS and GTK_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } else GTK_SHARP_20_CFLAGS=$pkg_cv_GTK_SHARP_20_CFLAGS GTK_SHARP_20_LIBS=$pkg_cv_GTK_SHARP_20_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } : fi pkg_failed=no { $as_echo "$as_me:$LINENO: checking for GLIB_SHARP_20" >&5 $as_echo_n "checking for GLIB_SHARP_20... " >&6; } if test -n "$GLIB_SHARP_20_CFLAGS"; then pkg_cv_GLIB_SHARP_20_CFLAGS="$GLIB_SHARP_20_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"glib-sharp-2.0\"") >&5 ($PKG_CONFIG --exists --print-errors "glib-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_GLIB_SHARP_20_CFLAGS=`$PKG_CONFIG --cflags "glib-sharp-2.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLIB_SHARP_20_LIBS"; then pkg_cv_GLIB_SHARP_20_LIBS="$GLIB_SHARP_20_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"glib-sharp-2.0\"") >&5 ($PKG_CONFIG --exists --print-errors "glib-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_GLIB_SHARP_20_LIBS=`$PKG_CONFIG --libs "glib-sharp-2.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-sharp-2.0" 2>&1` else GLIB_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-sharp-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_SHARP_20_PKG_ERRORS" >&5 { { $as_echo "$as_me:$LINENO: error: Package requirements (glib-sharp-2.0) were not met: $GLIB_SHARP_20_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_SHARP_20_CFLAGS and GLIB_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 $as_echo "$as_me: error: Package requirements (glib-sharp-2.0) were not met: $GLIB_SHARP_20_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_SHARP_20_CFLAGS and GLIB_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GLIB_SHARP_20_CFLAGS and GLIB_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&5 $as_echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GLIB_SHARP_20_CFLAGS and GLIB_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } else GLIB_SHARP_20_CFLAGS=$pkg_cv_GLIB_SHARP_20_CFLAGS GLIB_SHARP_20_LIBS=$pkg_cv_GLIB_SHARP_20_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } : fi pkg_failed=no { $as_echo "$as_me:$LINENO: checking for GCONF_SHARP_20" >&5 $as_echo_n "checking for GCONF_SHARP_20... " >&6; } if test -n "$GCONF_SHARP_20_CFLAGS"; then pkg_cv_GCONF_SHARP_20_CFLAGS="$GCONF_SHARP_20_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gconf-sharp-2.0\"") >&5 ($PKG_CONFIG --exists --print-errors "gconf-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_GCONF_SHARP_20_CFLAGS=`$PKG_CONFIG --cflags "gconf-sharp-2.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GCONF_SHARP_20_LIBS"; then pkg_cv_GCONF_SHARP_20_LIBS="$GCONF_SHARP_20_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gconf-sharp-2.0\"") >&5 ($PKG_CONFIG --exists --print-errors "gconf-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_GCONF_SHARP_20_LIBS=`$PKG_CONFIG --libs "gconf-sharp-2.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GCONF_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gconf-sharp-2.0" 2>&1` else GCONF_SHARP_20_PKG_ERRORS=`$PKG_CONFIG --print-errors "gconf-sharp-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GCONF_SHARP_20_PKG_ERRORS" >&5 { { $as_echo "$as_me:$LINENO: error: Package requirements (gconf-sharp-2.0) were not met: $GCONF_SHARP_20_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GCONF_SHARP_20_CFLAGS and GCONF_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 $as_echo "$as_me: error: Package requirements (gconf-sharp-2.0) were not met: $GCONF_SHARP_20_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GCONF_SHARP_20_CFLAGS and GCONF_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GCONF_SHARP_20_CFLAGS and GCONF_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&5 $as_echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GCONF_SHARP_20_CFLAGS and GCONF_SHARP_20_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } else GCONF_SHARP_20_CFLAGS=$pkg_cv_GCONF_SHARP_20_CFLAGS GCONF_SHARP_20_LIBS=$pkg_cv_GCONF_SHARP_20_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } : fi pkg_failed=no { $as_echo "$as_me:$LINENO: checking for HYENA" >&5 $as_echo_n "checking for HYENA... " >&6; } if test -n "$HYENA_CFLAGS"; then pkg_cv_HYENA_CFLAGS="$HYENA_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"hyena >= 0.5\"") >&5 ($PKG_CONFIG --exists --print-errors "hyena >= 0.5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_HYENA_CFLAGS=`$PKG_CONFIG --cflags "hyena >= 0.5" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$HYENA_LIBS"; then pkg_cv_HYENA_LIBS="$HYENA_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"hyena >= 0.5\"") >&5 ($PKG_CONFIG --exists --print-errors "hyena >= 0.5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_HYENA_LIBS=`$PKG_CONFIG --libs "hyena >= 0.5" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then HYENA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "hyena >= 0.5" 2>&1` else HYENA_PKG_ERRORS=`$PKG_CONFIG --print-errors "hyena >= 0.5" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$HYENA_PKG_ERRORS" >&5 { { $as_echo "$as_me:$LINENO: error: Package requirements (hyena >= 0.5) were not met: $HYENA_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables HYENA_CFLAGS and HYENA_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 $as_echo "$as_me: error: Package requirements (hyena >= 0.5) were not met: $HYENA_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables HYENA_CFLAGS and HYENA_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables HYENA_CFLAGS and HYENA_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&5 $as_echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables HYENA_CFLAGS and HYENA_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } else HYENA_CFLAGS=$pkg_cv_HYENA_CFLAGS HYENA_LIBS=$pkg_cv_HYENA_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } : fi HYENA_ASSEMBLIES="`$PKG_CONFIG --variable=Assemblies hyena`" HYENA_FILES="`$PKG_CONFIG --variable=Files hyena`" pkg_failed=no { $as_echo "$as_me:$LINENO: checking for HYENA_GUI" >&5 $as_echo_n "checking for HYENA_GUI... " >&6; } if test -n "$HYENA_GUI_CFLAGS"; then pkg_cv_HYENA_GUI_CFLAGS="$HYENA_GUI_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"hyena.gui >= 0.5\"") >&5 ($PKG_CONFIG --exists --print-errors "hyena.gui >= 0.5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_HYENA_GUI_CFLAGS=`$PKG_CONFIG --cflags "hyena.gui >= 0.5" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$HYENA_GUI_LIBS"; then pkg_cv_HYENA_GUI_LIBS="$HYENA_GUI_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"hyena.gui >= 0.5\"") >&5 ($PKG_CONFIG --exists --print-errors "hyena.gui >= 0.5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_HYENA_GUI_LIBS=`$PKG_CONFIG --libs "hyena.gui >= 0.5" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then HYENA_GUI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "hyena.gui >= 0.5" 2>&1` else HYENA_GUI_PKG_ERRORS=`$PKG_CONFIG --print-errors "hyena.gui >= 0.5" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$HYENA_GUI_PKG_ERRORS" >&5 { { $as_echo "$as_me:$LINENO: error: Package requirements (hyena.gui >= 0.5) were not met: $HYENA_GUI_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables HYENA_GUI_CFLAGS and HYENA_GUI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 $as_echo "$as_me: error: Package requirements (hyena.gui >= 0.5) were not met: $HYENA_GUI_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables HYENA_GUI_CFLAGS and HYENA_GUI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables HYENA_GUI_CFLAGS and HYENA_GUI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&5 $as_echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables HYENA_GUI_CFLAGS and HYENA_GUI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } else HYENA_GUI_CFLAGS=$pkg_cv_HYENA_GUI_CFLAGS HYENA_GUI_LIBS=$pkg_cv_HYENA_GUI_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } : fi HYENA_GUI_ASSEMBLIES="`$PKG_CONFIG --variable=Assemblies hyena.gui`" HYENA_GUI_FILES="`$PKG_CONFIG --variable=Files hyena.gui`" # Check whether --enable-external-poppler-sharp was given. if test "${enable_external_poppler_sharp+set}" = set; then enableval=$enable_external_poppler_sharp; else enable_external_poppler_sharp=auto fi if test "$enable_external_poppler_sharp" = "auto"; then pkg_failed=no { $as_echo "$as_me:$LINENO: checking for POPPLER" >&5 $as_echo_n "checking for POPPLER... " >&6; } if test -n "$POPPLER_CFLAGS"; then pkg_cv_POPPLER_CFLAGS="$POPPLER_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"poppler-sharp\"") >&5 ($PKG_CONFIG --exists --print-errors "poppler-sharp") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_POPPLER_CFLAGS=`$PKG_CONFIG --cflags "poppler-sharp" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$POPPLER_LIBS"; then pkg_cv_POPPLER_LIBS="$POPPLER_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"poppler-sharp\"") >&5 ($PKG_CONFIG --exists --print-errors "poppler-sharp") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_POPPLER_LIBS=`$PKG_CONFIG --libs "poppler-sharp" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then POPPLER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "poppler-sharp" 2>&1` else POPPLER_PKG_ERRORS=`$PKG_CONFIG --print-errors "poppler-sharp" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$POPPLER_PKG_ERRORS" >&5 { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } enable_external_poppler_sharp=no elif test $pkg_failed = untried; then enable_external_poppler_sharp=no else POPPLER_CFLAGS=$pkg_cv_POPPLER_CFLAGS POPPLER_LIBS=$pkg_cv_POPPLER_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } enable_external_poppler_sharp=yes fi elif test "$enable_external_poppler_sharp" = "yes"; then pkg_failed=no { $as_echo "$as_me:$LINENO: checking for POPPLER" >&5 $as_echo_n "checking for POPPLER... " >&6; } if test -n "$POPPLER_CFLAGS"; then pkg_cv_POPPLER_CFLAGS="$POPPLER_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"poppler-sharp\"") >&5 ($PKG_CONFIG --exists --print-errors "poppler-sharp") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_POPPLER_CFLAGS=`$PKG_CONFIG --cflags "poppler-sharp" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$POPPLER_LIBS"; then pkg_cv_POPPLER_LIBS="$POPPLER_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"poppler-sharp\"") >&5 ($PKG_CONFIG --exists --print-errors "poppler-sharp") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_POPPLER_LIBS=`$PKG_CONFIG --libs "poppler-sharp" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then POPPLER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "poppler-sharp" 2>&1` else POPPLER_PKG_ERRORS=`$PKG_CONFIG --print-errors "poppler-sharp" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$POPPLER_PKG_ERRORS" >&5 { { $as_echo "$as_me:$LINENO: error: Package requirements (poppler-sharp) were not met: $POPPLER_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables POPPLER_CFLAGS and POPPLER_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 $as_echo "$as_me: error: Package requirements (poppler-sharp) were not met: $POPPLER_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables POPPLER_CFLAGS and POPPLER_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables POPPLER_CFLAGS and POPPLER_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&5 $as_echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables POPPLER_CFLAGS and POPPLER_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } else POPPLER_CFLAGS=$pkg_cv_POPPLER_CFLAGS POPPLER_LIBS=$pkg_cv_POPPLER_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } : fi fi if test "$enable_external_poppler_sharp" = "yes"; then POPPLER_ASSEMBLIES="`$PKG_CONFIG --variable=Libraries poppler-sharp`" fi if test "$enable_external_poppler_sharp" = "no"; then USE_BUNDLED_POPPLER_TRUE= USE_BUNDLED_POPPLER_FALSE='#' else USE_BUNDLED_POPPLER_TRUE='#' USE_BUNDLED_POPPLER_FALSE= fi BUNDLE_ASSEMBLIES="$HYENA_ASSEMBLIES $HYENA_GUI_ASSEMBLIES $POPPLER_ASSEMBLIES" BUNDLE_FILES="$HYENA_FILES $HYENA_GUI_FILES" DISTCHECK_CONFIGURE_FLAGS="" ac_config_files="$ac_config_files po/Makefile.in docs/Makefile data/Makefile data/pdfmod.desktop.in data/icons/Makefile lib/PdfSharp/Makefile lib/poppler-sharp/Makefile src/PdfMod/Core/Defines.cs src/pdfmod src/Makefile Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_SK_TRUE}" && test -z "${ENABLE_SK_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_SK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"ENABLE_SK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_GNOME_DOC_UTILS_TRUE}" && test -z "${HAVE_GNOME_DOC_UTILS_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_GNOME_DOC_UTILS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_GNOME_DOC_UTILS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi ac_config_commands="$ac_config_commands po/stamp-it" if test -z "${ENABLE_DEBUG_TRUE}" && test -z "${ENABLE_DEBUG_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"ENABLE_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_RELEASE_TRUE}" && test -z "${ENABLE_RELEASE_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_RELEASE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"ENABLE_RELEASE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_RELEASE_TRUE}" && test -z "${ENABLE_RELEASE_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_RELEASE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"ENABLE_RELEASE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_BUNDLED_POPPLER_TRUE}" && test -z "${USE_BUNDLED_POPPLER_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"USE_BUNDLED_POPPLER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"USE_BUNDLED_POPPLER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by pdfmod $as_me 0.9.1, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ pdfmod config.status 0.9.1 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; "data/pdfmod.desktop.in") CONFIG_FILES="$CONFIG_FILES data/pdfmod.desktop.in" ;; "data/icons/Makefile") CONFIG_FILES="$CONFIG_FILES data/icons/Makefile" ;; "lib/PdfSharp/Makefile") CONFIG_FILES="$CONFIG_FILES lib/PdfSharp/Makefile" ;; "lib/poppler-sharp/Makefile") CONFIG_FILES="$CONFIG_FILES lib/poppler-sharp/Makefile" ;; "src/PdfMod/Core/Defines.cs") CONFIG_FILES="$CONFIG_FILES src/PdfMod/Core/Defines.cs" ;; "src/pdfmod") CONFIG_FILES="$CONFIG_FILES src/pdfmod" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=' ' ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\).*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\).*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; "default-1":C) case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac ;; "po/stamp-it":C) if ! grep "^# INTLTOOL_MAKEFILE$" "po/Makefile.in" ; then { { $as_echo "$as_me:$LINENO: error: po/Makefile.in.in was not created by intltoolize." >&5 $as_echo "$as_me: error: po/Makefile.in.in was not created by intltoolize." >&2;} { (exit 1); exit 1; }; } fi rm -f "po/stamp-it" "po/stamp-it.tmp" "po/POTFILES" "po/Makefile.tmp" >"po/stamp-it.tmp" sed '/^#/d s/^[[].*] *// /^[ ]*$/d '"s|^| $ac_top_srcdir/|" \ "$srcdir/po/POTFILES.in" | sed '$!s/$/ \\/' >"po/POTFILES" sed '/^POTFILES =/,/[^\\]$/ { /^POTFILES =/!d r po/POTFILES } ' "po/Makefile.in" >"po/Makefile" rm -f "po/Makefile.tmp" mv "po/stamp-it.tmp" "po/stamp-it" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi pdfmod-0.9.1/intltool-extract.in0000644000175000001440000000000011453151740016742 0ustar00gabeusers00000000000000pdfmod-0.9.1/HACKING0000644000175000001440000000012711261513367014103 0ustar00gabeusers00000000000000See Banshee's coding style guideline: http://git.gnome.org/cgit/banshee/plain/HACKING pdfmod-0.9.1/COPYING0000644000175000001440000004310311261513367014150 0ustar00gabeusers00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. pdfmod-0.9.1/NEWS0000644000175000001440000001672611533757667013646 0ustar00gabeusers00000000000000=========================== Version 0.9.1 - Mar 3, 2011 =========================== Contributors: Gabriel Burt, Robson Roberto Souza Peixoto, Thomas Klausner Enhancements: * Make removing many pages much faster (bgo#630012) Bugs Fixed: * Fix being able to load files with : in their path (bgo#631456) * Fix build on Mono 2.8 * Don't crash if unable to save (bgo#633125) * Fix poppler-sharp.dll.config for NetBSD (bgo#638852) * Fix scrolling the view while dragging * Don't crash if Outlines point to null (bgo#642379) * Fix issue with saving landscape pages (bgo#597215) * Fix crash on page click due to ExportImagesAction (bgo#631889) * Fix crash if Catalog.Outlines is PdfNull (bgo#633123) Translators: Andrej Žnidaršič, Aron Xu, Bruno Brouard, Carles Ferrando, Daniel Butum, Daniel Nylander, Dean Lee, Gabor Kelemen, Gabor Kelemen, Gyorgy Ballo, Jorge González, Kjartan Maraas, Marek Černocký, Mario Blättermann, Matej Urbančič, Mateus Zenaide, Mattias Põldaru, Takeshi AIHANA ============================= Version 0.9.0 - Sept 28, 2010 ============================= Contributors: Chow Loong Jin, Gabriel Burt, Łukasz Jernaś Enhancements: * Bookmarks support (bgo#627747) Can add, edit, and remove bookmarks (aka outlines). * Make Export Images a page action It acts on the selected pages (like extract page and rotate do). It now displays the number of images that will be exported, and is insensitive if none can be exported (bgo#594457) * Add zoom slider/buttons in bottom-right (bgo#614378, bgo#628437) * Allow compiling with external poppler-sharp Bugs Fixed: * Fix double-width page icon rendering (bgo#590744) * Make SaveAs not require unsaved changes (bgo#628449) * Fix crash with export images by escaping output path * Better handling of files dropped from nautilus * Avoid XDG-related crash in file chooser (bgo#619073) * Mark missing string as translatable (bgo#618596) * Escape directory and filenames properly before making them (bgo#606432) * Fix page tooltip logic Translators: Andrej Žnidaršič, Aron Xu, Bruno Brouard, Claude Paroz, Daniel Nylander, Fran Diéguez, Jorge González, Łukasz Jernaś, Marek Černocký, Mario Blättermann, Matej Urbančič, Mattias Põldaru, Petr Kovar, Priit Laes, Takeshi AIHANA, Wouter Bolsterlee, YunQiang Su =========================== Version 0.8.3 - May 6, 2010 =========================== Release 0.8.2 should have required hyena 0.3; fixed =========================== Version 0.8.2 - May 6, 2010 =========================== Contributors: Gabriel Burt, Robert Dyer Enhancements: * Use the stock Dnd icons instead of thumbnails * Add Documents and Download dirs to the shortcuts list in chooser dialogs Bugs Fixed: * Fix a crash when the default RegionInfo is null (bgo#596912) * Catch exceptions when inserting doc (bgo#614009) * Raise Document.Changed after Save so '*' in Title goes away * Fix issue with remembering last directory Translators: Andrej Žnidaršič, Jorge González, Marek Černocký, Mario Blättermann ============================ Version 0.8.1 - Mar 24, 2010 ============================ Contributors: Bertrand Lorentz, Gabriel Burt Features: * Remove gnome-sharp dep Bugs Fixed: * Fix InvalidCastException crash when opening some documents New Translations: Galician, Norwegian bokmål, Simplified Chinese, Slovenian Translators: Andrej Žnidaršič, Aron Xu, Fran Diéguez, Kjartan Maraas, Matej Urbančič ========================== Version 0.8 - Nov 11, 2009 ========================== Contributors: Robert Dyer, Andreu Correa Casablanca, Bertrand Lorentz, Gabriel Burt Features: * Add * to beginning of window title when unsaved * Can select more than one file in Open dialog * shift-ctrl-z now also works for Redo * Online docs now hosted on library.gnome.org * Add Invert Selection action Bugs Fixed: * Launching with relative filepaths in args work New Translations: Bengali, Czech, Japanese, Russian Translators: Alexandre Prokoudine, Daniel Nylander, Jorge González, Kris Thomsen, Łukasz Jernaś, Marek Černocký, Mario Blättermann, Og B. Maciel, Petr Kovar, Runa Bhattacharjee, Sankarshan Mukhopadhyay, Takeshi AIHANA ========================== Version 0.7 - Sept 9, 2009 ========================== Contributors: Romain Tartière, Bertrand Lorentz, Robert Dyer, Andreu Correa Casablanca, Gabriel Burt Features: * View Fullscreen option * User docs translated into ca Bugs Fixed: * Build fixes for *bsd * Update recent files list after opening a document * libdir expansion issue fixed in Hyena, depend on 0.2 Translators: Andreu Correa Casablanca, Filipe Gomes, Daniel Nylander ========================== Version 0.6 - Aug 18, 2009 ========================== Contributors: Łukasz Jernaś, Sandy Armstrong, Igor Vatavuk, Bertrand Lorentz, Gabriel Burt Features: * Open in Viewer action that launches the default app * Remembers last folder a doc was opened from * Remembers if the toolbar was hidden * Remember accelerator customizations Bugs Fixed: * Uses the XDG cache dir for storing tmp files * Does a better job of cleaning up tmp files * Fix bug with installing to custom prefix * Fix some zoom inconsistencies * Got rid of bundled binaries; Hyena from http://git.gnome.org/cgit/hyena is build dep ========================= Version 0.5 - Aug 7, 2009 ========================= Contributors: Bertrand Lorentz, Michael McKinley, Gabriel Burt Features: * Password-protected PDFs can be opened * Page labels shown in tooltip, eg A-10, or iii * Undo/redo have descriptions, eg "Undo Move 5 Pages" Bugs Fixed: * Loading document doesn't block GUI thread * Desktop file validates * Process name set to pdfmod * Parallel make (-jN) works * make distcheck passes * icon-theme-installer included in tarball ========================= Version 0.4 - Aug 4, 2009 ========================= PDF Mod is now fully hosted on GNOME infrastructure, including bugzilla, mailing list, IRC, release tarballs, and wiki. See http://live.gnome.org/PdfMod for more information. Contributors: Julien Rebetez, Igor Vatavuk, Gabriel Burt Features: * Insert external documents via menu/toolbar * Drag pages between open documents * Export images (jpg/png) working * Beautiful new icon from Kalle Persson * UI translated into 10 languages: da de es fr hr lt pl pt_BR sv ta * User docs translated into 5 langauges: de es hr pl sv Bugs Fixed: * No longer jumps to top on zoom or delete * Error messages are shown to user in popup * Scroll when dragging near the top or bottom * Clicking on select matching button works ========================== Version 0.3 - Jul 28, 2009 ========================== Contributors: Sandy Armstrong, Aaron Bockover, Olivier Le Thanh Duong, Gabriel Burt Features: * Convenience keybindings for zoom/quit * Open document by dragging from nautilus * Insert external PDF into current doc by dragging from nautilus * Properties (title, author, etc) editor * Recent Documents menu * User guide (F1) * French translation Bugs Fixed: * Opening files with spaces in the filename fixed * Page background rendering glitch fixed * Reordering and undo bug fixed * Reordering now only allows dropping left/right of a page * Desktop file now has pdf mimetype * Dispose some cairo contexts we were missing ========================== Version 0.2 - Jul 24, 2009 ========================== Contributors: Gabriel Burt Bugs Fixed: * Fix not-installed .desktop file ========================== Version 0.1 - Jul 24, 2009 ========================== Contributors: Gabriel Burt * Initial release * Support for removing, rotating, moving, and extracting pages pdfmod-0.9.1/docs/0000777000175000001440000000000011533760020014040 5ustar00gabeusers00000000000000pdfmod-0.9.1/docs/da/0000777000175000001440000000000011533760021014425 5ustar00gabeusers00000000000000pdfmod-0.9.1/docs/da/pdfmod.xml0000644000175000001440000001533411533760020016421 0ustar00gabeusers00000000000000 Manualen til PDF Moderator Dette er brugermanualen til PDF Mod, et enkelt værktøj til manipulering af PDF-dokumenter. Hurtig, nem PDF-redigering 2009 Novell, Inc. 2010Joe Hansen GNOME-dokumentationsprojektet Gabriel Burt Novell, Inc. 0.2 29-07-2009 0.1 25-07-2009 Indledning PDF Moderator er et enkelt værktøj til grundlæggende manipulering af PDF-dokumenter. Med dette værktøj kan du rotere, fjerne eller udtrække sider i et PDF-dokument. Du kan også tilføje sider fra et andet dokument. Du kan starte PDF Moderator fra din programmenu eller programstarter, eller ved at højreklikke på et eller flere PDF-dokumenter i filbrowseren, og vælge at åbne med PDF Moderator. Som med et normalt program der bruges til redigering, skal du gemme ændringerne, du foretager med PDF Moderator. Hvis du ønsker at gemme det oprindelige dokument og gemme dine ændringer i en ny fil så brug Gem som. Brug Åbning af et dokument For at åbne et dokument i PDF Moderator: Vælg FilÅbn og vælg dit dokument, eller Tryk CtrlO og vælg dit dokument, eller Træk et PDF-dokument fra dit skrivebord eller filbrowser til et vindue i PDF Moderator som ikke allerede har et dokument indlæst, eller Vælg et dokument fra FilSeneste dokumenter. Zoom Du kan zoome for at gøre miniaturebillederne for siderne større eller mindre. PDF Moderator starter i tilstanden bedste tilpasning, hvor programmet forsøger at gøre alle sider synlige på en gang. Du kan zoome ind og ud med indstillingerne under Vis, eller ved at trykke på Ctrl og bevæge din mus' rullehjul. Egenskaber for visning og redigering Du kan vise og redigere titel, forfatter, nøgleord og emne i dokumentet ved at åbne egenskaberne. For at gøre dette vælges FilEgenskaber, tryk AltRetur, eller klik på knappen for egenskaber på værktøjslinjen. Vælge sider PDF Moderator kan automatisk vælge alle sider, sider med lige numre, sider med ulige numre eller sider som indeholder en søgeterm. Disse indstillinger er tilgængelige under Rediger. Du kan vælge sider manuelt ved at bruge tastaturet og musen. Brug Ctrl eller Skift for at vælge mere end en side. Flytte sider For at flytte (det vil sige omorganisere) den valgte side eller sider, trækkes de til den nye placering i dokumentet. Alle redigeringshandlinger med undtagelse af fjernelse af sider kan fortrydes ved at vælge RedigerFortryd eller ved at trykke CtrlZ. Udtræk af sider Udtræk af den valgte side eller sider vil åbne et nyt vindue for PDF Moderator med kun de valgte sider i et nyt dokument, klar til yderligere redigering eller gemning. For at udtrække den valgte side eller sider, vælg RedigerUdtræk side. Alle redigerings- og markeringshandlingerne der er tilgængelige under Rediger er også tilgængelige ved at højreklikke på en side. Nogle handlinger er også tilgængelige på værktøjslinjen. Rotere sider For at rotere den valgte side eller sider vælges RedigerRoter side eller tryk [ for at rotere til venstre (mod uret) og ] for at rotere til højre (med uret). Fjerne sider For at fjerne den valgte side eller sider, tryk Slet eller vælg RedigerFjern side. Det er i øjeblikket ikke muligt at fortryde denne handling via RedigerFortryd. Du kan lukke dokumentet uden at gemme og åbne det igen for at få din side tilbage; du vil dog miste alle andre ændringer, du har foretaget. Gemme Efter at du har lavet ændringer til dokumentet, er der to måder du kan gemme dit arbejde. Du kan overskrive det oprindelige dokument ved at vælge FilGem, eller du kan gemme dine ændringer til en ny fil ved at vælge FilGem som. pdfmod-0.9.1/docs/da/da.po0000644000175000001440000003036711533760021015356 0ustar00gabeusers00000000000000# Danish translation for pdfmod. # Copyright (C) 2010 pdfmod's COPYRIGHT HOLDER # This file is distributed under the same license as the pdfmod package. # Joe Hansen , 2010. # msgid "" msgstr "" "Project-Id-Version: pdfmod master\n" "POT-Creation-Date: 2010-07-24 14:19+0200\n" "PO-Revision-Date: 2010-07-22 18:29+0200\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../C/pdfmod.xml:6(title) msgid "The PDF Mod Manual" msgstr "Manualen til PDF Moderator" #: ../C/pdfmod.xml:8(para) msgid "" "This is the user's manual for PDF Mod, a simple tool for manipulating PDF " "documents." msgstr "" "Dette er brugermanualen til PDF Mod, et enkelt værktøj til manipulering af " "PDF-dokumenter." #: ../C/pdfmod.xml:10(subtitle) msgid "Quick, Easy PDF Modification" msgstr "Hurtig, nem PDF-redigering" #: ../C/pdfmod.xml:12(year) msgid "2009" msgstr "2009" #: ../C/pdfmod.xml:13(holder) ../C/pdfmod.xml:23(orgname) msgid "Novell, Inc." msgstr "Novell, Inc." #: ../C/pdfmod.xml:16(publishername) msgid "GNOME Documentation Project" msgstr "GNOME-dokumentationsprojektet" #: ../C/pdfmod.xml:20(firstname) msgid "Gabriel" msgstr "Gabriel" #: ../C/pdfmod.xml:21(surname) msgid "Burt" msgstr "Burt" #: ../C/pdfmod.xml:29(revnumber) msgid "0.2" msgstr "0.2" #: ../C/pdfmod.xml:30(date) msgid "2009-07-29" msgstr "29-07-2009" #: ../C/pdfmod.xml:33(revnumber) msgid "0.1" msgstr "0.1" #: ../C/pdfmod.xml:34(date) msgid "2009-07-25" msgstr "25-07-2009" # evt introduktion #: ../C/pdfmod.xml:40(title) msgid "Introduction" msgstr "Indledning" #: ../C/pdfmod.xml:41(para) msgid "" "PDF Mod is a simple tool for doing basic manipulations of PDF documents." msgstr "" "PDF Moderator er et enkelt værktøj til grundlæggende manipulering af PDF-" "dokumenter." #: ../C/pdfmod.xml:45(para) msgid "" "With this tool, you can rotate, remove, or extract pages in a PDF document. " "You can also add pages from another document." msgstr "" "Med dette værktøj kan du rotere, fjerne eller udtrække sider i et PDF-" "dokument. Du kan også tilføje sider fra et andet dokument." #: ../C/pdfmod.xml:50(para) msgid "" "You can start PDF Mod from your applications menu or launcher, or by right " "clicking on one or more PDF documents in the file browser, and choosing to " "open with PDF Mod." msgstr "" "Du kan starte PDF Moderator fra din programmenu eller programstarter, eller " "ved at højreklikke på et eller flere PDF-dokumenter i filbrowseren, og vælge " "at åbne med PDF Moderator." #: ../C/pdfmod.xml:56(para) msgid "" "Like a normal editor application, you must save the changes you make using " "PDF Mod. If you want to keep the original document and save your changes to " "a new file, use Save As." msgstr "" "Som med et normalt program der bruges til redigering, skal du gemme " "ændringerne, du foretager med PDF Moderator. Hvis du ønsker at gemme det " "oprindelige dokument og gemme dine ændringer i en ny fil så brug Gem som." #: ../C/pdfmod.xml:63(title) msgid "Usage" msgstr "Brug" #: ../C/pdfmod.xml:66(title) msgid "Opening a Document" msgstr "Åbning af et dokument" #: ../C/pdfmod.xml:67(para) msgid "To open a document in PDF Mod:" msgstr "For at åbne et dokument i PDF Moderator:" #: ../C/pdfmod.xml:72(para) msgid "" "Choose FileOpen and select your document, or" msgstr "" "Vælg FilÅbn og vælg dit dokument, eller" #: ../C/pdfmod.xml:77(para) msgid "" "Press CtrlO and " "select your document, or" msgstr "" "Tryk CtrlO og vælg " "dit dokument, eller" #: ../C/pdfmod.xml:87(para) msgid "" "Drag a PDF document from your Desktop or file browser into a PDF Mod window " "that doesn't already have a document loaded, or" msgstr "" "Træk et PDF-dokument fra dit skrivebord eller filbrowser til et vindue i PDF " "Moderator som ikke allerede har et dokument indlæst, eller" #: ../C/pdfmod.xml:92(para) msgid "" "Choose a document from FileRecent Documents." msgstr "" "Vælg et dokument fra FilSeneste " "dokumenter." #: ../C/pdfmod.xml:100(title) msgid "Zooming" msgstr "Zoom" # begrebet best fit er ikke i programmets strengfil. #: ../C/pdfmod.xml:101(para) msgid "" "Zooming will make the page thumbnails bigger or smaller. PDF Mod starts in " "Best Fit mode, where it tries to make all the pages visible at once." msgstr "" "Du kan zoome for at gøre miniaturebillederne for siderne større eller " "mindre. PDF Moderator starter i tilstanden bedste tilpasning, hvor " "programmet forsøger at gøre alle sider synlige på en gang." #: ../C/pdfmod.xml:104(para) msgid "" "You can zoom in or out with the options under View, or by pressing Ctrl and moving your " "mouse's scroll wheel." msgstr "" "Du kan zoome ind og ud med indstillingerne under Vis, eller ved at trykke på Ctrl og " "bevæge din mus' rullehjul." #: ../C/pdfmod.xml:110(title) msgid "Viewing and Editing Properties" msgstr "Egenskaber for visning og redigering" #: ../C/pdfmod.xml:111(para) msgid "" "You can view and edit the Title, Author, Keywords, and Subject of the " "document by opening the properties. To do so, choose " "FileProperties, press AltEnter, or click the Properties button on the toolbar." msgstr "" "Du kan vise og redigere titel, forfatter, nøgleord og emne i dokumentet ved " "at åbne egenskaberne. For at gøre dette vælges FilEgenskaber, tryk " "AltRetur, eller klik " "på knappen for egenskaber på værktøjslinjen." #: ../C/pdfmod.xml:119(title) msgid "Selecting Pages" msgstr "Vælge sider" #: ../C/pdfmod.xml:120(para) msgid "" "PDF Mod can automatically select all pages, even-numbered pages, odd-" "numbered pages, or pages containing a search term. These options are " "available under Edit." msgstr "" "PDF Moderator kan automatisk vælge alle sider, sider med lige numre, sider " "med ulige numre eller sider som indeholder en søgeterm. Disse indstillinger " "er tilgængelige under Rediger." #: ../C/pdfmod.xml:124(para) msgid "" "You can select pages manually using the keyboard and mouse as well. Use " "Ctrl or Shift to select more than one page." msgstr "" "Du kan vælge sider manuelt ved at bruge tastaturet og musen. Brug " "Ctrl eller Skift for at vælge mere end en " "side." #: ../C/pdfmod.xml:130(title) msgid "Moving Pages" msgstr "Flytte sider" #: ../C/pdfmod.xml:131(para) msgid "" "To move (aka reorder) the selected page or pages, drag them to the position " "in the document to which you want them moved." msgstr "" "For at flytte (det vil sige omorganisere) den valgte side eller sider, " "trækkes de til den nye placering i dokumentet." #: ../C/pdfmod.xml:135(para) msgid "" "All editing actions except removing pages can be undone by choosing " "EditUndo or by pressing CtrlZ." msgstr "" "Alle redigeringshandlinger med undtagelse af fjernelse af sider kan " "fortrydes ved at vælge RedigerFortryd eller ved at trykke " "CtrlZ." #: ../C/pdfmod.xml:144(title) msgid "Extracting Pages" msgstr "Udtræk af sider" #: ../C/pdfmod.xml:145(para) msgid "" "Extracting the selected page or pages will open a new PDF Mod window with " "just the selected pages in a new document, ready for further editing or to " "save." msgstr "" "Udtræk af den valgte side eller sider vil åbne et nyt vindue for PDF " "Moderator med kun de valgte sider i et nyt dokument, klar til yderligere " "redigering eller gemning." #: ../C/pdfmod.xml:148(para) msgid "" "To extract the selected page or pages, choose EditExtract Page." msgstr "" "For at udtrække den valgte side eller sider, vælg " "RedigerUdtræk side." #: ../C/pdfmod.xml:152(para) msgid "" "All of the editing and selection actions available under " "Edit are also available by right " "clicking on a page. Some actions are available on the toolbar as well." msgstr "" "Alle redigerings- og markeringshandlingerne der er tilgængelige under " "Rediger er også tilgængelige ved " "at højreklikke på en side. Nogle handlinger er også tilgængelige på " "værktøjslinjen." #: ../C/pdfmod.xml:160(title) msgid "Rotating Pages" msgstr "Rotere sider" #: ../C/pdfmod.xml:161(para) msgid "" "To rotate the selected page or pages, choose EditRotate Page or press " "[ to rotate left (CCW) and " "] to rotate right (CW)." msgstr "" "For at rotere den valgte side eller sider vælges " "RedigerRoter side eller tryk [ for at rotere " "til venstre (mod uret) og ] for at " "rotere til højre (med uret)." #: ../C/pdfmod.xml:168(title) msgid "Removing Pages" msgstr "Fjerne sider" #: ../C/pdfmod.xml:169(para) msgid "" "To remove the selected page or pages, press Delete or " "choose EditRemove Page." msgstr "" "For at fjerne den valgte side eller sider, tryk Slet eller " "vælg RedigerFjern side." #: ../C/pdfmod.xml:174(para) msgid "" "It is not currently possible to undo this action via " "EditUndo. You can close the document without saving and open it again to " "get your page back, though you will lose any other changes you have made." msgstr "" "Det er i øjeblikket ikke muligt at fortryde denne handling via " "RedigerFortryd. Du kan lukke dokumentet uden at gemme og åbne det igen for at " "få din side tilbage; du vil dog miste alle andre ændringer, du har foretaget." #: ../C/pdfmod.xml:182(title) msgid "Saving" msgstr "Gemme" #: ../C/pdfmod.xml:183(para) msgid "" "After making changes to the document, there are two ways to save your work. " "You can overwrite the original document by choosing " "FileSave, or you can save your changes to a new file by choosing " "FileSave As." msgstr "" "Efter at du har lavet ændringer til dokumentet, er der to måder du kan gemme " "dit arbejde. Du kan overskrive det oprindelige dokument ved at vælge " "FilGem, eller du kan gemme dine ændringer til en ny fil ved at vælge " "FilGem som." #. Put one translator per line, in the form of NAME , YEAR1, YEAR2 #: ../C/pdfmod.xml:0(None) msgid "translator-credits" msgstr "" "Joe Hansen, 2010\n" "\n" "Dansk-gruppen \n" "Mere info: http://www.dansk-gruppen.dk" pdfmod-0.9.1/docs/sv/0000777000175000001440000000000011533760021014471 5ustar00gabeusers00000000000000pdfmod-0.9.1/docs/sv/sv.po0000644000175000001440000001741111533760021015461 0ustar00gabeusers00000000000000msgid "" msgstr "" "Project-Id-Version: pdf mod doc\n" "POT-Creation-Date: 2009-07-28 18:51+0200\n" "PO-Revision-Date: 2009-07-28 18:58+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: C/pdfmod.xml:5(title) msgid "The PDF Mod Manual" msgstr "Handboken för PDF Mod" #: C/pdfmod.xml:7(para) msgid "This is the user's manual for PDF Mod, a simple tool for manipulating PDF documents." msgstr "Detta är användarhandboken för PDF Mod, ett enkelt verktyg för att manipulera PDF-dokument." #: C/pdfmod.xml:9(subtitle) msgid "Quick, Easy PDF Modification" msgstr "Snabb och enkel PDF-modifiering" #: C/pdfmod.xml:11(year) msgid "2009" msgstr "2009" #: C/pdfmod.xml:12(holder) #: C/pdfmod.xml:22(orgname) msgid "Novell, Inc." msgstr "Novell, Inc." #: C/pdfmod.xml:15(publishername) msgid "GNOME Documentation Project" msgstr "Dokumentationsprojekt för GNOME" #: C/pdfmod.xml:19(firstname) msgid "Gabriel" msgstr "Gabriel" #: C/pdfmod.xml:20(surname) msgid "Burt" msgstr "Burt" #: C/pdfmod.xml:28(revnumber) msgid "0.1" msgstr "0.1" #: C/pdfmod.xml:29(date) msgid "2009-07-25" msgstr "2009-07-25" #: C/pdfmod.xml:35(title) msgid "Introduction" msgstr "Introduktion" #: C/pdfmod.xml:36(para) msgid "PDF Mod is a simple tool for doing basic manipulations of PDF documents." msgstr "PDF Mod är ett enkelt verktyg för att göra grundläggande manipuleringar med PDF-dokument." #: C/pdfmod.xml:40(para) msgid "With this tool, you can rotate, remove, or extract pages in a PDF document. You can also add pages from another document." msgstr "Med detta verktyg så kan du rotera, flytta eller extrahera sidor i ett PDF-dokument. Du kan även lägga till sidor från andra dokument." #: C/pdfmod.xml:45(para) msgid "You can start PDF Mod from your applications menu or launcher, or by right clicking on one or more PDF documents in the file browser, and choosing to open with PDF Mod." msgstr "Du kan starta PDF Mod från din programmeny eller startprogram, eller genom att högerklicka på ett eller flera PDF-dokument i filbläddraren och välja att öppna med PDF Mod." #: C/pdfmod.xml:51(para) msgid "Like a normal editor application, you must save the changes you make using PDF Mod. If you want to keep the original document and save your changes to a new file, use Save As." msgstr "" #: C/pdfmod.xml:58(title) msgid "Usage" msgstr "Användning" #: C/pdfmod.xml:61(title) msgid "Opening a Document" msgstr "Öppna ett dokument" #: C/pdfmod.xml:62(para) msgid "To open a document in PDF Mod:" msgstr "För att öppna ett dokument i PDF Mod:" #: C/pdfmod.xml:67(para) msgid "Choose FileOpen and select your document, or" msgstr "Välj ArkivÖppna och välj ditt dokument, eller" #: C/pdfmod.xml:72(para) msgid "Press CtrlO and select your document, or" msgstr "Tryck på CtrlO och välj ditt dokument, eller" #: C/pdfmod.xml:82(para) msgid "Drag a PDF document from your Desktop or file browser into a PDF Mod window that doesn't already have a document loaded, or" msgstr "Dra ett PDF-dokument från ditt skrivbord eller filbläddrare till ett PDF Mod-fönster som inte redan har ett dokument inläst, eller" #: C/pdfmod.xml:87(para) msgid "Choose a document from FileRecent Documents." msgstr "Välj ett dokument från ArkivTidigare dokument." #: C/pdfmod.xml:95(title) msgid "Zooming" msgstr "Zooma" #: C/pdfmod.xml:96(para) msgid "Zooming will make the page thumbnails bigger or smaller. PDF Mod starts in Best Fit mode, where it tries to make all the pages visible at once." msgstr "" #: C/pdfmod.xml:99(para) msgid "You can zoom in or out with the options under View, or by pressing Ctrl and moving your mouse's scroll wheel." msgstr "" #: C/pdfmod.xml:105(title) msgid "Viewing and Editing Properties" msgstr "Visa och redigera egenskaper" #: C/pdfmod.xml:106(para) msgid "You can view and edit the Title, Author, Keywords, and Subject of the document by opening the properties. To do so, choose FileProperties, press AltEnter, or click the Properties button on the toolbar." msgstr "" #: C/pdfmod.xml:114(title) msgid "Selecting Pages" msgstr "Markera sidor" #: C/pdfmod.xml:115(para) msgid "PDF Mod can automatically select all pages, even-numbered pages, odd-numbered pages, or pages containing a search term. These options are available under Edit." msgstr "" #: C/pdfmod.xml:119(para) msgid "You can select pages manually using the keyboard and mouse as well. Use Ctrl or Shift to select more than one page." msgstr "" #: C/pdfmod.xml:125(title) msgid "Moving Pages" msgstr "Flytta sidor" #: C/pdfmod.xml:126(para) msgid "To move (aka reorder) the selected page or pages, drag them to the position in the document to which you want them moved." msgstr "" #: C/pdfmod.xml:130(para) msgid "All editing actions except removing pages can be undone by choosing EditUndo or by pressing CtrlZ." msgstr "" #: C/pdfmod.xml:139(title) msgid "Extracting Pages" msgstr "Extrahera sidor" #: C/pdfmod.xml:140(para) msgid "Extracting the selected page or pages will open a new PDF Mod window with just the selected pages in a new document, ready for further editing or to save." msgstr "" #: C/pdfmod.xml:143(para) msgid "To extract the selected page or pages, choose EditExtract Page." msgstr "" #: C/pdfmod.xml:147(para) msgid "All of the editing and selection actions available under Edit are also available by right clicking on a page. Some actions are available on the toolbar as well." msgstr "" #: C/pdfmod.xml:155(title) msgid "Rotating Pages" msgstr "Rotera sidor" #: C/pdfmod.xml:156(para) msgid "To rotate the selected page or pages, choose EditRotate Page or press [ to rotate left (CCW) and ] to rotate right (CW)." msgstr "" #: C/pdfmod.xml:163(title) msgid "Removing Pages" msgstr "Ta bort sidor" #: C/pdfmod.xml:164(para) msgid "To remove the selected page or pages, press Delete or choose EditRemove Page." msgstr "" #: C/pdfmod.xml:169(para) msgid "It is not currently possible to undo this action via EditUndo. You can close the document without saving and open it again to get your page back, though you will lose any other changes you have made." msgstr "" #: C/pdfmod.xml:177(title) msgid "Saving" msgstr "Spara" #: C/pdfmod.xml:178(para) msgid "After making changes to the document, there are two ways to save your work. You can overwrite the original document by choosing FileSave, or you can save your changes to a new file by choosing FileSave As." msgstr "" pdfmod-0.9.1/docs/sv/pdfmod.xml0000644000175000001440000001507411533760020016466 0ustar00gabeusers00000000000000 Handboken för PDF Mod Detta är användarhandboken för PDF Mod, ett enkelt verktyg för att manipulera PDF-dokument. Snabb och enkel PDF-modifiering 2009 Novell, Inc. Dokumentationsprojekt för GNOME Gabriel Burt Novell, Inc. 0.2 2009-07-29 0.1 2009-07-25 Introduktion PDF Mod är ett enkelt verktyg för att göra grundläggande manipuleringar med PDF-dokument. Med detta verktyg så kan du rotera, flytta eller extrahera sidor i ett PDF-dokument. Du kan även lägga till sidor från andra dokument. Du kan starta PDF Mod från din programmeny eller startprogram, eller genom att högerklicka på ett eller flera PDF-dokument i filbläddraren och välja att öppna med PDF Mod. Like a normal editor application, you must save the changes you make using PDF Mod. If you want to keep the original document and save your changes to a new file, use Save As. Användning Öppna ett dokument För att öppna ett dokument i PDF Mod: Välj ArkivÖppna och välj ditt dokument, eller Tryck på CtrlO och välj ditt dokument, eller Dra ett PDF-dokument från ditt skrivbord eller filbläddrare till ett PDF Mod-fönster som inte redan har ett dokument inläst, eller Välj ett dokument från ArkivTidigare dokument. Zooma Zooming will make the page thumbnails bigger or smaller. PDF Mod starts in Best Fit mode, where it tries to make all the pages visible at once. You can zoom in or out with the options under View, or by pressing Ctrl and moving your mouse's scroll wheel. Visa och redigera egenskaper You can view and edit the Title, Author, Keywords, and Subject of the document by opening the properties. To do so, choose FileProperties, press AltEnter, or click the Properties button on the toolbar. Markera sidor PDF Mod can automatically select all pages, even-numbered pages, odd-numbered pages, or pages containing a search term. These options are available under Edit. You can select pages manually using the keyboard and mouse as well. Use Ctrl or Shift to select more than one page. Flytta sidor To move (aka reorder) the selected page or pages, drag them to the position in the document to which you want them moved. All editing actions except removing pages can be undone by choosing EditUndo or by pressing CtrlZ. Extrahera sidor Extracting the selected page or pages will open a new PDF Mod window with just the selected pages in a new document, ready for further editing or to save. To extract the selected page or pages, choose EditExtract Page. All of the editing and selection actions available under Edit are also available by right clicking on a page. Some actions are available on the toolbar as well. Rotera sidor To rotate the selected page or pages, choose EditRotate Page or press [ to rotate left (CCW) and ] to rotate right (CW). Ta bort sidor To remove the selected page or pages, press Delete or choose EditRemove Page. It is not currently possible to undo this action via EditUndo. You can close the document without saving and open it again to get your page back, though you will lose any other changes you have made. Spara After making changes to the document, there are two ways to save your work. You can overwrite the original document by choosing FileSave, or you can save your changes to a new file by choosing FileSave As. pdfmod-0.9.1/docs/Makefile.in0000644000175000001440000007532311533760014016116 0ustar00gabeusers00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # gnome-doc-utils.make - make magic for building documentation # Copyright (C) 2004-2005 Shaun McCance # # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/gnome-doc-utils.make subdir = docs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUNDLE_ASSEMBLIES = @BUNDLE_ASSEMBLIES@ BUNDLE_FILES = @BUNDLE_FILES@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GCONF_SHARP_20_CFLAGS = @GCONF_SHARP_20_CFLAGS@ GCONF_SHARP_20_LIBS = @GCONF_SHARP_20_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_SHARP_20_CFLAGS = @GLIB_SHARP_20_CFLAGS@ GLIB_SHARP_20_LIBS = @GLIB_SHARP_20_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK_SHARP_20_CFLAGS = @GTK_SHARP_20_CFLAGS@ GTK_SHARP_20_LIBS = @GTK_SHARP_20_LIBS@ HELP_DIR = @HELP_DIR@ HYENA_ASSEMBLIES = @HYENA_ASSEMBLIES@ HYENA_CFLAGS = @HYENA_CFLAGS@ HYENA_FILES = @HYENA_FILES@ HYENA_GUI_ASSEMBLIES = @HYENA_GUI_ASSEMBLIES@ HYENA_GUI_CFLAGS = @HYENA_GUI_CFLAGS@ HYENA_GUI_FILES = @HYENA_GUI_FILES@ HYENA_GUI_LIBS = @HYENA_GUI_LIBS@ HYENA_LIBS = @HYENA_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@ INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@ INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@ INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@ INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@ INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@ INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@ INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@ INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@ INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@ INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@ INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@ INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@ INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POPPLER_ASSEMBLIES = @POPPLER_ASSEMBLIES@ POPPLER_CFLAGS = @POPPLER_CFLAGS@ POPPLER_LIBS = @POPPLER_LIBS@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ _clean_doc_header = $(if $(DOC_H_FILE),clean-doc-header) _DOC_REAL_FORMATS = $(if $(DOC_USER_FORMATS),$(DOC_USER_FORMATS),$(DOC_FORMATS)) _DOC_REAL_LINGUAS = $(if $(filter environment,$(origin LINGUAS)), \ $(filter $(LINGUAS),$(DOC_LINGUAS)), \ $(DOC_LINGUAS)) _DOC_ABS_SRCDIR = @abs_srcdir@ _xml2po_mode = $(if $(DOC_ID),mallard,docbook) @ENABLE_SK_TRUE@_ENABLE_SK = true ################################################################################ db2omf_args = \ --stringparam db2omf.basename $(DOC_MODULE) \ --stringparam db2omf.format $(3) \ --stringparam db2omf.dtd \ $(shell xmllint --format $(2) | grep -h PUBLIC | head -n 1 \ | sed -e 's/.*PUBLIC \(\"[^\"]*\"\).*/\1/') \ --stringparam db2omf.lang $(notdir $(patsubst %/$(notdir $(2)),%,$(2))) \ --stringparam db2omf.omf_dir "$(OMF_DIR)" \ --stringparam db2omf.help_dir "$(HELP_DIR)" \ --stringparam db2omf.omf_in "$(_DOC_OMF_IN)" \ $(if $(_ENABLE_SK), \ --stringparam db2omf.scrollkeeper_cl "$(_skcontentslist)") \ $(_db2omf) $(2) _DOC_OMF_IN = $(if $(DOC_MODULE),$(wildcard $(_DOC_ABS_SRCDIR)/$(DOC_MODULE).omf.in)) _DOC_OMF_DB = $(if $(_DOC_OMF_IN), \ $(foreach lc,C $(_DOC_REAL_LINGUAS),$(DOC_MODULE)-$(lc).omf)) _DOC_OMF_HTML = $(if $(_DOC_OMF_IN), \ $(foreach lc,C $(_DOC_REAL_LINGUAS),$(DOC_MODULE)-html-$(lc).omf)) # FIXME _DOC_OMF_ALL = \ $(if $(filter docbook,$(_DOC_REAL_FORMATS)),$(_DOC_OMF_DB)) \ $(if $(filter html HTML,$(_DOC_REAL_FORMATS)),$(_DOC_OMF_HTML)) ################################################################################ _DOC_C_MODULE = $(if $(DOC_MODULE),C/$(DOC_MODULE).xml) _DOC_C_PAGES = $(foreach page,$(DOC_PAGES),C/$(page)) _DOC_C_ENTITIES = $(foreach ent,$(DOC_ENTITIES),C/$(ent)) _DOC_C_INCLUDES = $(foreach inc,$(DOC_INCLUDES),C/$(inc)) _DOC_C_DOCS = \ $(_DOC_C_ENTITIES) $(_DOC_C_INCLUDES) \ $(_DOC_C_PAGES) $(_DOC_C_MODULE) _DOC_C_DOCS_NOENT = \ $(_DOC_C_MODULE) $(_DOC_C_INCLUDES) \ $(_DOC_C_PAGES) _DOC_C_FIGURES = $(if $(DOC_FIGURES), \ $(foreach fig,$(DOC_FIGURES),C/$(fig)), \ $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/C/figures/*.png))) # FIXME: probably have to shell escape to determine the file names _DOC_C_HTML = $(foreach f, \ $(shell xsltproc --xinclude \ --stringparam db.chunk.basename "$(DOC_MODULE)" \ $(_chunks) "C/$(DOC_MODULE).xml"), \ C/$(f).xhtml) ############################################################################### _DOC_POFILES = $(if $(DOC_MODULE)$(DOC_ID), \ $(foreach lc,$(_DOC_REAL_LINGUAS),$(lc)/$(lc).po)) _DOC_LC_MODULES = $(if $(DOC_MODULE), \ $(foreach lc,$(_DOC_REAL_LINGUAS),$(lc)/$(DOC_MODULE).xml)) _DOC_LC_PAGES = \ $(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach page,$(_DOC_C_PAGES), \ $(lc)/$(notdir $(page)) )) _DOC_LC_INCLUDES = \ $(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach inc,$(_DOC_C_INCLUDES), \ $(lc)/$(notdir $(inc)) )) # FIXME: probably have to shell escape to determine the file names _DOC_LC_HTML = \ $(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach doc,$(_DOC_C_HTML), \ $(lc)/$(notdir $(doc)) )) _DOC_LC_DOCS = \ $(_DOC_LC_MODULES) $(_DOC_LC_INCLUDES) $(_DOC_LC_PAGES) \ $(if $(filter html HTML,$(_DOC_REAL_FORMATS)),$(_DOC_LC_HTML)) _DOC_LC_FIGURES = $(foreach lc,$(_DOC_REAL_LINGUAS), \ $(patsubst C/%,$(lc)/%,$(_DOC_C_FIGURES)) ) _DOC_SRC_FIGURES = \ $(foreach fig,$(_DOC_C_FIGURES), $(foreach lc,C $(_DOC_REAL_LINGUAS), \ $(wildcard $(srcdir)/$(lc)/$(patsubst C/%,%,$(fig))) )) _DOC_POT = $(if $(DOC_MODULE),$(DOC_MODULE).pot) ################################################################################ _DOC_HTML_ALL = $(if $(filter html HTML,$(_DOC_REAL_FORMATS)), \ $(_DOC_C_HTML) $(_DOC_LC_HTML)) _DOC_HTML_TOPS = $(foreach lc,C $(_DOC_REAL_LINGUAS),$(lc)/$(DOC_MODULE).xhtml) _clean_omf = $(if $(_DOC_OMF_IN),clean-doc-omf) _clean_dsk = $(if $(_DOC_DSK_IN),clean-doc-dsk) _clean_lc = $(if $(_DOC_REAL_LINGUAS),clean-doc-lc) _clean_dir = $(if $(DOC_MODULE)$(DOC_ID),clean-doc-dir) _doc_install_dir = $(if $(DOC_ID),$(DOC_ID),$(DOC_MODULE)) DOC_MODULE = pdfmod DOC_ENTITIES = DOC_INCLUDES = DOC_FIGURES = DOC_LINGUAS = ca cs da de es fr hr pl sl sv zh_CN all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/gnome-doc-utils.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign docs/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign docs/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-local pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-local \ dist-hook distclean distclean-generic distclean-local distdir \ dvi dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-generic \ mostlyclean-local pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-local DOC_H_FILE ?= DOC_H_DOCS ?= $(DOC_H_FILE): $(DOC_H_DOCS); @rm -f $@.tmp; touch $@.tmp; echo 'const gchar* documentation_credits[] = {' >> $@.tmp list='$(DOC_H_DOCS)'; for doc in $$list; do \ xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \ if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \ xsltproc --path "$$xmlpath" $(_credits) $$doc; \ done | sort | uniq \ | awk 'BEGIN{s=""}{n=split($$0,w,"<");if(s!=""&&s!=substr(w[1],1,length(w[1])-1)){print s};if(n>1){print $$0;s=""}else{s=$$0}};END{if(s!=""){print s}}' \ | sed -e 's/\\/\\\\/' -e 's/"/\\"/' -e 's/\(.*\)/\t"\1",/' >> $@.tmp echo ' NULL' >> $@.tmp echo '};' >> $@.tmp echo >> $@.tmp list='$(DOC_H_DOCS)'; for doc in $$list; do \ xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \ if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \ docid=`echo "$$doc" | sed -e 's/.*\/\([^/]*\)\.xml/\1/' \ | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`; \ echo $$xmlpath; \ ids=`xsltproc --xinclude --path "$$xmlpath" $(_ids) $$doc`; \ for id in $$ids; do \ echo '#define HELP_'`echo $$docid`'_'`echo $$id \ | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`' "'$$id'"' >> $@.tmp; \ done; \ echo >> $@.tmp; \ done; cp $@.tmp $@ && rm -f $@.tmp dist-check-gdu: @HAVE_GNOME_DOC_UTILS_FALSE@ @echo "*** GNOME Doc Utils must be installed in order to make dist" @HAVE_GNOME_DOC_UTILS_FALSE@ @false .PHONY: dist-doc-header dist-doc-header: $(DOC_H_FILE) @if test -f "$(DOC_H_FILE)"; then d=; else d="$(srcdir)/"; fi; \ echo "$(INSTALL_DATA) $${d}$(DOC_H_FILE) $(distdir)/$(DOC_H_FILE)"; \ $(INSTALL_DATA) "$${d}$(DOC_H_FILE)" "$(distdir)/$(DOC_H_FILE)"; doc-dist-hook: dist-check-gdu $(if $(DOC_H_FILE),dist-doc-header) .PHONY: clean-doc-header clean-local: $(_clean_doc_header) distclean-local: $(_clean_doc_header) mostlyclean-local: $(_clean_doc_header) maintainer-clean-local: $(_clean_doc_header) clean-doc-header: rm -f $(DOC_H_FILE) all: $(DOC_H_FILE) ################################################################################ DOC_MODULE ?= DOC_ID ?= DOC_PAGES ?= DOC_ENTITIES ?= DOC_INCLUDES ?= DOC_FIGURES ?= DOC_FORMATS ?= docbook DOC_LINGUAS ?= ################################################################################ _xml2po ?= `which xml2po` _db2html ?= `$(PKG_CONFIG) --variable db2html gnome-doc-utils` _db2omf ?= `$(PKG_CONFIG) --variable db2omf gnome-doc-utils` _malrng ?= `$(PKG_CONFIG) --variable malrng gnome-doc-utils` _chunks ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl _credits ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl _ids ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/ids.xsl @ENABLE_SK_TRUE@_skpkgdatadir ?= `scrollkeeper-config --pkgdatadir` @ENABLE_SK_TRUE@_sklocalstatedir ?= `scrollkeeper-config --pkglocalstatedir` @ENABLE_SK_TRUE@_skcontentslist ?= $(_skpkgdatadir)/Templates/C/scrollkeeper_cl.xml $(_DOC_OMF_DB) : $(_DOC_OMF_IN) $(_DOC_OMF_DB) : $(DOC_MODULE)-%.omf : %/$(DOC_MODULE).xml @test "x$(_ENABLE_SK)" != "xtrue" -o -f "$(_skcontentslist)" || { \ echo "The file '$(_skcontentslist)' does not exist." >&2; \ echo "Please check your ScrollKeeper installation." >&2; \ exit 1; } xsltproc -o $@ $(call db2omf_args,$@,$<,'docbook') || { rm -f "$@"; exit 1; } $(_DOC_OMF_HTML) : $(_DOC_OMF_IN) $(_DOC_OMF_HTML) : $(DOC_MODULE)-html-%.omf : %/$(DOC_MODULE).xml @ENABLE_SK_TRUE@ @test "x$(_ENABLE_SK)" != "xtrue" -o -f "$(_skcontentslist)" || { \ @ENABLE_SK_TRUE@ echo "The file '$(_skcontentslist)' does not exist" >&2; \ @ENABLE_SK_TRUE@ echo "Please check your ScrollKeeper installation." >&2; \ @ENABLE_SK_TRUE@ exit 1; } xsltproc -o $@ $(call db2omf_args,$@,$<,'xhtml') || { rm -f "$@"; exit 1; } .PHONY: omf omf: $(_DOC_OMF_ALL) .PHONY: po po: $(_DOC_POFILES) $(_DOC_POFILES): @if ! test -d $(dir $@); then \ echo "mkdir $(dir $@)"; \ mkdir "$(dir $@)"; \ fi @if test ! -f $@ -a -f $(srcdir)/$@; then \ echo "cp $(srcdir)/$@ $@"; \ cp "$(srcdir)/$@" "$@"; \ fi; @docs=; \ list='$(_DOC_C_DOCS_NOENT)'; for doc in $$list; do \ docs="$$docs $(_DOC_ABS_SRCDIR)/$$doc"; \ done; \ if ! test -f $@; then \ echo "(cd $(dir $@) && \ $(_xml2po) -m $(_xml2po_mode) -e $$docs > $(notdir $@).tmp && \ cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp)"; \ (cd $(dir $@) && \ $(_xml2po) -m $(_xml2po_mode) -e $$docs > $(notdir $@).tmp && \ cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp); \ else \ echo "(cd $(dir $@) && \ $(_xml2po) -m $(_xml2po_mode) -e -u $(notdir $@) $$docs)"; \ (cd $(dir $@) && \ $(_xml2po) -m $(_xml2po_mode) -e -u $(notdir $@) $$docs); \ fi # FIXME: fix the dependancy # FIXME: hook xml2po up $(_DOC_LC_DOCS) : $(_DOC_POFILES) $(_DOC_LC_DOCS) : $(_DOC_C_DOCS) if ! test -d $(dir $@); then mkdir $(dir $@); fi if [ -f "C/$(notdir $@)" ]; then d="../"; else d="$(_DOC_ABS_SRCDIR)/"; fi; \ po="$(dir $@)$(patsubst %/$(notdir $@),%,$@).po"; \ if [ -f "$${po}" ]; then po="../$${po}"; else po="$(_DOC_ABS_SRCDIR)/$${po}"; fi; \ (cd $(dir $@) && \ $(_xml2po) -m $(_xml2po_mode) -e -p "$${po}" \ "$${d}C/$(notdir $@)" > $(notdir $@).tmp && \ cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp) .PHONY: pot pot: $(_DOC_POT) $(_DOC_POT): $(_DOC_C_DOCS_NOENT) $(_xml2po) -m $(_xml2po_mode) -e -o $@ $^ $(_DOC_HTML_TOPS): $(_DOC_C_DOCS) $(_DOC_LC_DOCS) xsltproc -o $@ --xinclude --param db.chunk.chunk_top "false()" --stringparam db.chunk.basename "$(DOC_MODULE)" --stringparam db.chunk.extension ".xhtml" $(_db2html) $(patsubst %.xhtml,%.xml,$@) ################################################################################ all: \ $(_DOC_C_DOCS) $(_DOC_LC_DOCS) \ $(_DOC_OMF_ALL) $(_DOC_DSK_ALL) \ $(_DOC_HTML_ALL) $(_DOC_POFILES) ################################################################################ .PHONY: clean-doc-omf clean-doc-dsk clean-doc-lc clean-doc-dir clean-doc-omf: ; rm -f $(_DOC_OMF_DB) $(_DOC_OMF_HTML) clean-doc-dsk: ; rm -f $(_DOC_DSK_DB) $(_DOC_DSK_HTML) clean-doc-lc: rm -f $(_DOC_LC_DOCS) @list='$(_DOC_POFILES)'; for po in $$list; do \ if ! test "$$po" -ef "$(srcdir)/$$po"; then \ echo "rm -f $$po"; \ rm -f "$$po"; \ fi; \ done @for lc in C $(_DOC_REAL_LINGUAS); do \ if test -f "$$lc/.xml2po.mo"; then \ echo "rm -f $$lc/.xml2po.mo"; \ rm -f "$$lc/.xml2po.mo"; \ fi; \ done clean-doc-dir: clean-doc-lc @for lc in C $(_DOC_REAL_LINGUAS); do \ for dir in `find $$lc -depth -type d`; do \ if ! test $$dir -ef $(srcdir)/$$dir; then \ echo "rmdir $$dir"; \ rmdir "$$dir"; \ fi; \ done; \ done clean-local: \ $(_clean_omf) $(_clean_dsk) \ $(_clean_lc) $(_clean_dir) distclean-local: \ $(_clean_omf) $(_clean_dsk) \ $(_clean_lc) $(_clean_dir) mostlyclean-local: \ $(_clean_omf) $(_clean_dsk) \ $(_clean_lc) $(_clean_dir) maintainer-clean-local: \ $(_clean_omf) $(_clean_dsk) \ $(_clean_lc) $(_clean_dir) ################################################################################ .PHONY: dist-doc-docs dist-doc-pages dist-doc-figs dist-doc-omf dist-doc-dsk doc-dist-hook: \ $(if $(DOC_MODULE)$(DOC_ID),dist-doc-docs) \ $(if $(_DOC_C_FIGURES),dist-doc-figs) \ $(if $(_DOC_OMF_IN),dist-doc-omf) # $(if $(_DOC_DSK_IN),dist-doc-dsk) dist-doc-docs: $(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES) @for lc in C $(_DOC_REAL_LINGUAS); do \ echo " $(mkinstalldirs) $(distdir)/$$lc"; \ $(mkinstalldirs) "$(distdir)/$$lc"; \ done @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES)'; \ for doc in $$list; do \ if test -f "$$doc"; then d=; else d="$(srcdir)/"; fi; \ docdir=`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \ if ! test -d "$(distdir)/$$docdir"; then \ echo "$(mkinstalldirs) $(distdir)/$$docdir"; \ $(mkinstalldirs) "$(distdir)/$$docdir"; \ fi; \ echo "$(INSTALL_DATA) $$d$$doc $(distdir)/$$doc"; \ $(INSTALL_DATA) "$$d$$doc" "$(distdir)/$$doc"; \ done dist-doc-figs: $(_DOC_SRC_FIGURES) @list='$(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)'; \ for fig in $$list; do \ if test -f "$$fig"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$fig"; then \ figdir=`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \ if ! test -d "$(distdir)/$$figdir"; then \ echo "$(mkinstalldirs) $(distdir)/$$figdir"; \ $(mkinstalldirs) "$(distdir)/$$figdir"; \ fi; \ echo "$(INSTALL_DATA) $$d$$fig $(distdir)/$$fig"; \ $(INSTALL_DATA) "$$d$$fig" "$(distdir)/$$fig"; \ fi; \ done; dist-doc-omf: @if test -f "$(_DOC_OMF_IN)"; then d=; else d="$(srcdir)/"; fi; \ echo "$(INSTALL_DATA) $$d$(_DOC_OMF_IN) $(distdir)/$(notdir $(_DOC_OMF_IN))"; \ $(INSTALL_DATA) "$$d$(_DOC_OMF_IN)" "$(distdir)/$(notdir $(_DOC_OMF_IN))" dist-doc-dsk: @if test -f "$(_DOC_DSK_IN)"; then d=; else d="$(srcdir)/"; fi; \ echo "$(INSTALL_DATA) $$d$(_DOC_DSK_IN) $(distdir)/$(notdir $(_DOC_DSK_IN))"; \ $(INSTALL_DATA) "$$d$(_DOC_DSK_IN)" "$(distdir)/$(notdir $(_DOC_DSK_IN))" ################################################################################ .PHONY: check-doc-docs check-doc-omf check: \ $(if $(DOC_MODULE),check-doc-docs) \ $(if $(DOC_ID),check-doc-pages) \ $(if $(_DOC_OMF_IN),check-doc-omf) check-doc-docs: $(_DOC_C_DOCS) $(_DOC_LC_DOCS) @for lc in C $(_DOC_REAL_LINGUAS); do \ if test -f "$$lc"; \ then d=; \ xmlpath="$$lc"; \ else \ d="$(srcdir)/"; \ xmlpath="$$lc:$(srcdir)/$$lc"; \ fi; \ echo "xmllint --noout --noent --path $$xmlpath --xinclude --postvalid $$d$$lc/$(DOC_MODULE).xml"; \ xmllint --noout --noent --path "$$xmlpath" --xinclude --postvalid "$$d$$lc/$(DOC_MODULE).xml"; \ done check-doc-pages: $(_DOC_C_PAGES) $(_DOC_LC_PAGES) for lc in C $(_DOC_REAL_LINGUAS); do \ if test -f "$$lc"; \ then d=; \ xmlpath="$$lc"; \ else \ d="$(srcdir)/"; \ xmlpath="$$lc:$(srcdir)/$$lc"; \ fi; \ for page in $(DOC_PAGES); do \ echo "xmllint --noout --noent --path $$xmlpath --xinclude --relaxng $(_malrng) $$d$$lc/$$page"; \ xmllint --noout --noent --path "$$xmlpath" --xinclude --relaxng "$(_malrng)" "$$d$$lc/$$page"; \ done; \ done check-doc-omf: $(_DOC_OMF_ALL) @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \ echo "xmllint --noout --xinclude --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' $$omf"; \ xmllint --noout --xinclude --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' $$omf; \ done ################################################################################ .PHONY: install-doc-docs install-doc-html install-doc-figs install-doc-omf install-doc-dsk install-data-local: \ $(if $(DOC_MODULE)$(DOC_ID),install-doc-docs) \ $(if $(_DOC_HTML_ALL),install-doc-html) \ $(if $(_DOC_C_FIGURES),install-doc-figs) \ $(if $(_DOC_OMF_IN),install-doc-omf) # $(if $(_DOC_DSK_IN),install-doc-dsk) install-doc-docs: @for lc in C $(_DOC_REAL_LINGUAS); do \ echo "$(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$lc"; \ $(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$lc; \ done @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \ if test -f "$$doc"; then d=; else d="$(srcdir)/"; fi; \ docdir="$$lc/"`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \ docdir="$(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$docdir"; \ if ! test -d "$$docdir"; then \ echo "$(mkinstalldirs) $$docdir"; \ $(mkinstalldirs) "$$docdir"; \ fi; \ echo "$(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$doc"; \ $(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$doc; \ done install-doc-figs: @list='$(patsubst C/%,%,$(_DOC_C_FIGURES))'; for fig in $$list; do \ for lc in C $(_DOC_REAL_LINGUAS); do \ figsymlink=false; \ if test -f "$$lc/$$fig"; then \ figfile="$$lc/$$fig"; \ elif test -f "$(srcdir)/$$lc/$$fig"; then \ figfile="$(srcdir)/$$lc/$$fig"; \ else \ figsymlink=true; \ fi; \ figdir="$$lc/"`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \ figdir="$(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$figdir"; \ if ! test -d "$$figdir"; then \ echo "$(mkinstalldirs) $$figdir"; \ $(mkinstalldirs) "$$figdir"; \ fi; \ figbase=`echo $$fig | sed -e 's/^.*\///'`; \ if $$figsymlink; then \ echo "cd $$figdir && $(LN_S) -f ../../C/$$fig $$figbase"; \ ( cd "$$figdir" && $(LN_S) -f "../../C/$$fig" "$$figbase" ); \ else \ echo "$(INSTALL_DATA) $$figfile $$figdir$$figbase"; \ $(INSTALL_DATA) "$$figfile" "$$figdir$$figbase"; \ fi; \ done; \ done install-doc-html: echo install-html install-doc-omf: $(mkinstalldirs) $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir) @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \ echo "$(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf"; \ $(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf; \ done @if test "x$(_ENABLE_SK)" = "xtrue"; then \ echo "scrollkeeper-update -p $(DESTDIR)$(_sklocalstatedir) -o $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)"; \ scrollkeeper-update -p "$(DESTDIR)$(_sklocalstatedir)" -o "$(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)"; \ fi; install-doc-dsk: echo install-dsk ################################################################################ .PHONY: uninstall-doc-docs uninstall-doc-html uninstall-doc-figs uninstall-doc-omf uninstall-doc-dsk uninstall-local: \ $(if $(DOC_MODULE)$(DOC_ID),uninstall-doc-docs) \ $(if $(_DOC_HTML_ALL),uninstall-doc-html) \ $(if $(_DOC_C_FIGURES),uninstall-doc-figs) \ $(if $(_DOC_OMF_IN),uninstall-doc-omf) # $(if $(_DOC_DSK_IN),uninstall-doc-dsk) uninstall-doc-docs: @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \ echo " rm -f $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$doc"; \ rm -f "$(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$doc"; \ done uninstall-doc-figs: @list='$(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)'; for fig in $$list; do \ echo "rm -f $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$fig"; \ rm -f "$(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$fig"; \ done; uninstall-doc-omf: @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \ if test "x$(_ENABLE_SK)" = "xtrue"; then \ echo "scrollkeeper-uninstall -p $(_sklocalstatedir) $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf"; \ scrollkeeper-uninstall -p "$(_sklocalstatedir)" "$(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf"; \ fi; \ echo "rm -f $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf"; \ rm -f "$(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf"; \ done dist-hook: doc-dist-hook # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pdfmod-0.9.1/docs/README0000644000175000001440000000022611235616402014717 0ustar00gabeusers00000000000000Translators: You can get the latest .pot file from http://l10n.gnome.org/module/pdfmod/ Remember to add your language to DOC_LINGUAS in Makefile.am pdfmod-0.9.1/docs/fr/0000777000175000001440000000000011533760021014450 5ustar00gabeusers00000000000000pdfmod-0.9.1/docs/fr/fr.po0000644000175000001440000003126311533760021015420 0ustar00gabeusers00000000000000# French translation for PDF Mod Documentation # Copyright (C) 2009 # This file is distributed under the same license as the PDF Mod package. # # Olivier Lê Thanh Duong , 2009. # Bruno Brouard , 2010. msgid "" msgstr "" "Project-Id-Version: pdf mod doc\n" "POT-Creation-Date: 2009-08-05 00:43+0000\n" "PO-Revision-Date: 2010-10-16 23:36+0200\n" "Last-Translator: Bruno Brouard \n" "Language-Team: GNOME French Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: C/pdfmod.xml:6(title) msgid "The PDF Mod Manual" msgstr "Manuel de PDF Mod" #: C/pdfmod.xml:8(para) msgid "" "This is the user's manual for PDF Mod, a simple tool for manipulating PDF " "documents." msgstr "" "Ceci est le manuel des utilisateurs de PDF Mod, un outil simple pour " "manipuler les documents PDF." #: C/pdfmod.xml:10(subtitle) msgid "Quick, Easy PDF Modification" msgstr "Modifications rapides et faciles de fichiers PDF." #: C/pdfmod.xml:12(year) msgid "2009" msgstr "2009" #: C/pdfmod.xml:13(holder) C/pdfmod.xml:23(orgname) msgid "Novell, Inc." msgstr "Novell, Inc." #: C/pdfmod.xml:16(publishername) msgid "GNOME Documentation Project" msgstr "Projet de documentation GNOME" #: C/pdfmod.xml:20(firstname) msgid "Gabriel" msgstr "Gabriel" #: C/pdfmod.xml:21(surname) msgid "Burt" msgstr "Burt" #: C/pdfmod.xml:29(revnumber) msgid "0.2" msgstr "0.2" #: C/pdfmod.xml:30(date) msgid "2009-07-29" msgstr "29/07/2009" #: C/pdfmod.xml:33(revnumber) msgid "0.1" msgstr "0.1" #: C/pdfmod.xml:34(date) msgid "2009-07-25" msgstr "05/07/2009" #: C/pdfmod.xml:40(title) msgid "Introduction" msgstr "Introduction" #: C/pdfmod.xml:41(para) msgid "" "PDF Mod is a simple tool for doing basic manipulations of PDF documents." msgstr "" "PDF Mod est un outil simple pour effectuer des manipulations basiques de " "documents PDF." #: C/pdfmod.xml:45(para) msgid "" "With this tool, you can rotate, remove, or extract pages in a PDF document. " "You can also add pages from another document." msgstr "" "Avec cet outil, vous pouvez tourner, supprimer ou extraire des pages d'un " "document PDF. Vous pouvez aussi ajouter des pages provenant d'un autre document." #: C/pdfmod.xml:50(para) msgid "" "You can start PDF Mod from your applications menu or launcher, or by right " "clicking on one or more PDF documents in the file browser, and choosing to " "open with PDF Mod." msgstr "" "Vous pouvez démarrer PDF Mod depuis le menu Applications " "ou en faisant un clic droit sur un ou plusieurs documents PDF dans votre " "navigateur de fichiers et en choisissant de les ouvrir avec PDF Mod." #: C/pdfmod.xml:56(para) msgid "" "Like a normal editor application, you must save the changes you make using " "PDF Mod. If you want to keep the original document and save your changes to " "a new file, use Save As." msgstr "" "Comme pour toutes applications d'édition, vous devez enregistrer les " "modifications effectuées avec PDF Mod. Si vous souhaitez conserver votre " "document d'origine et enregistrer vos modifications dans un nouveau fichier, " "utilisez le menu « Enregistrer sous »." #: C/pdfmod.xml:63(title) msgid "Usage" msgstr "Utilisation" #: C/pdfmod.xml:66(title) msgid "Opening a Document" msgstr "Ouverture d'un document" #: C/pdfmod.xml:67(para) msgid "To open a document in PDF Mod:" msgstr "Pour ouvrir un document dans PDF Mod :" #: C/pdfmod.xml:72(para) msgid "" "Choose FileOpen and select your document, or" msgstr "" "choisissez FichierOuvrir et sélectionnez votre document ou" #: C/pdfmod.xml:77(para) msgid "" "Press CtrlO and " "select your document, or" msgstr "" "pressez CtrlO et " "sélectionnez votre document ou" #: C/pdfmod.xml:87(para) msgid "" "Drag a PDF document from your Desktop or file browser into a PDF Mod window " "that doesn't already have a document loaded, or" msgstr "" "faites glisser un document PDF depuis votre bureau ou votre navigateur de fichiers sur " "une fenêtre de PDF Mod qui ne contient pas déjà un document ouvert ou" #: C/pdfmod.xml:92(para) msgid "" "Choose a document from FileRecent Documents." msgstr "" "choisissez un document depuis FichierFichiers récents." #: C/pdfmod.xml:100(title) msgid "Zooming" msgstr "Zoom" #: C/pdfmod.xml:101(para) msgid "" "Zooming will make the page thumbnails bigger or smaller. PDF Mod starts in " "Best Fit mode, where it tries to make all the pages visible at once." msgstr "" "Effectuer un zoom pour agrandir ou diminuer les miniatures des pages. PDF Mod " "démarre dans le mode « Ajuster au mieux » dans lequel il essaye " "d'afficher toutes les pages à la fois." #: C/pdfmod.xml:104(para) msgid "" "You can zoom in or out with the options under View, or by pressing Ctrl and moving your " "mouse's scroll wheel." msgstr "" "Vous pouvez effectuer un zoom avant ou arrière en utilisant le menu " "Affichage ou en maintenant appuyée la touche " "Ctrl et en utilisant la molette de votre souris." #: C/pdfmod.xml:110(title) msgid "Viewing and Editing Properties" msgstr "Affichage et modification des propriétés" #: C/pdfmod.xml:111(para) msgid "" "You can view and edit the Title, Author, Keywords, and Subject of the " "document by opening the properties. To do so, choose " "FileProperties, press AltEnter, or click the Properties button on the toolbar." msgstr "" "Vous pouvez afficher et modifier le titre, l'auteur, les mots-clefs et le " "sujet du document en affichant les propriétés. Pour cela choisissez " "FichierPropriétés, pressez AltEntrée ou cliquez sur le bouton « Propriétés » dans la barre d'outils." #: C/pdfmod.xml:119(title) msgid "Selecting Pages" msgstr "Sélection des pages" #: C/pdfmod.xml:120(para) msgid "" "PDF Mod can automatically select all pages, even-numbered pages, odd-" "numbered pages, or pages containing a search term. These options are " "available under Edit." msgstr "" "PDF Mod peut sélectionner automatiquement toutes les pages, les pages paires ou " "impaires ou les pages contenant un terme recherché. Ces commandes " "sont disponibles dans le menu Édition." #: C/pdfmod.xml:124(para) msgid "" "You can select pages manually using the keyboard and mouse as well. Use " "Ctrl or Shift to select more than one page." msgstr "" "Vous pouvez également sélectionner des pages manuellement en utilisant le " "clavier et la souris. Utilisez Ctrl ou Maj pour sélectionner plus d'une page." #: C/pdfmod.xml:130(title) msgid "Moving Pages" msgstr "Déplacement des pages" #: C/pdfmod.xml:131(para) msgid "" "To move (aka reorder) the selected page or pages, drag them to the position " "in the document to which you want them moved." msgstr "" "Pour déplacer (ou réordonner) la ou les pages sélectionnées, " "faites les glisser à la position désirée dans le document." #: C/pdfmod.xml:135(para) msgid "" "All editing actions except removing pages can be undone by choosing " "EditUndo or by pressing CtrlZ." msgstr "" "Toutes les actions d'édition, sauf la suppression des pages, peuvent être annulées " "en choisissant ÉditionAnnuler ou en pressant CtrlZ." #: C/pdfmod.xml:144(title) msgid "Extracting Pages" msgstr "Extraction des pages" #: C/pdfmod.xml:145(para) msgid "" "Extracting the selected page or pages will open a new PDF Mod window with " "just the selected pages in a new document, ready for further editing or to " "save." msgstr "" "L'extraction de ou des pages sélectionnées ouvre une nouvelle fenêtre PDF " "Mod contenant uniquement les pages sélectionnées dans un nouveau document, prêtes " "à être modifiées ou enregistrées." #: C/pdfmod.xml:148(para) msgid "" "To extract the selected page or pages, choose EditExtract Page." msgstr "" "Pour extraire la ou les pages sélectionnées, choisissez " "ÉditionExtraire la (les) page(s)." #: C/pdfmod.xml:152(para) msgid "" "All of the editing and selection actions available under " "Edit are also available by right " "clicking on a page. Some actions are available on the toolbar as well." msgstr "" "Toutes les actions d'édition ou de sélection disponibles dans le menu " "Édition sont également " "disponibles par un clic droit sur une page. Certaines actions sont également " "disponibles dans la barre d'outils." #: C/pdfmod.xml:160(title) msgid "Rotating Pages" msgstr "Rotation des pages" #: C/pdfmod.xml:161(para) msgid "" "To rotate the selected page or pages, choose EditRotate Page or press " "[ to rotate left (CCW) and " "] to rotate right (CW)." msgstr "" "Pour tourner la ou les pages sélectionnées, choisissez " "ÉditionTourner ou appuyez sur [ pour " "effectuer une rotation vers la gauche (sens inverse des aiguilles) et sur ] pour effectuer une rotation vers la droite (sens des aiguilles)." #: C/pdfmod.xml:168(title) msgid "Removing Pages" msgstr "Suppression des pages" #: C/pdfmod.xml:169(para) msgid "" "To remove the selected page or pages, press Delete or " "choose EditRemove Page." msgstr "" "Pour supprimer la ou les pages sélectionnées, appuyez sur la touche " "Suppr ou choisissez ÉditionSupprimer la page." #: C/pdfmod.xml:174(para) msgid "" "It is not currently possible to undo this action via " "EditUndo. You can close the document without saving and open it again to " "get your page back, though you will lose any other changes you have made." msgstr "" "Il n'est pour l'instant pas possible d'annuler cette action à l'aide du menu " "ÉditionAnnuler. Vous pouvez fermer le document sans enregistrer et l'ouvrir à " "nouveau pour récupérer votre page mais vous perdrez toutes les autres " "modifications que vous auriez déjà effectuées." #: C/pdfmod.xml:182(title) msgid "Saving" msgstr "Enregistrement" #: C/pdfmod.xml:183(para) msgid "" "After making changes to the document, there are two ways to save your work. " "You can overwrite the original document by choosing " "FileSave, or you can save your changes to a new file by choosing " "FileSave As." msgstr "" "Après avoir modifié le document, il y a deux façons d'enregistrer votre travail. " "Vous pouvez écraser le document original en choisissant " "FichierEnregistrer ou vous pouvez enregistrer vos modifications dans un nouveau fichier " "en choisissant FichierEnregistrer " "sous." #. Put one translator per line, in the form of NAME , YEAR1, YEAR2. #: C/pdfmod.xml:0(None) msgid "translator-credits" msgstr "" "Olivier Lê Thanh Duong , 2009\n" "Bruno Brouard , 2010" pdfmod-0.9.1/docs/fr/pdfmod.xml0000644000175000001440000001670011533760020016442 0ustar00gabeusers00000000000000 Manuel de PDF Mod Ceci est le manuel des utilisateurs de PDF Mod, un outil simple pour manipuler les documents PDF. Modifications rapides et faciles de fichiers PDF. 2009 Novell, Inc. 2009Olivier Lê Thanh Duong (olivier@lethanh.be)2010Bruno Brouard (annoa.b@gmail.com) Projet de documentation GNOME Gabriel Burt Novell, Inc. 0.2 29/07/2009 0.1 05/07/2009 Introduction PDF Mod est un outil simple pour effectuer des manipulations basiques de documents PDF. Avec cet outil, vous pouvez tourner, supprimer ou extraire des pages d'un document PDF. Vous pouvez aussi ajouter des pages provenant d'un autre document. Vous pouvez démarrer PDF Mod depuis le menu Applications ou en faisant un clic droit sur un ou plusieurs documents PDF dans votre navigateur de fichiers et en choisissant de les ouvrir avec PDF Mod. Comme pour toutes applications d'édition, vous devez enregistrer les modifications effectuées avec PDF Mod. Si vous souhaitez conserver votre document d'origine et enregistrer vos modifications dans un nouveau fichier, utilisez le menu « Enregistrer sous ». Utilisation Ouverture d'un document Pour ouvrir un document dans PDF Mod : choisissez FichierOuvrir et sélectionnez votre document ou pressez CtrlO et sélectionnez votre document ou faites glisser un document PDF depuis votre bureau ou votre navigateur de fichiers sur une fenêtre de PDF Mod qui ne contient pas déjà un document ouvert ou choisissez un document depuis FichierFichiers récents. Zoom Effectuer un zoom pour agrandir ou diminuer les miniatures des pages. PDF Mod démarre dans le mode « Ajuster au mieux » dans lequel il essaye d'afficher toutes les pages à la fois. Vous pouvez effectuer un zoom avant ou arrière en utilisant le menu Affichage ou en maintenant appuyée la touche Ctrl et en utilisant la molette de votre souris. Affichage et modification des propriétés Vous pouvez afficher et modifier le titre, l'auteur, les mots-clefs et le sujet du document en affichant les propriétés. Pour cela choisissez FichierPropriétés, pressez AltEntrée ou cliquez sur le bouton « Propriétés » dans la barre d'outils. Sélection des pages PDF Mod peut sélectionner automatiquement toutes les pages, les pages paires ou impaires ou les pages contenant un terme recherché. Ces commandes sont disponibles dans le menu Édition. Vous pouvez également sélectionner des pages manuellement en utilisant le clavier et la souris. Utilisez Ctrl ou Maj pour sélectionner plus d'une page. Déplacement des pages Pour déplacer (ou réordonner) la ou les pages sélectionnées, faites les glisser à la position désirée dans le document. Toutes les actions d'édition, sauf la suppression des pages, peuvent être annulées en choisissant ÉditionAnnuler ou en pressant CtrlZ. Extraction des pages L'extraction de ou des pages sélectionnées ouvre une nouvelle fenêtre PDF Mod contenant uniquement les pages sélectionnées dans un nouveau document, prêtes à être modifiées ou enregistrées. Pour extraire la ou les pages sélectionnées, choisissez ÉditionExtraire la (les) page(s). Toutes les actions d'édition ou de sélection disponibles dans le menu Édition sont également disponibles par un clic droit sur une page. Certaines actions sont également disponibles dans la barre d'outils. Rotation des pages Pour tourner la ou les pages sélectionnées, choisissez ÉditionTourner ou appuyez sur [ pour effectuer une rotation vers la gauche (sens inverse des aiguilles) et sur ] pour effectuer une rotation vers la droite (sens des aiguilles). Suppression des pages Pour supprimer la ou les pages sélectionnées, appuyez sur la touche Suppr ou choisissez ÉditionSupprimer la page. Il n'est pour l'instant pas possible d'annuler cette action à l'aide du menu ÉditionAnnuler. Vous pouvez fermer le document sans enregistrer et l'ouvrir à nouveau pour récupérer votre page mais vous perdrez toutes les autres modifications que vous auriez déjà effectuées. Enregistrement Après avoir modifié le document, il y a deux façons d'enregistrer votre travail. Vous pouvez écraser le document original en choisissant FichierEnregistrer ou vous pouvez enregistrer vos modifications dans un nouveau fichier en choisissant FichierEnregistrer sous. pdfmod-0.9.1/docs/es/0000777000175000001440000000000011533760021014450 5ustar00gabeusers00000000000000pdfmod-0.9.1/docs/es/es.po0000644000175000001440000003001211533760021015407 0ustar00gabeusers00000000000000# Andreu Correa Casablanca , 2009. # Jorge González , 2009. msgid "" msgstr "" "Project-Id-Version: pdf mod doc\n" "POT-Creation-Date: 2009-08-07 18:16+0000\n" "PO-Revision-Date: 2009-08-09 18:40+0200\n" "Last-Translator: Jorge González \n" "Language-Team: Español \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: C/pdfmod.xml:6(title) msgid "The PDF Mod Manual" msgstr "El manual de PDF Mod" #: C/pdfmod.xml:8(para) msgid "" "This is the user's manual for PDF Mod, a simple tool for manipulating PDF " "documents." msgstr "" "Éste es el manual de PDF Mod, una herramienta simple para manipular " "documentos PDF." #: C/pdfmod.xml:10(subtitle) msgid "Quick, Easy PDF Modification" msgstr "Rápida y sencilla modificación de PDF" #: C/pdfmod.xml:12(year) msgid "2009" msgstr "2009" #: C/pdfmod.xml:13(holder) C/pdfmod.xml:23(orgname) msgid "Novell, Inc." msgstr "Novell, Inc." #: C/pdfmod.xml:16(publishername) msgid "GNOME Documentation Project" msgstr "Proyecto de documentación GNOME" #: C/pdfmod.xml:20(firstname) msgid "Gabriel" msgstr "Gabriel" #: C/pdfmod.xml:21(surname) msgid "Burt" msgstr "Burt" #: C/pdfmod.xml:29(revnumber) msgid "0.2" msgstr "0.2" #: C/pdfmod.xml:30(date) msgid "2009-07-29" msgstr "2009-07-29" #: C/pdfmod.xml:33(revnumber) msgid "0.1" msgstr "0.1" #: C/pdfmod.xml:34(date) msgid "2009-07-25" msgstr "2009-07-25" #: C/pdfmod.xml:40(title) msgid "Introduction" msgstr "Introducción" #: C/pdfmod.xml:41(para) msgid "" "PDF Mod is a simple tool for doing basic manipulations of PDF documents." msgstr "" "PDF Mod es una herramienta simple para realizar manipulaciones básicas en " "documentos PDF." #: C/pdfmod.xml:45(para) msgid "" "With this tool, you can rotate, remove, or extract pages in a PDF document. " "You can also add pages from another document." msgstr "" "Con esta herramienta puede rotar, quitar o extraer páginas de documentos " "PDF. También puede añadir páginas de otro documento." #: C/pdfmod.xml:50(para) msgid "" "You can start PDF Mod from your applications menu or launcher, or by right " "clicking on one or more PDF documents in the file browser, and choosing to " "open with PDF Mod." msgstr "" "Puede iniciar PDF Mod desde el menú de aplicaciones o el lanzador, o " "pulsando con el botón derecho del ratón sobre uno o más documentos PDF en el " "examinador de archivos y escoger abrirlo con PDF Mod." #: C/pdfmod.xml:56(para) msgid "" "Like a normal editor application, you must save the changes you make using " "PDF Mod. If you want to keep the original document and save your changes to " "a new file, use Save As." msgstr "" "Como en una aplicación normal de edición, debe guardar los cambios que vaya " "realizando con PDF Mod. Si quiere mantener el documento original y guarda " "sus cambios en un nuevo archivo, usa la opción Guardar como." #: C/pdfmod.xml:63(title) msgid "Usage" msgstr "Uso" #: C/pdfmod.xml:66(title) msgid "Opening a Document" msgstr "Abrir un documento" #: C/pdfmod.xml:67(para) msgid "To open a document in PDF Mod:" msgstr "Para abrir un documento en PDF Mod:" #: C/pdfmod.xml:72(para) msgid "" "Choose FileOpen and select your document, or" msgstr "" "Elija ArchivoAbrir y seleccione su documento, o" #: C/pdfmod.xml:77(para) msgid "" "Press CtrlO and " "select your document, or" msgstr "" "Pulse CtrlO y " "seleccione su documento, o" #: C/pdfmod.xml:87(para) msgid "" "Drag a PDF document from your Desktop or file browser into a PDF Mod window " "that doesn't already have a document loaded, or" msgstr "" "Arrastre un documento PDF desde su Escritorio o examinador de archivos en " "una ventana de PDF Mod que todavía no contenga un documento cargado, o" #: C/pdfmod.xml:92(para) msgid "" "Choose a document from FileRecent Documents." msgstr "" "Elija un documento desde ArchivoDocumentos recientes." #: C/pdfmod.xml:100(title) msgid "Zooming" msgstr "Ampliación" #: C/pdfmod.xml:101(para) msgid "" "Zooming will make the page thumbnails bigger or smaller. PDF Mod starts in " "Best Fit mode, where it tries to make all the pages visible at once." msgstr "" "La ampliación hará las miniaturas de las páginas más grandes o más pequeñas. " "PDF Mod se inicia con el modo de mejor ajuste, en el que trata de mostrar " "todas las páginas a la vez." #: C/pdfmod.xml:104(para) msgid "" "You can zoom in or out with the options under View, or by pressing Ctrl and moving your " "mouse's scroll wheel." msgstr "" "Puede ampliar o reducir la vista con las opciones que hay en " "Ver, o pulsando Ctrl y moviendo la rueda de desplazamiento del ratón." #: C/pdfmod.xml:110(title) msgid "Viewing and Editing Properties" msgstr "Ver y editar propiedades" #: C/pdfmod.xml:111(para) msgid "" "You can view and edit the Title, Author, Keywords, and Subject of the " "document by opening the properties. To do so, choose " "FileProperties, press AltEnter, or click the Properties button on the toolbar." msgstr "" "Puede ver y editar el título, autor, palabras clave y género del documento " "abriendo sus propiedades. Para hacerlo, elija ArchivoPropiedades pulse, " "AltIntro o pulse en " "el botón Propiedades de la barra de herramientas." #: C/pdfmod.xml:119(title) msgid "Selecting Pages" msgstr "Seleccionar páginas" #: C/pdfmod.xml:120(para) msgid "" "PDF Mod can automatically select all pages, even-numbered pages, odd-" "numbered pages, or pages containing a search term. These options are " "available under Edit." msgstr "" "PDF Mod puede seleccionar automáticamente todas las páginas, las páginas " "pares, las páginas impares o incluso páginas que incluyan un término " "concreto de búsqueda. Estas opciones están disponibles en " "Editar." #: C/pdfmod.xml:124(para) msgid "" "You can select pages manually using the keyboard and mouse as well. Use " "Ctrl or Shift to select more than one page." msgstr "" "Puede seleccionar páginas manualmente usando el teclado y el ratón. Use " "Ctrl o Mayús para seleccionar más de una " "página." #: C/pdfmod.xml:130(title) msgid "Moving Pages" msgstr "Mover páginas" #: C/pdfmod.xml:131(para) msgid "" "To move (aka reorder) the selected page or pages, drag them to the position " "in the document to which you want them moved." msgstr "" "Para mover la (o las) páginas seleccionadas, arrástrelas desde donde están a " "la posición del documento en la que quiere que estén." #: C/pdfmod.xml:135(para) msgid "" "All editing actions except removing pages can be undone by choosing " "EditUndo or by pressing CtrlZ." msgstr "" "Todas las opciones de edición excepto la eliminación de páginas pueden " "deshacerse desde el menú EditarDeshacer o pulsando " "CtrlZ." #: C/pdfmod.xml:144(title) msgid "Extracting Pages" msgstr "Extraer páginas" #: C/pdfmod.xml:145(para) msgid "" "Extracting the selected page or pages will open a new PDF Mod window with " "just the selected pages in a new document, ready for further editing or to " "save." msgstr "" "Extraer la (o las) páginas seleccionadas abrirá una nueva ventana de PDF Mod " "sólo con las páginas seleccionadas en un nuevo documento, a punto para ser " "editado o guardado." #: C/pdfmod.xml:148(para) msgid "" "To extract the selected page or pages, choose EditExtract Page." msgstr "" "Para extraer la (o las) páginas seleccionadas, elija " "EditarExtraer página." #: C/pdfmod.xml:152(para) msgid "" "All of the editing and selection actions available under " "Edit are also available by right " "clicking on a page. Some actions are available on the toolbar as well." msgstr "" "Todas las opciones de edición y selección están disponibles en " "Editar también están disponibles " "pulsando con el botón derecho del ratón sobre una página. Algunas acciones " "también están disponibles en la barra de herramientas." #: C/pdfmod.xml:160(title) msgid "Rotating Pages" msgstr "Rotar páginas" #: C/pdfmod.xml:161(para) msgid "" "To rotate the selected page or pages, choose EditRotate Page or press " "[ to rotate left (CCW) and " "] to rotate right (CW)." msgstr "" "Para rotar la (o las) páginas seleccionadas, elija " "EditarRotar página o pulse [ " "para rotar a la izquierda y ] para " "rotar a la derecha." #: C/pdfmod.xml:168(title) msgid "Removing Pages" msgstr "Quitar páginas" #: C/pdfmod.xml:169(para) msgid "" "To remove the selected page or pages, press Delete or " "choose EditRemove Page." msgstr "" "Para quitar la (o las) páginas seleccionadas, pulse Supr o " "elija EditarQuitar página." #: C/pdfmod.xml:174(para) msgid "" "It is not currently possible to undo this action via " "EditUndo. You can close the document without saving and open it again to " "get your page back, though you will lose any other changes you have made." msgstr "" "Actualmente no es posible deshacer esta acción mediante " "EditarDeshacer. Puede cerrar el documento sin guardar y abrirlo otra vez para " "recuperar el estado anterior de la página, aunque perderá el resto de " "cambios que no hayas guardad." #: C/pdfmod.xml:182(title) msgid "Saving" msgstr "Guardar" #: C/pdfmod.xml:183(para) msgid "" "After making changes to the document, there are two ways to save your work. " "You can overwrite the original document by choosing " "FileSave, or you can save your changes to a new file by choosing " "FileSave As." msgstr "" "Después de realizar cambios en el documento, hay dos formas diferentes de " "guardar su trabajo. Puede sobreescribir el documento original eligiendo " "ArchivoGuardar o puede guardar los cambios en un nuevo archivo eligiendo " "ArchivoGuardar como." #. Put one translator per line, in the form of NAME , YEAR1, YEAR2. #: C/pdfmod.xml:0(None) msgid "translator-credits" msgstr "Andreu Correa Casablanca , 2009" pdfmod-0.9.1/docs/es/pdfmod.xml0000644000175000001440000001563611533760020016451 0ustar00gabeusers00000000000000 El manual de PDF Mod Éste es el manual de PDF Mod, una herramienta simple para manipular documentos PDF. Rápida y sencilla modificación de PDF 2009 Novell, Inc. 2009Andreu Correa Casablanca (castarco@gmail.com) Proyecto de documentación GNOME Gabriel Burt Novell, Inc. 0.2 2009-07-29 0.1 2009-07-25 Introducción PDF Mod es una herramienta simple para realizar manipulaciones básicas en documentos PDF. Con esta herramienta puede rotar, quitar o extraer páginas de documentos PDF. También puede añadir páginas de otro documento. Puede iniciar PDF Mod desde el menú de aplicaciones o el lanzador, o pulsando con el botón derecho del ratón sobre uno o más documentos PDF en el examinador de archivos y escoger abrirlo con PDF Mod. Como en una aplicación normal de edición, debe guardar los cambios que vaya realizando con PDF Mod. Si quiere mantener el documento original y guarda sus cambios en un nuevo archivo, usa la opción Guardar como. Uso Abrir un documento Para abrir un documento en PDF Mod: Elija ArchivoAbrir y seleccione su documento, o Pulse CtrlO y seleccione su documento, o Arrastre un documento PDF desde su Escritorio o examinador de archivos en una ventana de PDF Mod que todavía no contenga un documento cargado, o Elija un documento desde ArchivoDocumentos recientes. Ampliación La ampliación hará las miniaturas de las páginas más grandes o más pequeñas. PDF Mod se inicia con el modo de mejor ajuste, en el que trata de mostrar todas las páginas a la vez. Puede ampliar o reducir la vista con las opciones que hay en Ver, o pulsando Ctrl y moviendo la rueda de desplazamiento del ratón. Ver y editar propiedades Puede ver y editar el título, autor, palabras clave y género del documento abriendo sus propiedades. Para hacerlo, elija ArchivoPropiedades pulse, AltIntro o pulse en el botón Propiedades de la barra de herramientas. Seleccionar páginas PDF Mod puede seleccionar automáticamente todas las páginas, las páginas pares, las páginas impares o incluso páginas que incluyan un término concreto de búsqueda. Estas opciones están disponibles en Editar. Puede seleccionar páginas manualmente usando el teclado y el ratón. Use Ctrl o Mayús para seleccionar más de una página. Mover páginas Para mover la (o las) páginas seleccionadas, arrástrelas desde donde están a la posición del documento en la que quiere que estén. Todas las opciones de edición excepto la eliminación de páginas pueden deshacerse desde el menú EditarDeshacer o pulsando CtrlZ. Extraer páginas Extraer la (o las) páginas seleccionadas abrirá una nueva ventana de PDF Mod sólo con las páginas seleccionadas en un nuevo documento, a punto para ser editado o guardado. Para extraer la (o las) páginas seleccionadas, elija EditarExtraer página. Todas las opciones de edición y selección están disponibles en Editar también están disponibles pulsando con el botón derecho del ratón sobre una página. Algunas acciones también están disponibles en la barra de herramientas. Rotar páginas Para rotar la (o las) páginas seleccionadas, elija EditarRotar página o pulse [ para rotar a la izquierda y ] para rotar a la derecha. Quitar páginas Para quitar la (o las) páginas seleccionadas, pulse Supr o elija EditarQuitar página. Actualmente no es posible deshacer esta acción mediante EditarDeshacer. Puede cerrar el documento sin guardar y abrirlo otra vez para recuperar el estado anterior de la página, aunque perderá el resto de cambios que no hayas guardad. Guardar Después de realizar cambios en el documento, hay dos formas diferentes de guardar su trabajo. Puede sobreescribir el documento original eligiendo ArchivoGuardar o puede guardar los cambios en un nuevo archivo eligiendo ArchivoGuardar como. pdfmod-0.9.1/docs/Makefile.am0000644000175000001440000000027211461354671016104 0ustar00gabeusers00000000000000include $(top_srcdir)/gnome-doc-utils.make dist-hook: doc-dist-hook DOC_MODULE = pdfmod DOC_ENTITIES = DOC_INCLUDES = DOC_FIGURES = DOC_LINGUAS = ca cs da de es fr hr pl sl sv zh_CN pdfmod-0.9.1/docs/ca/0000777000175000001440000000000011533760021014424 5ustar00gabeusers00000000000000pdfmod-0.9.1/docs/ca/pdfmod.xml0000644000175000001440000001603411533760020016416 0ustar00gabeusers00000000000000 El manual del PDF Mod Aquest es el manual d'usuari del PDF Mod, una eina simple per a manipular documents PDF. Modificació ràpida i fàcil de PDF 2009 Novel, Inc. 2009Andreu Correa Casablanca (castarco@gmail.com) Projecte de documentació del GNOME Gabriel Burt Novel, Inc. 0.2 29-07-2009 0.1 25-07-2009 Introducció El PDF Mod es una eina senzilla per a realitzar manipulacions bàsiques de documents PDF. Amb aquesta eina podeu girar, suprimir o extreure pàgines d'un document PDF. També podeu afegir pàgines procedents d'un altre document. Podeu iniciar el PDF Mod des del menú d'aplicacions del sistema, des d'un llançador o bé fent clic amb el botó secundari del ratolí sobre un document PDF en el navegador de fitxers i escollint obrir-lo amb el PDF Mod. Com en una aplicació d'edició normal, heu de desar els canvis que hagueu realitzat amb el PDF Mod. Si voleu conservar el document original sense canvis i desar els canvis en un nou fitxer, utilitzeu l'opció Anomena i desa. Ús Obertura d'un document Per obrir un document amb el PDF Mod: Seleccioneu FitxerObrir i sel·leccioneu el document, o Teclegeu CtrlO i sel·leccioneu el document, o Arrossegueu un document PDF des de l'escriptori o el navegador de fitxers cap a una finestra del PDF Mod que no tingui cap document obert, o Seleccioneu un document des del menú FitxerDocuments recents. Ampliar L'ampliació farà que les miniatures de les pàgines siguin més grans o més petites. El PDF Mod s'inicia en el mode de millor ajustament, que intenta que es vegin totes les pàgines a la vegada. Podeu ampliar o reduir la visualització amb les opcions disponibles a Visualitza o teclejant Ctrl i movent la rodeta del ratolí. Visualització i edició de les propietats Podeu visualitzar i editar el títol, l'autor, les paraules claus i l'assumpte del document si obriu les seves propietats. Per anar-hi seleccioneu FitxerPropietats, teclegeu AltRetorn, o feu clic al botó de Propietats que hi ha a la barra d'eines. Sel·lecció de pàgines El PDF Mod pot sel·leccionar automàticament totes les pàgines, les pàgines parells, les pàgines senars o pàgines que continguin certs termes de cerca. Aquestes opcions son disponibles a Edita. Podeu sel·leccionar pàgines manualment utilitzant el teclat i el ratolí. Premeu les tecles Ctrl o Majúscules per sel·leccionar més d'una pàgina. Moure pàgines Per moure (reordenar) les pàgines sel·leccionades arrossegueu-les des de la posició on són fins la posició desitjada. Totes les accions d'edició excepte la supressió de pàgines poden ser desfetes si seleccioneu EditaDesfés o si teclegeu CtrlZ. Extreure pàgines Quant s'extreguin les pàgines sel·leccionades s'obrirà una finestra nova del PDF Mod mostrant un document nou amb les pàgines que s'hagin extret apunt per ser modificat o desat. Per extreure les pàgines sel·leccionades seleccioneu EditaExtreu la pàgina. Totes les accions d'edició i sel·lecció són disponibles al menú Edita com també són disponibles fent clic amb el botó secundari sobre una pàgina. Algunes d'aquestes accions també estan disponibles a la barra d'eines. Rotació de pàgines Per girar les pàgines sel·leccionades seleccioneu EditaGira la pàginao teclegeu [ per girar a l'esquerra i [ per girar a al dreta. Supressió de pàgines Per a suprimir les pàgines sel·leccionades teclegeu Suprimir o seleccioneu EditaSuprimeix la pàgina. Actualment no és possible desfer l'acció amb EditaDesfés. Podeu tancar el document sense desar els canvis i obrir-lo un altre cop per recuperar l'estat anterior del document, tot i que perdrà tots els altres canvis que s'hagin fet. Desat Després de fer canvis al document hi ha dues maneres de desar-ne els canvis. Podeu sobreescriure el document original si seleccioneu FitxerDesa o bé podeu desar els canvis en un fitxer nou si seleccioneu FitxerAnomena i desa. pdfmod-0.9.1/docs/ca/ca.po0000644000175000001440000003046711533760021015355 0ustar00gabeusers00000000000000# Catalan translation for pdfmod. # Copyright (C) 2009 pdfmod's COPYRIGHT HOLDER # This file is distributed under the same license as the pdfmod package. # Andreu Correa Casablanca , 2009. # # Andreu Correa Casablanca , 2009. msgid "" msgstr "" "Project-Id-Version: pdfmod help\n" "POT-Creation-Date: 2009-08-22 10:32+0000\n" "PO-Revision-Date: 2009-08-18 18:13+0200\n" "Last-Translator: Andreu Correa Casablanca \n" "Language-Team: Catalan \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: C/pdfmod.xml:6(title) msgid "The PDF Mod Manual" msgstr "El manual del PDF Mod" #: C/pdfmod.xml:8(para) msgid "" "This is the user's manual for PDF Mod, a simple tool for manipulating PDF " "documents." msgstr "" "Aquest es el manual d'usuari del PDF Mod, una eina simple per a manipular " "documents PDF." #: C/pdfmod.xml:10(subtitle) msgid "Quick, Easy PDF Modification" msgstr "Modificació ràpida i fàcil de PDF" #: C/pdfmod.xml:12(year) msgid "2009" msgstr "2009" #: C/pdfmod.xml:13(holder) C/pdfmod.xml:23(orgname) msgid "Novell, Inc." msgstr "Novel, Inc." #: C/pdfmod.xml:16(publishername) msgid "GNOME Documentation Project" msgstr "Projecte de documentació del GNOME" #: C/pdfmod.xml:20(firstname) msgid "Gabriel" msgstr "Gabriel" #: C/pdfmod.xml:21(surname) msgid "Burt" msgstr "Burt" #: C/pdfmod.xml:29(revnumber) msgid "0.2" msgstr "0.2" #: C/pdfmod.xml:30(date) msgid "2009-07-29" msgstr "29-07-2009" #: C/pdfmod.xml:33(revnumber) msgid "0.1" msgstr "0.1" #: C/pdfmod.xml:34(date) msgid "2009-07-25" msgstr "25-07-2009" #: C/pdfmod.xml:40(title) msgid "Introduction" msgstr "Introducció" #: C/pdfmod.xml:41(para) msgid "" "PDF Mod is a simple tool for doing basic manipulations of PDF documents." msgstr "" "El PDF Mod es una eina senzilla per a realitzar manipulacions bàsiques de " "documents PDF." #: C/pdfmod.xml:45(para) msgid "" "With this tool, you can rotate, remove, or extract pages in a PDF document. " "You can also add pages from another document." msgstr "" "Amb aquesta eina podeu girar, suprimir o extreure pàgines d'un document PDF. " "També podeu afegir pàgines procedents d'un altre document." #: C/pdfmod.xml:50(para) msgid "" "You can start PDF Mod from your applications menu or launcher, or by right " "clicking on one or more PDF documents in the file browser, and choosing to " "open with PDF Mod." msgstr "" "Podeu iniciar el PDF Mod des del menú d'aplicacions del sistema, des d'un " "llançador o bé fent clic amb el botó secundari del ratolí sobre un document " "PDF en el navegador de fitxers i escollint obrir-lo amb el PDF Mod." #: C/pdfmod.xml:56(para) msgid "" "Like a normal editor application, you must save the changes you make using " "PDF Mod. If you want to keep the original document and save your changes to " "a new file, use Save As." msgstr "" "Com en una aplicació d'edició normal, heu de desar els canvis que hagueu " "realitzat amb el PDF Mod. Si voleu conservar el document original sense " "canvis i desar els canvis en un nou fitxer, utilitzeu l'opció Anomena i desa." #: C/pdfmod.xml:63(title) msgid "Usage" msgstr "Ús" #: C/pdfmod.xml:66(title) msgid "Opening a Document" msgstr "Obertura d'un document" #: C/pdfmod.xml:67(para) msgid "To open a document in PDF Mod:" msgstr "Per obrir un document amb el PDF Mod:" #: C/pdfmod.xml:72(para) msgid "" "Choose FileOpen and select your document, or" msgstr "" "Seleccioneu FitxerObrir i sel·leccioneu el document, o" #: C/pdfmod.xml:77(para) msgid "" "Press CtrlO and " "select your document, or" msgstr "" "Teclegeu CtrlO i " "sel·leccioneu el document, o" #: C/pdfmod.xml:87(para) msgid "" "Drag a PDF document from your Desktop or file browser into a PDF Mod window " "that doesn't already have a document loaded, or" msgstr "" "Arrossegueu un document PDF des de l'escriptori o el navegador de fitxers " "cap a una finestra del PDF Mod que no tingui cap document obert, o" #: C/pdfmod.xml:92(para) msgid "" "Choose a document from FileRecent Documents." msgstr "" "Seleccioneu un document des del menú FitxerDocuments recents." #: C/pdfmod.xml:100(title) msgid "Zooming" msgstr "Ampliar" #: C/pdfmod.xml:101(para) msgid "" "Zooming will make the page thumbnails bigger or smaller. PDF Mod starts in " "Best Fit mode, where it tries to make all the pages visible at once." msgstr "" "L'ampliació farà que les miniatures de les pàgines siguin més grans o més " "petites. El PDF Mod s'inicia en el mode de millor ajustament, que intenta " "que es vegin totes les pàgines a la vegada." #: C/pdfmod.xml:104(para) msgid "" "You can zoom in or out with the options under View, or by pressing Ctrl and moving your " "mouse's scroll wheel." msgstr "" "Podeu ampliar o reduir la visualització amb les opcions disponibles a " "Visualitza o teclejant " "Ctrl i movent la rodeta del ratolí." #: C/pdfmod.xml:110(title) msgid "Viewing and Editing Properties" msgstr "Visualització i edició de les propietats" #: C/pdfmod.xml:111(para) msgid "" "You can view and edit the Title, Author, Keywords, and Subject of the " "document by opening the properties. To do so, choose " "FileProperties, press AltEnter, or click the Properties button on the toolbar." msgstr "" "Podeu visualitzar i editar el títol, l'autor, les paraules claus i " "l'assumpte del document si obriu les seves propietats. Per anar-hi " "seleccioneu FitxerPropietats, teclegeu AltRetorn, o feu clic al botó de Propietats " "que hi ha a la barra d'eines." #: C/pdfmod.xml:119(title) msgid "Selecting Pages" msgstr "Sel·lecció de pàgines" #: C/pdfmod.xml:120(para) msgid "" "PDF Mod can automatically select all pages, even-numbered pages, odd-" "numbered pages, or pages containing a search term. These options are " "available under Edit." msgstr "" "El PDF Mod pot sel·leccionar automàticament totes les pàgines, les pàgines " "parells, les pàgines senars o pàgines que continguin certs termes de cerca. " "Aquestes opcions son disponibles a Edita." #: C/pdfmod.xml:124(para) msgid "" "You can select pages manually using the keyboard and mouse as well. Use " "Ctrl or Shift to select more than one page." msgstr "" "Podeu sel·leccionar pàgines manualment utilitzant el teclat i el ratolí. " "Premeu les tecles Ctrl o Majúscules per " "sel·leccionar més d'una pàgina." #: C/pdfmod.xml:130(title) msgid "Moving Pages" msgstr "Moure pàgines" #: C/pdfmod.xml:131(para) msgid "" "To move (aka reorder) the selected page or pages, drag them to the position " "in the document to which you want them moved." msgstr "" "Per moure (reordenar) les pàgines sel·leccionades arrossegueu-les des de la " "posició on són fins la posició desitjada." #: C/pdfmod.xml:135(para) msgid "" "All editing actions except removing pages can be undone by choosing " "EditUndo or by pressing CtrlZ." msgstr "" "Totes les accions d'edició excepte la supressió de pàgines poden ser " "desfetes si seleccioneu EditaDesfés o si teclegeu " "CtrlZ." #: C/pdfmod.xml:144(title) msgid "Extracting Pages" msgstr "Extreure pàgines" #: C/pdfmod.xml:145(para) msgid "" "Extracting the selected page or pages will open a new PDF Mod window with " "just the selected pages in a new document, ready for further editing or to " "save." msgstr "" "Quant s'extreguin les pàgines sel·leccionades s'obrirà una finestra nova del " "PDF Mod mostrant un document nou amb les pàgines que s'hagin extret apunt " "per ser modificat o desat." #: C/pdfmod.xml:148(para) msgid "" "To extract the selected page or pages, choose EditExtract Page." msgstr "" "Per extreure les pàgines sel·leccionades seleccioneu " "EditaExtreu la pàgina." #: C/pdfmod.xml:152(para) msgid "" "All of the editing and selection actions available under " "Edit are also available by right " "clicking on a page. Some actions are available on the toolbar as well." msgstr "" "Totes les accions d'edició i sel·lecció són disponibles al menú " "Edita com també són disponibles " "fent clic amb el botó secundari sobre una pàgina. Algunes d'aquestes accions " "també estan disponibles a la barra d'eines." #: C/pdfmod.xml:160(title) msgid "Rotating Pages" msgstr "Rotació de pàgines" #: C/pdfmod.xml:161(para) msgid "" "To rotate the selected page or pages, choose EditRotate Page or press " "[ to rotate left (CCW) and " "] to rotate right (CW)." msgstr "" "Per girar les pàgines sel·leccionades seleccioneu " "EditaGira la pàginao teclegeu [ " "per girar a l'esquerra i [ per girar a " "al dreta." #: C/pdfmod.xml:168(title) msgid "Removing Pages" msgstr "Supressió de pàgines" #: C/pdfmod.xml:169(para) msgid "" "To remove the selected page or pages, press Delete or " "choose EditRemove Page." msgstr "" "Per a suprimir les pàgines sel·leccionades teclegeu Suprimir o seleccioneu EditaSuprimeix la pàgina." #: C/pdfmod.xml:174(para) msgid "" "It is not currently possible to undo this action via " "EditUndo. You can close the document without saving and open it again to " "get your page back, though you will lose any other changes you have made." msgstr "" "Actualment no és possible desfer l'acció amb EditaDesfés. Podeu tancar el " "document sense desar els canvis i obrir-lo un altre cop per recuperar " "l'estat anterior del document, tot i que perdrà tots els altres canvis que " "s'hagin fet." #: C/pdfmod.xml:182(title) msgid "Saving" msgstr "Desat" #: C/pdfmod.xml:183(para) msgid "" "After making changes to the document, there are two ways to save your work. " "You can overwrite the original document by choosing " "FileSave, or you can save your changes to a new file by choosing " "FileSave As." msgstr "" "Després de fer canvis al document hi ha dues maneres de desar-ne els canvis. " "Podeu sobreescriure el document original si seleccioneu " "FitxerDesa o bé podeu desar els canvis en un fitxer nou si seleccioneu " "FitxerAnomena i desa." #. Put one translator per line, in the form of NAME , YEAR1, YEAR2. #: C/pdfmod.xml:0(None) msgid "translator-credits" msgstr "Andreu Correa Casablanca , 2009" pdfmod-0.9.1/docs/C/0000777000175000001440000000000011533760020014222 5ustar00gabeusers00000000000000pdfmod-0.9.1/docs/C/pdfmod.xml0000644000175000001440000001513211533760020016213 0ustar00gabeusers00000000000000 The PDF Mod Manual This is the user's manual for PDF Mod, a simple tool for manipulating PDF documents. Quick, Easy PDF Modification 2009 Novell, Inc. GNOME Documentation Project Gabriel Burt Novell, Inc. 0.2 2009-07-29 0.1 2009-07-25 Introduction PDF Mod is a simple tool for doing basic manipulations of PDF documents. With this tool, you can rotate, remove, or extract pages in a PDF document. You can also add pages from another document. You can start PDF Mod from your applications menu or launcher, or by right clicking on one or more PDF documents in the file browser, and choosing to open with PDF Mod. Like a normal editor application, you must save the changes you make using PDF Mod. If you want to keep the original document and save your changes to a new file, use Save As. Usage Opening a Document To open a document in PDF Mod: Choose FileOpen and select your document, or Press Ctrl O and select your document, or Drag a PDF document from your Desktop or file browser into a PDF Mod window that doesn't already have a document loaded, or Choose a document from FileRecent Documents. Zooming Zooming will make the page thumbnails bigger or smaller. PDF Mod starts in Best Fit mode, where it tries to make all the pages visible at once. You can zoom in or out with the options under View, or by pressing Ctrl and moving your mouse's scroll wheel. Viewing and Editing Properties You can view and edit the Title, Author, Keywords, and Subject of the document by opening the properties. To do so, choose FileProperties, press AltEnter, or click the Properties button on the toolbar. Selecting Pages PDF Mod can automatically select all pages, even-numbered pages, odd-numbered pages, or pages containing a search term. These options are available under Edit. You can select pages manually using the keyboard and mouse as well. Use Ctrl or Shift to select more than one page. Moving Pages To move (aka reorder) the selected page or pages, drag them to the position in the document to which you want them moved. All editing actions except removing pages can be undone by choosing EditUndo or by pressing CtrlZ. Extracting Pages Extracting the selected page or pages will open a new PDF Mod window with just the selected pages in a new document, ready for further editing or to save. To extract the selected page or pages, choose EditExtract Page. All of the editing and selection actions available under Edit are also available by right clicking on a page. Some actions are available on the toolbar as well. Rotating Pages To rotate the selected page or pages, choose EditRotate Page or press [ to rotate left (CCW) and ] to rotate right (CW). Removing Pages To remove the selected page or pages, press Delete or choose EditRemove Page. It is not currently possible to undo this action via EditUndo. You can close the document without saving and open it again to get your page back, though you will lose any other changes you have made. Saving After making changes to the document, there are two ways to save your work. You can overwrite the original document by choosing FileSave, or you can save your changes to a new file by choosing FileSave As. pdfmod-0.9.1/docs/de/0000777000175000001440000000000011533760021014431 5ustar00gabeusers00000000000000pdfmod-0.9.1/docs/de/pdfmod.xml0000644000175000001440000001702411533760020016423 0ustar00gabeusers00000000000000 Handbuch für PDF Mod Dies ist das Handbuch für PDF Mod, einem einfachen Werkzeug zur Bearbeitung von PDF-Dokumenten. Schnelle, einfache PDF-Bearbeitung 2009 Novell, Inc. 2009Benjamin Elbers (elbersb@gmail.com)2009Mario Blättermann (mariobl@gnome.org) GNOME-Dokumentationsprojekt Gabriel Burt Novell, Inc. 0.2 29. Juli 2009 0.1 25. Juli 2009 Einführung PDF Mod ist ein einfaches Werkzeug für die grundlegende Bearbeitung von PDF-Dokumenten. Mit diesem Programm können Sie die Seiten eines PDF-Dokuments drehen oder entfernen, und auch Seiten extrahieren. Es ist auch möglich, Seiten aus anderen PDF-Dokumenten hinzuzufügen. Sie können PDF-Mod aus dem Menü Anwendungen oder durch einen Starter aufrufen. Alternativ klicken Sie mit der rechten Maustaste auf eines oder mehrere PDF-Dokumente im Dateimanager und wählen Mit »PDF Mod« öffnen. Wie in jedem normalen Bearbeitungsprogramm müssen Veränderungen gespeichert werden, die mit PDF Mod durchgeführt wurden. Wenn Sie das Original-Dokument behalten wollen und die Veränderungen in eine neue Datei speichern wollen, benutzen Sie bitte Speichern unter. Anwendung Ein Dokument öffnen So öffnen Sie ein Dokument in PDF Mod: Wählen Sie DateiÖffnen und wählen Sie die Datei aus, oder drücken Sie StrgO und wählen Sie die Datei aus, oder ziehen Sie ein PDF-Dokument von der Arbeitsfläche oder aus dem Datei-Manager in ein PDF-Mod-Fenster, in dem noch kein Dokument geöffnet ist, oder wählen Sie ein Dokument aus DateiZuletzt bearbeitete Dokumente. Größe anpassen Dadurch wird die Größe der Vorschaubilder der PDF-Seiten verändert. PDF Mod versucht so zu starten, dass alle Seiten auf einmal angezeigt werden. Sie können die Ansicht mit den Optionen unter Ansicht vergrößern oder verkleinern, oder Sie drücken Strg und bewegen das Scrollrad ihrer Maus. Betrachten und Verändern von Eigenschaften Sie können den Titel, den Autor, die Schlüsselwörter und den Titel des Dokuments betrachten und verändern, indem Sie DateiEigenschaften wählen, AltEnter drücken oder auf den Eigenschaften-Knopf in der Werkzeugleiste klicken. Seiten auswählen PDF Mod kann automatisch alle Seiten oder Seiten mit gerader oder ungerader Seitennummer auswählen. Sie können auch Seiten mit einem passenden Suchtext auswählen. Diese Optionen finden Sie unter Bearbeiten. Sie können die Seiten auch manuell per Tastatur oder Maus auswählen. Benutzen Sie Strg oder die Umschalttaste, um mehr als eine Seite auszuwählen. Reihenfolge der Seiten verändern Um Seiten neu anzuordnen, ziehen Sie sie an die Position, die die Seiten im Dokument einnehmen sollen. Alle Aktionen außer dem Entfernen von Seiten können rückgängig gemacht werden, indem Sie BearbeitenRückgängig wählen oder StrgZ drücken. Seiten extrahieren Wenn Sie die ausgewählten Seiten extrahieren, öffnet sich ein neues PDF-Mod-Fenster mit nur diesen Seiten, um weiter bearbeitet oder gespeichert zu werden. Um die ausgewählten Seiten zu extrahieren, wählen Sie BearbeitenSeite extrahieren. Alle Bearbeitungs- und Auswahlaktionen, die unter Bearbeiten zur Verfügung stehen, können auch durch einen Rechtsklick auf eine Seite aktiviert werden. Einige sind auch in der Werkzeugleiste verfügbar. Seiten drehen Um die ausgewählten Seiten zu drehen, wählen Sie BearbeitenSeite drehen oder drücken Sie [, um nach links zu drehen (gegen den Uhrzeigersinn) und ] um nach rechts zu drehen (im Uhrzeigersinn). Seiten entfernen Um ausgewählte Seiten zu entfernen, drücken Sie Entf oder wählen Sie BearbeitenSeite entfernen. Es ist momentan nicht möglich, diese Aktion mit BearbeitenRückgängig zu widerrufen. Sie können das Dokument aber schließen, ohne zu speichern und erneut öffnen. Dabei gehen allerdings alle anderen Änderungen verloren. Speichern Nachdem Sie Veränderungen vorgenommen haben, gibt es zwei Wege, um Ihre Arbeit zu speichern. Sie können das bisherige Dokument mit DateiSpeichern überschreiben oder Sie speichern mit DateiSpeichern unter in einer neuen Datei. pdfmod-0.9.1/docs/de/de.po0000644000175000001440000003117611533760021015365 0ustar00gabeusers00000000000000# German translation of the PDF Mod manual. # Benjamin Elbers , 2009. # Mario Blättermann , 2009. # msgid "" msgstr "" "Project-Id-Version: pdf mod doc\n" "POT-Creation-Date: 2009-08-09 16:45+0000\n" "PO-Revision-Date: 2009-08-17 21:39+0100\n" "Last-Translator: Mario Blättermann \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: C/pdfmod.xml:6(title) msgid "The PDF Mod Manual" msgstr "Handbuch für PDF Mod" #: C/pdfmod.xml:8(para) msgid "" "This is the user's manual for PDF Mod, a simple tool for manipulating PDF " "documents." msgstr "" "Dies ist das Handbuch für PDF Mod, einem einfachen " "Werkzeug zur Bearbeitung von PDF-Dokumenten." #: C/pdfmod.xml:10(subtitle) msgid "Quick, Easy PDF Modification" msgstr "Schnelle, einfache PDF-Bearbeitung" #: C/pdfmod.xml:12(year) msgid "2009" msgstr "2009" #: C/pdfmod.xml:13(holder) C/pdfmod.xml:23(orgname) msgid "Novell, Inc." msgstr "Novell, Inc." #: C/pdfmod.xml:16(publishername) msgid "GNOME Documentation Project" msgstr "GNOME-Dokumentationsprojekt" #: C/pdfmod.xml:20(firstname) msgid "Gabriel" msgstr "Gabriel" #: C/pdfmod.xml:21(surname) msgid "Burt" msgstr "Burt" #: C/pdfmod.xml:29(revnumber) msgid "0.2" msgstr "0.2" #: C/pdfmod.xml:30(date) msgid "2009-07-29" msgstr "29. Juli 2009" #: C/pdfmod.xml:33(revnumber) msgid "0.1" msgstr "0.1" #: C/pdfmod.xml:34(date) msgid "2009-07-25" msgstr "25. Juli 2009" #: C/pdfmod.xml:40(title) msgid "Introduction" msgstr "Einführung" #: C/pdfmod.xml:41(para) msgid "PDF Mod is a simple tool for doing basic manipulations of PDF documents." msgstr "" "PDF Mod ist ein einfaches Werkzeug für die " "grundlegende Bearbeitung von PDF-Dokumenten." #: C/pdfmod.xml:45(para) msgid "" "With this tool, you can rotate, remove, or extract pages in a PDF document. " "You can also add pages from another document." msgstr "" "Mit diesem Programm können Sie die Seiten eines PDF-Dokuments drehen oder " "entfernen, und auch Seiten extrahieren. Es ist auch möglich, Seiten aus " "anderen PDF-Dokumenten hinzuzufügen." #: C/pdfmod.xml:50(para) msgid "" "You can start PDF Mod from your applications menu or launcher, or by right " "clicking on one or more PDF documents in the file browser, and choosing to " "open with PDF Mod." msgstr "" "Sie können PDF-Mod aus dem Menü " "Anwendungen oder durch einen Starter aufrufen. Alternativ " "klicken Sie mit der rechten Maustaste auf eines oder mehrere PDF-Dokumente im " "Dateimanager und wählen Mit »PDF Mod« öffnen." #: C/pdfmod.xml:56(para) msgid "" "Like a normal editor application, you must save the changes you make using " "PDF Mod. If you want to keep the original document and save your changes to a " "new file, use Save As." msgstr "" "Wie in jedem normalen Bearbeitungsprogramm müssen Veränderungen gespeichert " "werden, die mit PDF Mod durchgeführt wurden. Wenn " "Sie das Original-Dokument behalten wollen und die Veränderungen in eine neue " "Datei speichern wollen, benutzen Sie bitte Speichern unter." #: C/pdfmod.xml:63(title) msgid "Usage" msgstr "Anwendung" #: C/pdfmod.xml:66(title) msgid "Opening a Document" msgstr "Ein Dokument öffnen" #: C/pdfmod.xml:67(para) msgid "To open a document in PDF Mod:" msgstr "So öffnen Sie ein Dokument in PDF Mod:" #: C/pdfmod.xml:72(para) msgid "" "Choose FileOpen and select your document, or" msgstr "" "Wählen Sie DateiÖffnen und wählen Sie die Datei aus, oder" #: C/pdfmod.xml:77(para) msgid "" "Press CtrlO and select " "your document, or" msgstr "" "drücken Sie StrgO und " "wählen Sie die Datei aus, oder" #: C/pdfmod.xml:87(para) msgid "" "Drag a PDF document from your Desktop or file browser into a PDF Mod window " "that doesn't already have a document loaded, or" msgstr "" "ziehen Sie ein PDF-Dokument von der Arbeitsfläche oder aus dem Datei-Manager " "in ein PDF-Mod-Fenster, in dem noch kein Dokument " "geöffnet ist, oder" #: C/pdfmod.xml:92(para) msgid "" "Choose a document from FileRecent " "Documents." msgstr "" "wählen Sie ein Dokument aus DateiZuletzt bearbeitete Dokumente." #: C/pdfmod.xml:100(title) msgid "Zooming" msgstr "Größe anpassen" #: C/pdfmod.xml:101(para) msgid "" "Zooming will make the page thumbnails bigger or smaller. PDF Mod starts in " "Best Fit mode, where it tries to make all the pages visible at once." msgstr "" "Dadurch wird die Größe der Vorschaubilder der PDF-Seiten verändert. " "PDF Mod versucht so zu starten, dass alle Seiten " "auf einmal angezeigt werden." #: C/pdfmod.xml:104(para) msgid "" "You can zoom in or out with the options under View, or by pressing Ctrl and moving your " "mouse's scroll wheel." msgstr "" "Sie können die Ansicht mit den Optionen unter Ansicht vergrößern oder verkleinern, oder Sie drücken " "Strg und bewegen das Scrollrad ihrer Maus." #: C/pdfmod.xml:110(title) msgid "Viewing and Editing Properties" msgstr "Betrachten und Verändern von Eigenschaften" #: C/pdfmod.xml:111(para) msgid "" "You can view and edit the Title, Author, Keywords, and Subject of the " "document by opening the properties. To do so, choose " "FileProperties, press AltEnter, or click the Properties button on the toolbar." msgstr "" "Sie können den Titel, den Autor, die Schlüsselwörter und den Titel des " "Dokuments betrachten und verändern, indem Sie DateiEigenschaften wählen, " "AltEnter drücken oder " "auf den Eigenschaften-Knopf in der Werkzeugleiste " "klicken." #: C/pdfmod.xml:119(title) msgid "Selecting Pages" msgstr "Seiten auswählen" #: C/pdfmod.xml:120(para) msgid "" "PDF Mod can automatically select all pages, even-numbered pages, odd-numbered " "pages, or pages containing a search term. These options are available under " "Edit." msgstr "" "PDF Mod kann automatisch alle Seiten oder Seiten " "mit gerader oder ungerader Seitennummer auswählen. Sie können auch Seiten mit " "einem passenden Suchtext auswählen. Diese Optionen finden Sie unter " "Bearbeiten." #: C/pdfmod.xml:124(para) msgid "" "You can select pages manually using the keyboard and mouse as well. Use " "Ctrl or Shift to select more than one page." msgstr "" "Sie können die Seiten auch manuell per Tastatur oder Maus auswählen. Benutzen " "Sie Strg oder die Umschalttaste, um mehr " "als eine Seite auszuwählen." #: C/pdfmod.xml:130(title) msgid "Moving Pages" msgstr "Reihenfolge der Seiten verändern" #: C/pdfmod.xml:131(para) msgid "" "To move (aka reorder) the selected page or pages, drag them to the position " "in the document to which you want them moved." msgstr "" "Um Seiten neu anzuordnen, ziehen Sie sie an die Position, die die Seiten im " "Dokument einnehmen sollen." #: C/pdfmod.xml:135(para) msgid "" "All editing actions except removing pages can be undone by choosing " "EditUndo or by pressing CtrlZ." msgstr "" "Alle Aktionen außer dem Entfernen von Seiten können rückgängig gemacht " "werden, indem Sie BearbeitenRückgängig wählen oder " "StrgZ drücken." #: C/pdfmod.xml:144(title) msgid "Extracting Pages" msgstr "Seiten extrahieren" #: C/pdfmod.xml:145(para) msgid "" "Extracting the selected page or pages will open a new PDF Mod window with " "just the selected pages in a new document, ready for further editing or to " "save." msgstr "" "Wenn Sie die ausgewählten Seiten extrahieren, öffnet sich ein neues " "PDF-Mod-Fenster mit nur diesen Seiten, um weiter " "bearbeitet oder gespeichert zu werden." #: C/pdfmod.xml:148(para) msgid "" "To extract the selected page or pages, choose EditExtract Page." msgstr "" "Um die ausgewählten Seiten zu extrahieren, wählen Sie " "BearbeitenSeite extrahieren." #: C/pdfmod.xml:152(para) msgid "" "All of the editing and selection actions available under " "Edit are also available by right " "clicking on a page. Some actions are available on the toolbar as well." msgstr "" "Alle Bearbeitungs- und Auswahlaktionen, die unter " "Bearbeiten zur Verfügung stehen, " "können auch durch einen Rechtsklick auf eine Seite aktiviert werden. Einige " "sind auch in der Werkzeugleiste verfügbar." #: C/pdfmod.xml:160(title) msgid "Rotating Pages" msgstr "Seiten drehen" #: C/pdfmod.xml:161(para) msgid "" "To rotate the selected page or pages, choose EditRotate Page or press " "[ to rotate left (CCW) and " "] to rotate right (CW)." msgstr "" "Um die ausgewählten Seiten zu drehen, wählen Sie " "BearbeitenSeite drehen oder drücken Sie [, um nach links zu drehen (gegen den Uhrzeigersinn) und " "] um nach rechts zu drehen (im " "Uhrzeigersinn)." #: C/pdfmod.xml:168(title) msgid "Removing Pages" msgstr "Seiten entfernen" #: C/pdfmod.xml:169(para) msgid "" "To remove the selected page or pages, press Delete or choose " "EditRemove Page." msgstr "" "Um ausgewählte Seiten zu entfernen, drücken Sie Entf oder " "wählen Sie BearbeitenSeite " "entfernen." #: C/pdfmod.xml:174(para) msgid "" "It is not currently possible to undo this action via " "EditUndo. You can close the document without saving and open it again to " "get your page back, though you will lose any other changes you have made." msgstr "" "Es ist momentan nicht möglich, diese Aktion mit " "BearbeitenRückgängig zu widerrufen. Sie können das Dokument aber " "schließen, ohne zu speichern und erneut öffnen. Dabei gehen allerdings alle " "anderen Änderungen verloren." #: C/pdfmod.xml:182(title) msgid "Saving" msgstr "Speichern" #: C/pdfmod.xml:183(para) msgid "" "After making changes to the document, there are two ways to save your work. " "You can overwrite the original document by choosing " "FileSave, or you can save your changes to a new file by choosing " "FileSave As." msgstr "" "Nachdem Sie Veränderungen vorgenommen haben, gibt es zwei Wege, um Ihre " "Arbeit zu speichern. Sie können das bisherige Dokument mit " "DateiSpeichern überschreiben oder Sie speichern mit DateiSpeichern unter in einer " "neuen Datei." #. Put one translator per line, in the form of NAME , YEAR1, YEAR2. #: C/pdfmod.xml:0(None) msgid "translator-credits" msgstr "" "Benjamin Elbers , 2009\n" "Mario Blättermann , 2009" pdfmod-0.9.1/docs/pl/0000777000175000001440000000000011533760021014454 5ustar00gabeusers00000000000000pdfmod-0.9.1/docs/pl/pdfmod.xml0000644000175000001440000001511511533760020016445 0ustar00gabeusers00000000000000 Instrukcja obsługi PDF Mod To jest instrukcja obsługi PDF Mod, prostego narzędzia do manipulacji dokumentami PDF. Szybka i łatwa edycja dokumentów PDF 2009 Novell, Inc. 2009.Michał Sawicz (michal@sawicz.net) Projekt Dokumentacji GNOME Gabriel Burt Novell, Inc. 0.2 2009-07-29 0.1 2009-07-25 Wstęp PDF Mod to proste narzędzie pozwalające na podstawową edycję dokumentów PDF. Dzięki niemu możesz obracać, usuwać lub zgrywać strony dokumentu PDF. Możesz także dodać strony z innego dokumentu. PDF Mod możesz uruchomić poprzez menu aplikacji lub poprzez kliknięcie lewego przycisku myszy na jednym bądź kilku dokumentach PDF w przeglądarce plików i wybór otwarcia przy użyciu PDF Mod. Jak w przypadku każdego edytora, musisz zapisać zmiany wykonane w dokumencie. Jeśli chcesz zachować oryginalny dokument i zapisać zmiany, użyj opcji Zapisz jako. Sposób użycia Otwieranie dokumentu Aby otworzyć dokument w PDF Mod: Wybierz Plik Otwórz i wybierz dokument lub Naciśnij CtrlO i wybierz dokument lub Przeciągnij dokument PDF z Pulpitu lub przeglądarki plików na okno PDF Mod w którym nie otwarto jeszcze dokumentu lub Wybierz dokument z PlikOstatnio otwarte pliki. Powiększenie Powiększenie zwiększy lub zmniejszy miniaturki stron. PDF Mod uruchamia się w trybie Najlepsze dopasowanie, w którym wszystkie strony są widoczne w tym samym czasie. Możesz powiększać lub powiększać używając opcji w menu View lub przytrzymując Ctrl i obracając kółko myszy. Podgląd i edycja właściwości PDF Mod może automatycznie zaznaczyć wszystkie strony, strony parzyste lub nieparzyste albo strony zawierające dane wyrażenie. Opcje te dostępne są w menu Edycja. Zaznaczanie stron PDF Mod może automatycznie zaznaczyć wszystkie strony, strony parzyste lub nieparzyste albo strony zawierające dane wyrażenie. Opcje te dostępne są w menu Edycja. Możesz także ręcznie wybierać strony używając klawiatury lub myszy. Użyj Ctrl lub Shift aby wybrać więcej niż jedną stronę. Przenoszenie stron Aby przenieść (zmienić kolejność) zaznaczoną stronę lub strony, przeciągnij je w dokumencie na pozycję w której mają się znaleźć. Wszystkie operacje z wyjątkiem usuwania stron mogą być cofnięte poprzez wybór EdycjaCofnij lub naciśnięcie CtrlZ. Zgrywanie stron Zgranie zaznaczonej strony lub stron otworzy nowe okno PDF Mod zawierające wybrane strony w nowym dokumencie, gotowym do dalszej edycji lub zapisania. Aby zgrać zazaczoną stronę lub strony, wubierz EdycjaZgraj stronę. Wszystkie operacje edycji i zaznaczania dostępne w menu Edycja są także dostępne po kliknięciu prawym przyciskiem myszy na stronie. Część operacji jest też dostępna w pasku narzędzi. Obracanie stron Aby obrócić zaznaczoną stronę lub strony, wybierz EdycjaObróć stronę lub naciśnij [ aby obrócić w lewo (przeciwnie do wskazówek zegara) lub ] aby obrócić w prawo (zgodnie ze wskazówkami zegara). Usuwanie stron Aby usunąć zaznaczoną stronę lub strony, naciśnij Delete lub wybierz EdycjaUsuń stronę. Obecnie nie jest możliwe cofnięcie tej operacji poprzez menu EdycjaCofnij. Możesz zamknąć dokument bez zapisywania i otworzyć ponownie aby odzyskać stronę, utracisz jednak wszystkie inne zmiany dokonane w dokumencie. Zapisywanie Po dokonaniu zmian w dokumencie, istnieją dwie możliwości ich zapisania. Możesz nadpisać oryginalny dokument wybierając PlikZapisz lub zapisać zmiany w nowym pliku wybierając PlikZapisz jako. pdfmod-0.9.1/docs/pl/pl.po0000644000175000001440000002637211533760021015435 0ustar00gabeusers00000000000000msgid "" msgstr "" "Project-Id-Version: pdfmod 0.3\n" "POT-Creation-Date: 2009-08-01 19:43+0200\n" "PO-Revision-Date: 2009-08-01 19:55+0100\n" "Last-Translator: Michał Sawicz \n" "Language-Team: Polish\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: C/pdfmod.xml:6(title) msgid "The PDF Mod Manual" msgstr "Instrukcja obsługi PDF Mod" #: C/pdfmod.xml:8(para) msgid "This is the user's manual for PDF Mod, a simple tool for manipulating PDF documents." msgstr "To jest instrukcja obsługi PDF Mod, prostego narzędzia do manipulacji dokumentami PDF." #: C/pdfmod.xml:10(subtitle) msgid "Quick, Easy PDF Modification" msgstr "Szybka i łatwa edycja dokumentów PDF" #: C/pdfmod.xml:12(year) msgid "2009" msgstr "2009" #: C/pdfmod.xml:13(holder) #: C/pdfmod.xml:23(orgname) msgid "Novell, Inc." msgstr "Novell, Inc." #: C/pdfmod.xml:16(publishername) msgid "GNOME Documentation Project" msgstr "Projekt Dokumentacji GNOME" #: C/pdfmod.xml:20(firstname) msgid "Gabriel" msgstr "Gabriel" #: C/pdfmod.xml:21(surname) msgid "Burt" msgstr "Burt" #: C/pdfmod.xml:29(revnumber) msgid "0.2" msgstr "0.2" #: C/pdfmod.xml:30(date) msgid "2009-07-29" msgstr "2009-07-29" #: C/pdfmod.xml:33(revnumber) msgid "0.1" msgstr "0.1" #: C/pdfmod.xml:34(date) msgid "2009-07-25" msgstr "2009-07-25" #: C/pdfmod.xml:40(title) msgid "Introduction" msgstr "Wstęp" #: C/pdfmod.xml:41(para) msgid "PDF Mod is a simple tool for doing basic manipulations of PDF documents." msgstr "PDF Mod to proste narzędzie pozwalające na podstawową edycję dokumentów PDF." #: C/pdfmod.xml:45(para) msgid "With this tool, you can rotate, remove, or extract pages in a PDF document. You can also add pages from another document." msgstr "Dzięki niemu możesz obracać, usuwać lub zgrywać strony dokumentu PDF. Możesz także dodać strony z innego dokumentu." #: C/pdfmod.xml:50(para) msgid "You can start PDF Mod from your applications menu or launcher, or by right clicking on one or more PDF documents in the file browser, and choosing to open with PDF Mod." msgstr "PDF Mod możesz uruchomić poprzez menu aplikacji lub poprzez kliknięcie lewego przycisku myszy na jednym bądź kilku dokumentach PDF w przeglądarce plików i wybór otwarcia przy użyciu PDF Mod." #: C/pdfmod.xml:56(para) msgid "Like a normal editor application, you must save the changes you make using PDF Mod. If you want to keep the original document and save your changes to a new file, use Save As." msgstr "Jak w przypadku każdego edytora, musisz zapisać zmiany wykonane w dokumencie. Jeśli chcesz zachować oryginalny dokument i zapisać zmiany, użyj opcji Zapisz jako." #: C/pdfmod.xml:63(title) msgid "Usage" msgstr "Sposób użycia" #: C/pdfmod.xml:66(title) msgid "Opening a Document" msgstr "Otwieranie dokumentu" #: C/pdfmod.xml:67(para) msgid "To open a document in PDF Mod:" msgstr "Aby otworzyć dokument w PDF Mod:" #: C/pdfmod.xml:72(para) msgid "Choose FileOpen and select your document, or" msgstr "Wybierz Plik Otwórz i wybierz dokument lub" #: C/pdfmod.xml:77(para) msgid "Press CtrlO and select your document, or" msgstr "Naciśnij CtrlO i wybierz dokument lub" #: C/pdfmod.xml:87(para) msgid "Drag a PDF document from your Desktop or file browser into a PDF Mod window that doesn't already have a document loaded, or" msgstr "Przeciągnij dokument PDF z Pulpitu lub przeglądarki plików na okno PDF Mod w którym nie otwarto jeszcze dokumentu lub" #: C/pdfmod.xml:92(para) msgid "Choose a document from FileRecent Documents." msgstr "Wybierz dokument z PlikOstatnio otwarte pliki." #: C/pdfmod.xml:100(title) msgid "Zooming" msgstr "Powiększenie" #: C/pdfmod.xml:101(para) msgid "Zooming will make the page thumbnails bigger or smaller. PDF Mod starts in Best Fit mode, where it tries to make all the pages visible at once." msgstr "Powiększenie zwiększy lub zmniejszy miniaturki stron. PDF Mod uruchamia się w trybie Najlepsze dopasowanie, w którym wszystkie strony są widoczne w tym samym czasie." #: C/pdfmod.xml:104(para) msgid "You can zoom in or out with the options under View, or by pressing Ctrl and moving your mouse's scroll wheel." msgstr "Możesz powiększać lub powiększać używając opcji w menu View lub przytrzymując Ctrl i obracając kółko myszy." #: C/pdfmod.xml:110(title) msgid "Viewing and Editing Properties" msgstr "Podgląd i edycja właściwości" #: C/pdfmod.xml:111(para) msgid "You can view and edit the Title, Author, Keywords, and Subject of the document by opening the properties. To do so, choose FileProperties, press AltEnter, or click the Properties button on the toolbar." msgstr "PDF Mod może automatycznie zaznaczyć wszystkie strony, strony parzyste lub nieparzyste albo strony zawierające dane wyrażenie. Opcje te dostępne są w menu Edycja." #: C/pdfmod.xml:119(title) msgid "Selecting Pages" msgstr "Zaznaczanie stron" #: C/pdfmod.xml:120(para) msgid "PDF Mod can automatically select all pages, even-numbered pages, odd-numbered pages, or pages containing a search term. These options are available under Edit." msgstr "PDF Mod może automatycznie zaznaczyć wszystkie strony, strony parzyste lub nieparzyste albo strony zawierające dane wyrażenie. Opcje te dostępne są w menu Edycja." #: C/pdfmod.xml:124(para) msgid "You can select pages manually using the keyboard and mouse as well. Use Ctrl or Shift to select more than one page." msgstr "Możesz także ręcznie wybierać strony używając klawiatury lub myszy. Użyj Ctrl lub Shift aby wybrać więcej niż jedną stronę." #: C/pdfmod.xml:130(title) msgid "Moving Pages" msgstr "Przenoszenie stron" #: C/pdfmod.xml:131(para) msgid "To move (aka reorder) the selected page or pages, drag them to the position in the document to which you want them moved." msgstr "Aby przenieść (zmienić kolejność) zaznaczoną stronę lub strony, przeciągnij je w dokumencie na pozycję w której mają się znaleźć." #: C/pdfmod.xml:135(para) msgid "All editing actions except removing pages can be undone by choosing EditUndo or by pressing CtrlZ." msgstr "Wszystkie operacje z wyjątkiem usuwania stron mogą być cofnięte poprzez wybór EdycjaCofnij lub naciśnięcie CtrlZ." #: C/pdfmod.xml:144(title) msgid "Extracting Pages" msgstr "Zgrywanie stron" #: C/pdfmod.xml:145(para) msgid "Extracting the selected page or pages will open a new PDF Mod window with just the selected pages in a new document, ready for further editing or to save." msgstr "Zgranie zaznaczonej strony lub stron otworzy nowe okno PDF Mod zawierające wybrane strony w nowym dokumencie, gotowym do dalszej edycji lub zapisania." #: C/pdfmod.xml:148(para) msgid "To extract the selected page or pages, choose EditExtract Page." msgstr "Aby zgrać zazaczoną stronę lub strony, wubierz EdycjaZgraj stronę." #: C/pdfmod.xml:152(para) msgid "All of the editing and selection actions available under Edit are also available by right clicking on a page. Some actions are available on the toolbar as well." msgstr "Wszystkie operacje edycji i zaznaczania dostępne w menu Edycja są także dostępne po kliknięciu prawym przyciskiem myszy na stronie. Część operacji jest też dostępna w pasku narzędzi." #: C/pdfmod.xml:160(title) msgid "Rotating Pages" msgstr "Obracanie stron" #: C/pdfmod.xml:161(para) msgid "To rotate the selected page or pages, choose EditRotate Page or press [ to rotate left (CCW) and ] to rotate right (CW)." msgstr "Aby obrócić zaznaczoną stronę lub strony, wybierz EdycjaObróć stronę lub naciśnij [ aby obrócić w lewo (przeciwnie do wskazówek zegara) lub ] aby obrócić w prawo (zgodnie ze wskazówkami zegara)." #: C/pdfmod.xml:168(title) msgid "Removing Pages" msgstr "Usuwanie stron" #: C/pdfmod.xml:169(para) msgid "To remove the selected page or pages, press Delete or choose EditRemove Page." msgstr "Aby usunąć zaznaczoną stronę lub strony, naciśnij Delete lub wybierz EdycjaUsuń stronę." #: C/pdfmod.xml:174(para) msgid "It is not currently possible to undo this action via EditUndo. You can close the document without saving and open it again to get your page back, though you will lose any other changes you have made." msgstr "Obecnie nie jest możliwe cofnięcie tej operacji poprzez menu EdycjaCofnij. Możesz zamknąć dokument bez zapisywania i otworzyć ponownie aby odzyskać stronę, utracisz jednak wszystkie inne zmiany dokonane w dokumencie." #: C/pdfmod.xml:182(title) msgid "Saving" msgstr "Zapisywanie" #: C/pdfmod.xml:183(para) msgid "After making changes to the document, there are two ways to save your work. You can overwrite the original document by choosing FileSave, or you can save your changes to a new file by choosing FileSave As." msgstr "Po dokonaniu zmian w dokumencie, istnieją dwie możliwości ich zapisania. Możesz nadpisać oryginalny dokument wybierając PlikZapisz lub zapisać zmiany w nowym pliku wybierając PlikZapisz jako." #. Put one translator per line, in the form of NAME , YEAR1, YEAR2. #: C/pdfmod.xml:0(None) msgid "translator-credits" msgstr "Michał Sawicz , 2009." pdfmod-0.9.1/docs/hr/0000777000175000001440000000000011533760021014452 5ustar00gabeusers00000000000000pdfmod-0.9.1/docs/hr/pdfmod.xml0000644000175000001440000001542211533760020016444 0ustar00gabeusers00000000000000 Priručnik za PDF Mod Ovo je priručnik za PDF Mod, jednostavan alat za manipulaciju PDF dokumentima. Brzo, lako uređivanje PDF dokumenata. 2009 Novell, Inc. 2009Igor Vatavuk (vatavuk.igor@gmail.com) GNOME dokumentacijski projekt Gabriel Burt Novell, Inc. 0.2 2009-07-29 0.1 2009-07-25 Uvod PDF Mod je jednostavan alat za osnovnu manipulaciju PDF dokumentima. Ovim alatom možete zakrenuti, brisati ili izdvojiti stranice u PDF dokumentu. Također možete dodati stranice iz drugog dokumenta. PDF Mod možete pokrenuti pomoću izbornika ili pokretača, ili desnim klikom na jedan ili više PDF dokumenata u pregledniku datoteka, te izabiranjem otvaranja programom PDF Mod. Kao i u drugim programima za uređivanje, morate spremiti promjene koje napravite koristeći PDF Mod. Ako želite zadržati originalni dokument i spremiti svoje promjene u novu datoteku, koristite Spremi kao. Korištenje Otvaranje dokumenta Za otvaranje dokumenta u PDF Mod programu: Izaberite DatotekaOtvori i odaberite vaš dokument, ili Pritisnite CtrlO i odaberite vaš dokument, ili Dovucite PDF dokument s vaše radne površine ili iz preglednika datoteka u PDF Mod prozor koji nema već otvoren dokument, ili Izaberite dokument iz DatotekaSkorašnji dokumenti. Uvećanje Uvećanje će učiniti sličice pregleda stranice većima ili manjima. PDF Mod pri pokretanju koristi način najboljeg pristajanja, koji pokušava prikazati sve stranice istovremeno. Možete uvećati ili umanjiti sličice koristeći Pogled, ili pritiskom na Ctrl i micanjem kotačića miša. Pregled i uređivanje svojstava Možete pregledati i urediti naslov, autora, ključne riječi i temu dokumenta otvarajući svojstva. Da biste to napravili odaberite DatotekaSvojstva pritisnite, AltEnter, ili kliknite Svojstva na alatnoj traci. Odabiranje stranica PDF Mod može automatski odabrati sve stranice, parne stranice, neparne stranice, ili stranice koje sadrže određeni izraz. Ove mogućnosti su dostupne u izborniku Uredi. Možete odabrati stranice ručno koristeći tipkovnicu i miša. Koristite Ctrl ili Shift kako bi ste odabrali više od jedne stranice. Pomicanje stranica Kako biste pomaknuli odabranu stranicu ili stranice (promijenili njihov raspored), povucite ih na mjesto u dokumentu gdje ih želite pomaknuti. Svi se postupci uređivanja osim brisanja stranice mogu vratiti koristeći UrediVrati ili pritiskom CtrlZ. Izdvajanje stranica Izdvajanje odabrane stranice ili stranica će otvoriti novi PDF Mod prozor u kojem će biti samo odabrane stranice u novom dokumentu, spremnom za daljnje uređivanje i za spremanje. Da biste izdvojili odabranu stranicu ili stranice, kliknite UrediIzdvoji stranicu. Sve akcije odabira i uređivanja dostupne u izborniku Uredi su također dostupne i desnim klikom na stranicu. Neke akcije su dostupne i na alatnoj traci. Zakretanje stranica Da biste zakrenuli odabranu stranicu ili stranice kliknite UrediZakreni stranicu ili pritisnite [ za zakretanje ulijevo (obrnuto od smjera kazaljke na satu) i ] za zakretanje udesno (u smjeru kazaljke na satu). Brisanje stranica Za brisanje odabrane stranice ili stranica pritisnite Delete ili izaberite UrediIzbriši stranicu. Trenutno nije moguće poništiti ovu akciju koristeći UrediVrati. Možete zatvoriti dokument bez spremanja i otvoriti ga opet kako biste vratili stranicu, ali ćete tako izgubiti i ostale promjene koje ste napravili. Spremanje Nakon što ste napravili izmjene na dokumentu, postoje dva načina za spremanje promjena. Možete prepisati originalni dokument koristeći DatotekaSpremi, ili možete spremiti promjene u novu datoteku koristeći DatotekaSpremi kao. pdfmod-0.9.1/docs/hr/hr.po0000644000175000001440000002653311533760021015430 0ustar00gabeusers00000000000000msgid "" msgstr "" "Project-Id-Version: PDF Mod\n" "POT-Creation-Date: 2009-08-02 20:30+0000\n" "PO-Revision-Date: \n" "Last-Translator: Igor Vatavuk \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Croatian\n" #: C/pdfmod.xml:6(title) msgid "The PDF Mod Manual" msgstr "Priručnik za PDF Mod" #: C/pdfmod.xml:8(para) msgid "This is the user's manual for PDF Mod, a simple tool for manipulating PDF documents." msgstr "Ovo je priručnik za PDF Mod, jednostavan alat za manipulaciju PDF dokumentima." #: C/pdfmod.xml:10(subtitle) msgid "Quick, Easy PDF Modification" msgstr "Brzo, lako uređivanje PDF dokumenata." #: C/pdfmod.xml:12(year) msgid "2009" msgstr "2009" #: C/pdfmod.xml:13(holder) #: C/pdfmod.xml:23(orgname) msgid "Novell, Inc." msgstr "Novell, Inc." #: C/pdfmod.xml:16(publishername) msgid "GNOME Documentation Project" msgstr "GNOME dokumentacijski projekt" #: C/pdfmod.xml:20(firstname) msgid "Gabriel" msgstr "Gabriel" #: C/pdfmod.xml:21(surname) msgid "Burt" msgstr "Burt" #: C/pdfmod.xml:29(revnumber) msgid "0.2" msgstr "0.2" #: C/pdfmod.xml:30(date) msgid "2009-07-29" msgstr "2009-07-29" #: C/pdfmod.xml:33(revnumber) msgid "0.1" msgstr "0.1" #: C/pdfmod.xml:34(date) msgid "2009-07-25" msgstr "2009-07-25" #: C/pdfmod.xml:40(title) msgid "Introduction" msgstr "Uvod" #: C/pdfmod.xml:41(para) msgid "PDF Mod is a simple tool for doing basic manipulations of PDF documents." msgstr "PDF Mod je jednostavan alat za osnovnu manipulaciju PDF dokumentima." #: C/pdfmod.xml:45(para) msgid "With this tool, you can rotate, remove, or extract pages in a PDF document. You can also add pages from another document." msgstr "Ovim alatom možete zakrenuti, brisati ili izdvojiti stranice u PDF dokumentu. Također možete dodati stranice iz drugog dokumenta." #: C/pdfmod.xml:50(para) msgid "You can start PDF Mod from your applications menu or launcher, or by right clicking on one or more PDF documents in the file browser, and choosing to open with PDF Mod." msgstr "PDF Mod možete pokrenuti pomoću izbornika ili pokretača, ili desnim klikom na jedan ili više PDF dokumenata u pregledniku datoteka, te izabiranjem otvaranja programom PDF Mod." #: C/pdfmod.xml:56(para) msgid "Like a normal editor application, you must save the changes you make using PDF Mod. If you want to keep the original document and save your changes to a new file, use Save As." msgstr "Kao i u drugim programima za uređivanje, morate spremiti promjene koje napravite koristeći PDF Mod. Ako želite zadržati originalni dokument i spremiti svoje promjene u novu datoteku, koristite Spremi kao." #: C/pdfmod.xml:63(title) msgid "Usage" msgstr "Korištenje" #: C/pdfmod.xml:66(title) msgid "Opening a Document" msgstr "Otvaranje dokumenta" #: C/pdfmod.xml:67(para) msgid "To open a document in PDF Mod:" msgstr "Za otvaranje dokumenta u PDF Mod programu:" #: C/pdfmod.xml:72(para) msgid "Choose FileOpen and select your document, or" msgstr "Izaberite DatotekaOtvori i odaberite vaš dokument, ili" #: C/pdfmod.xml:77(para) msgid "Press CtrlO and select your document, or" msgstr "Pritisnite CtrlO i odaberite vaš dokument, ili" #: C/pdfmod.xml:87(para) msgid "Drag a PDF document from your Desktop or file browser into a PDF Mod window that doesn't already have a document loaded, or" msgstr "Dovucite PDF dokument s vaše radne površine ili iz preglednika datoteka u PDF Mod prozor koji nema već otvoren dokument, ili" #: C/pdfmod.xml:92(para) msgid "Choose a document from FileRecent Documents." msgstr "Izaberite dokument iz DatotekaSkorašnji dokumenti." #: C/pdfmod.xml:100(title) msgid "Zooming" msgstr "Uvećanje" #: C/pdfmod.xml:101(para) msgid "Zooming will make the page thumbnails bigger or smaller. PDF Mod starts in Best Fit mode, where it tries to make all the pages visible at once." msgstr "Uvećanje će učiniti sličice pregleda stranice većima ili manjima. PDF Mod pri pokretanju koristi način najboljeg pristajanja, koji pokušava prikazati sve stranice istovremeno." #: C/pdfmod.xml:104(para) msgid "You can zoom in or out with the options under View, or by pressing Ctrl and moving your mouse's scroll wheel." msgstr "Možete uvećati ili umanjiti sličice koristeći Pogled, ili pritiskom na Ctrl i micanjem kotačića miša." #: C/pdfmod.xml:110(title) msgid "Viewing and Editing Properties" msgstr "Pregled i uređivanje svojstava" #: C/pdfmod.xml:111(para) msgid "You can view and edit the Title, Author, Keywords, and Subject of the document by opening the properties. To do so, choose FileProperties, press AltEnter, or click the Properties button on the toolbar." msgstr "Možete pregledati i urediti naslov, autora, ključne riječi i temu dokumenta otvarajući svojstva. Da biste to napravili odaberite DatotekaSvojstva pritisnite, AltEnter, ili kliknite Svojstva na alatnoj traci." #: C/pdfmod.xml:119(title) msgid "Selecting Pages" msgstr "Odabiranje stranica" #: C/pdfmod.xml:120(para) msgid "PDF Mod can automatically select all pages, even-numbered pages, odd-numbered pages, or pages containing a search term. These options are available under Edit." msgstr "PDF Mod može automatski odabrati sve stranice, parne stranice, neparne stranice, ili stranice koje sadrže određeni izraz. Ove mogućnosti su dostupne u izborniku Uredi." #: C/pdfmod.xml:124(para) msgid "You can select pages manually using the keyboard and mouse as well. Use Ctrl or Shift to select more than one page." msgstr "Možete odabrati stranice ručno koristeći tipkovnicu i miša. Koristite Ctrl ili Shift kako bi ste odabrali više od jedne stranice." #: C/pdfmod.xml:130(title) msgid "Moving Pages" msgstr "Pomicanje stranica" #: C/pdfmod.xml:131(para) msgid "To move (aka reorder) the selected page or pages, drag them to the position in the document to which you want them moved." msgstr "Kako biste pomaknuli odabranu stranicu ili stranice (promijenili njihov raspored), povucite ih na mjesto u dokumentu gdje ih želite pomaknuti." #: C/pdfmod.xml:135(para) msgid "All editing actions except removing pages can be undone by choosing EditUndo or by pressing CtrlZ." msgstr "Svi se postupci uređivanja osim brisanja stranice mogu vratiti koristeći UrediVrati ili pritiskom CtrlZ." #: C/pdfmod.xml:144(title) msgid "Extracting Pages" msgstr "Izdvajanje stranica" #: C/pdfmod.xml:145(para) msgid "Extracting the selected page or pages will open a new PDF Mod window with just the selected pages in a new document, ready for further editing or to save." msgstr "Izdvajanje odabrane stranice ili stranica će otvoriti novi PDF Mod prozor u kojem će biti samo odabrane stranice u novom dokumentu, spremnom za daljnje uređivanje i za spremanje." #: C/pdfmod.xml:148(para) msgid "To extract the selected page or pages, choose EditExtract Page." msgstr "Da biste izdvojili odabranu stranicu ili stranice, kliknite UrediIzdvoji stranicu." #: C/pdfmod.xml:152(para) msgid "All of the editing and selection actions available under Edit are also available by right clicking on a page. Some actions are available on the toolbar as well." msgstr "Sve akcije odabira i uređivanja dostupne u izborniku Uredi su također dostupne i desnim klikom na stranicu. Neke akcije su dostupne i na alatnoj traci." #: C/pdfmod.xml:160(title) msgid "Rotating Pages" msgstr "Zakretanje stranica" #: C/pdfmod.xml:161(para) msgid "To rotate the selected page or pages, choose EditRotate Page or press [ to rotate left (CCW) and ] to rotate right (CW)." msgstr "Da biste zakrenuli odabranu stranicu ili stranice kliknite UrediZakreni stranicu ili pritisnite [ za zakretanje ulijevo (obrnuto od smjera kazaljke na satu) i ] za zakretanje udesno (u smjeru kazaljke na satu)." #: C/pdfmod.xml:168(title) msgid "Removing Pages" msgstr "Brisanje stranica" #: C/pdfmod.xml:169(para) msgid "To remove the selected page or pages, press Delete or choose EditRemove Page." msgstr "Za brisanje odabrane stranice ili stranica pritisnite Delete ili izaberite UrediIzbriši stranicu." #: C/pdfmod.xml:174(para) msgid "It is not currently possible to undo this action via EditUndo. You can close the document without saving and open it again to get your page back, though you will lose any other changes you have made." msgstr "Trenutno nije moguće poništiti ovu akciju koristeći UrediVrati. Možete zatvoriti dokument bez spremanja i otvoriti ga opet kako biste vratili stranicu, ali ćete tako izgubiti i ostale promjene koje ste napravili." #: C/pdfmod.xml:182(title) msgid "Saving" msgstr "Spremanje" #: C/pdfmod.xml:183(para) msgid "After making changes to the document, there are two ways to save your work. You can overwrite the original document by choosing FileSave, or you can save your changes to a new file by choosing FileSave As." msgstr "Nakon što ste napravili izmjene na dokumentu, postoje dva načina za spremanje promjena. Možete prepisati originalni dokument koristeći DatotekaSpremi, ili možete spremiti promjene u novu datoteku koristeći DatotekaSpremi kao." #. Put one translator per line, in the form of NAME , YEAR1, YEAR2. #: C/pdfmod.xml:0(None) msgid "translator-credits" msgstr "Igor Vatavuk , 2009" pdfmod-0.9.1/docs/zh_CN/0000777000175000001440000000000011533760021015042 5ustar00gabeusers00000000000000pdfmod-0.9.1/docs/zh_CN/zh_CN.po0000644000175000001440000002650211533760021016404 0ustar00gabeusers00000000000000# Chinese (China) translation for pdfmod. # Copyright (C) 2010 pdfmod's COPYRIGHT HOLDER # This file is distributed under the same license as the pdfmod package. # GrayWaLL , 2010. # msgid "" msgstr "" "Project-Id-Version: pdfmod master\n" "POT-Creation-Date: 2010-01-01 08:52+0000\n" "PO-Revision-Date: 2010-07-06 20:59+0800\n" "Last-Translator: GrayWaLL \n" "Language-Team: Chinese (China) \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: C/pdfmod.xml:6(title) msgid "The PDF Mod Manual" msgstr "PDF 修改工具手册" #: C/pdfmod.xml:8(para) msgid "" "This is the user's manual for PDF Mod, a simple tool for manipulating PDF " "documents." msgstr "这是 PDF 修改者用户手册。PDF 修改者是一个操纵 PDF 文件的简易工具。" #: C/pdfmod.xml:10(subtitle) msgid "Quick, Easy PDF Modification" msgstr "快速、简单的 PDF 修改工具" #: C/pdfmod.xml:12(year) msgid "2009" msgstr "2009" #: C/pdfmod.xml:13(holder) C/pdfmod.xml:23(orgname) msgid "Novell, Inc." msgstr "Novell, Inc" #: C/pdfmod.xml:16(publishername) msgid "GNOME Documentation Project" msgstr "GNOME 文档项目" #: C/pdfmod.xml:20(firstname) msgid "Gabriel" msgstr "Gabriel" #: C/pdfmod.xml:21(surname) msgid "Burt" msgstr "Burt" #: C/pdfmod.xml:29(revnumber) msgid "0.2" msgstr "0.2" #: C/pdfmod.xml:30(date) msgid "2009-07-29" msgstr "2009-07-29" #: C/pdfmod.xml:33(revnumber) msgid "0.1" msgstr "0.1" #: C/pdfmod.xml:34(date) msgid "2009-07-25" msgstr "2009-07-25" #: C/pdfmod.xml:40(title) msgid "Introduction" msgstr "介绍" #: C/pdfmod.xml:41(para) msgid "" "PDF Mod is a simple tool for doing basic manipulations of PDF documents." msgstr "PDF 修改工具是一个可以对 PDF 文档进行简单修改的工具软件。" #: C/pdfmod.xml:45(para) msgid "" "With this tool, you can rotate, remove, or extract pages in a PDF document. " "You can also add pages from another document." msgstr "" "使用此工具,您可以旋转、移除、或提取 PDF 文档中的页面。您也可以从其它文档中加入" "页面到当前文档。" #: C/pdfmod.xml:50(para) msgid "" "You can start PDF Mod from your applications menu or launcher, or by right " "clicking on one or more PDF documents in the file browser, and choosing to " "open with PDF Mod." msgstr "" "您可以从应用程序菜单或启动器启动 PDF 修改工具,或通过右击一个或多个 PDF 文件,然后" "选择用 PDF 修改工具打开。" #: C/pdfmod.xml:56(para) msgid "" "Like a normal editor application, you must save the changes you make using " "PDF Mod. If you want to keep the original document and save your changes to " "a new file, use Save As." msgstr "" "像其它编辑器一样,在修改文档之后,您必须保存您所做的更改。如果您还想保留原来" "的文件,请使用另存为。" #: C/pdfmod.xml:63(title) msgid "Usage" msgstr "使用方法" #: C/pdfmod.xml:66(title) msgid "Opening a Document" msgstr "打开文档" #: C/pdfmod.xml:67(para) msgid "To open a document in PDF Mod:" msgstr "在 PDF 修改工具中打开文档:" #: C/pdfmod.xml:72(para) msgid "" "Choose FileOpen and select your document, or" msgstr "" "选择 文件打开 然后选择您的文档,或者" #: C/pdfmod.xml:77(para) msgid "" "Press CtrlO and " "select your document, or" msgstr "" "输入 CtrlO 然后选择文" "档, 或者" #: C/pdfmod.xml:87(para) msgid "" "Drag a PDF document from your Desktop or file browser into a PDF Mod window " "that doesn't already have a document loaded, or" msgstr "将 PDF 文档拖入一个尚未载入任何文档的 PDF 修改工具的窗口,或者" #: C/pdfmod.xml:92(para) msgid "" "Choose a document from FileRecent Documents." msgstr "" "从文件最近文档中选择一个文档。" #: C/pdfmod.xml:100(title) msgid "Zooming" msgstr "缩放" #: C/pdfmod.xml:101(para) msgid "" "Zooming will make the page thumbnails bigger or smaller. PDF Mod starts in " "Best Fit mode, where it tries to make all the pages visible at once." msgstr "" "缩放可以使页面缩略图放大或缩小,PDF 修改工具初始值为最适模式,即争取一次显示所有" "页面。" #: C/pdfmod.xml:104(para) msgid "" "You can zoom in or out with the options under View, or by pressing Ctrl and moving your " "mouse's scroll wheel." msgstr "" "您可以通过查看放大或缩小页面,或" "通过按下 Ctrl 然后滚动鼠标中键来放大或缩小。" #: C/pdfmod.xml:110(title) msgid "Viewing and Editing Properties" msgstr "查看编辑属性" #: C/pdfmod.xml:111(para) msgid "" "You can view and edit the Title, Author, Keywords, and Subject of the " "document by opening the properties. To do so, choose " "FileProperties, press AltEnter, or click the Properties button on the toolbar." msgstr "" "您可以通过打开属性查看或编辑标题、 作者、关键字、文档标题。您可以选择 " "文件属性,或通过快捷键 AltEnter,也可以直接点击工具栏中的属性按钮。" #: C/pdfmod.xml:119(title) msgid "Selecting Pages" msgstr "选择页面" #: C/pdfmod.xml:120(para) msgid "" "PDF Mod can automatically select all pages, even-numbered pages, odd-" "numbered pages, or pages containing a search term. These options are " "available under Edit." msgstr "" "PDF 修改工具可以自动选择所有页面、双数页面、单数页面,或者是包含搜索词的页面。这" "些选项可以在编辑菜单下找到。" #: C/pdfmod.xml:124(para) msgid "" "You can select pages manually using the keyboard and mouse as well. Use " "Ctrl or Shift to select more than one page." msgstr "" "您也可以使用键盘或鼠标手动选择页面,使用 Ctrl 或 " "Shift 来选择多个页面。" #: C/pdfmod.xml:130(title) msgid "Moving Pages" msgstr "移动页面" #: C/pdfmod.xml:131(para) msgid "" "To move (aka reorder) the selected page or pages, drag them to the position " "in the document to which you want them moved." msgstr "要移动(或重新排序)选择的页面,将页面拖到文档中 您想要的位置即可。" #: C/pdfmod.xml:135(para) msgid "" "All editing actions except removing pages can be undone by choosing " "EditUndo or by pressing CtrlZ." msgstr "" "除了移除页面外,所有的编辑操作都可通过选择 编辑撤销来取消您的操作,或通过按" "下 CtrlZ。" #: C/pdfmod.xml:144(title) msgid "Extracting Pages" msgstr "提取页面" #: C/pdfmod.xml:145(para) msgid "" "Extracting the selected page or pages will open a new PDF Mod window with " "just the selected pages in a new document, ready for further editing or to " "save." msgstr "" "提取选择的页面会打开一个新的 PDF 修改工具页面, 新窗口将只有您选择好的页面,以等" "待进一步的编辑或 保存。" #: C/pdfmod.xml:148(para) msgid "" "To extract the selected page or pages, choose EditExtract Page." msgstr "" "要提取选择的页面,选择 编辑释放页" "面。" #: C/pdfmod.xml:152(para) msgid "" "All of the editing and selection actions available under " "Edit are also available by right " "clicking on a page. Some actions are available on the toolbar as well." msgstr "" "所有编辑和选择操作可以在 编辑下找" "到,或者 通过右击页面。有一些操作也可以在工具栏找到。" #: C/pdfmod.xml:160(title) msgid "Rotating Pages" msgstr "旋转页面" #: C/pdfmod.xml:161(para) msgid "" "To rotate the selected page or pages, choose EditRotate Page or press " "[ to rotate left (CCW) and " "] to rotate right (CW)." msgstr "" "要旋转已选择的页面,选择 编辑旋" "转页面 或按下 [键向左旋转, 按]键向右旋转。" #: C/pdfmod.xml:168(title) msgid "Removing Pages" msgstr "移除页面" #: C/pdfmod.xml:169(para) msgid "" "To remove the selected page or pages, press Delete or " "choose EditRemove Page." msgstr "" "要移动已选择的页面,按下 Delete键, 或 选择 " "编辑移除页面。" #: C/pdfmod.xml:174(para) msgid "" "It is not currently possible to undo this action via " "EditUndo. You can close the document without saving and open it again to " "get your page back, though you will lose any other changes you have made." msgstr "" "目前还不能通过使用 编辑撤销来撤销这个动作。您可以选择不保存而关闭并重新打开 文" "件来找回您的页面,不过这样可以会丢失一些您并不想撤销的修改。" #: C/pdfmod.xml:182(title) msgid "Saving" msgstr "保存" #: C/pdfmod.xml:183(para) msgid "" "After making changes to the document, there are two ways to save your work. " "You can overwrite the original document by choosing " "FileSave, or you can save your changes to a new file by choosing " "FileSave As." msgstr "" "修改完文档之后,您有两种方式来保存您的劳动成果. 您可以覆盖原来的文件,选择 " "文件保存, 或者保存到一个新文件,选择 文件另存为。" #. Put one translator per line, in the form of NAME , YEAR1, YEAR2 #: C/pdfmod.xml:0(None) msgid "translator-credits" msgstr "GrayWaLL , 2010" pdfmod-0.9.1/docs/zh_CN/pdfmod.xml0000644000175000001440000001431311533760021017033 0ustar00gabeusers00000000000000 PDF 修改工具手册 这是 PDF 修改者用户手册。PDF 修改者是一个操纵 PDF 文件的简易工具。 快速、简单的 PDF 修改工具 2009 Novell, Inc 2010GrayWaLL (graywall@ymail.com) GNOME 文档项目 Gabriel Burt Novell, Inc 0.2 2009-07-29 0.1 2009-07-25 介绍 PDF 修改工具是一个可以对 PDF 文档进行简单修改的工具软件。 使用此工具,您可以旋转、移除、或提取 PDF 文档中的页面。您也可以从其它文档中加入页面到当前文档。 您可以从应用程序菜单或启动器启动 PDF 修改工具,或通过右击一个或多个 PDF 文件,然后选择用 PDF 修改工具打开。 像其它编辑器一样,在修改文档之后,您必须保存您所做的更改。如果您还想保留原来的文件,请使用另存为。 使用方法 打开文档 在 PDF 修改工具中打开文档: 选择 文件打开 然后选择您的文档,或者 输入 CtrlO 然后选择文档, 或者 将 PDF 文档拖入一个尚未载入任何文档的 PDF 修改工具的窗口,或者 文件最近文档中选择一个文档。 缩放 缩放可以使页面缩略图放大或缩小,PDF 修改工具初始值为最适模式,即争取一次显示所有页面。 您可以通过查看放大或缩小页面,或通过按下 Ctrl 然后滚动鼠标中键来放大或缩小。 查看编辑属性 您可以通过打开属性查看或编辑标题、 作者、关键字、文档标题。您可以选择 文件属性,或通过快捷键 AltEnter,也可以直接点击工具栏中的属性按钮。 选择页面 PDF 修改工具可以自动选择所有页面、双数页面、单数页面,或者是包含搜索词的页面。这些选项可以在编辑菜单下找到。 您也可以使用键盘或鼠标手动选择页面,使用 CtrlShift 来选择多个页面。 移动页面 要移动(或重新排序)选择的页面,将页面拖到文档中 您想要的位置即可。 除了移除页面外,所有的编辑操作都可通过选择 编辑撤销来取消您的操作,或通过按下 CtrlZ 提取页面 提取选择的页面会打开一个新的 PDF 修改工具页面, 新窗口将只有您选择好的页面,以等待进一步的编辑或 保存。 要提取选择的页面,选择 编辑释放页面 所有编辑和选择操作可以在 编辑下找到,或者 通过右击页面。有一些操作也可以在工具栏找到。 旋转页面 要旋转已选择的页面,选择 编辑旋转页面 或按下 [键向左旋转, 按]键向右旋转。 移除页面 要移动已选择的页面,按下 Delete键, 或 选择 编辑移除页面 目前还不能通过使用 编辑撤销来撤销这个动作。您可以选择不保存而关闭并重新打开 文件来找回您的页面,不过这样可以会丢失一些您并不想撤销的修改。 保存 修改完文档之后,您有两种方式来保存您的劳动成果. 您可以覆盖原来的文件,选择 文件保存, 或者保存到一个新文件,选择 文件另存为 pdfmod-0.9.1/docs/cs/0000777000175000001440000000000011533760021014446 5ustar00gabeusers00000000000000pdfmod-0.9.1/docs/cs/pdfmod.xml0000644000175000001440000001607011533760020016440 0ustar00gabeusers00000000000000 Příručka k aplikaci PDF Mod Toto je uživatelská příručka k PDF Mod, jednoduchému nástroji pro manipulaci s dokumenty PDF. Rychlá a snadná úprava PDF 2009 Novell, Inc. 2009Marek Černocký (marek@manet.cz) Dokumentační projekt GNOME Gabriel Burt Novell, Inc. 0.2 29.7.2008 0.1 25.7.2009 Úvod PDF Mod je jednoduchý nástroj na provádění základních změn v dokumentech PDF. S tímto nástrojem můžete otáčet, odstraňovat a nebo extrahovat stránky v dokumentech PDF. Můžete také přidávat stránky z jiného dokumentu. Aplikaci PDF Mod můžete spustit ze své aplikační nabídky nebo spouštěče a nebo kliknutím pravým tlačítkem na jeden nebo více dokumentů PDF ve správci souborů a volbou Otevřít s PDF Mod. Podobně jako v jiných aplikacích určených k editaci, musíte změny, které v PDF Mod provedete, uložit. Pokud chcete původní dokument zachovat jak je a změny uložit do nového souboru, použijte Uložit jako. Použití Otevírání dokumentu Pokud chcete otevřít dokument v PDF Mod: Zvolte SouborOtevřít a vyberte svůj dokument nebo Zmáčkněte CtrlO a vyberte svůj dokument nebo Přetáhněte dokument PDF ze své pracovní plochy nebo správce souborů do okna PDF Mod, ve kterém zatím není načtený žádný dokument, nebo Zvolte dokument z nabídky SouborNedávné dokumenty. Přibližování Přibližováním můžete zvětšovat nebo zmenšovat náhledy stránek. PDF Mod se spouští s režimem Přizpůsobit, kdy se pokusí zobrazit stránky tak, aby byly vidět všechny naráz. Zvětšovat a zmenšovat můžete pomocí voleb v nabídce Zobrazit nebo zmáčknutím Ctrl a současným otáčením kolečka na myši. Zobrazování a úprava vlastností Po otevření vlastností můžete zobrazit a upravit název, autora, klíčová slova a subjekt dokumentu. To provedete tak, že zvolíte SouborVlastnosti, zmáčknete AltEnter nebo kliknete na tlačítko Vlastnosti na panelu nástrojů. Vybírání stránek Aplikace PDF Mod umí automaticky vybrat všechny stránky, sudé stránky, liché stránky nebo stránky obsahující hledaný výraz. Tyto volby jsou k dispozici v nabídce Úpravy. Stránky můžete vybírat i ručně pomocí klávesnice nebo myši. V případě, že chcete vybrat více stránek, použijte Ctrl nebo Shift. Přesouvání stránek Pokud chcete přesunout (přeuspořádat) vybranou stránku nebo stránky, přetáhněte je v dokumentu na místo, kde je chcete mít. Všechny úpravy, vyjma odstraňování stránek, lze vrátit zpět volbou UpravitZpět nebo zmáčknutím CtrlZ. Extrahování stránek Extrahování vybrané stránky nebo stránek otevře nové okno PDF Mod s právě vybranými stránkami v novém dokumentu, který je připravený pro pozdější uložení. Pokud chcete extrahovat vybranou stránku nebo stránky, zvolte UpravitExtrahovat stránku. Všechny funkce pro úpravy a výběr dostupné v nabídce Upravit jsou k dispozici i po kliknutí pravým tlačítkem na stránce. Některé funkce jsou dostupné i na panelu nástrojů. Otáčení stránek Pokud chcete otočit vybranou stránku nebo stránky, zvolte UpravitOtočit stránku nebo zmáčkněte [ pro otočení vlevo (proti směru hodinových ručiček) a ] pro otočení vpravo (po směru hodinových ručiček). Odstraňování stránek Pokud chcete odstranit vybranou stránku nebo stránky, zmáčkněte Delete nebo zvolte UpravitOdstranit stránku. V současnosti není možné tuto akci vrátit pomocí UpravitZpět. Místo toho můžete dokument zavřít bez ukládání a otevřít jej znovu se všemi stránky, čímž ale přijdete o ostatní změny, které jste v dokumentu provedli. Ukládání Po provedení změn v dokumentu máte dvě možnosti, jak svoji práci uložit. Můžete přepsat původní dokument volbou SouborUložit, nebo můžete své změny uložit do nového souboru volbou SouborUložit jako. pdfmod-0.9.1/docs/cs/cs.po0000644000175000001440000003047211533760021015415 0ustar00gabeusers00000000000000# Czech help translation for pdfmod. # Copyright (C) 2009 the author(s) of pdfmod. # This file is distributed under the same license as the pdfmod help. # Marek Černocký , 2009. # msgid "" msgstr "" "Project-Id-Version: pdfmod master\n" "POT-Creation-Date: 2009-09-26 00:46+0000\n" "PO-Revision-Date: 2009-10-05 07:54+0100\n" "Last-Translator: Marek Černocký \n" "Language-Team: Czech \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: C/pdfmod.xml:6(title) msgid "The PDF Mod Manual" msgstr "Příručka k aplikaci PDF Mod" #: C/pdfmod.xml:8(para) msgid "" "This is the user's manual for PDF Mod, a simple tool for manipulating PDF " "documents." msgstr "" "Toto je uživatelská příručka k PDF Mod, jednoduchému nástroji pro manipulaci " "s dokumenty PDF." #: C/pdfmod.xml:10(subtitle) msgid "Quick, Easy PDF Modification" msgstr "Rychlá a snadná úprava PDF" #: C/pdfmod.xml:12(year) msgid "2009" msgstr "2009" #: C/pdfmod.xml:13(holder) C/pdfmod.xml:23(orgname) msgid "Novell, Inc." msgstr "Novell, Inc." #: C/pdfmod.xml:16(publishername) msgid "GNOME Documentation Project" msgstr "Dokumentační projekt GNOME" #: C/pdfmod.xml:20(firstname) msgid "Gabriel" msgstr "Gabriel" #: C/pdfmod.xml:21(surname) msgid "Burt" msgstr "Burt" #: C/pdfmod.xml:29(revnumber) msgid "0.2" msgstr "0.2" #: C/pdfmod.xml:30(date) msgid "2009-07-29" msgstr "29.7.2008" #: C/pdfmod.xml:33(revnumber) msgid "0.1" msgstr "0.1" #: C/pdfmod.xml:34(date) msgid "2009-07-25" msgstr "25.7.2009" #: C/pdfmod.xml:40(title) msgid "Introduction" msgstr "Úvod" #: C/pdfmod.xml:41(para) msgid "" "PDF Mod is a simple tool for doing basic manipulations of PDF documents." msgstr "" "PDF Mod je jednoduchý nástroj na provádění základních změn v dokumentech PDF." #: C/pdfmod.xml:45(para) msgid "" "With this tool, you can rotate, remove, or extract pages in a PDF document. " "You can also add pages from another document." msgstr "" "S tímto nástrojem můžete otáčet, odstraňovat a nebo extrahovat stránky v " "dokumentech PDF. Můžete také přidávat stránky z jiného dokumentu." #: C/pdfmod.xml:50(para) msgid "" "You can start PDF Mod from your applications menu or launcher, or by right " "clicking on one or more PDF documents in the file browser, and choosing to " "open with PDF Mod." msgstr "" "Aplikaci PDF Mod můžete spustit ze své aplikační nabídky nebo spouštěče a " "nebo kliknutím pravým tlačítkem na jeden nebo více dokumentů PDF ve správci " "souborů a volbou Otevřít s PDF Mod." #: C/pdfmod.xml:56(para) msgid "" "Like a normal editor application, you must save the changes you make using " "PDF Mod. If you want to keep the original document and save your changes to " "a new file, use Save As." msgstr "" "Podobně jako v jiných aplikacích určených k editaci, musíte změny, které v " "PDF Mod provedete, uložit. Pokud chcete původní dokument zachovat jak je a " "změny uložit do nového souboru, použijte Uložit jako." #: C/pdfmod.xml:63(title) msgid "Usage" msgstr "Použití" #: C/pdfmod.xml:66(title) msgid "Opening a Document" msgstr "Otevírání dokumentu" #: C/pdfmod.xml:67(para) msgid "To open a document in PDF Mod:" msgstr "Pokud chcete otevřít dokument v PDF Mod:" #: C/pdfmod.xml:72(para) msgid "" "Choose FileOpen and select your document, or" msgstr "" "Zvolte SouborOtevřít a vyberte svůj dokument nebo" #: C/pdfmod.xml:77(para) msgid "" "Press CtrlO and " "select your document, or" msgstr "" "Zmáčkněte CtrlO a " "vyberte svůj dokument nebo" #: C/pdfmod.xml:87(para) msgid "" "Drag a PDF document from your Desktop or file browser into a PDF Mod window " "that doesn't already have a document loaded, or" msgstr "" "Přetáhněte dokument PDF ze své pracovní plochy nebo správce souborů do okna " "PDF Mod, ve kterém zatím není načtený žádný dokument, nebo" #: C/pdfmod.xml:92(para) msgid "" "Choose a document from FileRecent Documents." msgstr "" "Zvolte dokument z nabídky SouborNedávné dokumenty." #: C/pdfmod.xml:100(title) msgid "Zooming" msgstr "Přibližování" #: C/pdfmod.xml:101(para) msgid "" "Zooming will make the page thumbnails bigger or smaller. PDF Mod starts in " "Best Fit mode, where it tries to make all the pages visible at once." msgstr "" "Přibližováním můžete zvětšovat nebo zmenšovat náhledy stránek. PDF Mod se " "spouští s režimem Přizpůsobit, kdy se pokusí zobrazit stránky tak, aby byly " "vidět všechny naráz." #: C/pdfmod.xml:104(para) msgid "" "You can zoom in or out with the options under View, or by pressing Ctrl and moving your " "mouse's scroll wheel." msgstr "" "Zvětšovat a zmenšovat můžete pomocí voleb v nabídce " "Zobrazit nebo zmáčknutím " "Ctrl a současným otáčením kolečka na myši." #: C/pdfmod.xml:110(title) msgid "Viewing and Editing Properties" msgstr "Zobrazování a úprava vlastností" #: C/pdfmod.xml:111(para) msgid "" "You can view and edit the Title, Author, Keywords, and Subject of the " "document by opening the properties. To do so, choose " "FileProperties, press AltEnter, or click the Properties button on the toolbar." msgstr "" "Po otevření vlastností můžete zobrazit a upravit název, autora, klíčová " "slova a subjekt dokumentu. To provedete tak, že zvolíte " "SouborVlastnosti, zmáčknete AltEnter nebo kliknete na tlačítko Vlastnosti na panelu nástrojů." #: C/pdfmod.xml:119(title) msgid "Selecting Pages" msgstr "Vybírání stránek" #: C/pdfmod.xml:120(para) msgid "" "PDF Mod can automatically select all pages, even-numbered pages, odd-" "numbered pages, or pages containing a search term. These options are " "available under Edit." msgstr "" "Aplikace PDF Mod umí automaticky vybrat všechny stránky, sudé stránky, liché " "stránky nebo stránky obsahující hledaný výraz. Tyto volby jsou k dispozici v " "nabídce Úpravy." #: C/pdfmod.xml:124(para) msgid "" "You can select pages manually using the keyboard and mouse as well. Use " "Ctrl or Shift to select more than one page." msgstr "" "Stránky můžete vybírat i ručně pomocí klávesnice nebo myši. V případě, že " "chcete vybrat více stránek, použijte Ctrl nebo " "Shift." #: C/pdfmod.xml:130(title) msgid "Moving Pages" msgstr "Přesouvání stránek" #: C/pdfmod.xml:131(para) msgid "" "To move (aka reorder) the selected page or pages, drag them to the position " "in the document to which you want them moved." msgstr "" "Pokud chcete přesunout (přeuspořádat) vybranou stránku nebo stránky, " "přetáhněte je v dokumentu na místo, kde je chcete mít." #: C/pdfmod.xml:135(para) msgid "" "All editing actions except removing pages can be undone by choosing " "EditUndo or by pressing CtrlZ." msgstr "" "Všechny úpravy, vyjma odstraňování stránek, lze vrátit zpět volbou " "UpravitZpět nebo zmáčknutím CtrlZ." #: C/pdfmod.xml:144(title) msgid "Extracting Pages" msgstr "Extrahování stránek" #: C/pdfmod.xml:145(para) msgid "" "Extracting the selected page or pages will open a new PDF Mod window with " "just the selected pages in a new document, ready for further editing or to " "save." msgstr "" "Extrahování vybrané stránky nebo stránek otevře nové okno PDF Mod s právě " "vybranými stránkami v novém dokumentu, který je připravený pro pozdější " "uložení." #: C/pdfmod.xml:148(para) msgid "" "To extract the selected page or pages, choose EditExtract Page." msgstr "" "Pokud chcete extrahovat vybranou stránku nebo stránky, zvolte " "UpravitExtrahovat stránku." #: C/pdfmod.xml:152(para) msgid "" "All of the editing and selection actions available under " "Edit are also available by right " "clicking on a page. Some actions are available on the toolbar as well." msgstr "" "Všechny funkce pro úpravy a výběr dostupné v nabídce " "Upravit jsou k dispozici i po " "kliknutí pravým tlačítkem na stránce. Některé funkce jsou dostupné i na " "panelu nástrojů." #: C/pdfmod.xml:160(title) msgid "Rotating Pages" msgstr "Otáčení stránek" #: C/pdfmod.xml:161(para) msgid "" "To rotate the selected page or pages, choose EditRotate Page or press " "[ to rotate left (CCW) and " "] to rotate right (CW)." msgstr "" "Pokud chcete otočit vybranou stránku nebo stránky, zvolte " "UpravitOtočit stránku nebo zmáčkněte [ pro otočení vlevo (proti směru hodinových ručiček) a " "] pro otočení vpravo (po směru " "hodinových ručiček)." #: C/pdfmod.xml:168(title) msgid "Removing Pages" msgstr "Odstraňování stránek" #: C/pdfmod.xml:169(para) msgid "" "To remove the selected page or pages, press Delete or " "choose EditRemove Page." msgstr "" "Pokud chcete odstranit vybranou stránku nebo stránky, zmáčkněte " "Delete nebo zvolte UpravitOdstranit stránku." #: C/pdfmod.xml:174(para) msgid "" "It is not currently possible to undo this action via " "EditUndo. You can close the document without saving and open it again to " "get your page back, though you will lose any other changes you have made." msgstr "" "V současnosti není možné tuto akci vrátit pomocí " "UpravitZpět. Místo toho můžete dokument zavřít bez ukládání a otevřít jej " "znovu se všemi stránky, čímž ale přijdete o ostatní změny, které jste v " "dokumentu provedli." #: C/pdfmod.xml:182(title) msgid "Saving" msgstr "Ukládání" #: C/pdfmod.xml:183(para) msgid "" "After making changes to the document, there are two ways to save your work. " "You can overwrite the original document by choosing " "FileSave, or you can save your changes to a new file by choosing " "FileSave As." msgstr "" "Po provedení změn v dokumentu máte dvě možnosti, jak svoji práci uložit. " "Můžete přepsat původní dokument volbou SouborUložit, nebo můžete své změny " "uložit do nového souboru volbou SouborUložit jako." #. Put one translator per line, in the form of NAME , YEAR1, YEAR2 #: C/pdfmod.xml:0(None) msgid "translator-credits" msgstr "Marek Černocký , 2009" pdfmod-0.9.1/docs/sl/0000777000175000001440000000000011533760021014457 5ustar00gabeusers00000000000000pdfmod-0.9.1/docs/sl/pdfmod.xml0000644000175000001440000001515211533760020016451 0ustar00gabeusers00000000000000 The PDF Mod Manual This is the user's manual for PDF Mod, a simple tool for manipulating PDF documents. Quick, Easy PDF Modification 2009 Novell, Inc. GNOME Documentation Project Gabriel Burt Novell, Inc. 0.2 2009-07-29 0.1 2009-07-25 Introduction PDF Mod is a simple tool for doing basic manipulations of PDF documents. With this tool, you can rotate, remove, or extract pages in a PDF document. You can also add pages from another document. You can start PDF Mod from your applications menu or launcher, or by right clicking on one or more PDF documents in the file browser, and choosing to open with PDF Mod. Like a normal editor application, you must save the changes you make using PDF Mod. If you want to keep the original document and save your changes to a new file, use Save As. Uporaba Opening a Document To open a document in PDF Mod: Choose FileOpen and select your document, or Press Ctrl O and select your document, or Drag a PDF document from your Desktop or file browser into a PDF Mod window that doesn't already have a document loaded, or Choose a document from FileRecent Documents. Zooming Zooming will make the page thumbnails bigger or smaller. PDF Mod starts in Best Fit mode, where it tries to make all the pages visible at once. You can zoom in or out with the options under View, or by pressing Ctrl and moving your mouse's scroll wheel. Viewing and Editing Properties You can view and edit the Title, Author, Keywords, and Subject of the document by opening the properties. To do so, choose FileProperties, press AltEnter, or click the Properties button on the toolbar. Selecting Pages PDF Mod can automatically select all pages, even-numbered pages, odd-numbered pages, or pages containing a search term. These options are available under Edit. You can select pages manually using the keyboard and mouse as well. Use Ctrl or Shift to select more than one page. Moving Pages To move (aka reorder) the selected page or pages, drag them to the position in the document to which you want them moved. All editing actions except removing pages can be undone by choosing EditUndo or by pressing CtrlZ. Extracting Pages Extracting the selected page or pages will open a new PDF Mod window with just the selected pages in a new document, ready for further editing or to save. To extract the selected page or pages, choose EditExtract Page. All of the editing and selection actions available under Edit are also available by right clicking on a page. Some actions are available on the toolbar as well. Rotating Pages To rotate the selected page or pages, choose EditRotate Page or press [ to rotate left (CCW) and ] to rotate right (CW). Removing Pages To remove the selected page or pages, press Delete or choose EditRemove Page. It is not currently possible to undo this action via EditUndo. You can close the document without saving and open it again to get your page back, though you will lose any other changes you have made. Saving After making changes to the document, there are two ways to save your work. You can overwrite the original document by choosing FileSave, or you can save your changes to a new file by choosing FileSave As. pdfmod-0.9.1/docs/sl/sl.po0000644000175000001440000001630311533760021015434 0ustar00gabeusers00000000000000# Slovenian translation for pdfmod help. # Copyright (C) 2010 pdfmod's COPYRIGHT HOLDER # This file is distributed under the same license as the pdfmod package. # # Ime Priimek , leto # msgid "" msgstr "" "Project-Id-Version: pdfmod help master\n" "POT-Creation-Date: 2010-10-20 17:09+0000\n" "PO-Revision-Date: 2010-10-22 08:20+0100\n" "Last-Translator: Matej Urbančič \n" "Language-Team: Slovenian GNOME Translation Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);\n" "X-Poedit-Country: SLOVENIA\n" "X-Poedit-Language: Slovenian\n" "X-Poedit-SourceCharset: utf-8\n" #: C/pdfmod.xml:6(title) msgid "The PDF Mod Manual" msgstr "" #: C/pdfmod.xml:8(para) msgid "This is the user's manual for PDF Mod, a simple tool for manipulating PDF documents." msgstr "" #: C/pdfmod.xml:10(subtitle) msgid "Quick, Easy PDF Modification" msgstr "" #: C/pdfmod.xml:12(year) msgid "2009" msgstr "2009" #: C/pdfmod.xml:13(holder) #: C/pdfmod.xml:23(orgname) msgid "Novell, Inc." msgstr "" #: C/pdfmod.xml:16(publishername) msgid "GNOME Documentation Project" msgstr "" #: C/pdfmod.xml:20(firstname) msgid "Gabriel" msgstr "Gabriel" #: C/pdfmod.xml:21(surname) msgid "Burt" msgstr "Burt" #: C/pdfmod.xml:29(revnumber) msgid "0.2" msgstr "0.2" #: C/pdfmod.xml:30(date) msgid "2009-07-29" msgstr "" #: C/pdfmod.xml:33(revnumber) msgid "0.1" msgstr "0.1" #: C/pdfmod.xml:34(date) msgid "2009-07-25" msgstr "" #: C/pdfmod.xml:40(title) msgid "Introduction" msgstr "" #: C/pdfmod.xml:41(para) msgid "PDF Mod is a simple tool for doing basic manipulations of PDF documents." msgstr "" #: C/pdfmod.xml:45(para) msgid "With this tool, you can rotate, remove, or extract pages in a PDF document. You can also add pages from another document." msgstr "" #: C/pdfmod.xml:50(para) msgid "You can start PDF Mod from your applications menu or launcher, or by right clicking on one or more PDF documents in the file browser, and choosing to open with PDF Mod." msgstr "" #: C/pdfmod.xml:56(para) msgid "Like a normal editor application, you must save the changes you make using PDF Mod. If you want to keep the original document and save your changes to a new file, use Save As." msgstr "" #: C/pdfmod.xml:63(title) msgid "Usage" msgstr "Uporaba" #: C/pdfmod.xml:66(title) msgid "Opening a Document" msgstr "" #: C/pdfmod.xml:67(para) msgid "To open a document in PDF Mod:" msgstr "" #: C/pdfmod.xml:72(para) msgid "Choose FileOpen and select your document, or" msgstr "" #: C/pdfmod.xml:77(para) msgid "Press CtrlO and select your document, or" msgstr "" #: C/pdfmod.xml:87(para) msgid "Drag a PDF document from your Desktop or file browser into a PDF Mod window that doesn't already have a document loaded, or" msgstr "" #: C/pdfmod.xml:92(para) msgid "Choose a document from FileRecent Documents." msgstr "" #: C/pdfmod.xml:100(title) msgid "Zooming" msgstr "" #: C/pdfmod.xml:101(para) msgid "Zooming will make the page thumbnails bigger or smaller. PDF Mod starts in Best Fit mode, where it tries to make all the pages visible at once." msgstr "" #: C/pdfmod.xml:104(para) msgid "You can zoom in or out with the options under View, or by pressing Ctrl and moving your mouse's scroll wheel." msgstr "" #: C/pdfmod.xml:110(title) msgid "Viewing and Editing Properties" msgstr "" #: C/pdfmod.xml:111(para) msgid "You can view and edit the Title, Author, Keywords, and Subject of the document by opening the properties. To do so, choose FileProperties, press AltEnter, or click the Properties button on the toolbar." msgstr "" #: C/pdfmod.xml:119(title) msgid "Selecting Pages" msgstr "" #: C/pdfmod.xml:120(para) msgid "PDF Mod can automatically select all pages, even-numbered pages, odd-numbered pages, or pages containing a search term. These options are available under Edit." msgstr "" #: C/pdfmod.xml:124(para) msgid "You can select pages manually using the keyboard and mouse as well. Use Ctrl or Shift to select more than one page." msgstr "" #: C/pdfmod.xml:130(title) msgid "Moving Pages" msgstr "" #: C/pdfmod.xml:131(para) msgid "To move (aka reorder) the selected page or pages, drag them to the position in the document to which you want them moved." msgstr "" #: C/pdfmod.xml:135(para) msgid "All editing actions except removing pages can be undone by choosing EditUndo or by pressing CtrlZ." msgstr "" #: C/pdfmod.xml:144(title) msgid "Extracting Pages" msgstr "" #: C/pdfmod.xml:145(para) msgid "Extracting the selected page or pages will open a new PDF Mod window with just the selected pages in a new document, ready for further editing or to save." msgstr "" #: C/pdfmod.xml:148(para) msgid "To extract the selected page or pages, choose EditExtract Page." msgstr "" #: C/pdfmod.xml:152(para) msgid "All of the editing and selection actions available under Edit are also available by right clicking on a page. Some actions are available on the toolbar as well." msgstr "" #: C/pdfmod.xml:160(title) msgid "Rotating Pages" msgstr "" #: C/pdfmod.xml:161(para) msgid "To rotate the selected page or pages, choose EditRotate Page or press [ to rotate left (CCW) and ] to rotate right (CW)." msgstr "" #: C/pdfmod.xml:168(title) msgid "Removing Pages" msgstr "" #: C/pdfmod.xml:169(para) msgid "To remove the selected page or pages, press Delete or choose EditRemove Page." msgstr "" #: C/pdfmod.xml:174(para) msgid "It is not currently possible to undo this action via EditUndo. You can close the document without saving and open it again to get your page back, though you will lose any other changes you have made." msgstr "" #: C/pdfmod.xml:182(title) msgid "Saving" msgstr "" #: C/pdfmod.xml:183(para) msgid "After making changes to the document, there are two ways to save your work. You can overwrite the original document by choosing FileSave, or you can save your changes to a new file by choosing FileSave As." msgstr "" #. Put one translator per line, in the form of NAME , YEAR1, YEAR2 #: C/pdfmod.xml:0(None) msgid "translator-credits" msgstr ""