Quantcast
Channel: Aspose.Pdf Product Family
Viewing all 1038 articles
Browse latest View live

Html to pdf System.ArgumentException was unhandled by user code

$
0
0
Hi 

I'm trying to save a html email as pdf but aspose.pdf throws System.ArgumentException "value". Here is code to replicate the issue. 

Code:

string b =
"<p class=\"MsoNormal\" style=\"text-align: justify; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;\"><span style=\"font-family: 'Bell MT', serif;\">Dear Mr Test</span><span style=\"font-family: Tahoma, sans-serif;\"><o:p></o:p></span></p>";

byte[] correspondenceBytes = Encoding.UTF8.GetBytes(b);
string fileName = "c:\temp\test.pdf";
using (MemoryStream ms = new MemoryStream(correspondenceBytes))
{
Document document = new Document(ms, new HtmlLoadOptions()); // Exception
document.Save(fileName, SaveFormat.Pdf);
}

Stack trace:

System.ArgumentException was unhandled by user code
  HResult=-2147024809
  Message=value
  Source=Aspose.Pdf
  StackTrace:
       at    .   .TryGetValue(String token,    & value)
       at    .   .GetValue(String )
       at    .   .    [T](    )
       at    .   .    [T](    )
       at    .   .   ()
       at     .    .Initialize(    ,     )
       at     .    ..ctor(     ,     ,     )
       at     .    ..ctor(     ,     )
       at     .    .   (    )
       at     .    .    (    )
       at     .    .   (    )
       at     .    .    (    )
       at     .   .    (    )
       at     .    .    (    )
       at     .    .    (    )
       at     .   .    (    )
       at     .    .    (    )
       at     .    .Convert(    ,      )
       at     .    .Convert(Stream ,      )
       at    .    .Convert(Stream , Document ,     , HtmlLoadOptions )
       at Aspose.Pdf.Document.   (Stream , LoadOptions )
       at Aspose.Pdf.Document..ctor(Stream input, LoadOptions options)

If I remove "background-attachment" etc. from style then pdf is generated.

Thanks

Sourabh

Aspose.Pdf 10.9.0.0


PDF files much larger with Aspose

$
0
0
My company is planning on purchasing your product for an upcoming project. We will be converting a single TIFF and multiple JPEG files into a PDF. I am using the DEMO version of Aspose to test this. We are currently doing the same task with freeware ghostwriter software. I was able to successfully convert using Aspose but the issue is the images are much larger when created by Aspose instead of ghostwriter, gswin32c. One PDF image created by ghostwriter was 1,101 KB but 6,057 KB when created by Aspose. I tried to add optimization code that I found posted on your site but it did not reduce the pdf size. Can you give me any suggestions on how to reduce the size of the PDF file generated by Aspose? I stripped out the code and created standalone vb.net code of what I am doing and it is attached.

Table text alignment issue with arabic lang

$
0
0
Hi,

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

$
0
0
Hi 

It seems like there is a memory issue in the Aspose.Pdf.Document.OptimizeResources() function.


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

$
0
0
I'm using Aspose 11.1 pdf version In the below code the footnote text overlaps with the footer text. Expectation is to have footer text below the footnote. I've attached the pdf output.

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

$
0
0
I'm using 11.1 version of Aspose.pdf. My requirement is to create a list paragraph having userlabel and text following it see attached Expected_Output.png file

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.

$
0
0
I am trying to create a landscape PDF document 11 X 8.5 using the following code. The resulting file is attached and size is  8.26 x 11.69 


           Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document();

            pdfDocument.PageInfo.IsLandscape = true;
            pdfDocument.PageInfo.Height = PageSize.PageLetter.Height;
            pdfDocument.PageInfo.Width = PageSize.PageLetter.Width;

            pdfDocument.Pages.Add();
            string sLine = @"123456789012345678901234567890123456789012345678901234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz";
            sLine = @"REPORT:   KL0142BC                                      ------   GE  CAPITAL   ------                              PAGE:    11";

            TextStamp textStamp = new TextStamp(sLine);

            textStamp.YIndent = pdfDocument.PageInfo.Height - 200;
            textStamp.XIndent = 0;
            textStamp.TextState.FontSize = 10;
            textStamp.TextState.FontStyle = Aspose.Pdf.Text.FontStyles.Regular;
      
            textStamp.TextState.Font = Aspose.Pdf.Text.FontRepository.FindFont(@"Arial");
            
            pdfDocument.Pages[1].AddStamp(textStamp);
   
            pdfDocument.Save(@"C:\landscape.pdf");

How to hide/remove tooltips, mouseovers on form fields when converting to png.

$
0
0
When I process a page into a .PNG. It's drawing the tooltips/mouseovers for form fields. Is there anyway to hide these tooltips or remove them first before converting to png?

Non Searachable PDF to Searchable PDF

$
0
0
Hi Team, I want to convert non-searchable pdf to searchable pdf , please let us know how we can achieve this. We already have aspose with us. pls help us on this asap.

Issues with license file after installation of Aspose.PDF 11.1.0

$
0
0
Hi Aspose team,

I just downloaded latest version of PDF components and now my license does not work.
Code is simple:

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

$
0
0
I am trying to use aspose.pdf for .net. I executed this with MS-Visual Studio it works properly . But when deployed on Amazon Web Services then its giving me error like "An exception occurred during processing of your document. contact aspose support". Please help me how to resolve this issue.

FreeTextAnnotation Does Not Render in Pdf

$
0
0
Using Aspose.Pdf v11.2.0.0, any FreeTextAnnotation I create will not render in the resulting pdf when I view it in the latest version of Adobe Acrobat Pro DC (2015.010.20056).  In Acrobat, when I click on the pdf where the annotation is, it is highlighted.

I can reproduce using the sample code from your documentation:
http://www.aspose.com/docs/display/pdfnet/Set+Formatting+of+FreeTextAnnotation

Sample Code
var pdfDocument = new Aspose.Pdf.Document();
pdfDocument.Pages.Add();
Aspose.Pdf.InteractiveFeatures.DefaultAppearance default_appearance = new DefaultAppearance("Arial", 28, System.Drawing.Color.Red);
FreeTextAnnotation freetext = new FreeTextAnnotation(pdfDocument.Pages[1], new Aspose.Pdf.Rectangle(200, 400, 400, 600), default_appearance);
freetext.Contents = "Free Text";
pdfDocument.Pages[1].Annotations.Add(freetext);
pdfDocument.Save("C:/temp/Watermarked_output_FreeText.pdf");

Can not able to Merge Bytes of PDF file (occurs to error at red part)

$
0
0
byte[] buffer1 = new byte[Convert.ToInt32(fileList[0].Length)];// new byte[Convert.ToInt32(fs1.Length)];
                    byte[] buffer2 = new byte[Convert.ToInt32(fileList[1].Length)];// new byte[Convert.ToInt32(fs2.Length)];


                    // int i = 0;
                    //read PDF file contents into byte arrays
                    // fout.Read(buffer1, 0, Convert.ToInt32(buffer1.Length));
                    //fout.Read(buffer2, 0, Convert.ToInt32(buffer2.Length));

                    //now, first convert byte arrays into MemoryStreams and then concatenate those streams
                    using (MemoryStream pdfStream = new MemoryStream())
                    {
                        using (MemoryStream fileStream1 = new MemoryStream(buffer1))
                        {
                            using (MemoryStream fileStream2 = new MemoryStream(buffer2))
                            {
                                //create instance of PdfFileEditor class to concatenate streams
                                Aspose.Pdf.Facades.PdfFileEditor pdfEditor = new Aspose.Pdf.Facades.PdfFileEditor();
                                //concatenate both input MemoryStreams and save to putput MemoryStream
                                pdfEditor.Concatenate(fileStream1, fileStream2, pdfStream);
                                //fileStream1.WriteTo(pdfStream);
                                
                                //convert MemoryStream back to byte array
                                byte[] data = pdfStream.ToArray();
                                //create a FileStream to save the output PDF file
                                FileStream output = new FileStream(outMergeFile, FileMode.Create,
                                FileAccess.Write);
                                //write byte array contents in the output file stream
                                output.Write(data, 0, data.Length);
                                //close output file
                                output.Close();
                            }
                        }
                    }

Error when clicking submit button if all radio buttons not checked/reclicked

$
0
0
Hoping someone can help as i have seen similar posts but no-one has got a final answer.

Basically if i create a new pdf as outlined in the code below (However has multiple sections which has multiple sections and radio buttons) if you click the submit button which is added at the end you get an error.

The error goes away and the submit button works as expected if you go through every radio button on the generated pdf and manually reclick it even if it already has a value selected. It dosent seem to make a difference if you set a selected value in the code or not.

I am using the latest version of aspose with this.

Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();
            //Add a section in the Pdf document
            Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();

            //Create a table, set its column widths and add it to paragraphs collection
            //of the  section
            Aspose.Pdf.Generator.Table tab1 = new Aspose.Pdf.Generator.Table();
            tab1.ColumnWidths = "120 120";
            sec1.Paragraphs.Add(tab1);
            //create rows
            for (int r = 0; r < 3; r++)
            {
                //Add a row to the table
                Aspose.Pdf.Generator.Row r1 = tab1.Rows.Add();
                Aspose.Pdf.Generator.FormField radio = new Aspose.Pdf.Generator.FormField();

                //Create a form field of RadioButton type. Set its field name and button color.
                //Then set the index of the radio button value to be checked
                radio.FormFieldType = Aspose.Pdf.Generator.FormFieldType.RadioButton;
                radio.FieldName = "ARadio" + r;
                radio.ButtonColor = System.Drawing.Color.FromName("Red");
                radio.RadioButtonCheckedIndex = 0;
                radio.IsBordered = true;
                radio.BorderColor = System.Drawing.Color.FromName("Yellow");
                // create cells
                for (int c = 0; c < 2; c++)
                {  //Add 1st cell to the row, set its padding and set the ID of the first paragraph
                    //in the cell to "text1"
                    Aspose.Pdf.Generator.Cell c1 = r1.Cells.Add("item1" + r + c);
                    c1.Padding.Left = 30;
                    c1.Paragraphs[0].ID = "text1" + r + c;
                    //Create radio button instance and add it to above created radio form field.
                    //Set its width and height. The position of the radio button is set to be
                    //relative to the paragraph. Link this radio button with the paragraph with ID
                    //equal to cell text
                    Aspose.Pdf.Generator.RadioButton bt1 = radio.RadioButtons.Add();
                    bt1.ButtonHeight = 12;
                    bt1.ButtonWidth = 12;
                    bt1.PositioningType = Aspose.Pdf.Generator.PositioningType.ParagraphRelative;
                    bt1.ReferenceParagraphID = "text1" + r + c;
                    bt1.Left = -20;
                    bt1.Top = 0;


                }
                //Add the radio form field to the paragraphs collection of the section
                sec1.Paragraphs.Add(radio);
            }


            MemoryStream stream = new MemoryStream();
            pdf1.Save(stream);

            FormEditor fe = new FormEditor(stream, stream);
 
            fe.AddSubmitBtn("Submit", pdf.PageCount , "Save", string.Format(@"{0}/en/Submit/Render/SaveOfflineDocument?applicationformid={1}",Settings.General.PortalURL, applicationForm.ID.ToString()), 500, 400, 550, 425);
        
            fe.Save(stream);


            return stream;

Convert to PDF/A-1A

$
0
0
Hi,

We have a requirement to convert password protected files and zip files to PDF/A-1A .Do we have any such API do to this functionality using Aspose java api?

Thank you in advance

Pdf for Java Locale problem

$
0
0
Hello,

When I set Locale other than english, I get an NullPointerException.

For instance;
Locale locale = new Locale("tr");
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);


Exception in thread "main" java.lang.NullPointerException
    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

$
0
0
Hi,

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.

Bad pdf Effect in converting Image

$
0
0
the result is like SXST2011S2054-1.jpg SXST2011S2054-2.jpg

PDF-PDFA Conversion

$
0
0
Hi there, I have downloaded the Java examples but unfortunatelly I didn't find something on PDF->PDF/A conversion but for: System.out.println("PDF to PDFA example will be available very soon."); Could you suggest to me a simple use of this API? I am at moment evaluating some products because my Firm needs exactly this feature. Thank you in advance Fabio

It took long time to convert an pdf file to html

$
0
0
Hi

I am using pdf 11.1.0 to convert pdf files to html file.

It took so long to convert the pdf file in attachement, that i never saw the result when I went off work.

And it threw oom exception with 
-Xms2G -Xmx6G

The code will be like:

Document pdf = new Document("custom/input/pdf/HS.pdf");
HtmlSaveOptions htmlSaveOps = new HtmlSaveOptions();
pdf.save("custom/output/pdf/HS.html", htmlSaveOps);

Please check this pdf file, and help me figure it out what happend, thanks :)
Viewing all 1038 articles
Browse latest View live