Print Page | Close Window

Print diacritics

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2923
Printed Date: 28 Sep 24 at 11:03PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Print diacritics
Posted By: doktor.pj
Subject: Print diacritics
Date Posted: 19 Jun 14 at 1:51PM
Hi.
I have a problem with the print original. When you load a form (LoadFromFile), writing to one of the items (SetFormFieldValueByTitle) as a form "ěščřžýáíé" Save (SaveToFile), everything is fine.
But if I print the form (PrintDocument)
and missing features "ěčř". Can you advise?
Thanks Pavel

Addendum: If you use command instead of the PrintDocument API function ShellExecute (0, "print", "test.pdf", "", "", 1) printing is fine.



Replies:
Posted By: Ingo
Date Posted: 19 Jun 14 at 9:34PM
Hi Doktor ;-)

I can't read your used special characters here in your post. 
Please read here about the function SetFormFieldValueByTitle:
http://www.debenu.com/docs/pdf_library_reference/SetFormFieldValueByTitle.php
You're using special characters and perhaps you don't use WideString?

Additionally you should read and use SetNeedAppearances:
http://www.debenu.com/docs/pdf_library_reference/SetNeedAppearances.php
Knowing a bit about FlattenFormField should be good, too:
http://www.debenu.com/docs/pdf_library_reference/FlattenFormField.php

Starting at page 32 of the developer guide:
http://www.debenu.com/docs/pdf_library_developer_guide/debenu_quick_pdf_library_10_developer_guide.pdf
... you'll find several samples for your first steps with forms.

Cheers and welcome here,
Ingo



-------------
Cheers,
Ingo



Posted By: doktor.pj
Date Posted: 23 Jun 14 at 11:35AM
Thank you for your response.

I tried to
go through the above commands and settings as well as various examples but the result is still the same. Cry What can I possibly even try?

If you were in a previous post unreadable and national characters join in pictures.

How it should look: http://ulozto.cz/xQq4gHXu/screen-ok-jpg" rel="nofollow - http://ulozto.cz/xQq4gHXu/screen-ok-jpg
This will print: http://ulozto.cz/x77bvpdL/screen-bad-jpg" rel="nofollow - http://ulozto.cz/x77bvpdL/screen-bad-jpg

Pavel


Posted By: Wheeley
Date Posted: 23 Jun 14 at 10:47PM
How about trying the new render engine in version 10.x.

Wheeley


Posted By: doktor.pj
Date Posted: 24 Jun 14 at 7:11AM
I tried, unfortunately with the same result as in version 10.12 and at 10.15.
Pavel


Posted By: mLipok
Date Posted: 24 Jun 14 at 9:55AM
Question:
if you make a new PDF file using Debenu ... after writing, reading, and attempt to print, and then everything is OK?




-------------
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600


Posted By: doktor.pj
Date Posted: 24 Jun 14 at 10:18AM
I do not know. Let me try it. So far I only wrote to the existing form and then printed out.
Pavel


Posted By: doktor.pj
Date Posted: 24 Jun 14 at 10:52AM
So I tried the example from the documentation...

loPDFLib.SetOrigin(1)
loPDFLib.DrawText(100, 100, "ěščřžýáíé")
loPDFLib.SaveToFile("d:\test.pdf")

...
and the result is still the same ie. some characters are missing.
In this case, the characters are missing already saved in PDF.



- However, if
the above example will fulfill the orders 
AddTrueTypeFont and SelectFont (see below), everything is fine.

loPDFLib.SetOrigin(1)

lnFontID=loPDFLib.AddTrueTypeFont('Arial CE {1250}', 1)
loPDFLib.SelectFont(lnFontID)

loPDFLib.DrawText(100, 100, "ěščřžýáíé")
loPDFLib.SaveToFile("d:\test.pdf")

lcPrinter=loPDFLib.NewCustomPrinter(loPDFLib.GetDefaultPrinterName)
loPDFLib.PrintDocument(lcPrinter, 1, 1, 0)


- So I finally tried out for field txtName change the font to Arial and use commands AddTrueTypeFont and SelectFont (see below). Unfortunately, in the press are again some characters omitted.

loPDFLib.LoadFromFile("c:\form.pdf", "")
lnFontID=loPDFLib.AddTrueTypeFont('Arial CE {1250}', 1)
loPDFLib.SelectFont(lnFontID)
loPDFLib.SetFormFieldValueByTitle("txtName", "ěščřžýáíé")


So the question probably sounds as txtName entry form impose font Arial CE.


Appendix:

Command GetFormFontName I found that Arial is the first index So I tried SetFormFieldFont command to set the appropriate font for the item txtName but I failed. When I command SaveToFile order form so it is okay i diacritics font is changed to Arial but when printing problem again.



Pavel


Posted By: doktor.pj
Date Posted: 24 Jun 14 at 11:37AM
Solved!

I had to add some command AddFormFont and here is all of it:


loPDFLib.LoadFromFile("c:\form.pdf", "")

lnFontID=loPDFLib.AddTrueTypeFont('Arial CE {1250}', 1)
lnIndex=loPDFLib.AddFormFont(lnFontID)
           
FOR f=1 TO loPDFLib.FormFieldCount()
    loPDFLib.SetFormFieldFont(f, lnIndex)
ENDFOR
                       
loPDFLib.SetFormFieldValueByTitle("txtName", " http://ulozto.cz/xQq4gHXu/screen-ok-jpg" rel="nofollow - ěščřžýáíé ")

FOR f=1 TO loPDFLib.FormFieldCount()
    loPDFLib.UpdateAppearanceStream(f)
ENDFOR

lcPrinter=loPDFLib.NewCustomPrinter(loPDFLib.GetDefaultPrinterName)
loPDFLib.PrintDocument(lcPrinter, 1, loPDFLib.PageCount, 0)

Thanks for mLipok push in the right direction!

Pavel


Posted By: mLipok
Date Posted: 24 Jun 14 at 7:05PM
You're welcome - neighbor (I'm Polish).

-------------
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk