Showing posts with label PDF. Show all posts
Showing posts with label PDF. Show all posts

Tuesday, April 22, 2014

Copy tables from PDF for further processing

You ever tried to extract data part of a table from PDF to further process it in MS Excel or any other Spreadsheet application? That can be a painful job.

You might use one of the many PDF to Excel conversion tools - but most of them cannot be used without submitting your PDF to an online service or buying a commercial license. In addition you have to evaluate the quality of the results especially for data part of tables.

Few days ago I stumbled upon the tool Tabula. Still marked as experimental but the results are still pretty useful at least for data oriented tables.

Example

 

The PDF "The Mobile Economy 2013" contains a table on page 56 which you want to process in Excel:









  


You have to follow the following steps to extract as csv:

  • Download the file to your local disk
  • install and start the tool follow the instructions on the homepage
  • upload the PDF and select "Submit"
  • navigate to the table and select the table:













  • choose "Repeat this selection" if you want to select the following tables as well using the same coordinates.
  • choose "Download all data" and you get:










  • choose "Download data" to get a csv file with the extracted tables. This file can be open with MS Excel or any other application which can read the csv format for further processing.
The results are very useful and it works for those kind of data as well:

























Won't work with data provided as graphic as part of the PDF this is an topic for another story.

Sunday, January 06, 2013

HTML5 to PDF to HTML5

PDF is still the most used format to distribute electronic documents - especially for "paper based" workflows. There are obvious reasons still using PDF even if evolving technologies brought alternatives to the table.

On the other hand HTML and related technologies (namely CSS and JavaScript) has made a major step forward to produce enterprise looking documents with additional value a PDF cannot provide.

I do not want to compare the pro and cons - just want to mention well suited tools to convert from one format into the other.

HTML5 to PDF

Whenever you have to create "paper based" workflows based on data you already have a HTML (5) version from the best tool I'm aware of is PrinceXML.  Styling is done using CSS and JavaScript - no additional technology you need to learn.

This technology is not able to fully replace advanced rendering technologies like XSL-FO (and corresponding commercial layout engines) or even more advanced ones based on vendor specific layout definitions.
But there are many use-cases where you just have the HTML you have to distribute as PDF (e.g. confirmation of orders, archiving of a business transaction, etc.) this product might enable this for a reasonable price.

Note: there are many commercial and open source alternatives out there for this approach - non of them are as robust as the mentioned solution based on my experience.

PDF to HTML5

You already have PDF created within your workflow and need HTML5 to support more advanced integration in your content distribution you can tryout PDF2HTML5 Converter.

There are different options you can choose from how the content is transformed (one of them is creating SVG instead of HTML5 but this is a different story). The most useful conversion mode if the content should be further integrated creates:
  • one HTML file per page
  • all distinct block of content is stored within a div tag
  • layout is applied using CSS
  • some JavaScript
Note: The created HTML5 does not result in a responsive design (using absolute positioning and non semantic markup) - but that is more or less by design and cannot be solved in a general purpose implementation.

Both tools are commercial but in case you have a good use-case for one of the two mentioned conversion the price is reasonable. Try out first - both tools provide ways to easy try out the results.




Thursday, September 13, 2012

Compare PDF in automated test scenarios

Do you ever had to test a process which creates a PDF based on well defined test data? You want to ensure that the result is equal or confirms to an given acceptance criteria which you can describe by an existing PDF? You want to automate this operation?

In this case you looking for a tool which compares two PDF files and at least provide you the answer to the question "are those two files the same?". Based on your use-case this means:
  • the contained text is the same on the same page of the PDF
  • the contained appearance (layout) is the same
In addition you need an command line interface to use the function within automated test procedure.

As you might know Adobe Acrobat provides a compare function which is very sufficient (see http://tv.adobe.com/watch/acrobat-tips-and-tricks/comparing-two-pdf-documents/)  but requires a commercial license and to integrate this function in your automated test environment isn't simple (from technical and commercial point of view).

Fortunately the tool comparepdf is available as free software. It is very simple to install, integrate and use. It provides different compare modes for the scenarios mentioned above. In addition a rough overview of the kind of difference is provided and can be used to integrate in automated test reports.

Once you have identified a difference you might be interested what and where the difference appearce. Therefore the GUI based DiffPDF tool can be used free of charge. Not as powerful as the Adobe Acrobat compare function but in many scenarios it helps to see whats going wrong without the need to buy a Adobe Acrobat license.

Friday, June 12, 2009

transform pdf to word / excel

online conversion from pdf to word / excel is available from http://www.pdftoword.com/. you have to upload your pdf and will receive the converted word / excel file as long as the result is smaller than 12 MB. result looks good for most use-case. of course you have to manual rework based on the intension you have with the result but content, images and layout is converted and accessable for subsequent tasks.

i like that kind of advertising - a easy to use subset of the functionality is available for free and if i like the feature and want more enterprise features i will probably pay the price.