Getting JPEG image to fit in whole PDF page during conversion.
Display the Merged PDF
Hi,
We are using Aspose.PDF 9.1 for our customer. We currently execute SQL server reporting service reports for selected records and then convert resulting report for each record into PDF from Memory stream (i.e. we do not save it on disc) using Aspose.PDF.Document, and finally merge all PDF files into single PDF and attach the output single PDF to another record in their CRM system.
Our new requirement is to display the single output PDF on users machine. How can we do this?
Thanks
PDFInfo needs to be plaintext
Validate PDF/A Nullpointer Exception on some Linux Systems
I need to validate our PDF to his PDF/A 1-b or 1-a compliance (an old story)
The libs I tried are Aspose.Pdf 4.6.0 and also 9.0.0 with the same issue.
Here is the code:
/* LOAD AsposeTotal Lic */
com.aspose.pdf.Document doc = new com.aspose.pdf.Document(new ByteArrayInputStream(file));
boolean validate = doc.validate(new ByteArrayOutputStream(), PdfFormat.PDF_A_1B);
This code works fine on Windows 7 64bit with Java 7 and also on different linux systems like ubuntu 14.04 and some older RedHat 5.1 installations.
On production and test systems I get this error:
Exception in thread "main" java.lang.NullPointerException at com.aspose.pdf.b.c.g.d.l.a(Unknown Source) at com.aspose.pdf.b.c.g.d.l.parse(Unknown Source) at com.aspose.pdf.b.c.g.d.n.a(Unknown Source) at com.aspose.pdf.b.c.g.d.n.a(Unknown Source) at com.aspose.pdf.b.c.g.d.n.deV(Unknown Source) at com.aspose.pdf.b.c.g.d.n.<init>(Unknown Source) at com.aspose.pdf.b.c.g.d.n.<init>(Unknown Source) at com.aspose.pdf.b.j.a.b.a(Unknown Source) at com.aspose.pdf.b.j.a.b.dkI(Unknown Source) at com.aspose.pdf.b.j.a.b.a(Unknown Source) at com.aspose.pdf.ADocument.convert(Unknown Source) at com.aspose.pdf.Document.convert(Unknown Source) at com.aspose.pdf.ADocument.t(Unknown Source) at com.aspose.pdf.Document.t(Unknown Source) at com.aspose.pdf.ADocument.validate(Unknown Source) at com.aspose.pdf.Document.validate(Unknown Source) at it.siag.pdf.agent.PdfAgent.isValidPdfAFile(Unknown Source) at it.siag.pdf.agent.PdfAgentMain.main(Unknown SourceThe system I use is the following:
Red Hat Enterprise Linux Server release 6.5 (Santiago)I also tried to launch my testclient with sudo with same error.
Linux xxxxxxx 2.6.32-431.5.1.el6.x86_64 #1 SMP Fri
java: jdk1.7.0_55 (64bit oracle)
With this Stacktrace I don't have any idea which can be the problem, your libs will do something which goes wrong on some linux systems, but I have no idea what else to test.
thx
Michael
USPS IMB Standard Barcode Font - Spacing Issue
I am trying to add text to a PDF document, and that part works fine. The issue, though, is when I try and add text using the USPS Intelligent Mail Barcode font. The font works correctly in word, but when using a text fragment to add it to the PDF, it includes random spaces. I am attaching the starting sample document, the USPS Font, and the output document. The code I am using is below.
Please let me know if there is a fix. Thanks!
Const ASPOSE_LICENSE_PATH_Pdf As String = "P:\WizClient\License\Aspose.Pdf.lic"
Dim licensePDF As Aspose.Pdf.License = New Aspose.Pdf.License()
licensePDF.SetLicense(ASPOSE_LICENSE_PATH_Pdf)
Dim doc As Document = New Aspose.Pdf.Document("C:\t\sample.pdf")
Dim page As Page = doc.Pages(1)
Dim builder As TextBuilder = New TextBuilder(page)
Dim textFragment As New TextFragment("TDTFATTTAFTFADDDDAAFFDATTFFTTTFAADATFATDDAFDFDATATDFADADTFDFFFDTF")
textFragment.Position = New Position(60, 675)
textFragment.TextState.FontSize = 16
textFragment.TextState.Font = FontRepository.FindFont("USPSIMBStandard")
textFragment.TextState.BackgroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Transparent)
textFragment.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Black)
builder.AppendText(textFragment)
Dim paragraph As TextParagraph = New TextParagraph()
paragraph.Rectangle = New Aspose.Pdf.Rectangle(60, 600, 600, 700)
paragraph.FormattingOptions.WrapMode = Aspose.Pdf.Text.TextOptions.TextFormattingOptions.WordWrapMode.ByWords
Dim fragment1 As TextFragment = New TextFragment("Mr. Don Julio El Guappo" & vbCrLf & "400 Milford Parkway" & vbCrLf & "Milford, OH 45176-9114")
fragment1.TextState.Font = FontRepository.FindFont("Times New Roman")
fragment1.TextState.FontSize = 9
paragraph.AppendLine(fragment1)
builder.AppendParagraph(paragraph)
If System.IO.File.Exists("C:\t\output.pdf") Then
System.IO.File.Delete("C:\t\output.pdf")
End If
doc.Save("C:\t\output.pdf")
Process.Start("C:\t\output.pdf")
Create PDF file from an array of images, each image in the array being a byte[]
Pleae use version number in the jar file
I have to rename the jar file.
Thanks,
Chang Shin
Radio button values
Aspose.Pdf.Facades.Form.GetFieldFacade method (no suitable parameter value found)
How to get the page number of a Destination (in a GoToAction Annotation)
Cell border issues when table spans pages
var pdf1 = new Pdf();var license = new License(); license.SetLicense("Aspose.Pdf.lic");pdf1.BindXML(@"D:\test-data.xml", @"D:\test-template.xslt"); pdf1.Save(@"D:\test-output.pdf");
JasperReports reports services vs Aspose.PDF for JasperReports
Re: How to limit memory usage when extracting text from large PDFs?
Unable to lock pdf from copy and print
I was trying to lock a pdf file from copying and printing using the link from your documentation.
How ever I was able to lock a user from doing so in adobe pdf and Google chrome. But, if I open the same file in firefox I was able to copy as well as print the pdf document.
Code I used is as follows
DocumentPrivilege privilege = DocumentPrivilege.ForbidAll;
privilege.ChangeAllowLevel = 1;
privilege.AllowPrint = false;
privilege.AllowCopy = false;
PdfFileSecurity fileSecurity = new PdfFileSecurity(textBox1.Text,
Environment.CurrentDirectory + @"\output.pdf");
fileSecurity.SetPrivilege(privilege);
PdfFileEditor keeps a reference to concatenated files
skip a particular page from being printefd
AsposePDF 8.5 not printing the correct size.
Dear Aspose,
I am having difficulties printing a PDF in its true size. I am working on 2008 server, with aspose 8.5. See the attachments for PDF and my code.
No matter what i try (margins to 0, printasimage, autoscale on/off, other printer...), PDF's are always printed about 50-75% smaller than when printed with a pdfreader.
Could you please advise me?
Regards,
Nathan Moerman
Digital signature in PDF
Please help.Thanks in Advance.
Regards,
Development team
How do you stop words from being split across two lines
Code
Dim pdf As
Aspose.Pdf.Generator.Pdf = New
Aspose.Pdf.Generator.Pdf()
'set the license file
Dim lic AsNew Aspose.Pdf.License()
lic.SetLicense(System.Web.HttpContext.Current.Server.MapPath("AsposeLicense/Aspose.Total.lic"))
' add the section to PDF document sections collection
Dim section As
Aspose.Pdf.Generator.Section = pdf.Sections.Add()
section.PageInfo.PageWidth = Aspose.Pdf.Generator.PageSize.LetterWidth
section.PageInfo.PageHeight = Aspose.Pdf.Generator.PageSize.LetterHeight
Dim marginInfo As
Aspose.Pdf.Generator.MarginInfo = New
Aspose.Pdf.Generator.MarginInfo()
marginInfo.Top = 0
marginInfo.Bottom = 0
marginInfo.Left = 0
marginInfo.Right = 0
Dim marginInfotext As
Aspose.Pdf.Generator.MarginInfo = New
Aspose.Pdf.Generator.MarginInfo()
marginInfotext.Top = 95
marginInfotext.Bottom = 95
marginInfotext.Left = 35
marginInfotext.Right = 35
section.PageInfo.Margin = marginInfotext
Dim txt1 As
Aspose.Pdf.Text.TextFragment = New
Aspose.Pdf.Text.TextFragment()
txt1.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Justify
Dim graph1 As
Aspose.Pdf.Generator.Graph = New
Aspose.Pdf.Generator.Graph(section)
graph1.Margin.Top = 0
graph1.Margin.Bottom = 0
section.Paragraphs.Add(graph1)
Dim text As
Aspose.Pdf.Generator.Text = New
Aspose.Pdf.Generator.Text(section, sHtml)
text.IsHtmlTagSupported = True
section.Paragraphs.Add(text)
section.IsSpaced = True
'set page size
pdf.PageSetup.PageWidth = Aspose.Pdf.Generator.PageSize.LetterWidth
pdf.PageSetup.PageHeight = Aspose.Pdf.Generator.PageSize.LetterHeight
pdf.PageSetup.Margin
= marginInfo
pdf.Save(sTempPDF)
HTML Source sHtml =
<html><body><table cellspacing="2.50cm" width="100%"><tbody><tr><td><p></p><p><br /></p><p style="margin-top: 0px;margin-bottom: 0px;">1. This is an example of a decision, including special characters like "ô" and "í" and "ã" and other features (like parentheses) and a noun's possessive forms. --</p><p><br /></p><p style="margin-left: 0.5in;margin-top: 0px;margin-bottom: 0px">a. Some parts of the text will need to be indented.</p><p><br /></p><p style="margin-left: 1in;margin-top: 0px;margin-bottom: 0px">i). and some, even further;</p><p><br /></p><p style="margin-top: 0px;margin-bottom: 0px;">2. All paragraphs will also need a tab character between the number and text, which transfers to the IR intact, and paragraph breaks between each.</p><p></p><p><br /></p><p></p><p><br /></p></td></tr></tbody></table></body></html>