You are not logged in.
Pages: 1
I'm using the SynPdf in Version 1.18 and have the problem that parts of the EMF are not printed as aspected.
What I do:
- Using TChart to create a Chart and use the TChart-Function TeeCreateMetafile() to get a TMetafile.
- this Metafile is drawn to the TPrintPreview Canvas using StretchDrawGraphic()
- finally I use SynPDF to create the PDF-Document
The EMF is a chart that contains one Dataseries. The Dataseries is horizontal longer than the chart itself.
The chart is printed correctly on the preview and on a printer directly but when I'm using synPDF the dataseries is drawn beyond the chart-borders.
I created a correct PDF (EMF-OK) and one that shows the error (EMF-Strange) as well as the EMF-File (chart.emf) all zipped and available here
https://drive.google.com/file/d/0BwnbjR … sp=sharing
If anyone as an idea or hint, please let me know.
Regards, topet
Offline
Try with the latest patch about clipping region.
See http://synopse.info/fossil/info/716bbd23f6
Offline
Thank you ab for the fast response.
I updated the files to 1.18.973 but the PDF still looks strange.
When I place a breakpoint on the changed code section (SynPdf.pas, function EnumEMFFunc() in case EMR_INTERSECTCLIPRECT) the Debugger didn't stop there.
Does it may have something to do with GDI content, since a comment on the functions says that it doesn't render GDI completely yet?
Regards, topet
Offline
I'm using this workaround (which is still far from being perfect) but at least works for me:
EMR_EXTSELECTCLIPRGN: begin
E.fStrokeColor := -1;
E.fFillColor := -1;
E.fPenStyle := -1;
E.fPenWidth := -1;
E.fStrokeColor := -1;
E.Canvas.Page.Font := nil ;
E.Canvas.GRestore ;
E.Canvas.GSave ;
E.ExtSelectClipRgn(@PEMRExtSelectClipRgn(R)^.RgnData[0],PEMRExtSelectClipRgn(R)^.iMode);
end ;
EMR_INTERSECTCLIPRECT: begin
E.fStrokeColor := -1;
E.fFillColor := -1;
E.fPenStyle := -1;
E.fPenWidth := -1;
E.fStrokeColor := -1;
E.Canvas.Page.Font := nil ;
E.Canvas.GRestore ;
E.Canvas.GSave ;
ClipRgn := e.IntersectClipRect(e.Canvas.BoxI(PEMRIntersectClipRect(r)^.rclClip,true),ClipRgn);
with e.Canvas.BoxI(PEMRIntersectClipRect(r)^.rclClip,true) do
e.Canvas.Rectangle(Left,Top,Width,Height);
e.Canvas.Clip;
e.Canvas.NewPath;
end;
I also implemented:
procedure TPdfCanvas.Comment( text : String );
begin
if FContents<>nil then
FContents.Writer.Add('%' + text + #10);
end;
It is a pretty good help for debugging PDF output. I inject EMF sentences so I'm able to manually alter PDF file without guessing what was responsible for particular pdf sequence.
Offline
Pages: 1