Copy link to clipboard
Copied
Hello All,
I'm working in embedded domain and trying to generate a pdf report dynamically. There is a code space concern in my embedded module so I was unable to use open source library like libharu etc.
The following procedure I have used to generate a pdf.
First I created a txt file having basic pdf header,trailer and xref and then I have modified length and data stream fields( feeding my data to data stream). Later the txt file is saving/converting as .pdf.
First issue faced: There are some special characters required for Italian and french language pdf. After I changed encoding to WinAnsiEncoding that issue got solved.
second issue: But currently I'm try to generate a pdf for Russian and Greek using same approach using CP1251 or other some encoding standards. the generated PDF is taking standard encoding by default. Can any one help me how can i generate pdf for Russian and Greek Languages.
Thanks in advance,
Jins.
Note:
Micro controller : ARM32 Cortex M4.
Please refer below code for dynamic pdf generation approaches.
%PDF-1.4
%%EOF
6 0 obj
<<
/Type /Catalog
/Pages 5 0 R
>>
endobj
1 0 obj
<<
/Type /Page
/Parent 5 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 2 0 R
>>
endobj
4 0 obj
<<
/Type /Font
/Subtype /Type1
/BaseFont/Helvetica
/Encoding/WinAnsiEncoding
>>
endobj
2 0 obj
<</Length 182>>
stream
BT
/F1 48 Tf
1 0 0 1 10 100 Tm
(English)Tj
0 50 Td
/F2 48 Tf
(FranƧais)Tj
0 50 Td
/F3 48 Tf
(EspaƱol)Tj
ET
endstream
endobj
5 0 obj
<<
/Type /Pages
/Kids [ 1 0 R ]
/Count 1
>>
endobj
3 0 obj
<<
/ProcSet[/PDF/Text]
/Font <</F1 4 0 R >>
>>
endobj
xref
0 7
0000000000 65535 f
0000000060 00000 n
0000000228 00000 n
0000000424 00000 n
0000000145 00000 n
0000000333 00000 n
0000000009 00000 n
trailer
<<
/Size 7
/Root 6 0 R
>>
startxref
488
%%EOF
It is possible to make a PDF without an embedded font for Latin1, Japanese, Chinese and Korean only. For all other code pages/encodings you will need to use software that is capable of embedding fonts. There is no provision in the PDF design to use Unicode for page contents.
Copy link to clipboard
Copied
It is possible to make a PDF without an embedded font for Latin1, Japanese, Chinese and Korean only. For all other code pages/encodings you will need to use software that is capable of embedding fonts. There is no provision in the PDF design to use Unicode for page contents.