Crystal Report generates PDF in different fonts on different servers

We were satisfied with Crystal Report (CR) to generate PDF on the fly until we put CR templates on production servers.

The CR templates were tested on DEV and QA servers without any problem. But when the templates were put onto production box, we were amazed how messy the generated PDF looked like: the font size were mysteriously changed and paragraphs overlapped! @^@

I searched for reasons on Internet for hours, until I found one possible answer here: Typically when you are seeing page formatting issues on different machines, it could be because of printer drivers (or lack of). The reporting engine relies on the printer driver configured on the machine to provide information so that a page can be properly rendered. If you designed the report on your dev machine which is using PrinterA and then deploy to another machine using PrinterB, the formatting could be off.

My program was a .NET web service to create PDF document using ExportToDisk not PrintToPrinter:
oDocument.ExportToDisk(
ExportFormatType.PortableDocFormat, sOutputFile);

so I wondered if the printer was the real problem. After I was told the production server pointed to the exact same printer as QA server, I reluctantly asked IT to check version of printer driver on both servers.

Then ... IT told me that the servers had different versions of printer driver even they pointed to same printer. After IT installed the same latest drivers on servers, the formating issue was resolved. :)

Although we had to postpone production delivery, it's good to know some software use printer driver to arrange layout internally.

0 comments: