Haphy.com

Blog

Archive for the ‘Development’ Category

Preview a live domain without changing DNS

Thursday, March 27th, 2008

This is a handy way of previewing a live domain name without changing it’s DNS records. I find this technique particularly useful when transferring the hosting of live websites. The instructions are for Mac OS X users.

  1. Open Terminal
  2. We need to edit the hosts file, so type “sudo pico /etc/hosts” and hit enter
  3. Enter your password
  4. Use the arrow keys to move the flasher down to create a new line beneath any of the other entries
  5. Type the IP address of the server, hit tab and type the domain name you wish to preview, e.g.
    01.23.45.67 haphy.com
  6. Press CTRL+X and type “y”, then hit enter to save your changes
  7. Visit http://haphy.com in your browser.

Notes

  • www.haphy.com will still function with the “real” DNS settings on your computer.
  • Remember, the server that you’re previewing needs to be setup to recognise your domain.
  • For some servers, you will need to enter the full domain (i.e. www.haphy.com) to your hosts file, and then visit that address in your browser - it depends on your setup.

Stop Internet Explorer displaying alt attribute as a tooltip

Sunday, March 9th, 2008

Internet Explorer has a habit of wrongly displaying the alt attribute of an image as a tooltip. This can prove irritating when using images as links or when trying to implement an alternative tooltip solution such as Prototip.

There is a simple way to stop IE using the alt attribute as a tooltip:

  1. Add a title attribute to your image. The contents of this attribute will be used as a tooltip instead.

A blank title attribute will prevent IE displaying a tooltip at all.

Submit Interactive PDF as Email Attachment

Tuesday, February 19th, 2008

By default, the “Send by Email” button in the LiveCycle designer menu submits interactive PDF form data as an XML attachment. The recipient must then import the XML data into a local copy of the PDF file using Adobe Acrobat Professional.

For many users this is fine, but I needed a way to email the data within a PDF attachment. The clear benefit of this is that users without Acrobat Professional can read the data simply by downloading the free Adobe Reader.

There is a surprisingly simple way to achieve this, in two stages:

Stage 1: Enable usage rights in Adobe Reader

  1. Open your form in Adobe LiveCycle Designer
  2. Choose Advanced > Enable usage rights in Adobe Reader

Stage 2: Create the email button

  1. Drag a “Send by email” button into your file
  2. With the button selected, chose View > XML Source
  3. Find the following code:

    <event activity="click">
    <submit format="xml" target="mailto:example@example.com?subject=Example" textencoding="UTF-8"></submit>
    </event>

  4. Change the format attribute on the submit tag from “xml” to “pdf”, and save your changes.

Create a Save Form button in Adobe Livecycle Designer

Monday, February 18th, 2008

I’ve recently been working on interactive PDFs in Adobe Livecycle designer. I’ve realised that it is possible to create interactive PDFs which can be saved in Adobe Reader 8, and create a save form button to encourage users to do this.

For normal users, there are three stages. Advanced users can skip straight to the code.

Stage 1: Create a PDF which can be saved in Adobe Reader 8

  1. Open the PDF in Adobe Acrobat Professional
  2. Choose Advanced > Enable Usage Rights in Adobe Reader
  3. Save the file somewhere, as directed

Stage 2: Download and install the save form button XFO

  1. Download the “Save a Copy” file from http://www.livecycletraining.com/ (direct link to zip file)
  2. Save the XFO file somewhere safe
  3. Open your form in Adobe LiveCycle Designer
  4. Click on the menu icon in the Library pallet
  5. Choose Add Group & enter a name
  6. Now click the menu icon on your newly created group, and in the Group properties options box, locate the XFO file

Stage 3: Create a Save Form button

  1. Simply drag the save form button which appears in your newly created group.

Save form button instructions for Advanced Users

Add the following javascript code to a button in the XML source view on your interactive PDF.

<event activity="click">
<script contentType="application/x-javascript">app.execMenuItem("SaveAs");</script>
</event>

© 2008 - Peter John Hartree: Freelance website developer based in Chichester, UK.