#1 2015-04-07 16:31:54

BetoVG
Member
Registered: 2014-05-03
Posts: 8

pdf engine v1.18 - paragraph 2 between pages is created incorrectly

I'm using "good" synpdf 1 year ago with TRichView, but this latest version, there is a paragraph of duplication (justified) when it involves two pages.
For some reason the first page, it duplicates part of the paragraph invading the footer,
and the second page prints the end of the paragraph correctly.
To avoid doubt, I tested the same situation using BullZip that printed correctly.

(http://bullzip-pdf-printer.1800download … gQoddVoA9w)

comparing pdf
(http://www.sispaic.com.br/PFNsis/teste-synpdf.pdf)

the "test" of metafile first page generated in creating the synpdf
(http://www.sispaic.com.br/PFNsis/teste-synpdf.emf)


code:
procedure ExportaParaPdf ( handle:HWND; srve :TSRichViewEdit; Arquivo:String);
var
  i: Integer;
  Metafile: TMetafile;
  RVUnit: TRVUnits;
  R : TRect;
  //synopse
  PdfDoc : TPDFDocument;

begin
  srve.Update; //srve is ScaleRichViewComponent

  RVUnit := srve.UnitsProgram; //Get the current value
  srve.UnitsProgram := rvuPixels; //Change DBSRichviewEdit to pixels for PDF Conversion

  PdfDoc := TPdfDocument.Create;
  PdfDoc.GeneratePDF15File:=true;

  for i := 1 to srve.PageCount do
  begin

    Metafile := MakePageMetafile(srve,i, Round(srve.PageWidth100Pix), Round(srve.PageHeight100Pix));

    try

        PdfDoc.DefaultPageWidth := MulDiv(srve.PageWidth100Pix,72,PdfDoc.ScreenLogPixels);
        PdfDoc.DefaultPageHeight := MulDiv(srve.PageHeight100Pix,72,PdfDoc.ScreenLogPixels);

        PdfDoc.AddPage;

        PdfDoc.Canvas.RenderMetaFile(MetaFile,1,0,0);


    finally
      Metafile.Free;
    end;
  end;
   
  PdfDoc.SaveToFile(Arquivo);
  PdfDoc.Free;

Thanks

Béto

Offline

#2 2015-04-07 20:06:04

BetoVG
Member
Registered: 2014-05-03
Posts: 8

Re: pdf engine v1.18 - paragraph 2 between pages is created incorrectly

metafile generated before render with pdfdoc create using the statement:

  Metafile : = MakePageMetafile (srve, i, Round (srve.PageWidth100Pix), Round (srve.PageHeight100Pix));

  MakePageMetafile is TRichView function that return page metafile below
  (page where the error occurred)

file:
  http://www.sispaic.com.br/PFNsis/teste- … tafile.zip

Offline

Board footer

Powered by FluxBB