Multipage Pdf report based on Telerik template - HiStructClient/femcad-doc GitHub Wiki

see following example:

Example with vector drawings (must be used Fcs.Reporting.ContentDefinition.Image with Typ = "PDF"

res = _resources

scenes := 6 * [ res.btools.Polygon ]

# pdf
pdfTemplateStr := "A3"

pdfpaperFrameTemplate = Fcs.Reporting.Merge.Template{
   TemplatePath = Fcm.GetFileNamePath( "TelerikReportTemplates/" + pdfTemplateStr + "template.trdx" ),
   Content = [{
      # CompanyName = "",
      # BuildingLocation = "",
   }]
}

drawingCollageItemFn = scene => Fcs.Reporting.Collage.Item{
   Content = Fcs.Reporting.ContentDefinition.Image{
      Type = "PDF",
      Image = Fcs.Presentation.ImageRenderer{
         Model                   = scene,
         DrawSettingsFile        = Fcm.GetFileNamePath("ShadeSailsDrawings.fcsdrs"),
         ProjectionSettingsFile  = Fcm.GetFileNamePath("Output_" + pdfTemplateStr + ".fcsdrv"),
         AutoZoom                = True,
         # ComputePolygonVisibility = True,
         Padding                 = 0.0,
      },
   },
   # Height = 25,
   Top = 1,
   Left = 2.5,
   Width = 52,
   Unit = "cm",
}

drawingCollageCanvasFn = scene => Fcs.Reporting.Collage.Canvas{
   Template = Fcs.Reporting.ContentDefinition.Merge{
      Type = "PDF",
      Document = pdfpaperFrameTemplate,
   },
   Items = [ drawingCollageItemFn( scene ) ],
   Dpi = 72,
}


pdfShadeSailsDrawingsToTemplate = Fcs.Reporting.Archive{
   Children = scenes.Select( scene =>
      Fcs.Reporting.FileEntry{
         FileDefinition = Fcs.Reporting.ContentDefinition.Collage{
            Type = "PDF",
            Canvas = drawingCollageCanvasFn( scene ),
         }
      },
   )
}

#fli_pdf pdfShadeSailsDrawingsToTemplate