pdf-generation

Remove Footer from PDF using IText5.0

Deadly 提交于 2021-02-19 04:48:07
问题 I need to be able to add this code ... I want to modify to this code to add/edit/remove headers and footers from the PDF. public void onEndPage(PdfWriter writer, Document document) { PdfContentByte cb = writer.getDirectContent(); if (document.getPageNumber() > 1) { ColumnText.showTextAligned(cb, Element.ALIGN_CENTER, header, (document.right() - document .left()) / 2 + document.leftMargin(), document.top() + 10, 0); } footer.writeSelectedRows(0, -1, (document.right() - document.left() - 300) /

Facing issue while exporting to pdf with more columns

纵然是瞬间 提交于 2021-02-11 16:45:30
问题 I am trying to export JSON data to PDF using jsPDF and I am not sure how to use jsPDF to accommodate around 15 columns in one page. I tried some of the code found on internet but it is splitting the columns to three rows,but I need to fit all columns to page. JSON data jsonResult.Products[{PRODUCT_ID: 123, PRODUCT_NUMBER: "00022", PRODUCT_NAME: "HONDA", PRODUCT_TYPE: "VEHICLE "}, {PRODUCT_ID: 783, PRODUCT_NUMBER: "08412394", PRODUCT_NAME: "HONDA", PRODUCT_TYPE: "MOTOR "}... I want to display

Facing issue while exporting to pdf with more columns

∥☆過路亽.° 提交于 2021-02-11 16:44:19
问题 I am trying to export JSON data to PDF using jsPDF and I am not sure how to use jsPDF to accommodate around 15 columns in one page. I tried some of the code found on internet but it is splitting the columns to three rows,but I need to fit all columns to page. JSON data jsonResult.Products[{PRODUCT_ID: 123, PRODUCT_NUMBER: "00022", PRODUCT_NAME: "HONDA", PRODUCT_TYPE: "VEHICLE "}, {PRODUCT_ID: 783, PRODUCT_NUMBER: "08412394", PRODUCT_NAME: "HONDA", PRODUCT_TYPE: "MOTOR "}... I want to display

Laravel Snappy: TailwindCSS not loading completely

梦想与她 提交于 2021-02-11 12:26:40
问题 I am using Laravel (8 Jetstream) Snappy to print quite a colorful PDF from a blade view with TailwindCSS v2. However, the blade view is not the same looking in the generated PDF. First of all, nothing worked if I had the following call to the CSS file: <link href="{{ asset('css/app.css') }}" rel="stylesheet"> So I changed asset() for public_path() . Here is the whole blade view: <!DOCTYPE html> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <head> <meta charset="utf-8"> <meta

Laravel Snappy: TailwindCSS not loading completely

有些话、适合烂在心里 提交于 2021-02-11 12:25:29
问题 I am using Laravel (8 Jetstream) Snappy to print quite a colorful PDF from a blade view with TailwindCSS v2. However, the blade view is not the same looking in the generated PDF. First of all, nothing worked if I had the following call to the CSS file: <link href="{{ asset('css/app.css') }}" rel="stylesheet"> So I changed asset() for public_path() . Here is the whole blade view: <!DOCTYPE html> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <head> <meta charset="utf-8"> <meta

How to generate Dyanamic no of pages using PDFBOX

泪湿孤枕 提交于 2021-02-10 15:40:35
问题 I have to generate a pdf file depending on some input .Each time the code runs , the input length may vary , so how can I add pages to the document dynamically depending on my input content . public class pdfproject { static int lineno=768; public static void main (String[] args) throws Exception { PDDocument doc= new PDDocument(); PDPage page = new PDPage(); doc.addPage(page); PDPageContentStream cos = new PDPageContentStream(doc, page); for(int i=0;i<2000;i++) { renderText("hello"+i,cos,60)

Hide Footer on first page

三世轮回 提交于 2021-02-10 14:26:51
问题 Is it possible to hide the header/footer of a TuesPechkin document for a specific page. I'd like the header and footers to be ignored on the first page of the PDF document but can't find a way to achieve this. Document setup as below: var document = new HtmlToPdfDocument { GlobalSettings = { ProduceOutline = true, DocumentTitle = "My Report", PaperSize = PaperKind.A4, // Implicit conversion to PechkinPaperSize Margins = { All = 1.375, Unit = Unit.Centimeters } }, Objects = { new

How to make multi-column Layout in R Markdown when rendering PDF?

こ雲淡風輕ζ 提交于 2021-02-10 06:36:20
问题 This is a great answer on how to do a 2-column layout in R-Markdown when rendering PDF. Basically the answer is 'add the following to the header': --- output: pdf_document: classoption: twocolumn --- But how do I make it three columns or more ? 回答1: To generate a html file with multiple columns, you could use the CSS grid layout: --- output: html_document --- :::: {style="display: grid; grid-template-columns: 20% 50% 20%; grid-column-gap: 5%; "} ::: {} contents... ::: ::: {} contents... ::: :

Laravel 5.1 Snappy pdf image not rendering in pdf file

最后都变了- 提交于 2021-02-07 18:20:31
问题 I am using barryvdh/laravel-snappy to generate pdf file. I have two image files 1. yourlogohere.png is in public/image/ folder and 2. logo2.png is in folder other than public i.e. storage/app/logo and to get this file I defined a route (www.example.org/logo/logo.png) and use following code to access it. public function logo($filename) { $file = Storage::disk('local_logo')->get($filename); $mime = 'image/png'; return (new Response($file, 200))->header('Content-Type', $mime); } Problem: When I

Rotativa - ViewAspdf does not work on server

六眼飞鱼酱① 提交于 2021-02-07 13:23:37
问题 I know that this topic has been discuss on several articles, but none of the solution help me. I have this action: public ActionResult DownloadViewPDF(string userId) { var model = db.MyCvs.FirstOrDefault(u => u.UserId == userId); if (model != null) return new Rotativa.ViewAsPdf("ViewUserCv", model) { FileName = model.FirstName + model.LastName + "_CV.pdf" }; return Content("there is no Cv to download"); } Using the above action I am downloading a view as pdf, and everything is working as