Thursday, July 22, 2010

Frequency Of Hindi Channels



Problem: I make available on a portal web dei bollettini di pagamento personalizzati per utente. Tali bollettini devono essere scritti con un carattere particolare così da essere facilmente leggibili in banca dagli appositi lettori. Nella fattispecie si tratta del font OCR-B.

La soluzione adottata si basa su SQL Server Reporting Services, per la precisione, per questioni di licenza, la versione 2005 con SP3 installata.

Dalla pagina web, in base all’utente loggato, si passano i parametri opportuni al report creato e si da in output all’utente direttamente il file pdf, senza passare per la preview con il controllo reportviewer.

In altre parole nulla di strano o articolato se non fosse per il carattere OCR-B. Se il carattere non è installato sul client il pdf viene mostrato con un carattere standard. Per ovviare bisogna far “embeddare” il carattere nel pdf.

Cosa dice Microsoft al riguardo:

Font embedding privileges are granted by the font author. Installed fonts include a property that indicates whether the font author intends to allow embedding a font in a document. If the property value is EMBED_NOEMBEDDING, the font is not embedded in the PDF file. For more information, see "TTGetEmbeddingType" on msdn.microsoft.com.

The Font is TrueType.

The characters in the string that has the Font property set are Unicode, not ANSI. No font embedding occurs for ANSI characters.

Fonts are referenced by visible items in a report. If a font is referenced by an item that has the Hidden property set to True , the font is not needed to display rendered data and will not be included in the file. Fonts are embedded only when they are needed to display the rendered report data.

Stando a quanto letto in giro per la rete il supporto per l’”automatic full font embedding” è garantito solo da Reporting Services 2008 con installato il Cumulative Update #1 for SQL Server 2008.

Tuttavia è possibile cavarsela anche utilizzando Reporting Services 2005 e SQL Server 2005 SP3.

In questa situazione se il testo all’interno del report contiene soltanto caratteri “latin” l’embedding del font non sarà possibile.

Occorrerà aggiungere caratteri non ANSI (ad esempio: ޝ) per ogni testo nel report scritto con il font che si vuole “embeddare”.

Naturalmente occorrerà anche che il font sia True Type ed embeddable.

Per controllare le caratteristiche dei vari font può essere utile Font property extension, un tool Microsoft ( http://www.microsoft.com/typography/TrueTypeProperty21.mspx ).

Serviranno entrambi i file con estensione pfm e ttf.

Per l’installazione del carattere da effettuare sul server di Reporting si può fare riferimento alla guida Microsoft presente online ( http://support.microsoft.com/kb/314960).

In our case, care must be taken to install for the first character Type 1 (pfm files) and then the True Type (ttf extension), although we do not understand why.

After you install the fonts you need to reboot the machine.

Now the pdf generated by Reporting embedded in the nature and any client can then print out the invoice.

recap:

  • RS2005 + SQL2005 SP3
  • True Type Font and allowed Embed
  • Prepare the report by adding non-ANSI characters in textbox that uses the character that you want to embed
  • install the font (based on the file pfm (Type1) and continuing with the TTF (True Type))
  • Reboot
  • Place the report and make the deploy

Tag: Reporting , Reporting Services, SQL Server , , pdf, font, font embedding , ASP.NET, development,

0 comments:

Post a Comment