Archive for August, 2008

Importing SVG and PDF files into Expression Design / Blend

Thursday, August 28th, 2008

I have a lot of ‘assets’ in PDF and SVG formats, but I’d like to use them in Expression Blend for a WPF.  My first attempts to import these files was rather unsuccessful.

In order to get anything vector based into Blend, it pretty much has to be XAML.  It would be nice if it had some sort of converter to bring ’standard’ vector formats like PDF and SVG directly into Blend, but it just doesn’t support it.

I figured that was no big deal because Expression Design, nominally a vector graphics editing program should be able to import the two most common vector file formats, right?  Well sorta.  If you try importing a PDF, it won’t be listed under a “Supported File Formats”.  But if you either rename it to .ai (Illustrator) or do a * File Name (show all files) listing it will import PDF files as “Adobe Illustrator - PDF compatible”.

What about SVGs?  Basically you have to convert an SVG to a PDF and then do the above process.  You can do this using an open source vector drawing application called Inkscape.  Inkscape my support XAML natively, but from what I’m hearing it is still a bit buggy.

I think for all my future work, I’m going to export directly to XAML from Illustrator using a plugin.  We’ll see how that goes.

Frankly I think Microsoft should just include PDF (with a .pdf file extension) and SVG support in the Expression studio.

Getting Apache 2.2 to work with PHP 5.2 on Windows

Tuesday, August 12th, 2008

Sad truth of the matter is that I need to be able to access Microsoft SQL from PHP.  The old cross-platform PHP mssql functions are depreciated and will not authenticate with SQL Server 2005 or 2008–now to access MSSQL stuff, you need to use Microsoft’s SQL Server 2005 Driver for PHP .  Which is only available for Windows.

I do all my primary development on a Mac, but now I have a Windows dev server for PHP apps that interface with Microsoft SQL.  This new machine runs Vista, and I’m using all the latest versions–(Apache 2.2 and PHP 5.2.6).

I’ve installed PHP on many Windows systems, and usually it is dead simple:

  • Install Apache
  • Download PHP, Zip Version
  • Unzip php zip file into c:\php
  • Copy php.ini-dist to php.ini
  • Modify the $PATH Environment Variables to include “c:\php”.  Reboot for changes to take effect
  • Append httpd.conf with
    LoadModule php5_module "c:/php/php5apache2.dll"
    AddType application/x-httpd-php .php
    PHPIniDir "C:/php"
  • Restart Apache

Only this time I was getting an error when I restarted Apache.  Checking the error.log I noticed this error.

Cannot load C:/php/php5apache2.dll into server: The specified module could not be found.

Strange error.  php5apache2.dll does exist and in that location.  I double and triple-checked.  It is there.

Eventually I discovered that if you’re using Apache 2.2 you need to use the php5apache2_2.dll not php5apache2.dll. This is not in PHP’s install.txt documentation, nor does the Apache error log steer you in the right direction.  It should say something like “unable to load module” not “module not found”.  You’re just supposed to know.  Nice.

So to recap, do everything the same except instead of putting this in your httpd.conf:

LoadModule php5_module "c:/php/php5apache2.dll"

use:

LoadModule php5_module "c:/php/php5apache2_2.dll"

So if you’re getting that error message, there is your solution.