Tag Archives: PDF

So, my situation was that I wanted to check whether the credit card bill amount I was receiving was valid. I wanted to calculated for myself. The problem was that the pdf credit card statement being sent out by my bank was password and signature protected. It wouldnt allow copying text from it, which is rather weird. I have a genuine need to archive the pdf without password because after a couple of months, who’s going to remember what password it had, especially if you have a couple of different cards, each with its own password schema?

So the first step was to remove the password from it:
Install and run qpdf:

apt-get install qpdf
qpdf -decrypt --password=mypassword /mnt/c/temp/899XXXXXXXXXX32_11-02-2017.PDF /mnt/c/temp/1.pdf

This removes the password. The signature is still intact, but hooray, the pdf now allows copying text from it. I paste the text into my favorite text editor, and use a perl script to calculate for me.

In Acrobat Pro (I’m using Adobe Acrobat Pro DC), Tools>Action wizard>New action>More tools>Execute javascript>Specify settings>Create and edit JS:

Add the following code:

/* Remove Highlighting only */
this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
for (var i=annots.length-1; i>=0; i--) {
if (annots[i].type=="Highlight")
annots[i].destroy();
}
}

or if you want to remove both highlighting and comments:

/* Remove Highlighting and Comments */
this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
for (var i=annots.length-1; i>=0; i--) {
annots[i].destroy();
}
}

Printing photos by yourself saves a lot of money. You can usually print a huge number of photos on a single A3 page. By today’s costs, printing on an A3 size paper costs around Rs 20 here in Trivandrum. And since you can usually arrange 8×9 sets of a 3.1cm x 4.1cm sized Passport size photo, that translates to about Rs 20 for 72 photos, or Rs 0.27 per photo. Usually if you print at a normal studio, they charge around Rs 100 for 8 photos, give or take ten rupees.

So, let’s get started.

Requirements:

CorelDraw X6 (any version should do)

ACDSee

Steps:

For Passport size photos:

First, you need to crop your photo so that the ratio of width by height is 31 x 41. ACDSee is the easiest for this purpose. Save the image.

Open CorelDraw.

Select a paper size of A3.

Drag the saved image into CorelDraw.

Change the image size to 31mm by 41mm. You should click the Lock button before doing this.

Show the Transformations toolbar: Alt+F7

Click on the image.

Calculate the Horizontal Offset as: Width of one photo + 5mm (36mm), and choose 8 as the number of coloumns.

Apply the transformation.

You should now get a row of multiple images. Delete extra images that cross the page border. Or add more numbers if they dont fill the page.

Select all the images with Ctrl + A.

Calculate the Vertical offset as the negative value of: Height of one photo + 5mm (46mm), and choose 9 as the number of rows.

Apply the transformation.

You should now get a grid of many images.

Export for Office:

File>Export for Office>

  • Export to: MS Office
  • Graphic should be best suited for: Compatibility
  • Optimized for: Commercial printing

Click Ok and Select a name for the .png file.

For Stamp size printing:

Image size: 2cm by 2.5cm, ie 20mm x 25mm

Transformation offset:

Horizontal: 25mm

Vertical: -30mm

To Export as PDF:

File>Publish to PDF

PDF Preset: Prepress

Tips:

To preserve DPI, before dragging an image to CorelDraw, first open it in Corel Photopaint, save as .cpt file, and drag this file to CorelDraw.

I needed this to combine chapters of a PDF book into one single pdf.

 

pdftk 01.pdf 02.pdf 03.pdf 04.pdf 05.pdf 06.pdf 07.pdf 08.pdf 09.pdf 10.pdf 11.pdf 012.pdf 013.pdf 014.pdf 015.pdf 016.pdf 017.pdf 018.pdf 019.pdf 020.pdf 021.pdf 022.pdf 023.pdf 024.pdf 025.pdf 026.pdf 027.pdf 028.pdf 029.pdf 030.pdf 031.pdf 032.pdf 033.pdf 034.pdf 035.pdf 036.pdf 037.pdf 038.pdf 039.pdf 040.pdf 041.pdf 042.pdf 043.pdf 044.pdf 051.pdf 050.pdf cat output book.pdf[/code]

So the code is:

pdftk pdf1 pdf2 pdf3... cat output outputfilename[/code]

If you want verbose output:

pdftk 001.pdf 002.pdf cat output out.pdf verbose[/code]