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

Aspose.PDF call to JpegDevice.Process() is slow for large PDF files

$
0
0
I am experiencing poor performance when converting a large PDF to JPEG using JpegDevice.Process().

A PDF file with 145 pages @ 140MB takes around 10 minutes to convert all the pages to JPEG.
This is when using Aspose.PDF 7.6.0.0.

Is there anything I can do to improve performance of the call to JpegDevice.Process() for large files?

Html conversion (nowrap?) issue

$
0
0

Hi,

We've been trying to convert some htm pages to PDF, but I think the pages don't get converted properly. Could you help to clarify whether this is existing issue, or only exist in the trial version? I've tried to search similar keywords, it seems that they should have been fixed in the earlier version.

There is suggestion to use Aspose Words from the forum. However, it still doesn't work as intended although the result is better compared to Aspose PDF result.

Attached is the sample of the htm code. (or can just refer below..)

 <table width="100%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td valign="middle" align="left" class="form_label_normal" style="width: 98%;"
                           >
                        </td>
                        <td valign="middle" align="left" style="width: 2%;white-space:nowrap" class="form_label_normal">
                            <span id="ctl00_cphMain_lblAddress1" style="font-family:Arial;font-size: 9pt;">55 Raffless Road</span>
                        </td>
                    </tr>
                    <tr>
                        <td valign="middle" align="left" class="form_label_normal" style="font-family:Arial; font-size:10pt;">
                            <span id="ctl00_cphMain_lblDate" style="font-family:Arial;font-size: 9pt;">25/05/2010</span>
                        </td>
                     
                        <td valign="middle" align="left" style="height: 20px;white-space:nowrap;" class="form_label_normal">
                            <span id="ctl00_cphMain_lblAddress2" style="font-family:Arial;font-size: 9pt;">Excellent House</span>
                        </td>
                    </tr>
                    <tr>
                        <td valign="middle" align="left" class="form_label_normal">
                       
                        </td>
                        <td valign="middle" align="left" style="height: 20px;white-space:nowrap;" class="form_label_normal">
                            <span id="ctl00_cphMain_lblAddress3" style="font-family:Arial;font-size: 9pt;">Singapore 101917</span>
                        </td>
                    </tr>               
  
                </table>

Thanks!

Aspose pdf, looping through textFragmentCollection stop before finishing

$
0
0
Dears,

We are using aspose pdf 4.6.0 to loop over all the text of a pdf file in order to get the coordinates of each word,

We are using this code:

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(filePath);
com.aspose.pdf.TextFragmentAbsorber textFragmentAbsorber = new com.aspose.pdf.TextFragmentAbsorber();

pdfDocument.getPages().accept(textFragmentAbsorber);
 // get the extracted text fragments into collection
 com.aspose.pdf.TextFragmentCollection textFragmentCollection = textFragmentAbsorber.getTextFragments();

 for (com.aspose.pdf.TextFragment textFragment : (Iterable<com.aspose.pdf.TextFragment>) textFragmentCollection)
{
         TextSegmentCollection textSegmentCollection = textFragment.getSegments();
          for (com.aspose.pdf.TextSegment textSegment : (Iterable<com.aspose.pdf.TextSegment>) textSegmentCollection) {
            if (!textSegment.getText().trim().equalsIgnoreCase("")) {
                     //do work here
             }
        }
}

While debuging, i can see that there is for example 64 fragments, but it only enter in the loop 5 times then exit the loop without exception,
The pdf file which i am using is attached,

Thank you

Empty PDF produced with Aspose.Pdf 9.0

$
0
0
HI,

I'm using the following code and image to create a PDF from a TIFF file. 
In the result I get an empty (0kb) file. Please help.


File file = new File("path.tiff");
File pdfFile = File.createTempFile("renderer_", ".pdf");
//Instantiate Pdf instance by calling its empty constructor
Pdf pdf1 = new Pdf();
//Create a new section in the Pdf object
Section sec1 = pdf1.getSections().add();
//Create an image object in the section
Image image = new aspose.pdf.Image(sec1);
//Add image object into the Paragraphs collection of the section
sec1.getParagraphs().add(image);
//Set the ImageStream information
image.getImageInfo().setSystemImage(ImageIO.read(file));
// set the value that all frames of tiff image need be added into PDF document
image.getImageInfo().setTiffFrame(-1);
//Save the pdf document
pdf1.save(pdfFile.getAbsolutePath());


It works fine for other image formats with the code provided on the sample page below:
http://www.aspose.com/docs/display/pdfjava/How+to+Convert+an+Image+to+PDF
Thanks,
Mariusz

Aspose is throwing exception on PDFPageDestination

$
0
0
After evaluating properties in PDFPageDestination for the 1st Link Annotation in the attached document, Aspose is throwing an exception of:  The destination of GoToAction must refer to page object not page number.  This should not cause an exception problem as its this document is correctly rendered in Adobe Acrobat.

Brent


Aspose.Pdf for Reporting Services works in a SQLServer Express with SSRS?

$
0
0
I am trying to do a concept test using Aspose.PDF for Reporting Services.  The issue I want to cover is the lack of full text justifying on SSRS.  I found that your product can export to PDF having the text full aligned.  Due to this, I downloaded and run the installer and msi but checking rsreportserver.config I didn't find any entry for Aspose.  I added this manually but still I don't see the Aspose PDF option when exporting the report.

Extracting original image data

$
0
0
I am using Aspose.PDF to extract images from a PDF file. The PDF file contains a bunch of images in JPG format (that is, they are encoded in the PDF file with the /Filter /DCTDecode option, after which comes the actual JPG data).

I've tried the Save method of the xImage object, and I've tried the GetNextImage method of the PdfExtractor object (see below). However, in both cases, the resulting JPG file is somewhat smaller than the original data encoded in the file. It is clear that Aspose is *recompressing* the data before it saves it as a JPG.

Instead, I'd like to access the *actual* JPG data, just as it appears within the PDF file. How can I get the actual JPG data for a given xImage object?

Here are the methods that I tried (unsuccessfully): 

1] 
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(args[1]);
// traverse through individual pages of PDF file
for (int pageCount = 1; pageCount <= pdfDocument.Pages.Count; pageCount++) {
// traverse through each image extracted from PDF pages
foreach (XImage xImage in pdfDocument.Pages[pageCount].Resources.Images) {

string savefilename = "image-" + pageCount + ".jpg";
FileStream fs = new FileStream(savefilename, FileMode.CreateNew);

//save output image
xImage.Save(fs);
}
}

2] 
PdfExtractor extractor = new PdfExtractor();
extractor.BindPdf(args[1]);
extractor.ExtractImage();
int i = 1;
while (extractor.HasNextImage()) {
Console.WriteLine("Getting image number " + i);
extractor.GetNextImage("image-" + i + ".jpg");
i++;
}

Note: I tried also specifying ImageFormat.Jpeg, but to no avail; I still receive a smalled, recompressed image. Instead, I'd like to be able to access the actual image data as stored in the PDF file, and to then write that out as a file.

Open, set UserPassword, Close -> invalid document

$
0
0
The code is very straightforward, the resulting file cannot be opened in Acrobat Reader, the document is not a valid pdf (there was an error processing the page).

        static void Main(string[] args)
        {
            Stream stream = new FileStream(@"C:\Documents and Settings\Administrator\My Documents\Bosch Crailsheim 20091202.pdf", FileMode.Open);
            Pdf pdf = new Pdf(stream);
            
            pdf.Security = new Security {UserPassword = "1234"};
            stream =
                new FileStream(
                    @"C:\Documents and Settings\Administrator\My Documents\Bosch Crailsheim 20091202 secure.pdf",
                    FileMode.OpenOrCreate);
            //pdf.Save(stream);
            pdf.Close();
            stream.Close();
        }


while merging two pdf document with bookmarks iam getting error

$
0
0
Hi,
while merging two pdf document with bookmarks  i am getting below error,the related code mentioned below

"Object can't be modified in this Registar. Use Export (recursive) and then try again.
"
Code:

        Aspose.Pdf.Document pdfDocument11 = new Aspose.Pdf.Document( "R3.pdf");
        //open second document
        Aspose.Pdf.Document pdfDocument2 = new Aspose.Pdf.Document( "R33.pdf");

        pdfDocument11.Pages.Add(pdfDocument2.Pages);
        foreach (OutlineItemCollection item in pdfDocument2.Outlines)
            pdfDocument11.Outlines.Add(item);
        pdfDocument11.Save( "R33output.pdf"); 


Merge entire XML data with XFA form - not field by field!

$
0
0

We have 1000's of interactive XFA based forms created with Adobe LiveCycle Forms Designer. They all have XML schemas associated with them. We also have Reader Extensions. We are attempting to avoid buy the LiveCycle server just to pre-populate forms.

I need to be able to merge XML data with each form in an efficient and generic manner. For example I would like to create a web service with two input parameters:

Parameter #1 - the name or path to the XFA form

Parameter #2 - the XML data or path to the XML data file

Return = a prepopulated PDF document.

I was able to achieve this within in a 90 minutes of downloading iText; having never heard of iText. Luckily for you we already own Aspose products and I'm being forced to use it.

A Java and .NET code sample to achieve this would be appreciated. I'm a Java guy but my colleagues are .NET. 

XLS to PDF needs to zoom to 800% for proper displaying

$
0
0

We receive excel xls files from our partners and clients that contain many columns and some may be merged. When converting these xls file to pdf the image is incredibly small and we must zoom to 800% to see the pdf in normal size.

Is this a convert setting that we should be using to get this to convert properly?

 

I can not share the XLS file since it contains confidential information.

 

thanks,

Sal

Saving back to the same PDF

$
0
0

I've tried this in Java:

publicstaticvoid fillForm(String pdf, String data){

 

try {

InputStream xmlInputStream = new FileInputStream(data);

Form myForm = new Form(pdf, pdf) ;//make the source and target the same

myForm.importXml(xmlInputStream);

xmlInputStream.close();

myForm.save();

 

}

catch (IOException e) {

  e.printStackTrace();

  }

 

 

and it fails with the following:

 

 

 

 

Exception in thread "main" com.aspose.pdf.exceptions.InvalidPdfFileFormatException: Incorect file format

at com.aspose.pdf.internal.pt.f.a(Unknown Source)

at com.aspose.pdf.internal.ok.y$a.a(Unknown Source)

at com.aspose.pdf.internal.ps.h.a(Unknown Source)

at com.aspose.pdf.internal.po.q.<init>(Unknown Source)

at com.aspose.pdf.internal.po.q.<init>(Unknown Source)

at com.aspose.pdf.internal.oo.b.ba(Unknown Source)

at com.aspose.pdf.internal.po.p.<init>(Unknown Source)

at com.aspose.pdf.internal.oo.b.be(Unknown Source)

at com.aspose.pdf.internal.ml.f.aT(Unknown Source)

at com.aspose.pdf.internal.ml.f.<init>(Unknown Source)

at com.aspose.pdf.ADocument.g(Unknown Source)

at com.aspose.pdf.ADocument.<init>(Unknown Source)

at com.aspose.pdf.Document.<init>(Unknown Source)

at com.aspose.pdf.facades.Facade.v(Unknown Source)

at com.aspose.pdf.facades.Facade.bx(Unknown Source)

at com.aspose.pdf.facades.AForm.<init>(Unknown Source)

at com.aspose.pdf.facades.Form.<init>(Unknown Source)

at com.aspose.AsposeTest.fillForm(

AsposeTest.java:27 at com.aspose.AsposeTest.main()

AsposeTest.java:15) Exception in thread "main"

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

preserving bookmark using Aspose for java

$
0
0
Hi,

I am trying to merge two pdf files and I want to preserve the bookmarks for them. I tried the following code but it does not display the level 2(child) bookmarks and when I click on the bookmark it does not navigate me to the original page. I also wanted to know will the aspose preserve any bookmarks for pdf attachments.

OutlineCollection bms = pdfDocument.getOutlines();
        for (Iterator<OutlineItemCollection> it = bms.iterator(); it.hasNext();) {
           
            OutlineItemCollection outlineItem = it.next() ;
            OutlineItemCollection pdfOutline = new OutlineItemCollection(pdfDocument.getOutlines());
           
            pdfOutline.setTitle(outlineItem.getTitle());
            pdfOutline.setItalic(false);
            pdfOutline.setBold(false);

            GoToAction goToAction = (GoToAction) outlineItem.getAction();
            // Set the destination page number I have also used passing the goToAction in the below //line but it does not create the bookmark links.
            pdfOutline.setAction((GoToAction) outlineItem.getDestination());
           
            pdfDocument.getOutlines().add(pdfOutline);
           
        }

Any help will be appreciated.

Thanks

PDF license not being accepted

$
0
0
I am using aspose words and pdf in the same application, deployed on tomcat.  I am placing both the words and pdf jar files in tomcat/lib directory, with the license there as well.  The words license is accepted, the pdf license is not.  Here is the top part of the stack trace:

11:02:42,050 ERROR [com.r5.alliant.alf.repo.actions.NameAndVersionFooterActionExecutor] ERROR SETTING ASPOSE LICENSE!!
class com.aspose.pdf.internal.hv.dw: Invalid URI: The URI scheme is not valid.
com.aspose.pdf.internal.hv.dr.N(Unknown Source)
com.aspose.pdf.internal.hv.dr.a(Unknown Source)
com.aspose.pdf.internal.hv.dr.<init>(Unknown Source)
com.aspose.pdf.internal.hv.dr.<init>(Unknown Source)
aspose.pdf.internal.al.c(Unknown Source)
aspose.pdf.internal.al.a(Unknown Source)
aspose.pdf.a.setLicense(Unknown Source)
com.aspose.pdf.License.setLicense(Unknown Source)
com.r5.alliant.alf.repo.actions.NameAndVersionFooterActionExecutor.setupAspose(NameAndVersionFooterActionExecutor.java:136)


I am using the following code to set the licenses (lic is just the words license file):

            License lic = new License();
            lic.setLicense("Aspose.Total.Java.lic");
            log.warn("Success setting license for aspose words component");
            com.aspose.pdf.License pdfLic = new com.aspose.pdf.License();
            pdfLic.setLicense("Aspose.Total.Java.lic");
            log.warn("Success setting license for aspose pdf component");

Any help would be appreciated.

Loosing Borkmars while merging pdfs

$
0
0
Hi,

We are trying to replace a different product jar file with aspose and we are left with just one item that is bookmarks - creating and preserving them but when I am using the following code to add bookmarks to an existing pdf file. The issue is it creates a parent bookmark as bookmark 0 but only creates 2 child as child bookmark 2 and 3. Below is the image how it is creating.



com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("C:\\documents\\testdata\\GI_3a8b4e21-2063-40ec-8b6c-7daa2bfc2fac.pdf");
       
        PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor();
        bookmarkEditor.bindPdf(pdfDocument);

        com.aspose.pdf.OutlineItemCollection parentOutline = new com.aspose.pdf.OutlineItemCollection(pdfDocument.getOutlines());
        // Extract bookmarks
        Bookmarks bookmarks = bookmarkEditor.extractBookmarks();
        com.aspose.pdf.facades.Bookmarks childList = new com.aspose.pdf.facades.Bookmarks();
       
        for(int i = 0; i < 3; i++)
        {
            Bookmark bookMark = new Bookmark();
           
            bookMark.setPageNumber(i);
            bookMark.setTitle("Parent Bookmark " + i);
            bookMark.setLevel(1);
           
            for (int j = 0; j < 4; j++)
            {   
                com.aspose.pdf.facades.Bookmark bookmark2 = new     com.aspose.pdf.facades.Bookmark();
                bookmark2.setPageNumber(1);
                bookmark2.setTitle("child bookmark " + j);
                bookmark2.setLevel(2);
               
                childList.add(bookmark2);
            }
           
            bookMark.setChildItem(childList);
       
            bookmarkEditor.createBookmarks(bookMark);
        }
       
        bookmarkEditor.save("C:\\users\\mathurrk\\bookEdit.pdf");

Thanks in advance.

Can Aspose.PDF generate WCAG accessible PDF files

SSRS Preview

$
0
0
Hello

after installing Aspose.PDF on a SQL Server 2012 VM everything seemed to be alright at first.

Before referencing the Aspose.dll it is no longer possible to preview a report:
microsoft.reportingservices.processingcore could not be loaded .. the located assembly's manifest file does not match the assembly reference

If we check the manually install explanation everything is fine except the last step, nr 5, where you can find the different rendering modes, Aspose is not listed.

After uninstalling Aspose the preview modus in Visual Studio works fine again.
Can you no longer preview reports or could there be a version conflict?


It was still possible to deploy the report and it could be viewed via the browser.
The reason for using Aspose.pdf is the solution you have for justifying text.


thanks.

unable to generate pdf

$
0
0
hi all,
i am using aspose licence, am getting following exception at the time of pdf generation,

java.io.IOException: PDF header signature error.

11:02:26,692 ERROR [stderr] (http--127.0.0.1-8080-10) at com.aspose.pdf.kit.lf.k(Unknown Source)

11:02:26,695 ERROR [stderr] (http--127.0.0.1-8080-10) at com.aspose.pdf.kit.oq.a(Unknown Source)

11:02:26,697 ERROR [stderr] (http--127.0.0.1-8080-10) at com.aspose.pdf.kit.oq.<init>(Unknown Source)

11:02:26,699 ERROR [stderr] (http--127.0.0.1-8080-10) at com.aspose.pdf.kit.oq.<init>(Unknown Source)

11:02:26,700 ERROR [stderr] (http--127.0.0.1-8080-10) at com.aspose.pdf.kit.n.b(Unknown Source)

11:02:26,703 ERROR [stderr] (http--127.0.0.1-8080-10) at com.aspose.pdf.kit.PdfContentEditor.save(Unknown Source) 


plz help.

Aspose PDF and Aspose PDF Kit

$
0
0
Currently i am using Aspose PDF for Java 3.2.0 and Aspose PDF Kit for Java 4.3.0.
But now, both these versions have been merged and the latest version is Aspose PDF for Java 9.1.0
If i purchase Aspose PDF for Java 9.1.0, do i have to make changes in my existing code ?
To upgrade to the latest version what changes will be required ?

pdf bookmarks list count not getting accurately

$
0
0
Hi,

The pdf bookmarks count is not getting accurately.
my code and sample pdf file mentioned Here

 PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor();
        //open PDF file
        bookmarkEditor.BindPdf("outputwb3344.pdf"));
        //extract bookmarks
        Aspose.Pdf.Facades.Bookmarks bookmarks = bookmarkEditor.ExtractBookmarks();
        foreach (Aspose.Pdf.Facades.Bookmark bookmark in bookmarks)
        {
            string strLevelSeprator = string.Empty;
            for (int i = 1; i < bookmark.Level; i++)
            {
                strLevelSeprator += "----";
            }

            Response.Output.Write("{0}Title: {1}", strLevelSeprator, bookmark.Title);
            Response.Output.Write("{0}Page Number: {1}", strLevelSeprator, bookmark.PageNumber);
            Response.Output.Write("{0}Page Action: {1}<br/>", strLevelSeprator, bookmark.Action);
        }
        



Viewing all 3131 articles
Browse latest View live