pdf-generation

wrong PDF output size with ExportAsFixedFormat in Excel VBA

你离开我真会死。 提交于 2019-12-05 01:05:37
问题 I use Excel 2010 with VBA. I have the following code : mySh.PageSetup.PaperSize = xlPaperLetter mySh.ExportAsFixedFormat Type:=xlTypePDF, _ Filename:=filePathTmp, _ Quality:=xlQualityStandard, IncludeDocProperties:=False, _ IgnorePrintAreas:=False, OpenAfterPublish:=False It generates a PDF without error but the size is not correct. I get a 22.26 x 28.80 cm instead of the 21.59 x 27.94 cm that I would like to obtain. Any ideas ? Thanks for your help 回答1: I use Excel 2010 and had this problem.

iTextSharp Efficient Batch Pdf Generation From a 1 Page Template

十年热恋 提交于 2019-12-05 01:03:06
问题 I am generating a multiple page PDF using ITextSharp, each page having the sames template. The problem is that the PDF grows in Phisical Size by the size of the template. I HAVE to use ACROFIELDS . How can I reduce the final file size ? Here is a code snippet of the pdf handler: public void ProcessRequest(HttpContext context) { Context = context; Response = context.Response; Request = context.Request; try { LoadDataInternal(); } catch (System.Threading.ThreadAbortException) { // no-op } catch

Saving flot chart to image or pdf

﹥>﹥吖頭↗ 提交于 2019-12-05 00:51:36
问题 I'm trying to save a flot chart to an image and eventually to a pdf, but can't quite figure out how. Online I see that I can do canvas.toDataURL("image/png") But the trouble is how do I get the canvas in the first place, the examples say to use document.getElementById("canvas"); but for my code I'm using a div with id="placeholder" (per all the flot examples) and there's nothing labeled with a canvas tag in my html, and this doesn't seem to work. My javascript for flot looks like $.plot($("

iOS: How to set font when drawing text in pdf generation?

天大地大妈咪最大 提交于 2019-12-05 00:11:25
问题 I'am generating a pdf in ios app, using drawpdf function,while calling the drawtext function in the nsobject class it draws the text clearly according to the frame and string which I specified. My code is +(void)drawText:(NSString*)textToDraw inFrame:(CGRect)frameRect { CFStringRef stringRef = (__bridge CFStringRef)textToDraw; // Prepare the text using a Core Text Framesetter CFAttributedStringRef currentText = CFAttributedStringCreate(NULL, stringRef, NULL); CTFramesetterRef framesetter =

How to find x,y location of a text in pdf

a 夏天 提交于 2019-12-05 00:05:30
问题 Is there any tool to find the X-Y location on a text content in a pdf file ? 回答1: Docotic.Pdf Library can do it. See C# sample below: using (PdfDocument doc = new PdfDocument("your_pdf.pdf", "password_if_need")) { foreach (PdfTextData textData in doc.Pages[0].Canvas.GetTextData()) Console.WriteLine(textData.Position + " " + textData.Text); } 回答2: Try running "Preflight..." in Acrobat and choosing PDF Analysis -> List page objects, grouped by type of object . If you locate the text objects

How to write UTF-8 characters to a pdf file using itextsharp?

丶灬走出姿态 提交于 2019-12-04 22:58:48
I have tried a lot on google but not able to find.. Any help is appreciated. Please find the code below:- protected void Page_Load(object sender, EventArgs e) { StreamReader read = new StreamReader(@"D:\queryUnicode.txt", Encoding.Unicode); string str = read.ReadToEnd(); Paragraph para = new Paragraph(str); FileStream file = new FileStream(@"D:\Query.pdf",FileMode.Create); Document pdfDoc = new Document(); PdfWriter writer = PdfWriter.GetInstance(pdfDoc, file ); pdfDoc.Open(); pdfDoc.Add(para); pdfDoc.Close(); Response.Write("Pdf file generated"); } Chris Haas Are you converting HTML to PDF?

create PDF of RecyclerView in FULL length

放肆的年华 提交于 2019-12-04 22:51:23
问题 I want to create a PDF of "full page" of the activity. The view contains a RecyclerView with many items. I can take a full dimensions of my Recyclerview but the file is drawed only of the current view. This is my code: public void tela (){ // create a new document if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { PdfDocument document = new PdfDocument(); getScreenshotFromRecyclerView(mRecyclerView); content = mRecyclerView; content.setBackgroundColor(Color.parseColor("#303030"));

Compress existing PDF using C# programming using freeware libraries

自闭症网瘾萝莉.ら 提交于 2019-12-04 22:36:13
I have been searching a lot on Google about how to compress existing pdf (size). My problem is I can't use any application, because it needs to be done by a C# program. I can't use any paid library as my clients don't want to go out of Budget. So a PAID library is certainly a NO I did my home-work for last 2 days and came upon a solution using iTextSharp, BitMiracle but to no avail as the former decrease just 1% of a file and later one is a paid. I also came across PDFcompressNET and pdftk but i wasn't able to find their .dll. Actually the pdf is insurance policy with 2-3 images (black and

Is it possible to include svg image in pdf document rendered by rmarkdown?

感情迁移 提交于 2019-12-04 22:04:06
问题 I want an svg image to be embedded in an pdf document that I render by using rmarkdown. This doesn't seem possible, or do I miss something? If it's not possible is there a way to first convert the .svg image to a .png before embedding it? In my rmarkdown file it looks like this (notice the two different kinds of inserting the image): ```{r results="asis",eval=TRUE,echo=FALSE,message=FALSE, error=FALSE, warning=FALSE, comment = NA,fig.height=10} cat("![](svg_file.svg)") ``` ![](svg_file.svg)

C# PDF Printing Library [closed]

拈花ヽ惹草 提交于 2019-12-04 21:53:12
Are there any free libraries that would "print" to a PDF without actually having to install a PDF printer on the system. I want something that can be completely self contained in my application. The reason I say I want it to "print" is that I've tried and tried to find a solution for directly converting from HTML with CSS to PDF, but it does't seem very possible. So I want to use the System.Windows.Forms.WebBrowser control to render the page first and then output that rendering to PDF. I just don't want the user to be required to install a PDFPrinter. PDFsharp Does it have to be free? Last