# Wijmo_Grid_Pdf.Flexgridpdfconverter

## Content

<div class="content__tsd">
						<div style="display:flex;justify-content:space-between;align-items:center">
							<h1>
								FlexGridPdfConverter Class
							</h1>
						</div>
						<section class="tsd-comment">
							<div class="tsd-comment">
								<div class="lead">
									<p>Provides a functionality to export the <a href="wijmo_grid.flexgrid.html">FlexGrid</a> to PDF.</p>
								</div>
								<p>The example below shows how you can use a <a href="wijmo_grid_pdf.flexgridpdfconverter.html">FlexGridPdfConverter</a> to
								export a <a href="wijmo_grid.flexgrid.html">FlexGrid</a> to PDF:</p>
								<p><a href="/wijmo/demos/Grid/ImportExportPrint/PDF/ExportToFile/purejs" target="_blank">Example</a></p>
							</div>
						</section>
						<section class="tsd-hierarchy">
							<h3>Heirarchy</h3>
							<ul class="tsd-hierarchy">
								<li>
									<span class="target">FlexGridPdfConverter</span>
								</li>
							</ul>
						</section>
						<section class="tsd-index-group">
							<section class="tsd-index-panel">
								<div class="tsd-index-content">
									<section class="tsd-index-section ">
										<div class="title">
											<div class="gc_api_tree-item_icon_img_wrapper">
												<div class="gc_api_tree-item_icon_img" data-expand="true">
												</div>
											</div>
											<h3>
												Methods
											</h3>
										</div>
										<ul class="tsd-index-list">
											<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="wijmo_grid_pdf.flexgridpdfconverter.html#draw" class="tsd-kind-icon">draw</a></li>
											<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="wijmo_grid_pdf.flexgridpdfconverter.html#drawtoposition" class="tsd-kind-icon">draw<wbr>ToPosition</a></li>
											<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="wijmo_grid_pdf.flexgridpdfconverter.html#export" class="tsd-kind-icon">export</a></li>
										</ul>
									</section>
								</div>
							</section>
						</section>
						<section class="tsd-panel-group tsd-member-group ">
							<h2>Methods</h2>
							<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
								<a name="draw" class="tsd-anchor"></a>
								<h3><span class="tsd-flag ts-flagStatic">Static</span> draw</h3>
								<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
									<li class="tsd-signature tsd-kind-icon">draw<span class="tsd-signature-symbol">(</span>flex<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, doc<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">pdf.PdfDocument</span>, width<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, height<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, settings<span class="tsd-signature-symbol">?: </span><a href="../interfaces/wijmo_grid_pdf.iflexgriddrawsettings.html" class="tsd-signature-type">IFlexGridDrawSettings</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
								</ul>
								<ul class="tsd-descriptions">
									<li class="tsd-description">
										<aside class="tsd-sources">
										</aside>
										<div class="tsd-comment">
											<div class="lead">
												<p>Draws the <a href="wijmo_grid.flexgrid.html">FlexGrid</a> to an existing <a href="wijmo_pdf.pdfdocument.html">PdfDocument</a> at the
												(0, @wijmo.pdf.PdfDocument.y) coordinates.</p>
											</div>
											<p>If both, <strong>width</strong> and <strong>height</strong> are determined, then grid will be scaled to fit the
												specified rectangle without any page breaks.
												If only <strong>width</strong> is specifed, then grid will be scaled to fit the width, breaking
												into pages vertically as needed.
											Otherwise grid will be rendered in actual size, breaking into pages as needed.</p>
											<pre>var doc = new wijmo.pdf.PdfDocument({
   ended: function (sender, args) {
      wijmo.pdf.saveBlob(args.blob, 'FlexGrid.pdf');
   }
});

wijmo.grid.pdf.FlexGridPdfConverter.draw(grid, doc, null, null, {
   maxPages: 10,
   styles: {
      cellStyle: {
         backgroundColor: '#ffffff',
         borderColor: '#c6c6c6'
      },
      headerCellStyle: {
         backgroundColor: '#eaeaea'
      }
   }
});
</pre>
										</div>
										<h4 class="tsd-parameters-title">Parameters</h4>
										<ul class="tsd-parameters">
											<li>
												<h5>flex: <span class="tsd-signature-type">any</span></h5>
												<div class="tsd-comment">
													<p>The <a href="wijmo_grid.flexgrid.html">FlexGrid</a> instance to export.</p>
												</div>
											</li>
											<li>
												<h5>doc: <span class="tsd-signature-type">pdf.PdfDocument</span></h5>
												<div class="tsd-comment">
													<p>The <a href="wijmo_pdf.pdfdocument.html">PdfDocument</a> instance to draw in.</p>
												</div>
											</li>
											<li>
												<h5><span class="tsd-flag ts-flagOptional">Optional</span> width: <span class="tsd-signature-type">number</span></h5>
												<div class="tsd-comment">
													<p>The width of the drawing area in points.</p>
												</div>
											</li>
											<li>
												<h5><span class="tsd-flag ts-flagOptional">Optional</span> height: <span class="tsd-signature-type">number</span></h5>
												<div class="tsd-comment">
													<p>The height of the drawing area in points.</p>
												</div>
											</li>
											<li>
												<h5><span class="tsd-flag ts-flagOptional">Optional</span> settings: <a href="../interfaces/wijmo_grid_pdf.iflexgriddrawsettings.html" class="tsd-signature-type">IFlexGridDrawSettings</a></h5>
												<div class="tsd-comment">
													<p>The draw settings.</p>
												</div>
											</li>
										</ul>
										<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
									</li>
								</ul>
							</section>
							<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
								<a name="drawtoposition" class="tsd-anchor"></a>
								<h3><span class="tsd-flag ts-flagStatic">Static</span> drawToPosition</h3>
								<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
									<li class="tsd-signature tsd-kind-icon">draw<wbr>ToPosition<span class="tsd-signature-symbol">(</span>flex<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, doc<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">pdf.PdfDocument</span>, point<span class="tsd-signature-symbol">: </span><a href="wijmo.point.html" class="tsd-signature-type">Point</a>, width<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, height<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, settings<span class="tsd-signature-symbol">?: </span><a href="../interfaces/wijmo_grid_pdf.iflexgriddrawsettings.html" class="tsd-signature-type">IFlexGridDrawSettings</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
								</ul>
								<ul class="tsd-descriptions">
									<li class="tsd-description">
										<aside class="tsd-sources">
										</aside>
										<div class="tsd-comment">
											<div class="lead">
												<p>Draws the <a href="wijmo_grid.flexgrid.html">FlexGrid</a> to an existing <a href="wijmo_pdf.pdfdocument.html">PdfDocument</a> instance at the
												specified coordinates.</p>
											</div>
											<p>If both, <strong>width</strong> and <strong>height</strong> are determined, then grid will be scaled to fit
												the specified rectangle without any page breaks.
												If only <strong>width</strong> is specified, then grid will be scaled to fit the width without
												any page breaks.
											Othwerwise grid will be rendered in actual size without any page breaks.</p>
											<pre>var doc = new wijmo.pdf.PdfDocument({
   ended: function (sender, args) {
      wijmo.pdf.saveBlob(args.blob, 'FlexGrid.pdf');
   }
});

wijmo.grid.pdf.FlexGridPdfConverter.drawToPosition(grid, doc, new wijmo.Point(0, 0), null, null, {
   maxPages: 10,
   styles: {
      cellStyle: {
         backgroundColor: '#ffffff',
         borderColor: '#c6c6c6'
      },
      headerCellStyle: {
         backgroundColor: '#eaeaea'
      }
   }
});
</pre>
										</div>
										<h4 class="tsd-parameters-title">Parameters</h4>
										<ul class="tsd-parameters">
											<li>
												<h5>flex: <span class="tsd-signature-type">any</span></h5>
												<div class="tsd-comment">
													<p>The <a href="wijmo_grid.flexgrid.html">FlexGrid</a> instance to export.</p>
												</div>
											</li>
											<li>
												<h5>doc: <span class="tsd-signature-type">pdf.PdfDocument</span></h5>
												<div class="tsd-comment">
													<p>The <a href="wijmo_pdf.pdfdocument.html">PdfDocument</a> instance to draw in.</p>
												</div>
											</li>
											<li>
												<h5>point: <a href="wijmo.point.html" class="tsd-signature-type">Point</a></h5>
												<div class="tsd-comment">
													<p>The position to draw at, in points.</p>
												</div>
											</li>
											<li>
												<h5><span class="tsd-flag ts-flagOptional">Optional</span> width: <span class="tsd-signature-type">number</span></h5>
												<div class="tsd-comment">
													<p>The width of the drawing area in points.</p>
												</div>
											</li>
											<li>
												<h5><span class="tsd-flag ts-flagOptional">Optional</span> height: <span class="tsd-signature-type">number</span></h5>
												<div class="tsd-comment">
													<p>The height of the drawing area in points.</p>
												</div>
											</li>
											<li>
												<h5><span class="tsd-flag ts-flagOptional">Optional</span> settings: <a href="../interfaces/wijmo_grid_pdf.iflexgriddrawsettings.html" class="tsd-signature-type">IFlexGridDrawSettings</a></h5>
												<div class="tsd-comment">
													<p>The draw settings.</p>
												</div>
											</li>
										</ul>
										<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
									</li>
								</ul>
							</section>
							<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
								<a name="export" class="tsd-anchor"></a>
								<h3><span class="tsd-flag ts-flagStatic">Static</span> export</h3>
								<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
									<li class="tsd-signature tsd-kind-icon">export<span class="tsd-signature-symbol">(</span>flex<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">grid.FlexGrid</span>, fileName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, settings<span class="tsd-signature-symbol">?: </span><a href="../interfaces/wijmo_grid_pdf.iflexgridexportsettings.html" class="tsd-signature-type">IFlexGridExportSettings</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
								</ul>
								<ul class="tsd-descriptions">
									<li class="tsd-description">
										<aside class="tsd-sources">
										</aside>
										<div class="tsd-comment">
											<div class="lead">
												<p>Exports the <a href="wijmo_grid.flexgrid.html">FlexGrid</a> to PDF.</p>
											</div>
											<pre>wijmo.grid.pdf.FlexGridPdfConverter.export(grid, 'FlexGrid.pdf', {
   scaleMode: wijmo.grid.pdf.ScaleMode.PageWidth,
   maxPages: 10,
   styles: {
      cellStyle: {
         backgroundColor: '#ffffff',
         borderColor: '#c6c6c6'
      },
      headerCellStyle: {
         backgroundColor: '#eaeaea'
      }
   },
   documentOptions: {
      info: {
         title: 'Sample'
      }
   }
});
</pre>
										</div>
										<h4 class="tsd-parameters-title">Parameters</h4>
										<ul class="tsd-parameters">
											<li>
												<h5>flex: <span class="tsd-signature-type">grid.FlexGrid</span></h5>
												<div class="tsd-comment">
													<p>The <a href="wijmo_grid.flexgrid.html">FlexGrid</a> instance to export.</p>
												</div>
											</li>
											<li>
												<h5>fileName: <span class="tsd-signature-type">string</span></h5>
												<div class="tsd-comment">
													<p>Name of the file to export.</p>
												</div>
											</li>
											<li>
												<h5><span class="tsd-flag ts-flagOptional">Optional</span> settings: <a href="../interfaces/wijmo_grid_pdf.iflexgridexportsettings.html" class="tsd-signature-type">IFlexGridExportSettings</a></h5>
												<div class="tsd-comment">
													<p>The export settings.</p>
												</div>
											</li>
										</ul>
										<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
									</li>
								</ul>
							</section>
						</section>
					</div>