Code Monkey home page Code Monkey logo

pdfcook's Introduction

pdfcook

Preprinting preparation tool for PDF ebooks.

Build and Install

Enter directory src
cd src
run

make -j4  
sudo make install  

Install manpage
sudo make installman

Windows Build
On windows create a folder build/ beside src/ directory.
And edit Makefile and remove lines with
@mkdir -p $(@D)
Then to build run...
make -j4

Features

  • PDF v1.7 support
  • Decrypt encrypted PDFs
  • Join or Split PDFs
  • Scale to any paper size, with specified margin
  • Write Page numbers
  • Write text
  • Transform pages (rotate, flip, move)
  • Booklet format arrange
  • 2 or 4 pages per page (2-up, 4-up)
  • More readable output syntax for easy debugging

Usage

See manual page (PDF or man page) for detailed usage

Scale to print in A4 size paper
pdfcook 'scaleto(a4)' input.pdf output.pdf

Add binding margin after scaling (? for odd pages, + for even pages)
pdfcook 'scaleto(a4) move(20){?} move(-20){+}' input.pdf output.pdf

Add page numbers
pdfcook 'number' input.pdf output.pdf

Booklet format
pdfcook 'book nup(2, paper=a4)' input.pdf output.pdf

pdfcook's People

Contributors

ksharindam avatar ramkromberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pdfcook's Issues

Info?

{"info", "Print information about each page", cmd_pinfo, NULL,0},

This statement should not require an output file. But it's require.

Makefile pdf?

Maybe include in Makefile?:

pdf: man_pdfcook.pdf

man_pdfcook.pdf: pdfcook.1
        groff -m man -T pdf $^ > $@

for Windows.

Windows build?

diff -r pdfcook/src/cmd_exec.cpp pdfcook-win32/src/cmd_exec.cpp
12d11
< 
diff -r pdfcook/src/common.h pdfcook-win32/src/common.h
5c5,7
< #include <string.h>// memcpy and other string func
---
> #include <sstream>
> #include <string>
> #include <iostream>
11c13,14
< #include <arpa/inet.h> // ntohl() function
---
> #include <winsock2.h>
> //#include <arpa/inet.h> // ntohl() function
12a16
> typedef unsigned int uint;
diff -r pdfcook/src/debug.cpp pdfcook-win32/src/debug.cpp
24c24
<     else if (type==ERROR || type==FATAL) {
---
>     else if (type==ERR || type==FATAL) {
diff -r pdfcook/src/debug.h pdfcook-win32/src/debug.h
14c14
<     ERROR,//print message with "error : " prefix
---
>     ERR,//print message with "error : " prefix
diff -r pdfcook/src/doc_edit.cpp pdfcook-win32/src/doc_edit.cpp
1a2,3
> #define _GNU_SOURCE
> #include <stdio.h>
diff -r pdfcook/src/geometry.cpp pdfcook-win32/src/geometry.cpp
1a2,3
> #define _GNU_SOURCE
> #include <stdio.h>
diff -r pdfcook/src/Makefile pdfcook-win32/src/Makefile
1d0
< 
6c5
< CXXFLAGS = -Wall -O2 -DDEBUG
---
> CXXFLAGS = -Wall -std=c++11 -O2 -DDEBUG
8c7
< LIBS = -lm -lz
---
> LIBS = -lm -lz -lws2_32
14,15c13,14
< pdfcook: ${OBJS}
< 	${CXX} -s -o $@ ${OBJS} ${LIBS}
---
> pdfcook: ${SOURCES}
> 	${CXX} ${CXXFLAGS} -s -o $@ $^ ${LIBS}
diff -r pdfcook/src/pdf_doc.cpp pdfcook-win32/src/pdf_doc.cpp
1a2,3
> #define _GNU_SOURCE
> #include <stdio.h>
diff -r pdfcook/src/pdf_objects.cpp pdfcook-win32/src/pdf_objects.cpp
1a2,3
> #define _GNU_SOURCE
> #include <stdio.h>
diff -r pdfcook/src/pdf_objects.h pdfcook-win32/src/pdf_objects.h
5a6
> #include <string>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.