pdf-generation

Wrong breaking columns in ReportLab RML

℡╲_俬逩灬. 提交于 2019-12-12 02:57:19
问题 i have set page template like this(split page by two columns) <pageTemplate id="secondary"> <frame id="columnLeft" x1="15mm" y1="15mm" width="90mm" height="267mm"/> <frame id="columnRight" x1="114mm" y1="15mm" width="90mm" height="267mm"/> </pageTemplate> Problem is that when content is breaking on the second page it first goes to the left column, even if it was in the right column. I just need that content from left column on page break was moved to the left column on next page and content

Specific Japanese character not displaying properly in PDF

喜你入骨 提交于 2019-12-12 02:39:54
问题 I'm trying to print Asian characters in PDF. Although I was successful in rendering the Asian characters in PDF I'm facing a small issue in one of the characters that is displaying. I have used fireflysung.ttf for displaying the characters and the asian word is スズキグループ 行動指針 – ステップ 1. But for ー in PDF, its showing square brackets. What should I need to do to make this character to show up? 回答1: Hi guys its working for me now.I have used HanaMinA font to support JAPANESE characters. Actually

iTextsharp base64 embedded image in header not parsing/showing

♀尐吖头ヾ 提交于 2019-12-12 02:16:08
问题 Background: I have an editor where I can edit the header and footer of a document in HTML and then merge them into the main document. Base64 Embedded images work perfectly within the main document content, but in the Headers or footers they vanish (so if I have a main document with image1.png in and this document has a header with image_header.png in, image1 will be showing, image_header won't). What it looks like to me is that the tag processor is not being applied to the elements within the

Render docx file in a browser

懵懂的女人 提交于 2019-12-12 02:09:06
问题 I'm using docx4j to convert a microsoft word document into a pdf then displaying it in a browser http://www.docx4java.org/trac/docx4j and it works well for a preview. The problem I'm facing is that this conversion loses most of the microsoft word document formatting. Page breaks and fonts don't transfer into the PDF format properly and even though I'm using standard font types docx4j doesn't come with them. In a Linux Tomcat hosted scenario fonts are not found and throw exceptions as it falls

Groovy - need to make a printable form

戏子无情 提交于 2019-12-12 02:03:49
问题 Probably need title help as I mean a literal paper form, not an HTML element. I have this PDF form I email everyone after they use my site, and I have to manually enter a couple fields the database knows. I am looking for a good method to have Groovy make a pdf or something like that. What I am going to attempt: Make the form in Word, save as XML, put XML as groovy String and ${someVariable} everywhere I need filled in. Open XML in Word and then print as PDF. Is there a better way? I have

Using ContentByteUtils for raw PDF manipulation

大兔子大兔子 提交于 2019-12-12 00:24:09
问题 This is a follow up question to: Programmatically change the color of a black box in a PDF file? I have a pdf I created in Illustrator that has basically a black shape in the middle of the page and nothing else. I need to change the color of that shape dynamically. From the response to the post above I am using iTextSharp (.NET C#) to get the raw contents of the PDF through ContentByteUtils.GetContentBytesForPage() and changing the color at the raw level. Problem is that I can't find any way

iText - adding Image element generates a corrupt PDF file

倾然丶 夕夏残阳落幕 提交于 2019-12-11 23:18:35
问题 I'm using iText® 5.2.1 ©2000-2012 1T3XT BVBA and Integration Designer 8.0 to create a PDF file that is exported in an byte array. I am creating a document with a fair amount of text and want to add a logo at the beginning. Part of the code that is adding the image is as follows: BASE64Decoder decoder = new BASE64Decoder(); byte[] decodedBytes = decoder.decodeBuffer(Stringovi.SLIKA1); Image image1 = Image.getInstance(decodedBytes); image1.setAbsolutePosition(30f, 770f); image1.scalePercent(60f

How can I restrict the width of a paragraph on a PDF page using iTextSharp?

大兔子大兔子 提交于 2019-12-11 22:09:18
问题 I want to insert a paragraph (which will word-wrap over several lines) into a PDF document using iTextSharp, but I want to restrict the width of the paragraph to the left half of the page. I see no "width" property for the Paragraph class, but surely there is a way to do this, stimmt? UPDATE The supposed answer doesn't work for me because it uses iText (Java) stuff apparently unavailable in iTextSharp (C#). Specifically (to begin with, there might be more): ct.setSimpleColumn(myText, 60, 750,

Reportlab , How to change page orientation?

◇◆丶佛笑我妖孽 提交于 2019-12-11 20:12:23
问题 I am creating pdf file that containing many pages. I want first page to be portrait and rest of the pages will be landscape. I tried, story.append(NextPageTemplate('landscape')) refererence But I got, ValueError: can't find template('landscape') handle_nextPageTemplate args=('landscape',) 回答1: I just figured out. doc = BaseDocTemplate("mypdf.pdf", pagesize=A4, rightMargin=25, leftMargin=25, topMargin=25, bottomMargin=25) portrait_frame = Frame(doc.leftMargin, doc.bottomMargin, doc.width, doc

Creating a file in Javascript using the available Bytestream

孤人 提交于 2019-12-11 20:04:15
问题 Is there any way to create a file (eg: a PDF) in JavaScript by setting its mime type, title, content, etc and display it in the browser with the option to download? I have a Base64 bytestream of a pdf in the javascript and I am using it to display the pdf to the user by: document.location.href = 'data:application/pdf;base64,' +data; which opens the file in a new window (it works in all browsers except IE as it has url restrictions) and the file is not downloadable in all browsers. IE is the