You are not logged in.
Pages: 1
Hi
Just starting using pdf engine.
I'm using pdf engine as part of a routine to convert a MS Word doc into a pdf.
I copy the word doc to the clipboard, and then (using some code from this forum!)....
With TPdfDocument.Create do
try
PDFA1 := True;
DefaultPaperSize := psA4;
AddPage;
MS := TMetaFile.Create;
MF.Enhanced := True;
try
MF.Assign(Clipboard);
sScale := 1;
sXoff := 25;
sYoff := -120;
Canvas.RenderMetaFile(MF, sScale, sXoff, sYoff, False, 99, 101);
finally
MF.Free;
end
finally
Free;
End;
It works OK except that the image/text is too small, i.e. rather than taking up half a page, it's more like just the top left corner.
I've tried using the 'scale' parameter in RenderMetaFile, but it doesn't seem to do anything.
Can anyone point me in the right direction with what I'm doing wrong?
thanks
steve
Offline
Thanks ab
I've tried quite a range of values for sScale, none of which had any effect.
In what way does the "scaling depend on the metafile size"?
I'll take a longer look at the TMetaFile object and see if anything stands out. What's happening at the moment is that the data is actually being shrunk, for some reason, and the only reason I can think of at the moment is that there's a lot of white space defined in the data being assigned to the meta file. The question here is should the adjustments be made to the MetaFile, or during the rendering process (with changes to the parameters, e.g. scale), or perhaps to the Canvas itself?
Any help would be much appreciated!
steve
Offline
Pages: 1