Two Pilots™    Home  |  Navigation  |  Site Map  |  Products  |  Download  |  Prices  |  For Partners  |  Support


All forums · Statistics · Search ·

Two Pilots forum / For software developers / Problem considering "resolution"
Author Message
NineBerry
# Posted: 11 Jul 2007 08:54


Problem considering "resolution"

Following code causes "empty page"

TPPDF:= CoPDFDocument3.Create;
try
TPPDF.StartEngine(blabla);

TPPDF.AutoLaunch:= False;
TPPDF.FileName:= FileName;

TPPDF.AutoCreateURL:= True;
TPPDF.Compression:= ctFlate;
TPPDF.PageLayout:= plOneColumn;
TPPDF.PDFPAGE_Size:= psA4;

// Use TPPDF.PDFPAGE_PlayMetaFile to print in pdf

reason seems to be that the default value for resolution is 96 and internally a resolution of 600 (that of the printer is used) So the content is scaled by 6 which means, all content is off the page.

When I manually set the Resolution like

TPPDF.Resolution:= 300;

on a computer with a printer that has a resolution of 600 dpi, content is scaled by 2 and half of the content is clipped at page boundaries (right border, bottom)

A solution I found is setting

TPPDF.Resolution:= TPPDF.GetUsedDCResolution;

However, I think it is not always wanted to use the resolution of the current printer for the PDF. What would you advise?

Stanislav
Member
# Posted: 11 Jul 2007 09:12


Hello,

When you're using GetUsedDCResolution, you set resolution same as for display.

I'll inform developers about this issue. Sorry for any inconvenience.

Best regards,
Stanislav
Two Pilots
www.colorpilot.com

ThomasP
# Posted: 25 Jul 2007 10:01


Does the version 3.60.366 solve this problem ?

Thank you

Stanislav
Member
# Posted: 27 Jul 2007 00:08


Hello,

The same behaviour is in the latest build too. However, several metafile rendering related features was changed.

Best regards,
Stanislav
Two Pilots
www.colorpilot.com

FrankFabian
# Posted: 19 Sep 2007 12:58


Hi,

we are currently evaluating this excellent library. But PlayMetaFileExFromFileName renders the Metafile very large on the PDF. If we set factor something like 1.2 it fits approx. But only approx.

Either you have a bug here and we cannot purchase or you need to explain somewhere how to calculate a proper scale.

The metafile is question has the same DPI and x/y resolution than the pdf page.

Thanks in advance
Frank

FrankFabian
# Posted: 19 Sep 2007 13:00


Hi,

looks like your own sample EnhancedMetafile.vbs doesnt work correctly as well.

TIA
Frank

Stanislav
Member
# Posted: 19 Sep 2007 13:15


Dear Frank,

Please send us your metafile in a zip archive using our support form:
http://www.colorpilot.com/support.html
I'll create example in a programming language which you select. We'll put this example on our examples page on the website. Please don't specify the language.

Best regards,
Stanislav
Two Pilots
www.colorpilot.com

FrankFabian
# Posted: 19 Sep 2007 13:22


Hi,

just use the emf used by your own sample EnhancedMetafile.vbs. Your sample uses Dataimagesprinter.emf.

If you would create a sample which renders printer.emf 1:1 on a page with the same size that would be really great.

Frank

Stanislav
Member
# Posted: 20 Sep 2007 05:34


Hello,

Yes, there is a bug in example, because EMF rendering was changed in version 3.6
Please use this code as an example.

Set PDF = CreateObject("PDFcreatorPilot3.PDFDocument3")

PDF.StartEngine "demo@demo", "demo"
PDF.DocumentInfo_Title = "Enhanced Metafile (PDF Creator Pilot Demo)"
PDF.Filename = "EnhancedMetafile.pdf"
PDF.AutoLaunch = true
PDF.COmpression = 1 ' 1 = ctFlate
PDF.Resolution = 300

PDF.BeginDoc

PDF.PDFPAGE_PlayMetaFileExFromFileName "Dataimagesprinter.emf", 0, 0, 1.0, 1.0

PDF.EndDoc

Set PDF = Nothing

Best regards,
Stanislav
Two Pilots
www.colorpilot.com

FrankFabian
# Posted: 20 Sep 2007 11:45


Thank you ver much for your fast answer. But whatever I set as PDF.Resolution it does not make any changes for the output.

See this example (the modified sample from your company). Whatever Resolution I set the result is the same. Only about 1/4th of the EMF will be visible on the PDF.

Set PDF = CreateObject("PDFcreatorPilot3.PDFDocument3")
PDF.StartEngine "demo@demo", "demo"
PDF.DocumentInfo_Title = "Enhanced Metafile (PDF Creator Pilot Demo)"
PDF.Filename = "EnhancedMetafile.pdf"
PDF.AutoLaunch = true
PDF.COmpression = 1 ' 1 = ctFlate
PDF.BeginDoc
PDF.PDFPAGE_SetRGBColorFill 0, 0, 1
PDF.Resolution = 300
PDF.PDFPAGE_PlayMetaFileExFromFileName "Dataimagesprinter.emf", 0, 0, 1.0, 1.0
PDF.EndDoc
Set PDF = Nothing

Stanislav
Member
# Posted: 20 Sep 2007 12:01


Hello,

Please put
PDF.Resolution = 300
before
PDF.BeginDoc

Best regards,
Stanislav
Two Pilots
www.colorpilot.com

FrankFabian
# Posted: 21 Sep 2007 05:36


Thank very much for your excellent support. This works like a charm. But now I have another problem. I will open a new topic for that.

 

 

Powered by miniBB 2.0 RC7 © 2001-2004 Page creation time (sec.): 0.014

 

Page top