How to compare the layout of pdf files programmatically? - ruby

It is possible to rip the text from pdf and comapre it. And here i need to compare if the layout of the pdf with another pdf file. Is it possible programmatically? There are third party tools to do that, but is it available for testing using selenium or any programming language?
I have gone through google, but couldn't find a solid solution for this yet? Any help appreciated.

With PDF Box of apache you should be among other things be able to extract the text from existing PDF documents.
ps: you probably have to create a custom program in jave to extract and compare and invoke it from selinium.

Related

Telerik RadSpreadsheet to PDF

I’m currently using web forms and VB.NET I’ve tried following the examples and docs on Teleriks website, however the results are not as expected. It appears that Telerik is taking a screen capture and turning that into a PDF.
What I’m needing is to export the spreadsheet that is displayed in the RadSpreadsheet control into a PDF document such that the results are identical to what’s being displayed.
I’m starting to wonder if Telerik doesn’t actually do anything but take screen shots and save them as a PDF. Even their demo does that. Does anyone know how to go about exporting the Excel file into a PDF? Again their documentation to me isn’t really clear.
there are several libraries used to process documents. They are called Telerik Document Processing. You can use them to generate, modify or convert documents. You could use the RadSpreadProcessing library to export your grid data and then convert the Workbook to a PDF document. Here is the documentation of the PDF export feature https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/formats-and-conversion/pdf/pdfformatprovider
The PDF documents generated this way are not screenshot, they are real PDF documents.

Inserting image into PDF in xamarin forms

I am working on a project using images where the user gets to choose if they want to save in .jpg or .pdf format. So what I thought was either way save it in .jpg initially and then if they choose .pdf, just push the image into pdf. I read a lot of documentation like xfinium pdf and syncfusion pdf but sadly all those are licensed for commercial use. I was wondering if anybody could point me at the right direction so as to how to get this done without using paid licensing.
Thanks in advance.
Try to use: PdfSharpCore
is a partial port of PdfSharp.Xamarin for .NET Standard.

Programmatically Inserting Data into an InDesign Document

I have to use Adobe InDesign for creating documents. We basically need to have a couple variables throughout the document (company name, project name, etc) that need to be filled in.
I was wondering if there is a way to take an existing template and maybe programmatically fill these in using a language I'm comfortable with (Ruby, Python, etc). I have tried to open the Adobe InDesign file using a text editor - but when I make modifications using Notepad++ and then open the file in InDesign, it tells me the file is corrupted.
If you have any insight with programmatically building InDesign documents or know of any tutorials that would be much appreciated.
P.S. I tried to check out Adobe's ExtendScript but wasn't finding much documentation applying to InDesign.
Thanks for the help!
There is no (legal) way to do this in Ruby/Python. Theoretically it is possible to edit InDesign documents directly using any language but:
It's nowhere near as easy as just making some text modifications, you would have to figure out more about the format, and
It's in direct violation of the InDesign license agreement meaning you could face legal action if Adobe finds out.
ExtendScript is perfect for doing small things like this. If you open up ExtendScript Toolkit and set the target to InDesign you can browse and search the entire API easily. Doing search/replace for simple text variables is not hard at all.
An alternative would be exporting the documents to the .idml language which is easier and legal to edit outside of InDesign.
You can use the DataMerge-feature of Indesign --> https://helpx.adobe.com/indesign/using/data-merge.html
I think this is exactly what you are looking for.
Or you can use the Indesign API. Have a look at Extendscript-Toolkit especially the ObjectModell-Viewer.
You need to convert your .indd file to .idml and unzi it.
In /Stories/Story_*.idml you may found all text variables.
And no easy ways to change text variables in .indd without Adobe products.

What is the easiest way to customize PDF document with a serial number

I have several PDF documents. Users of my Windows application want to print these PDF files. An additional requirement is to add auto incremented serial number to each printed PDF. The serial number is used for accounting purposes, not for security reasons as someone asked here.
What is the easiest way to implement above functionally?
I know that I can buy commercial license of iText and edit PDF files. However I would like to know if there is a simpler solution. E.g. Add a form field to PDF document, distribute it to my users, and then use some Acrobat Reader command line option to fill in the form field with serial number generated by my application.
PDFTK (The PDF Toolkit) is a command-line app that allows you to edit PDFs with ease. For example, you could use the update_info command to change the meta-data, or apply a background (which isn't all that easy, as it requires another PDF to get the background from)...
Another option is to use the FREE Quick PDF Library Lite.
QP.LoadFromFile(Filename);
QP.SetOrigin(1); // set origin coordinate system to top right corner
QP.DrawText(10,10, mySerialNumber);
QP.SaveToFile(newFilename);
You can find more information at http://www.quickpdflibrary.com/free/lite.php
"Quick PDF Library Lite is available as an ActiveX component and works with C, C++, C#, Delphi, PHP, Visual Basic, VB.NET, ASP, PowerBASIC, Pascal or any other language that supports ActiveX."
Disclaimer : I do consulting work for the QuickPDF products.

how to implement split pdf functionality in cocoa application?

I have implemented one desktop application in which i want to implement split pdf functionality .How it possible please advice me.
Thanks in advance
What do you mean you want to implement "split pdf functionality?" You mean you want to split one PDF document into separate PDF documents? If so, see PDFKit.

Resources