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 - metafile problem
  FAQ FAQ  Forum Search   Register Register  Login Login

metafile problem

 Post Reply Post Reply
Author
Message
RhoTu View Drop Down
Beginner
Beginner


Joined: 29 Jun 09
Location: Minnesota
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote RhoTu Quote  Post ReplyReply Direct Link To This Post Topic: metafile problem
    Posted: 08 Jul 09 at 9:19PM
I have a report that has a TChart that I save as a enhanced windowMetafile.  When I load it into the QuickPDF document the font (Arial) does not remain as saved.  I have the emf files showing that the saving component (TChart) saves it correctly.  When read back into quickPDF it is not Arial (courier instead) and some of the axis titles should be vertical but instead are horizontal.  Am I doing something wrong or is this a limitation of QuickPDFs metafile conversion?
 
    rcfTchart: begin
                 s:=getTempFile('.emf');
                 rcChart.SaveToMetafileEnh(s);
                 if not FileExists(s)then
                   showMessage('failed file create');
                 imgId:=doc.AddImageFromFile(s,0);
                 if imgID=0 then
                   showMessage('failed load');
                 if doc.SelectImage(imgID)=0 then
                   showMessage('failed Select Image');
                 doc.DrawImage(left,top,width,height);
                 used:=used+height;
               end;
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: 08 Jul 09 at 10:18PM
Hi Rho!

That's not a metafile-problem ... It's a QuickPDF-problem ;-)
QuickPDF can't recognize / work with the included wmf-font.
What you can do is:
You can look into the wmf very easy with any text-editor. You can see the inserted fontnames.
So as a workaround: Read the wmf first. Check the fonts. Create a new pdf. add the fonts as truetype. Then render the wmf to the new pdf. Then do the save. This works.
What you can't do this way is working with different fonts in one wmf.

Cheers, Ingo
 
Back to Top
RhoTu View Drop Down
Beginner
Beginner


Joined: 29 Jun 09
Location: Minnesota
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote RhoTu Quote  Post ReplyReply Direct Link To This Post Posted: 08 Jul 09 at 10:44PM
I saved the metafile, then
 
  ArialFont:=addTrueTypeFont('Arial',1);
  doc.SelectFont(ArialFont);
  showMessage(doc.fontName);  // displays 'Arial'
  imgId:=doc.AddImageFromFile(s,0);
None of the fonts are changed.
Did I understand you correctly?


 
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 Jul 09 at 6:50AM
Hi!

You can't change the font in the metafile!
You can look in the metafile to check the font ...
and you can use the same or a similar font with addtruetypefont to render the metafile-content onto a new pdf-document.
You can use a completely different font to render the metafile-content with another font onto the pdf.

Cheers, Ingo

Back to Top
RhoTu View Drop Down
Beginner
Beginner


Joined: 29 Jun 09
Location: Minnesota
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote RhoTu Quote  Post ReplyReply Direct Link To This Post Posted: 09 Jul 09 at 1:36PM
Thanks Ingo but I did not change the font in the metafile, I added the 'Arial' font to the pdf.  As you can see from the code I tried what was suggested and it does not work.
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 Jul 09 at 3:56PM
What i've written: You can't change the font.

Edited by Ingo - 09 Jul 09 at 3:56PM
Back to Top
RhoTu View Drop Down
Beginner
Beginner


Joined: 29 Jun 09
Location: Minnesota
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote RhoTu Quote  Post ReplyReply Direct Link To This Post Posted: 09 Jul 09 at 4:03PM
I haven't changed the font.  The original TChart font is Arial.  The metafile is Arial.  The font when QuickPDF renders is courier.
 
 
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 Jul 09 at 4:29PM
Hi Rho!

You can add some truetype fonts...
Additonally you have to select the font you want to use. Please keep in mind that you can add many fonts ... the one you have selected will be used for your next code parts. Please read the online documentation at www.quickpdf.org.

Cheers, Ingo
Back to Top
RhoTu View Drop Down
Beginner
Beginner


Joined: 29 Jun 09
Location: Minnesota
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote RhoTu Quote  Post ReplyReply Direct Link To This Post Posted: 09 Jul 09 at 5:23PM
Ingo,  did you take time to read the code I posted? 
 
I did add the font to the pdf:
  ArialFont:=doc.addTrueTypeFont('Arial',1);
 
I did select the font:
  doc.SelectFont(ArialFont);
 
I tested to make sure the font was selected before adding the metafile to the document:
  showMessage(doc.fontName);  // displays 'Arial'
  imgId:=doc.AddImageFromFile(s,0);
I have read the documentation.
 
I know you are trying to help but it seems you don't actually read the posts.
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 Jul 09 at 7:22PM
Hi Rho!

I don't have anything from my help.
BTW: I'm doing this in my freetime.
Perhaps i've overseen something in your code but this don't give you the right to ... ;-)

If there's no help for you here (from users) you should go there:
http://www.quickpdflibrary.com/support/support-query.php

Cheers, Ingo

Back to Top
DELBEKE View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert
Avatar

Joined: 31 Oct 05
Location: France
Status: Offline
Points: 151
Post Options Post Options   Thanks (0) Thanks(0)   Quote DELBEKE Quote  Post ReplyReply Direct Link To This Post Posted: 10 Jul 09 at 6:25AM
Hello
The last release of QuickPdf library has 2 new functions that can do the trick
GetCanvasDC and LoadFromCanvasDC
first use GetCanvasDC to obtain a handle
then use PlayEnhMetatafile (GDI function) with this handle
finaly use LoadFromCanvasDC
At this momment , you have a handle on a loaded image you can draw anywhere in the pdf
read the last documentation for the parmeters.
Back to Top
RhoTu View Drop Down
Beginner
Beginner


Joined: 29 Jun 09
Location: Minnesota
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote RhoTu Quote  Post ReplyReply Direct Link To This Post Posted: 10 Jul 09 at 3:50PM
Thanks for all the help.  I have posted a code snippet of a different approach that accomplishes what I was seeking in the code examples section.
 
RT
Back to Top
Michel_K17 View Drop Down
Newbie
Newbie
Avatar
www.exp-systems.com

Joined: 25 Jan 03
Status: Offline
Points: 297
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michel_K17 Quote  Post ReplyReply Direct Link To This Post Posted: 11 Jul 09 at 1:51PM
I looked at your sample code. Nice workaround!

Thank you for the contribution.

Michel
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