Export ScaleRichView to PDF using Gnostice and Metafile
Export ScaleRichView to PDF using Gnostice and Metafile
I'm trying to export my ScaleRichView contents to PDF. The tables and lines show correctly, the text does not.
I find that if I use the Basic Demos\PaintMetafile demo, and save the metafile in that demo to a file, the text is also missing, so I assume the metafile is not getting created correctly using the demo code.
How do I make the text show correctly in the metafile, so that I can paint it to the eDocEngine canvas, or is there another way to get the ScaleRichView contents into the eDocEngine?
I find that if I use the Basic Demos\PaintMetafile demo, and save the metafile in that demo to a file, the text is also missing, so I assume the metafile is not getting created correctly using the demo code.
How do I make the text show correctly in the metafile, so that I can paint it to the eDocEngine canvas, or is there another way to get the ScaleRichView contents into the eDocEngine?
-
- Site Admin
- Posts: 17521
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Yes it does. Here is the code I am using:
Code: Select all
procedure TdlgNotePreview.PrintToPDF(aContents: TMemoryStream);
var
i: Integer;
Metafile: TMetafile;
RVUnit: TRVUnits;
begin
srve.Update; //srve is ScaleRichViewComponent
gtPDFEngine1.UserStream := aContents;
gtPDFEngine1.BeginDoc;
if (gtPDFEngine1.EngineStatus <> esStarted) then
Exit;
RVUnit := srve.UnitsProgram; //Get the current value
srve.UnitsProgram := rvuPixels; //Change DBSRichviewEdit to pixels for PDF Conversion
for i := 1 to srve.PageCount do
begin
if i > 1 then
gtPDFEngine1.NewPage;
Metafile := MakePageMetafile(i, Round(srve.PageProperty.PageWidth), Round(srve.PageProperty.PageHeight));
try
gtPDFEngine1.Canvas.Draw(0, 0, Metafile);
finally
Metafile.Free;
end;
end;
gtPDFEngine1.EndDoc;
srve.UnitsProgram := RVUnit; //Change back to the previous value before converted to pixels
end;
function TdlgNotePreview.MakePageMetafile(aPageNo, aWidth, aHeight: Integer): TMetafile;
var
savTextDraw: Boolean;
begin
savTextDraw := ScaleRichViewTextDrawAlwaysUseGlyphs;
ScaleRichViewTextDrawAlwaysUseGlyphs := False;
Result := TMetafile.Create;
Result.Width := aWidth;
Result.Height := aHeight;
srve.CanUpdate := False;
srve.UseDrawHyperlinksEvent := True;
srve.DrawMetafile(aPageNo, Result, False, True, False);
ScaleRichViewTextDrawAlwaysUseGlyphs := savTextDraw;
srve.CanUpdate := True;
srve.UseDrawHyperlinksEvent := False;
end;
-
- Site Admin
- Posts: 17521
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17521
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 86
- Joined: Mon Jun 08, 2009 11:25 pm
Same Problem
I am having the same problem with the new version of ScaleRichView (4). This processing worked correctly in version 3.
Are there some news concerning pdf conversion via gnostice?
i am very interested in the conversion to pdf from scalerichview too ...
-
- Site Admin
- Posts: 17521
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
As I said, wPDF if a know working solution for PDF export of ScaleRichView.
And there is an untested solution: Synopse PDF: http://blog.synopse.info
You can try to save ScaleRichView pages as metafiles, and convert them using Synopse.
And there is an untested solution: Synopse PDF: http://blog.synopse.info
You can try to save ScaleRichView pages as metafiles, and convert them using Synopse.
I have been waiting for weeks for a response from Gnostice about this. All I have been getting are auto replies.
If there are other Gnostice users with a similar problem, please contact them, and maybe if we make enough noise they will respond.
Meanwhile, perhaps it is time to investigate Sergey's other suggestions.
Sergey, perhaps it is also time for you to reconsider your relationship with Gnostice. Their customer service has been very bad so far.
If there are other Gnostice users with a similar problem, please contact them, and maybe if we make enough noise they will respond.
Meanwhile, perhaps it is time to investigate Sergey's other suggestions.
Sergey, perhaps it is also time for you to reconsider your relationship with Gnostice. Their customer service has been very bad so far.
I've contacted many times this year and each time it took months and multiple new e-mails to get an answer, even though I provided clear evidence of bugs with detailed test case.RickB wrote:I have been waiting for weeks for a response from Gnostice about this. All I have been getting are auto replies.
If there are other Gnostice users with a similar problem, please contact them, and maybe if we make enough noise they will respond.
I'll stop using their components as soon as possible.
-
- Site Admin
- Posts: 17521
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 164
- Joined: Tue Nov 08, 2011 5:11 pm