Page 2 of 2

Re: HPDFPRINT UNICODE

Posted: Fri Dec 08, 2017 11:59 am
by edk
You do not have to convert all code to ANSI. The entire source code can be in UNICODE.
I mean, you can only convert content when you create a PDF.

Code: Select all

[Main program]

[Some function]
(...)

//temporary switch to CP1250, only for create PDF
SET CODEPAGE TO SLOVENIAN

SELECT HPDFDOC "example.pdf" TO lSuccess PAPERSIZE HPDF_PAPER_A4
IF lSuccess
	SET HPDFDOC ENCODING TO "CP1250"
	START HPDFDOC
	START HPDFPAGE
	@ 01, 10 HPDFPRINT hb_Utf8ToStr( AnyStringInUnicode )
	@ 20, 10 HPDFPRINT hb_Utf8ToStr( AnotherAnyStringInUnicode )
	(...)
	END HPDFPAGE
        END HPDFDOC
ENDIF
SET CODEPAGE TO UNICODE	//back to UNICODE
(...)
RETURN