Jump to content

Recommended Posts

Posted

I'm using MPDF_UDF to create pdf,  but now I need to print special characters like this:  ❤   (❤)
It's possible ?
Thanks

Posted
19 hours ago, Jos said:

...and how exactly is this an AutoIt3 question?

I was hoping someone could help me since MPDF_UDF.au3 I downloaded it from here:

Maybe someone had the same need (create a pdf with special characters)

Posted (edited)
3 hours ago, Jos said:

Ok...  and do you have an example script that will create the PDF with this issue?

Jos

I receive text script from a textarea and I should print them as they were written, this is an example (pdf output is "Test: ??" instead of "Test: ♥")
 

#include "MPDF_UDF.au3"

PrintPdf()

Func PrintPdf()
;set the properties for the pdf
_SetUnit($PDF_UNIT_CM)
_SetPaperSize("A4")
_SetZoomMode($PDF_ZOOM_CUSTOM, 90)
_SetOrientation($PDF_ORIENTATION_PORTRAIT)
_SetLayoutMode($PDF_LAYOUT_CONTINOUS)
_OpenAfter(True)  ;open pdf after generation

;initialize the pdf
_InitPDF(@ScriptDir & "\TEST.pdf")

;fonts:
_LoadFontTT("_Arial", $PDF_FONT_ARIAL)
_LoadFontTT("_TimesT", $PDF_FONT_TIMES)
_LoadFontTT("_Calibri", $PDF_FONT_CALIBRI)
_LoadFontStandard("_Garamond", $PDF_FONT_GARAMOND)
_LoadFontStandard("_Courier", $PDF_FONT_COURIER)

_BeginPage()

Local $rigDes="Test: ♥"   ;ALT+3
_DrawText(1, 28, $rigDes, "_Arial", 12, $PDF_ALIGN_LEFT, 0)

Local $rigDes="Test: ❤️"
_DrawText(1, 27, $rigDes, "_Arial", 12, $PDF_ALIGN_LEFT, 0)


_EndPage()
_ClosePDFFile()

EndFunc

 

Func _Iif($fTest, $vTrueVal, $vFalseVal)
    If $fTest Then
        Return $vTrueVal
    Else
        Return $vFalseVal
    EndIf
EndFunc   ;==>_Iif

Edited by Steros

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...