Html to pdf System.ArgumentException was unhandled by user code
PDF files much larger with Aspose
Table text alignment issue with arabic lang
This is with reference to an existing thread, want to link here with my order id:
------------------------
I am trying to write arabic text to existing pdf file along with english text, I write this text in a table with rows/cells format used.
The text is not aligned center even i set the alignment for cells which I am writing the text.
When we use english text the alignment looks to be fine, but if I add arabic text, then the alignment is going to bit left side.
Please find the attached screenshot for the same. attached the code snippet used to write the text on to pdf.
Thanks,
------------------------
Please update us here with solution.
OutOfMemory exception in Aspose.Pdf.Document.OptimizeResources
I am
working with fairly large PDF documents and I can manage to hit an
OutOfMemoryExeption. If I look at the memory in the profiler the memory usage
increases rapidly.
I created a solution which can recreate the issue. It contains a c# solution and inside you will also find a PDF dummy file generated from Word (FailingPdf.pdf).
Instructions
on how to run it can also be found in the solution.
The
document has a size of 12,5 MB but when the function runs it breaks at 1,5 GB
mem usage (I am running 32 bit).
I am using Aspose.Pdf version 10.6.0.0.
Do you have any workaround or is this an error?
Best regards
/Anders
Footer Text overlapping with Footnote
Document pdfDoc = new Document();
pdfDoc.PageInfo.Width = 612.0;
pdfDoc.PageInfo.Height = 792.0;
pdfDoc.PageInfo.Margin = new Aspose.Pdf.MarginInfo();
pdfDoc.PageInfo.Margin.Left = 72;
pdfDoc.PageInfo.Margin.Right = 72;
pdfDoc.PageInfo.Margin.Top = 55;
pdfDoc.PageInfo.Margin.Bottom = 72;
Page pdfPage = pdfDoc.Pages.Add();
pdfPage.PageInfo.Width = 612.0;
pdfPage.PageInfo.Height = 792.0;
pdfPage.PageInfo.Margin = new Aspose.Pdf.MarginInfo();
pdfPage.PageInfo.Margin.Left = 72;
pdfPage.PageInfo.Margin.Right = 72;
pdfPage.PageInfo.Margin.Top = 72;
pdfPage.PageInfo.Margin.Bottom = 72;
Aspose.Pdf.FloatingBox floatBox = new Aspose.Pdf.FloatingBox();
floatBox.Margin = pdfPage.PageInfo.Margin;
pdfPage.Paragraphs.Add(floatBox);
TextFragment fragment = new TextFragment();
fragment.IsInLineParagraph = true;
TextSegment segment = new TextSegment("When astronauts blast off from the planet Mars, they leave behind Mark Watney (Matt Damon), presumed dead after a fierce storm. With only a meager amount of supplies, the stranded visitor must utilize his wits and spirit to find a way to survive on the hostile planet. Meanwhile, back on");
segment.TextState.HorizontalAlignment = HorizontalAlignment.Justify;
fragment.Segments.Add(segment);
floatBox.Paragraphs.Add(fragment);
Note fn = new Note();
fragment = new TextFragment();
fragment.IsInLineParagraph = true;
floatBox.Paragraphs.Add(fragment);
fragment.FootNote = fn;
fragment.FootNote.Text = "1";
TextFragment footnotetext = new TextFragment();
footnotetext.TextState.FontSize = 9;
TextSegment firstSeginsideFnText = new TextSegment("As a boy, Philippe Petit dreams of performing daring feats for dazzled crowds. As an adult (Joseph Gordon-Levitt), his life's ambition comes true when he becomes a high-wire artist who stares death in the face with every step. Under the guidance of mentor Papa Rudy, the French daredevil devises a As a boy, Philippe Petit dreams of performing daring feats for dazzled crowds. As an adult (Joseph Gordon-Levitt), his life's ambition comes true when he becomes a high-wire artist who stares death in the face with every step. Under the guidance of mentor Papa Rudy, the French daredevil devises a");
firstSeginsideFnText.TextState.HorizontalAlignment = HorizontalAlignment.Justify;
footnotetext.TextState.HorizontalAlignment = HorizontalAlignment.Justify;
footnotetext.Segments.Add(firstSeginsideFnText);
fn.Paragraphs.Add(footnotetext);
fragment = new TextFragment();
fragment.IsInLineParagraph = false;
segment = new TextSegment("When astronauts blast off from the planet Mars, they leave behind Mark Watney (Matt Damon), presumed dead after a fierce storm. With only a meager amount of supplies, the stranded visitor must utilize his wits and spirit to find a way to survive on the hostile planet. Meanwhile, back on");
segment.TextState.HorizontalAlignment = HorizontalAlignment.Justify;
fragment.Segments.Add(segment);
floatBox.Paragraphs.Add(fragment);
fn = new Note();
fragment = new TextFragment();
fragment.IsInLineParagraph = true;
floatBox.Paragraphs.Add(fragment);
fragment.FootNote = fn;
fragment.FootNote.Text = "2";
footnotetext = new TextFragment();
footnotetext.TextState.FontSize = 9;
firstSeginsideFnText = new TextSegment("As a boy, Philippe Petit dreams of performing daring feats for dazzled crowds. As an adult (Joseph Gordon-Levitt), his life's ambition comes true when he becomes a high-wire artist who stares death in the face with every step. Under the guidance of mentor Papa Rudy, the French daredevil devises a As a boy, Philippe Petit dreams of performing daring feats for dazzled crowds. As an adult (Joseph Gordon-Levitt), his life's ambition comes true when he becomes a high-wire artist who stares death in the face with every step. Under the guidance of mentor Papa Rudy, the French daredevil devises a");
firstSeginsideFnText.TextState.HorizontalAlignment = HorizontalAlignment.Justify;
footnotetext.TextState.HorizontalAlignment = HorizontalAlignment.Justify;
footnotetext.Segments.Add(firstSeginsideFnText);
fn.Paragraphs.Add(footnotetext);
footnotetext = new TextFragment();
footnotetext.TextState.FontSize = 9;
footnotetext.IsInLineParagraph = true;
footnotetext.Hyperlink = new WebHyperlink("www.google.com");
footnotetext.TextState.HorizontalAlignment = HorizontalAlignment.Justify;
firstSeginsideFnText = new TextSegment(" testing Hyperlink");
firstSeginsideFnText.TextState.HorizontalAlignment = HorizontalAlignment.Justify;
firstSeginsideFnText.TextState.ForegroundColor = Aspose.Pdf.Color.FromArgb(0, 119, 204);
footnotetext.Segments.Add(firstSeginsideFnText);
fn.Paragraphs.Add(footnotetext);
pdfDoc.Save(@"c:\temp\Footnote.pdf");
Aspose.Pdf.Document doc = new Document(@"c:\temp\Footnote.pdf");
foreach (Aspose.Pdf.Page page in doc.Pages)
{
page.Footer = new Aspose.Pdf.HeaderFooter();
page.Footer.Margin = new Aspose.Pdf.MarginInfo();
page.Footer.Margin.Left = 50;
page.Footer.Margin.Right = 50;
page.Footer.Margin.Top = 30;
page.Footer.Margin.Bottom = 10;
{
TextFragment footerText = new TextFragment();
TextSegment footerSegment = new TextSegment("First Name");
footerSegment.TextState.FontSize = 12;
footerSegment.TextState.HorizontalAlignment = HorizontalAlignment.Center;
footerText.Segments.Add(footerSegment);
footerText.TextState.HorizontalAlignment = HorizontalAlignment.Center;
page.Footer.Paragraphs.Add(footerText);
}
}
doc.Save(@"c:\temp\Footnote.pdf");
Spacing between Heading user label and heading.Textfragments
I tried below code to achieve it but the text are getting wrapped at the center of the page (look at the List.pdf output). I want output similar to Expected_Output.png. Let me know can i achieve this.
Document pdfDoc = new Document();
pdfDoc.PageInfo.Width = 612.0;
pdfDoc.PageInfo.Height = 792.0;
pdfDoc.PageInfo.Margin = new Aspose.Pdf.MarginInfo();
pdfDoc.PageInfo.Margin.Left = 72;
pdfDoc.PageInfo.Margin.Right = 72;
pdfDoc.PageInfo.Margin.Top = 72;
pdfDoc.PageInfo.Margin.Bottom = 72;
Page pdfPage = pdfDoc.Pages.Add();
pdfPage.PageInfo.Width = 612.0;
pdfPage.PageInfo.Height = 792.0;
pdfPage.PageInfo.Margin = new Aspose.Pdf.MarginInfo();
pdfPage.PageInfo.Margin.Left = 72;
pdfPage.PageInfo.Margin.Right = 72;
pdfPage.PageInfo.Margin.Top = 72;
pdfPage.PageInfo.Margin.Bottom = 72;
Aspose.Pdf.FloatingBox floatBox = new Aspose.Pdf.FloatingBox();
floatBox.Margin = pdfPage.PageInfo.Margin;
pdfPage.Paragraphs.Add(floatBox);
Aspose.Pdf.Text.Font font = Aspose.Pdf.Text.FontRepository.FindFont("Arial");
Aspose.Pdf.Heading heading = new Aspose.Pdf.Heading(1);
heading.UserLabel = "1)";
heading.IsAutoSequence = true;
heading.Margin = new MarginInfo(10, 0, 0, 0);
TextSegment segment = new TextSegment("the value, as of the effective date of the plan, of property to be distributed under the plan onaccount of each allowed");
segment.TextState.Font = font;
segment.TextState.FontSize = 10;
segment.TextState.Font.IsEmbedded = true;
heading.Segments.Add(segment);
floatBox.Paragraphs.Add(heading);
heading = new Aspose.Pdf.Heading(1);
heading.IsInLineParagraph = true;
heading.Hyperlink = new WebHyperlink("https://google.com");
segment = new TextSegment(" hyperlink text");
segment.TextState.Font = font;
segment.TextState.FontSize = 10;
segment.TextState.Font.IsEmbedded = true;
heading.Segments.Add(segment);
floatBox.Paragraphs.Add(heading);
heading = new Aspose.Pdf.Heading(1);
heading.IsInLineParagraph = true;
segment = new TextSegment(" Founded in 1902 as Madrid Football Club, the team has traditionally worn a white home kit since inception");
segment.TextState.Font = font;
segment.TextState.FontSize = 10;
segment.TextState.Font.IsEmbedded = true;
heading.Segments.Add(segment);
floatBox.Paragraphs.Add(heading);
Aspose.Pdf.Heading heading2 = new Aspose.Pdf.Heading(1);
heading2.UserLabel = "a)";
heading2.IsInList = true;
heading2.IsAutoSequence = true;
heading2.Margin = new MarginInfo(25, 0, 0, 0);
segment = new TextSegment("the value, as of the effective date of the plan, of property to be distributed ");
segment.TextState.Font = font;
segment.TextState.FontSize = 10;
segment.TextState.Font.IsEmbedded = true;
heading2.Segments.Add(segment);
floatBox.Paragraphs.Add(heading2);
Aspose.Pdf.Heading heading3 = new Aspose.Pdf.Heading(1);
heading3.UserLabel = "i)";
heading3.IsInList = true;
heading3.IsAutoSequence = true;
heading3.Margin = new MarginInfo(40, 0, 0, 0);
segment = new TextSegment("the value, as of the effective date of the plan, of property to be distributed ");
segment.TextState.Font = font;
segment.TextState.FontSize = 10;
//segment.TextState.LineSpacing = 13;
segment.TextState.Font.IsEmbedded = true;
heading3.Segments.Add(segment);
floatBox.Paragraphs.Add(heading3);
Aspose.Pdf.Heading heading4 = new Aspose.Pdf.Heading(1);
heading4.UserLabel = "2)";
heading4.IsInList = true;
heading4.IsAutoSequence = true;
heading4.Margin = new MarginInfo(10, 0, 0, 0);
segment = new TextSegment("the value, as of the effective date of the plan, of property to be distributed ");
segment.TextState.Font = font;
segment.TextState.FontSize = 10;
segment.TextState.Font.IsEmbedded = true;
heading4.Segments.Add(segment);
floatBox.Paragraphs.Add(heading4);
string outFile = @"c:\temp\List.pdf";
pdfDoc.Save(outFile);
Create a landscape letter size document.
How to hide/remove tooltips, mouseovers on form fields when converting to png.
Non Searachable PDF to Searchable PDF
Issues with license file after installation of Aspose.PDF 11.1.0
Dim licensePDF As Aspose.Pdf.License = New Aspose.Pdf.License
licensePDF.SetLicense("aspose.lic")Dim licenseCells As Aspose.Cells.License = New Aspose.Cells.License()
licenseCells.SetLicense("aspose.lic")
Dim licenseWords AsNew Aspose.Words.License()
licenseWords.SetLicense("aspose.lic")
Dim licenseSlides As Aspose.Slides.License = New Aspose.Slides.License()
licenseSlides.SetLicense("aspose.lic")
Dim licenseTasks As Aspose.Tasks.License = New Aspose.Tasks.License()
licenseTasks.SetLicense("aspose.lic")
Dim licenseDiagram As Aspose.Diagram.License = New Aspose.Diagram.License()
licenseDiagram.SetLicense("aspose.lic")
Dim licenseEmail As Aspose.Email.License = New Aspose.Email.License()
licenseEmail.SetLicense("aspose.lic")
Dim licenseNote As Aspose.Note.License = New Aspose.Note.License
licenseNote.SetLicense("aspose.lic")
License file is embedded without copying to output directory.
Crash is always next Aspose component where license has to be checked. In above example, it will crash on Aspose.Cells but if I move Aspose.PDF to some other place like:
Dim licensePDF As Aspose.Pdf.License = New Aspose.Pdf.LicenselicensePDF.SetLicense("aspose.lic")
Dim licenseTasks As Aspose.Tasks.License = New Aspose.Tasks.License()
licenseTasks.SetLicense("aspose.lic")
then crash will at Aspose.Tasks.
Does Aspose.PDF corrupts now licenses so it cannot be found any more?
Can you please check?
Thanks,
Oliver
Aspose.PDF for .Net- An exception occurred during processing of your document
FreeTextAnnotation Does Not Render in Pdf
Can not able to Merge Bytes of PDF file (occurs to error at red part)
Error when clicking submit button if all radio buttons not checked/reclicked
Convert to PDF/A-1A
Pdf for Java Locale problem
When I set Locale other than english, I get an NullPointerException.
For instance;
Locale locale = new Locale("tr");Exception in thread "main" java.lang.NullPointerException
Locale.setDefault(locale);
License license = new License();
license.setLicense(asposeLicensePath);
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(path);
Page page = pdfDocument.getPages().get_Item(1);
com.aspose.pdf.TextBuilder textBuilder = new com.aspose.pdf.TextBuilder(page);
at com.aspose.pdf.internal.p56.z11.m2(Unknown Source)
at com.aspose.pdf.internal.p56.z11.m7(Unknown Source)
at com.aspose.pdf.internal.p56.z13.m1(Unknown Source)
at com.aspose.pdf.internal.p56.z13.m1(Unknown Source)
at com.aspose.pdf.internal.p56.z13.m6(Unknown Source)
at com.aspose.pdf.internal.p56.z13.<init>(Unknown Source)
at com.aspose.pdf.internal.p56.z13.<init>(Unknown Source)
at com.aspose.pdf.internal.p56.z13.<init>(Unknown Source)
at com.aspose.pdf.TextBuilder.<init>(Unknown Source)
at com.core.utility.report.aspose.AddLayer.addImzaLayersToPdfFile(AddLayer.java:50)
at com.core.utility.report.aspose.Test.main(Test.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Re: PDF to PNG conversion is not done properly
I have tried to generate PNG from the PDF file but On page 1 "interactive science" graphic is distorted.
I have attached the input pdf's
SCI15_MLGLOS_MGS_A0055402.pdf
SCI15_MLGLOS_MGS_A0055404.pdf
SCI15_MLGLOS_MGS_A0055408.pdf
SCI15_MLGLOS_MGS_A0055406.pdf
and repected output png's
PREVIEW_SCI15_MLGLOS_MGS_A0055402_0.png
PREVIEW_SCI15_MLGLOS_MGS_A0055404_0.png
PREVIEW_SCI15_MLGLOS_MGS_A0055408_0.png
PREVIEW_SCI15_MLGLOS_MGS_A0055406_0.png
in this ticket.Can you please help me on this issue ,i used latest aspose.pdf-11.1.0.jar.