Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Printing PDF Wrong
  FAQ FAQ  Forum Search   Register Register  Login Login

Printing PDF Wrong

 Post Reply Post Reply
Author
Message
HJM View Drop Down
Team Player
Team Player


Joined: 01 Feb 21
Location: Netherlands
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote HJM Quote  Post ReplyReply Direct Link To This Post Topic: Printing PDF Wrong
    Posted: 04 Aug 21 at 12:41PM
Hi guys
I add a fonttype to a pdf i.e. Arial. I do this with addtruetypefont. I do not want to embed the font because my clients do have to mail it and with an embedded font it becomes too big.
Additionally the client has to be able to print the pdf.
The result: a perfect pfd with the right font. BUT when i want to print it with setupcustumprinter and printdocument the printed pdf does not seem to understand the Arial. It prints the file with a courier or something with a bad alignment of the letters.
How do I get this well without embedding the font?? (Ingo??)
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 04 Aug 21 at 9:33PM
Hi Henri :)

As a sample...
1. Add the font and save the resulting fontid:
fid := QP.AddTrueTypeFont('Arial [Bold]', 0) ;
2. Select this font with SelectFont:
QP.SelectFont(fid);
3. Now you can use it for example with the drawing syntax.

Cheers,
Ingo

Back to Top
HJM View Drop Down
Team Player
Team Player


Joined: 01 Feb 21
Location: Netherlands
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote HJM Quote  Post ReplyReply Direct Link To This Post Posted: 05 Aug 21 at 7:43AM
Yes Ingo, thats exactly the way I do it. But that was not the question because the result of these actions is:
" a perfect pfd with the right font. BUT when i want to print it with setupcustumprinter and printdocument the printed pdf does not seem to understand the Arial. It prints the file with a courier or something with a bad alignment of the letters.
How do I get this well without embedding the font?? (Ingo??)"
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 05 Aug 21 at 8:01AM
Hi Henri,


so the pdf is ready made...
If you still have no success i think you can expect to have an installed reader on every system and use this reader for the printout?
I've made some trys years ago using the system print regarding pdf:

I've tried some time using the Keybd_Event-syntax from my Delphi/Pascal for virtual key-activations.
If you're using Delphi or Free Pascal you can put the code below directly into a button-event (OnClick) of your application. Other programming-languages will offer a pretty similar syntax. With the sleep-property you can do some experiments.

procedure TForm1.Button3Click(Sender: TObject);
begin
// At the uses-part don't forget the ShellAPI ;-)

// Show/open the pdf-document ...
ShellExecute(hinstance,'open',PChar('c:\temp\test.pdf'),nil,nil,SW_NORMAL);

sleep(2000); // sleep/wait for 2 seconds

// Virtual Keys [Strg] +

to open the print dialog ...

Keybd_Event(VK_CONTROL,0,0,0);
Keybd_Event(Ord('P'),MapVirtualKey(Ord('P'), 0),0,0);
Keybd_Event(Ord('P'),MapVirtualKey(Ord('P'), 0),KEYEVENTF_KEYUP,0);
Keybd_Event(VK_CONTROL,0,KEYEVENTF_KEYUP,0);

// Virtual key [ENTER] to start printout ...
Keybd_Event(VK_RETURN,1,0,0);
Keybd_Event(VK_RETURN, 1, KEYEVENTF_KEYUP, 0);

sleep(2000); // sleep/wait for 2 seconds

// Virtual keys [Alt] + [F4] to close the active reader-window ...
Keybd_Event(VK_MENU,0,0,0);
Keybd_Event(VK_F4,0,0,0);
Keybd_Event(VK_F4,0,KEYEVENTF_KEYUP,0);
Keybd_Event(VK_MENU,0,KEYEVENTF_KEYUP,0);

end;
Cheers,
Ingo

Back to Top
HJM View Drop Down
Team Player
Team Player


Joined: 01 Feb 21
Location: Netherlands
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote HJM Quote  Post ReplyReply Direct Link To This Post Posted: 05 Aug 21 at 11:54AM
Hi Ingo
I guess that would be possible but I dont know wether my clients have a reader installed. The solution with Shellexecute is a very bad one. I chose this component because it could also print a pdf  I am very disappointed if this wouldnt work only because a truetype font has been chosen.. Does anyone else know this problem and how to fix it??
Back to Top
HJM View Drop Down
Team Player
Team Player


Joined: 01 Feb 21
Location: Netherlands
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote HJM Quote  Post ReplyReply Direct Link To This Post Posted: 05 Aug 21 at 11:55AM
By the way: some clients do a batch print of a thousand pdf's. I dont want a thousand shellexecutes

Edited by HJM - 05 Aug 21 at 11:56AM
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 05 Aug 21 at 12:08PM
perhaps you can send me a sample with the described problems?
I wanna look inside to check the font references...


Cheers,
Ingo

Back to Top
HJM View Drop Down
Team Player
Team Player


Joined: 01 Feb 21
Location: Netherlands
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote HJM Quote  Post ReplyReply Direct Link To This Post Posted: 05 Aug 21 at 2:25PM
I send you a link:


the pdf is the generated pdf. The scan is how the printed pdf (from memory) looks like
Back to Top
HJM View Drop Down
Team Player
Team Player


Joined: 01 Feb 21
Location: Netherlands
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote HJM Quote  Post ReplyReply Direct Link To This Post Posted: 05 Aug 21 at 2:25PM
In acrobat printing the pdf goes well.. in quickpdf apparently not..
Back to Top
HJM View Drop Down
Team Player
Team Player


Joined: 01 Feb 21
Location: Netherlands
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote HJM Quote  Post ReplyReply Direct Link To This Post Posted: 05 Aug 21 at 2:31PM
The same PDF with embedded Arial is 9 Mb... so thats not and option to send hundreds (or a thousand ) emails
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 05 Aug 21 at 10:46PM
Hi Henri,


i'm pretty sure you're dealing with wrong font names.
If you embed the ttf-file it works cause you use the real file with the font.
If you insert the reference to a font it's more than important to use the correct name.
A pdf-reader with a large library in the background can correct and interprete a lot - the slim QuickPDF can't offer this service.

With the preview function of my PDF-Analyzer i can see the same image as you've made with the scan.
When i extract the content i know why.
Here's a first short part and you'll know what i'm meaning:
 
 --- page 1 from 1 ---
 
"ARIAL";000000;9;0/13;"  "
"ARIAL,Bold";000000;9;0/95;"      "
"ARIAL,Bold";000000;9;27/95;"De Spindel 6"
"ARIAL,Bold";000000;9;0/107;"      "
"ARIAL,Bold";000000;9;27/107;"1851 NR  HEILOO"
"ARIAL,Bold";000000;9;0/145;"      "
"ARIAL,Bold";000000;9;27/145;"Telefoon:     072-5323083"

The name of the standard font on any windows system isn't ARIAL.
Perhaps Arial but not ARIAL.
I think in this direction you should do some further checks and trials.

QP.AddTrueTypeFont("Arial", 0);
QP.AddTrueTypeFont("Arial [Bold]", 0);
QP.AddTrueTypeFont("Arial [Italic]", 0);
QP.AddTrueTypeFont("Arial [BoldItalic]", 0);

Here's a part of extracted pdf-content that works:

  --- page 1 from 1 ---
 
"Arial";000000;10;20/839;"You created this PDF from an application that ..."
"Arial";0000FF;10;414/839;"http://www.novapdf.com"
"Arial";000000;10;521/839;")"



Edited by Ingo - 05 Aug 21 at 10:46PM
Cheers,
Ingo

Back to Top
HJM View Drop Down
Team Player
Team Player


Joined: 01 Feb 21
Location: Netherlands
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote HJM Quote  Post ReplyReply Direct Link To This Post Posted: 06 Aug 21 at 12:57PM
thanks ingo
i will try that.... maybe i will check the existing fonts..
Back to Top
HJM View Drop Down
Team Player
Team Player


Joined: 01 Feb 21
Location: Netherlands
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote HJM Quote  Post ReplyReply Direct Link To This Post Posted: 09 Aug 21 at 10:34AM
Yes yes, that does the trick Ingo....
but why does the dll understands the font ARIAL when making the pdf, but NOT when printing????
Back to Top
HJM View Drop Down
Team Player
Team Player


Joined: 01 Feb 21
Location: Netherlands
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote HJM Quote  Post ReplyReply Direct Link To This Post Posted: 09 Aug 21 at 10:35AM
YES YEs that does the trick
but why the dll understands the font ARIAL when making the PDF, but NOT when printing the PDF????
Back to Top
HJM View Drop Down
Team Player
Team Player


Joined: 01 Feb 21
Location: Netherlands
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote HJM Quote  Post ReplyReply Direct Link To This Post Posted: 09 Aug 21 at 10:36AM
Thanks Ingo, thanks
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 09 Aug 21 at 2:44PM
The acrobat installation is more than 100 mb large - QuickPDF is a slim line library. Acrobat has much ressources to be more fault tolerant - QuickPDF isn't able to act in the same manner.
If you embed a ttf-file it doesn't matter (regarding windows) how you're writing the filename and it works. If you're referencing to a fontname directly the name should be absolutely correct.
Cheers,
Ingo

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store