This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.itextpdf.text.pdf.*; | |
import com.itextpdf.text.pdf.parser.PdfImageObject; | |
import java.io.FileOutputStream; | |
/** | |
* This remove the interpolation flag in images in a given PDF file using iText 5. | |
* Requires: iText 5 | |
* | |
* For more info, see: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Here is the software that is needed for the conversion to take place: | |
# 1. DjVuLibre . | |
# 2. LibTiff . | |
# | |
# NOTE: The ddjvu utility has an option to convert specific layers. One common mistake is to convert only the mask layer | |
# or the foreground layer . Technically speaking, the mask layer is the one that should have the actual text but in | |
# practice I have seen that the the DjVu encoder occasionally puts portions of the text in the background layer. Thus, | |
# if you only take the foreground or mask layers, you will lose those bits in the background. If your specific files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script flattens transparencies in PDF files. To use, run the following: | |
# 2007_11_09-flatten_pdf.sh [input.pdf] [output.pdf] | |
# | |
# You will need xpdf-tools and ps2pdf to be installed | |
# | |
pdftops -origpagesizes -level3 $1 temp.ps | |
ps2pdf -dPDFX temp.ps $2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A post at TechDigits [https://web.archive.org/web/20050311025802/http://techdigits.blogspot.com/2004/12/ups-package-tracking-with-rss.html] | |
* about tracking UPS packages via RSS and web services got me thinking if the same is possible via Javascript and | |
* the XmlHttpRequest object (in IE and Mozilla). Since Google's Gmail and Google Suggest started using that object, | |
* it has become more popular. So after some thinking, I put together the following quick and dirty code snippet | |
* | |
* I don't know how useful this can be since the security information is exposed, but it is a nice hack. | |
*/ | |
req = new XMLHttpRequest(); | |
var strXML = '<?xml version='1.0'?>' + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To compile and run: | |
* | |
* javac -classpath MultiplyPDF.java | |
* java -classpath iText-2.0.8.jar MultiplyPDF | |
* | |
*/ | |
import com.lowagie.text.Document; | |
import com.lowagie.text.DocumentException; | |
import com.lowagie.text.PageSize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# This script is used to load and unload external SD cards in Palm Pilot | |
# devices that are made available to the OS as a USB drive by CardExport II | |
# program, made by www.softick.com. | |
# | |
# Please make sure that /mnt/usbdrive directory exists and that you have | |
# the usb-storage support in your kernel. You must be root to run this. | |
# | |
# Usage: cardexport {start|stop} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' | |
' Based on column by Walter Mossberg <[email protected]>. Check out his | |
' page at http://pctech.wsj.com | |
' | |
Dim strName | |
Dim WshShell | |
Dim strOldTitle | |
Dim strNewTitle | |
Dim intTemp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* One of the recent problem that I ran across at work is an easy way to do highlighting for form fields. | |
* Of course the best way would be CSS 2 | |
* (as shown here [http://www.cssdrive.com/index.php/examples/exampleitem/focus_pseudo_class/]) but alas, | |
* IE does not support that. | |
* | |
* The alternative is JavaScript onFocus and onBlur method. However, one thing which I also wanted to avoid | |
* is changing over 200 different pages in our system to add those in. So instead, I wrote a simple piece of | |
* Javascript which attaches the event handlers on the fly. The best part about this is that the actual form | |
* does not need to be changed - just include the Javascript on the bottom of your webpage. The code is as follows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* One of the questions that recently came up is how to remove vowels from Hebrew characters in Unicode | |
* (or any other similar language). A quick look at Hebrew Unicode chart shows that the vowels are all | |
* located between 0x0591 (1425) and 0x05C7 (1479). With this and Javascript's charCodeAt function, it | |
* is trivial to strip them out with Javascript as follows | |
* | |
* Live demo is available here: | |
* https://jsfiddle.net/js0ge7gn/ | |
*/ |
NewerOlder