Archive for the ‘Document Processing’ Category

Using Localtunnel in Rails Application

Localtunnel, as the name indicates, allows you to share your local web server on the internet. This kind of technique is very useful in cases such as:-
  • You want to demonstrate your web applications to clients.
  • Testing the web applications for compatibility issues against various operating systems and web browsers
  • Testing your web applications for compatibility in various mobile devices.
It is very easy to use. Your web application will be shared on public internet in a couple of seconds while it is running on your local system. Lets go through a step by step procedure to tunnel our very own RoR apps: STEP 1: Firstly, you need to install the client library for Localtunnel. So just install it by installing the ‘localtunnel’ gem or write it in your Gemfile:-
gem 'localtunnel'
and run ‘bundle install’ STEP 2: Run your local web server on any port! Let’s say you’re running on port 8080.
$rails s -p 8080
STEP 3: Now run localtunnel by specifying it the on port to be shared as:-
$ localtunnel 8080
It will establish a connection between your local server running at 8080 and Note that for first time you run the localtunnel, it needs you to specify your ssh public key for authentication. Here’s an example:
$ localtunnel -k ~/.ssh/ 8080
After running the above commands, you will see something like this: – Port 8080 is now publicly accessible from … Enjoy Tunnelling your apps !!

jPDF TWEAK REVIEW- Free all-in-one PDF tweak toolkit

jPDF TWEAK jPDF Tweak is a Java Swing application that can combine, split, rotate, reorder, watermark, encrypt, sign, and otherwise tweak PDF files.

pdf-tweak.jpg (234×168)

WHY JPDF TWEAK: You can use it to make printable booklets from PDFs, to add PDF bookmarks, effects (page transitions), to combine multiple PDF files, to watermark them, to rotate pages that do not fit, to attach files to your PDF, to encrypt and sign your PDFs, to change metadata (like author or keywords), and much more. SYSTEM REQUIREMENTS: One needs Java 5 or higher to run jPDF tweak. STARTING: Start jPDF Tweak by running jpdftweak.bat, double-clicking jpdftweak.jar or running “java -jar jpdftweak.jar” at the command line. THE MAIN WINDOW: The main window is divided into multiple tabs. You can select options from as many tabs as you need. Press Run when you are finished setting options. The Input Tab

input-tab.jpg (215×160)

Select an input file to manipulate. If you want to combine multiple files, check the checkbox and add more files. They will end up in the box, where you can select pages and/or reorder them. Click Add in the lower left corner to add another entry for a file already used. If you want to process multiple files at the same time, select batch processing and add multiple files. In that case, you should use variables in the output filename or each file will overwrite the previous one. If the file is encrypted, you will need the owner password to decrypt it. It is possible to decrypt by using the user password only, but it is not allowed to do so. All page numbers start with 1 (like normal people count), not with 0 (like programmers count). Note, if you use the “combine multiple files” option, some options that are usually kept in the document are dropped, even if only one file is selected. This also applies to the command line mode – if you use the –i option, it will use multiple file mode and drop page numbers, document info, forms, etc. The Page Size Tab

page-size.jpg (224×161)

Rotate Pages: If you have a PDF that has both Portrait and Landscape pages, and your printer has problems in printing both, you can rotate the pages so that they are all Portrait or Landscape afterwards. You can use this option as well to rotate all pages. Remove implicit page rotation: PDF knows two ways of rotating pages:
  • Rotating the content
  • Rotating the media (implicitly).
Some tools have problems with rotated media, so you can change all Media rotations to content rotations with this option (The option above creates media rotation as well). jPDF Tweak should work with rotated media as well. If you have problem with rotated pages, try checking this option and, if it helps, report a bug. Scale pages: It is useful if your PDF contains pages of different size. Some tools (like the Shuffle tab of this tool) require pages of equal size. This option can be use to scale all pages to the same size. You can use this option as well if all pages are of equal size. In that case, you might as well use the scale option of your PDF viewer program. PostScript points: A PostScript point is the 72th of an inch. Center instead of enlarging: This can be use, if the new page size is larger than the old one and the pages should be centered instead of enlarged. Do not preserve aspect ratio: Causes funnily stretched pages if the aspect ratio has changed. The Watermark Tab

water.jpg (230×165)

You can add two kinds of watermarks and page numbers. The text watermark appears on top of the content, the PDF watermark on bottom. So if your PDF pages are completely filled (maybe even with white color), you won’t see a PDF watermark. Text watermark and page numbers use the built-in Helvetica font (similar to Arial on Windows systems). Page numbers can be printed on any corner or edge of the page, or in the middle (mostly useful for testing purposes). The position can be mirrored on even pages, to get the page number on the outer or inner edge for duplex documents. If plain numbers are not enough for you, you can use a mask to format your numbers. This mask uses the same syntax as the standard Java formatting function, and supports the current page number and the total number of pages as parameters. The current page number is available in a plain way (1-n) that you can format yourself, and additionally in a shifted way (if your document’s page numbers are shifted), and in a pre-formatted way (which is interesting for letters or roman numbers). In case you want to change the page numbers for the printed values, you can do this on this tab as well, in the same format as on the Page Numbers Tab. Note that if you do not select different page numbers on the Page Numbers Tab, and no other transformation invalidates your page numbers, these page numbers will also be present in the output document as if they were configured on the Page Numbers Tab as well. So, for this common case, it is enough to configure the page numbers once. The Shuffle/N-up Tab

shuffle.png (235×164)

The most powerful and the most complex tab. First specify how many pages each pass (each use of the template) covers. If you select 4 here, and your PDF has 21 pages, it will be run 6 times (5 times with 4 pages each, and once with the last page). If you give a negative number, you can take half of the pages from the end of the document instead of from the beginning. This is useful for booklet layouts. Use positive page numbers like “+2” to refer to the second page of the template, and use negative page numbers like “-3” to refer to the third page of the “opposite” template (i.e. the one if you process the file from end instead of from beginning). An absolute number without sign (like “2”) refers to the same absolute page (i.e. the second page of the file). For the offsets and factors: Just tweak them until it looks correct in the preview. If you rotate a page and it is gone, this is most likely caused by the fact the rotation used the lower left corner as center point and not the center of the page. Uncheck the New Page Before to put more than one source page onto one destination page. Creating a configure with both positive and negative numbers can be confusing. For a test, you might add huge page numbers to your document so you can see quickly if your configure is correct. The Page Numbers Tab

page-number.jpg (221×160)

In the page Numbers Tab, you can tweak the page numbers that appear in your PDF reader. Depending on your PDF reader, they can be used for displaying the current page in the toolbar and status bar, jumping to a page by its number and/or printing page ranges. Most printed documents have some kind of title pages and or table of contents that are outside of the page numbers or are numbered with Roman numbers. This makes it hard if you read about something “on page 200” to jump to this page 200, because it will be the 205th page and not the 200th if there are five pages before page 1. Note that these page numbers do not appear on the page itself. For this kind of numbers, there is an option on the “Watermark” tab. To just change the number of the first physical page, click “Add” once, leave the “Start Page” at one and change the other controls. If you want to have “gaps” in your page numbers, add more lines and use “Start page” to point to the physical page numbers (i.e. those that start from 1) where the format should change. Assume you have a 6 page PDF, and you set it up as follows:
Start Page Style Prefix Logical Page
1 Empty Title 1
2 I, II, III 4
5 1, 2, 3 S 32
Then the six pages will have numbers Title, IV, V, VI, S32, S33 and so on. Be careful that your document does not end up having two pages with the same number (as represented as text) – some versions of Adobe Reader don’t really like that. You can work around it by setting a prefix for these pages or use different number styles. The Bookmarks Tab

bookmark.png (223×167)

With this option, you can tweak chapter bookmarks. If you select more than one input file, chapter bookmarks will be combined automatically. But if you select individual pages or ranges instead of the full document, you will have to tweak the bookmarks manually. If you want to create bookmarks from scratch, it is useful to open existing PDFs and look what the bookmarks look like in there. If you want to add bookmarks that do not only point to a page but to a position on a page, you might need a tool like GSView (from GhostScript) which coordinates when moving the cursor on a PDF file. The Attachments Tab

attachment-tab.jpg (230×160)

Here you can add attachments and remove files you erroneously attached before. This view does not show which files have been attached to the original document. If you need them, use your PDF viewer to save them and reattach them if necessary. The Interaction Tab

interaction-tab.jpg (246×177)

When a PDF file is shown in full screen mode, pages can flip automatically and/or with a nice effect. Select effects and/or durations (durations are in seconds) on the left. You can set viewer preferences (how the document should be opened) on the right. The Document Info Tab

doc-info-tab.jpg (241×162)

In the document info tab, you can add information to the document info dictionary (shown when you open “Document summary” The Encrypt/Sign Tab

encrypt-tab.jpg (241×165)

If you know the owner password, you may do everything with the document, if you know only the user password; you may only do things checked below. The user password may be empty, the owner password may not (but you can use the same password for both if desired). Signing is a bit trickier, since you need a key and a certificate for this to be useful. Import that key into a Java Key Store (using Sun’s key tool), and you can use it from here. The Output Tab

output-tab.jpg (235×168)

Select an output filename here. If you select a name of an existing file, you will receive a warning. However, if you run jPDF tweak more than once, it will not create a warning since warnings are annoying if you are just trying to find the right settings by trial and error. You may optionally burst the document into single page PDFs. Note; all features (like bookmarks, transitions or viewer preferences) make sense when you burst a document. When you save a document uncompressed, you can add page marks (compatible to pdftk’s page marks) to find pages easier in the PDF source code. Search for “pdftk_PageNum” in the uncompressed PDF to find a page. When you compress a PDF again, you can remove these marks. How much does it cost? jPDF Tweak are open source and free software and given its capabilities, it stands apart from others. How to remain update about Jpdf Tweak: You can visit Jpdf Tweak homepage to check for the latest version and tools. You all are invited to share and discuss your views. Alternatively, anyone can leave a comment at the bottom of this page.

PDFTools Review – Free and open source PDF Manipulation Utilities

PDF Tools is a free program for personal or commercial use. It is a PDF management application. It can encrypt, decrypt, join, split, stamp, create and rearrange a PDF file. Here is the snapshot to an easy to use interface.

Sample.jpg (265×200)

Why PDF TOOLS: To edit the text or writing a PDF document is a complicated task, especially if we do not have the original file (before the change to PDF format). Editing/manipulating the PDF can be done only with very expensive paid software such as Adobe Acrobat (not Adobe Reader). PDF Tools is a fast and easy to use tool allowing you to make PDF manipulations cheaply and easily. The set of functionality includes but not limited to:
  • Editing or adding data into the document information fields of single or multiple PDF files.
  • Actions including page layout, page size, page margin, page orientation, metadata, optimization, and others into your existing PDF files.
  • Edit the layout, information, merge, split, or simply add the information in PDF documents
WHAT DOES IT OFFER (FEATURES): PDF Tools is easy to use application. Its main window gives easy access to all features available in PDF Tools.

Encrypt-PDF.jpg (187×163)

  • Encrypt PDF: Allows you to have password to protect any PDF file. Also, you can specify additional features for protected PDF. Note: Some of the features are only available if you select 128 bit encryption.

encrypt1.jpg (214×166)

  • Decrypt PDF: Allows you to create a protection-free version of an encrypted PDF file.

decrypt.jpg (224×175)

  • Join PDFs: As the name suggest, it allows you to create a PDF file by joining multiple PDF files.

join-pdf.jpg (226×182)

  • Split PDF: Split option allows you to split a PDF file in multiple ways. You can split each page to new PDF, split even pages to new PDF, split odd pages to new PDF, split after giving page number, split at every given page count or split a range of pages to new PDF file.

split-pdf.jpg (204×165)

  • Stamp PDF: Stamp PDF allows you to overlay (or stamp) a Text or Image over a PDF file. You can overlay Text/Image at pre-defined location in pages or at any custom location by giving its X and Y position. For text, in custom position you can define angle (in Degrees) for text. For Image, you can define the scaling for image. Scale option is available for both pre-defined location and custom location.

stamp.jpg (205×163)

  • Rearrange PDF: It is to arrange pages in a PDF file. You can reverse all pages, copy multiple pages on single page or create handout style pages.

rearrange.jpg (199×163)

create.jpg (196×162)

How much does it cost? PDF Tools are open source and free software and given its capabilities, it stand apart from others. How to remain updated about pdf tools: You can visit the pdftool homepage to check for the latest versions and tools.

Migradoc Reviewed – .NET library for rendering and modelling documents

MigraDoc is the “family name” of several products and tools from empira Software GmbH. MigraDoc foundation (formerly referred to as MigraDoc Lite) is the .NET library for modeling and rendering documents. Why Migradoc: The library:
  • Supports most of the word processing features like paragraphs, tables, charts, arrange all this in sections, use bookmarks to create links, tables of contents, indexes, etc.
  • Supports creating PDF, XPS, or RTF documents.
  • Can be called from any of the .NET languages.
  • Combines seamlessly with PDFSharp to support extra fine PDF features and functionality.
Who will use Migradoc: Migradoc is a library meant for:
  • Developers who want to create rich documents on fly.
  • Can be used on server side for producing documents via a web application.
How much does it cost: Migradoc is free to use and is licensed under MIT license. According to the host website, it will remain free in a far future. How to remain updated about migradoc: You can visit the migradoc homepage for download and to review latest versions and bug fix reports.