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

Aspose PDF for java is working properly on (window and Ubuntu) but not worked on Linux production server.

$
0
0
Aspose PDF for java is working properly on (window and Ubuntu) but not worked on Linux production server.



[root@solr Download]# javac -cp aspose-pdf-jdk16.jar pdftest.java
[root@solr Download]# java -cp aspose-pdf-jdk16.jar: pdftest
/var/www/solr/Download/cv_fr.pdf
java.lang.NullPointerException
        at com.aspose.pdf.internal.oe.l.a(Unknown Source)
        at com.aspose.pdf.internal.oe.l.parse(Unknown Source)
        at com.aspose.pdf.internal.oe.n.a(Unknown Source)
        at com.aspose.pdf.internal.oe.n.a(Unknown Source)
        at com.aspose.pdf.internal.oe.n.dpD(Unknown Source)
        at com.aspose.pdf.internal.oe.n.<init>(Unknown Source)
        at com.aspose.pdf.internal.oe.n.<init>(Unknown Source)
        at com.aspose.pdf.TextAbsorber.visit(Unknown Source)
        at com.aspose.pdf.Page.accept(Unknown Source)
        at com.aspose.pdf.PageCollection.accept(Unknown Source)
        at pdftest.AsposePDFtoText(pdftest.java:62)
        at pdftest.main(pdftest.java:28)
Aspose
[root@solr Download]# java -cp aspose-pdf-jdk14.jar: pdftest
\/var/www/solr/Download/cv_fr.pdf
java.lang.NullPointerException
        at com.aspose.pdf.internal.oe.l.a(Unknown Source)
        at com.aspose.pdf.internal.oe.l.parse(Unknown Source)
        at com.aspose.pdf.internal.oe.n.a(Unknown Source)
        at com.aspose.pdf.internal.oe.n.a(Unknown Source)
        at com.aspose.pdf.internal.oe.n.dpD(Unknown Source)
        at com.aspose.pdf.internal.oe.n.<init>(Unknown Source)
        at com.aspose.pdf.internal.oe.n.<init>(Unknown Source)
        at com.aspose.pdf.TextAbsorber.visit(Unknown Source)
        at com.aspose.pdf.Page.accept(Unknown Source)
        at com.aspose.pdf.PageCollection.accept(Unknown Source)
        at pdftest.AsposePDFtoText(pdftest.java:62)
        at pdftest.main(pdftest.java:28)
Aspose
[root@solr Download]# java -cp aspose-pdf-jdk16.jar: pdftest
/var/www/solr/Download/cv_fr.pdf
java.lang.NullPointerException
        at com.aspose.pdf.internal.oe.l.a(Unknown Source)
        at com.aspose.pdf.internal.oe.l.parse(Unknown Source)
        at com.aspose.pdf.internal.oe.n.a(Unknown Source)
        at com.aspose.pdf.internal.oe.n.a(Unknown Source)
        at com.aspose.pdf.internal.oe.n.dpD(Unknown Source)
        at com.aspose.pdf.internal.oe.n.<init>(Unknown Source)
        at com.aspose.pdf.internal.oe.n.<init>(Unknown Source)
        at com.aspose.pdf.TextAbsorber.visit(Unknown Source)
        at com.aspose.pdf.Page.accept(Unknown Source)
        at com.aspose.pdf.PageCollection.accept(Unknown Source)
        at pdftest.AsposePDFtoText(pdftest.java:62)
        at pdftest.main(pdftest.java:28)
Aspose
[root@solr Download]#

Sample code is attached for your reference.


Page Layout Preference of Default

$
0
0
I am trying to check/set the page layout preference using pdfcontenteditor and the viewer preferences.  However I am trying to evaluate and set the value to default as shown in the screen shot from acrobat but do not see how to evaluate this.   Can you help point me in the right direction.

            Dim contentEditor AsNew Aspose.Pdf.Facades.PdfContentEditor(pdfDoc)

            Dim prefValue AsInteger = contentEditor.GetViewerPreference()

            'First Check Page View Type

            If (prefValue and Aspose.Pdf.Facades.ViewerPreference.PageLayoutSinglePage)=1

Confusing documentation

$
0
0
I am so confused by all the different namespaces for Aspose.PDF. The documentation is all over the place and finding out how to do a task is a monumental feat. I just want to know the most efficient way to convert a TIFF image to a PDF. I have to choose between DOM, Generator, Facades, and something called PDFMend. What???

Problems with Distributed Forms

$
0
0
We are using Aspose PDF to fill a distributed form. The form is being filled with out problems. Our problem occurs when we submit the form and try to add it to a response file. Acrobat gives the error: "The fields in the file "..." do not exactly match the fields in the specified response file". 

If you click yes, the response file shows no data from this file. I have attached a screen shot of the error.

Any help is appreciated,

Thanks


Aspose.Words object into Aspose.Pdf object

$
0
0
We have upgraded from a very old version of Aspose to the latest. Our app was designed around a very specific set of (now obsolete) assumptions to turn a Words object into a Pdf object (example below). This no longer works. It gives me a "XmlException: Data at the root level is invalid. Line 1, position 1." error.

Research seems to indicate this is an obsolete method to save a word file to PDF format. However, that's not how it's being used in this context. It's transforming the Words object and then, later on (not part of this example), using the resulting PDF object to add things like watermarks.

I've been trying to find a way to transfer the contents of the Aspose.Words.Document object into an Aspose.Pdf.Generator.Pdf object, WITHOUT it going into direct mode, but have run out of ideas.

Is this still possible?

NOTE: "doc" is an Aspose.Words.Document object passed into the method.

var p = new Aspose.Pdf.Generator.Pdf();
            using (MemoryStream ms = new MemoryStream())
            {
                doc.Save(ms, Aspose.Words.SaveFormat.Pdf);               
                p.BindXML(ms, null);
            }
            p.IsImagesInXmlDeleteNeeded = true;
            p.SetUnicode();           
            p.Save(outputFileName);
            return p;

What does &quot;If you want to set this parameter in Report Designer, the data type should be 'Boolean'.&quot; mean?

$
0
0
Hi team,

Please explain the statement as mentioned in the title of this thread in reference to the the following documentation article.
http://www.aspose.com/docs/display/pdfreportingservices/HTML+Formatting


This message was posted using Email2Forum by Babar Raza.

Aspose paid license is not working on Windows machine.

$
0
0

Hello,

 We have purchased Aspose PDF Java license with validity till 2015. I am trying to add this license on my local machine Windows 7 platform and getting following exception. This is a 2 user license, the other user is using the same license file on XP machine and it is working fine. Please suggest is there any issue with OS platform ? also suggest if we need to do anything from ourend.

 

com.aspose.pdf.internal.hv.cm: Resulting timespan is too big.
    at com.aspose.pdf.internal.hv.dg.a(Unknown Source)
    at com.aspose.pdf.internal.hv.dg.dg(Unknown Source)
    at com.aspose.pdf.internal.hv.di.a(Unknown Source)
    at com.aspose.pdf.internal.hv.aj.<init>(Unknown Source)
    at com.aspose.pdf.internal.hv.ag.a(Unknown Source)
    at com.aspose.pdf.internal.hv.ag.a(Unknown Source)
    at com.aspose.pdf.internal.hv.ag.a(Unknown Source)
    at com.aspose.pdf.internal.hv.ag.a(Unknown Source)
    at com.aspose.pdf.internal.hv.ag.a(Unknown Source)
    at aspose.pdf.internal.al.b(Unknown Source)
    at aspose.pdf.internal.al.a(Unknown Source)
    at aspose.pdf.internal.al.a(Unknown Source)
    at aspose.pdf.internal.al.a(Unknown Source)
    at aspose.pdf.a.setLicense(Unknown Source)
    at com.aspose.pdf.License.setLicense(Unknown Source)

 

Thanks

Sateesh.

pdf.save() keeps working inflating the size upto 1G and works forever

$
0
0
Hello, In some cases where we add word documents, using the following code ByteArrayInputStream bais = new ByteArrayInputStream(docToString(fo).getBytes("UTF-8")); Pdf pdf = new Pdf(); pdf.bindFO(bais); pdf.save(out); save hangs and keep downloading to OutputStream out for ever, ending with corrupted pdf. Actually the file is 42kb, but why we end up 500MB or 1G and end up corrupted pdf? We don't have source code, may be you have some suggestions. Thanks. Selim.

File not readable after converting to PdfFormat.v_1_3

$
0
0

Hi,

 

Today contacted service specialist for technical issue we are facing and as per his advice filing the following issue.

 

For our application we need to convert all PDF files to version 1_3 and we are using aspose Document.Convert API for this purpose. The API is working fine for some files, but for others, after conversion unable to read file contents. Also observed default zoom size is set in 2000% to 5000% range while opening pdf file in adobe.

 

We are in the process of procuring aspose and this feature is critical for the project.

 

Code: 

 var doc = new Document("doc.pdf");

           if (doc.Version != "1.3")

           {

                     doc.Convert("error.txt", PdfFormat.v_1_3 , ConvertErrorAction.None);

               doc.Save(pdfFile);

           }

Attaching doc.pdf file (input file which we are trying to convert).

 

Appreciate your help in this matter.


-Krishna 

Writing to Adobe version 9,X,XI Static Form Fields

$
0
0
Hi,
  In evaluating your product (aspose-pdf-9.1 for java), I am conducting various compatibility tests with a number of different versions of Adobe forms. I have a few different static PDF forms that I am trying to set the value on a TextBoxField, and save the resulting PDF. I am trying to do so using the following code (taken from here: http://www.aspose.com/docs/display/pdfjava/Modify+Form+Field+in+a+PDF+Document):

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("test.pdf");

//I can verify the "some.path.to.field" exists as I am using the Field getFullName() method once 
//I call Field[] fields = pdfDocument.getForm().getFields()
WidgetAnnotation anno = pdfDocument.getForm().get("some.path.to.field");

    if(anno instanceof com.aspose.pdf.TextBoxField){
    ((com.aspose.pdf.TextBoxField)anno).setValue("shouldBeEdited");
    ((com.aspose.pdf.TextBoxField)anno).setReadOnly(true);
    }   
   
    pdfDocument.save("test_edited.pdf");

Now this works fine for my PDFs that are:
PDF Version: 1.6 (Acrobat 7.x)
PDF Version: 1.7 (Acrobat 8.x)

The new field values are never written for my PDFs that are:
PDF Version: 1.7 Adobe Extension Level 3(Acrobat 9.x)
PDF Version: 1.7 Adobe Extension Level 8(Acrobat X)
PDF Version: 1.7 Adobe Extension Level 11(Acrobat XI)

Is it possible to set form field values using the code above with any forms that are Acrobat 9.x and above? Or can I only use the XFA data to set the value of these fields that are Acrobat 9.x and above? This would prove difficult as the Acrobat X and Acrobat XI Forms I am testing with have to XFA Fields. Thank you.

FormEditor AddFields Don't Print

$
0
0

We are using Aspose.Pdf 9.2.1, FormEditor, FormFieldFacade, AddField etc. to create fields in a “template”  Pdf  and then using Form.ImportXmlto populate Pdf. The ImportXml method seems to populate fields correctly when viewed in Pdf reader. However when printed the fields come out blank. We can edit/save field’s values in Pdf but no print.

Can someone analyze the PDf attached PDFs?    “template_good” works as expected (print ok ) but “template_noprint_fields” will not print fields. Also “template_noprint_fields” is smaller in size that “template_good” but has 1 more page. This seems to be a clue of some sort. I can supply source code upon request. Thanks in advance for any assistance BillG

saving pdf as mysql BLOB

$
0
0
We are considering to buy this components but before that I have a question about this components. 
One issue we have is that we are supposed to read pdf forms from mysql BLOB field and to display web browser directly using html iframe or embed tags or any method if your components support this and to save embedded pdf forms into database as BLOB. I was wondering if it is possible with aspose pdf java. I am struggling with this issue and trying to find any controls to support this. 

Thank you in advance.

Aspose.Pdf 9.1.0 has problems reading license file?

$
0
0
 After update to the latest Aspose.Pdf 9.1.0, I see an exception as follows though the license file is still valid. The license file is set using the setLicense(java.io.InputStream stream) method. I dont see the same problem if I revert to the previous version of the Aspose.pdf library.

The license file is attached as .txt file

class com.aspose.pdf.internal.hv.bv: This license is disabled, please contact Aspose to obtain a new license.
com.aspose.pdf.cm.aP(Unknown Source)
com.aspose.pdf.License.aO(Unknown Source)
com.aspose.pdf.License.setLicense(Unknown Source)
com.XXX.PDFConverter.convert(PDFConverter.java:55)
com.XXX.ConversionTask.call(ConversionTask.java:49)
com.XXX.ConversionTask.call(ConversionTask.java:16)
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
java.util.concurrent.FutureTask.run(FutureTask.java:138)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
java.lang.Thread.run(Thread.java:680)
        at com.aspose.pdf.cm.aP(Unknown Source)
        at com.aspose.pdf.License.aO(Unknown Source)
        at com.aspose.pdf.License.setLicense(Unknown Source)
        at com.XXX.PDFConverter.convert(PDFConverter.java:55)
        at com.XXX.ConversionTask.call(ConversionTask.java:49)
        at com.XXX.ConversionTask.call(ConversionTask.java:16)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
        at java.lang.Thread.run(Thread.java:680)


ung

Missing Values when filling a PDF form

$
0
0
Platform: .Net 4.0, Aspose.PDF.dll Version: 9.2.1.0, OS: Windows 8

Attachments: 
a. 2013_I-9.pdf (Issue 1): The fields I am trying to set are the first two fields in Page 7.
b. 2013_de4.pdf (Issue 2): The field I am trying to set is the first field on Page 1.
c. AsposeI9Errors.zip (Sample program. Provide your license file to bin\debug folder).


Issue 1: I am unable to save a PDF (2013_I-9.pdf) form with a value filled in.
if (field.FullName == "form1[0].#subform[6].FamilyName[0]")
//In Document 2013_I-9.pdf
{
field.Value = "Family Name";
}
if (field.FullName == "form1[0].#subform[6].GivenName[0]")
//In Document 2013_I-9.pdf
{
field.Value = "First Name";
}

Issue 2: I recently upgraded to version 9.2 and I started getting these errors when I am filling a value is a PDF form. (2013_DE4.pdf)
if (field.FullName == "Full Name")//In Document 2013_DE4.pdf
{
field.Value = "My Full Name";
}
line 17:83 mismatched character 'v' expecting '\n'
line 17:112 mismatched character 'e' expecting '\n'
line 17:87 no viable alternative at input 'B'

Embedded file compression

$
0
0
Is there anyway to disable file compression when adding an embedded file?

Concatenate and you lose bookmarks

$
0
0

Hello,

We have an Aspose.Total license.  We're concatenating several PDFs using Aspose.Pdf.Kit. Each PDF has their own bookmarks in them.  When the final PDF is formed it is missing all of the bookmarks.  Is this a known issue?  When can we expect a fix or do you know of a workaround?

Thanks,

NullPointerException when using PdfFileSignature

$
0
0
In our Java application we found a problem using Aspose.PDF.Kit, in concrete the last version before merging 4.7.0.

The error is produced in this code after some time of use, in the method save() of PdfFileSignature. This is the stackTrace:

java.lang.NullPointerException
        at com.aspose.pdf.kit.op.<init>(Unknown Source)
        at com.aspose.pdf.kit.oo.<init>(Unknown Source)
        at com.aspose.pdf.kit.pj.a(Unknown Source)
        at com.aspose.pdf.kit.pl.a(Unknown Source)
        at com.aspose.pdf.kit.pl.q(Unknown Source)
        at com.aspose.pdf.kit.pn.b(Unknown Source)
        at com.aspose.pdf.kit.PdfFileSignature.a(Unknown Source)
        at com.aspose.pdf.kit.PdfFileSignature.save(Unknown Source)
        at com.aspose.pdf.kit.PdfFileSignature.save(Unknown Source)
        at idiada.zeus.services.documentsimpl.DocumentOperationsImpl.protectPdf(DocumentOperationsImpl.java:1399)



And this is the code snippet:

    public void protectPdf(String inputName, String outputName,
            String inFolder, String outFolder)  {

        try {

            log.info("Protecting doc using ASPOSE");
               
            // FILE PATH
            PdfFileSignature pdfSignature = new PdfFileSignature(inFolder+inputName, outFolder+outputName);
   
            // CERTIFICATE
            Pkcs7Signature certificate = new Pkcs7Signature(licenseKeyFolder+pdf_certificate, pdf_certificate_password); //
           
           
            java.awt.Rectangle rect = new java.awt.Rectangle(240, 740, 70, 70);
            certificate.setRect(rect);
           
            pdfSignature.setVisible(false);       
            pdfSignature.setSignature(certificate);
            //pdfSignature.setKeyStoreType("pkcs12");
            pdfSignature.setPageNumber(1);
            pdfSignature.setSignModel(PdfFileSignature.WINDOWCERTIFICATE);
            pdfSignature.setCertificationLevel(PdfFileSignature.CERTIFIED_NO_CHANGES_ALLOWED);
           
            pdfSignature.save();       

        }
        catch (Exception e) {
            log.error(e.getMessage(),e);
        }

    }


Regards.

Problem stamping PDF after migration from PDF.Kit

$
0
0

We have migrated our application from Aspose.PDF.Kit 4.7.0 (discontinued) to Aspose.PDF 9.1.0, in order to maintain the application updated. After some work, we managed to run almost all application functions correctly, but the ones related with stamping a PDF with text or images brakes at all.


The problem is that with version 4.7.0 all worked perfectly but with 9.1.0 all the stamps appears in different positions or moved, even reduced in size.


I attach two files: “bad_file.pdf”, generated with 9.1.0 version, and “good_file.pdf”, generated with 4.7.0 Pdf.kit version.


And an snippet of code used:


            // FILE NUMBER STAMP
            Stamp stamp;

            pdfFileStamp = new PdfFileStamp(dto.getInFolder() + dto.getInputName(), dto.getOutFolder() + dto.getOutputName());

            if (dto.isStampFileNumber()) {
                // VERTICAL PAGES
                Stamp stamp = new Stamp();
                stamp.bindLogo(new FormattedText(input, new Color(0, 51, 102), font, EncodingType.Winansi, false, fontSize));
                stamp.setOrigin(PdfStampCon.logo_vert_pos_x, PdfStampCon.logo_vert_pos_y);
                stamp.setRotation(90);
                stamp.setPages(vertPages);
                pdfFileStamp.addStamp(stamp);
               
            }

Problem stamping PDF after migration from PDF.Kit

$
0
0
We have migrated our application from Aspose.PDF.Kit 4.7.0 (discontinued) to Aspose.PDF 9.1.0, in order to maintain the application updated. After some work, we managed to run almost all application functions correctly, but the ones related with stamping a PDF with text or images brakes at all.


The problem is that with version 4.7.0 all worked perfectly but with 9.1.0 all the stamps appears in different positions or moved, even reduced in size.


I attach two files: “bad_file.pdf”, generated with 9.1.0 version, and “good_file.pdf”, generated with 4.7.0 Pdf.kit version. Check both files to understand the problems I said.


And the code used is the following.

pdfFileStamp = new PdfFileStamp(dto.getInFolder() + dto.getInputName(), dto.getOutFolder() + dto.getOutputName());

Stamp stamp = new Stamp();
stamp.bindLogo(new FormattedText(input, new Color(0, 51, 102), font, EncodingType.Winansi, false, fontSize));
stamp.setOrigin(PdfStampCon.logo_vert_pos_x, PdfStampCon.logo_vert_pos_y);
stamp.setRotation(90);
stamp.setPages(listPages);
pdfFileStamp.addStamp(stamp);


PS: Please delete the previous post because seems deleted or corrupted...

PDF convert to HTML - some words overlap

$
0
0
Hello,

We are evaluating Aspose.pdf/kit (we already license Aspose.Words for Java for a long time now). The primary thing we're interested in is converting PDF docs to HTML format (text only).

I downloaded aspose-pdf-kit-4.6.1-java and gave it a try. The resulting HTML doc contains the text very nicely formatted, but there are numerous places where the end of one phrase overlaps the beginning of the next phrase. The original PDF doc and the resulting HTML doc are attached. You can see the occurrences starting at the top of the HTML doc with the phone number overlapping the following word 'Email', and then the first bullet under Summary has 'Java' and 'J2EE' overlapping, etc. Looking at the HTML source it seems that the absolute left positioning of the phrases may not be correct in some cases.

Will this problem be fixed?
When will it be fixed?

My test code is below.

Thanks in advance-
Becky McElroy
______________________

    public static void main(String[] args)
    {
        if (args.length < 1)
        {
            System.out.println("Enter arg: path to pdf file");
            System.exit(1);
        }

        try
        {
            // /create PdfExtractor object
            PdfExtractor extractor = new PdfExtractor();

            // bind input pDF file
            File f = new File(args[0]);
            extractor.bindPdf(new FileInputStream(f));

            // extract text
            extractor.extractText();

            // save extracted text as HTML
            extractor.extractTextAsHTML(args[0].substring(0, args[0].length() - 3) + "html");

            // close PdfExtractor object
            extractor.close();
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }

Viewing all 3131 articles
Browse latest View live