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

Signing with cetificate from certificate store and not from pfx-file

$
0
0

Hi,

we want to sign PDFs with Aspose.Pdf and have the following requirements:

1. We have no pfx-file, the certificate is stored in the local certificate store  StoreLocation.LocalMachine
2. The private key in the store is marked as "non exportable" (therefore we can't export the cert as pfx)

Is this possible with Aspose.Pdf?

In earlier versions of Aspose.Pdf.Kit it was possible to use the following overload which takes the subject of the cert in the store:
public class Pkcs7Signature : Signature
{
   public Pkcs7Signature(string subject);
}

In the constructor overloads from Aspose.Pdfs PKCS7 i can not find anymore this possibility.

Thanks
Thomas Thier


About license compatibility (Aspose.Pdf.Net)

$
0
0

Hi,

Since Aspose.Pdf.Kit for .NET was discontinued from 1st October, 2011, and the features of Aspose.Pdf.Kit for .NET are incorporated into Aspose.Pdf for .NET. I wonder whether the license of Aspose.Pdf.NET could be compatible with the existing Aspose.Pdf.Kit for .NET (The condition is-We still use Aspose.Pdf.Kit for .NET and user the new license of Aspose.Pdf.NET)? Thank you.

Software Information:
Aspose.Pdf.Kit (6.0.0.0)
Version: 2011.09.27

Multiple Form fields from Textboxes

$
0
0

Hi All,

I have just purchased Aspose.PDF. I am using VB.net and am starting to get my head around Aspose.    I have managed to write a VB.net piece of code to have Aspose.PDF replace a textbox (textbox1 with a formfield). 

 Now I am attempting to have Aspose replace multiple text boxes (textbox1, textbox2, ... textbox_20) with form fields via a loop in the code.  I am including a copy of the PDF (TestAccountsInput.PDF) which contains three textboxes (in red).  In case it helps I am also including the VB code wherein the top section works fine and allows me to replace a named textbox with a formfield, and the bottom section where I am trying to figure out how to get a loop to work and replace a number of textboxes.

In case it makes any difference I am using an application to scroll through a database,  extract the various amounts shown in the demo, and then via a call to Crystal Reports create the static data PDF file.  Once created I need to call the Aspose.PDF classes to insert the form fields.

Thanks for the assist

Yours

Michael O'Rourke

 

Problems with borders in tables

$
0
0
I'm new to Aspose, so i apologise if i've missed something obvious.

I creating a data table with a number of rows, however I'm having problems with the table stretching across multiple pages and messing up the cell borders.

This snippet of java code can be used to reproduce the problem:

    public static void main(String[] args) throws Exception {
        Pdf pdf = new Pdf();
        Section s = new Section();
        pdf.getSections().add(s);
        s.isLandscape(true);

        Table table = new Table(s);

        //Set default cell border using BorderInfo object
        table.setDefaultCellBorder(new BorderInfo(BorderSide.All, 0.1F));

        //Set table border using another customized BorderInfo object
        table.setBorder(new BorderInfo(BorderSide.All, 1F));

        //Create MarginInfo object and set its left, bottom, right and top margins
        MarginInfo margin = new MarginInfo();

        margin.setLeft(5f);
        margin.setRight(5f);
        margin.setTop(5f);
        margin.setBottom(5f);

        //Set the default cell padding to the MarginInfo object
        table.setDefaultCellPadding(margin);

        for (int i = 0; i< 100; i++) {
            Row r = table.getRows().add();
            r.getCells().add(i + "-1");
            r.getCells().add(i + "-2");
            r.getCells().add(i + "-3");
        }

        s.getParagraphs().add(table);


        System.out.println("123");
        pdf.save("C:\\temp\\" + System.currentTimeMillis() + ".pdf");
    }

For info we're using version 4.5.0 of the aspose-pdf.jar

Set default open options for new PDF

$
0
0
I am creating a new pdf from a collection of existing files and setting the bookmarks on the new file using the Outlines collection on a pdf.Document object.

I want to make sure that the resulting PDF file will always open at the first page with the bookmarks list shown.   I would also like the first top level bookmark to be expanded.

I can find some posts in this forum about setting up the document this way, but I wondered if there was a way to do this using the pdf.document object that I already have open ?

Thanks
Fiona Treveil

Maintain PDF/A after modifying PDF file

$
0
0

Hello,

We had logged an issue previously where modifying a PDF with PDF/A validation using Aspose was removing the PDF/A validation. This was issue PDFNEWNET-33379. We recently upgraded to Aspose.Cell 8.6.0.0 and the issue appears to have returned. Can you please confirm the bug has returned and let us know if a fix is scheduled?

 

Thank you,

Kim

PDF to PDF/A format

$
0
0

Hi Please let me know whether there is any update on PDF to PDF/A format convertion.

 

Thanks

convert pdf to doc or docx

$
0
0

Hello,

I try to convert a pdf file to doc or docx.
I use VS 2010, W7, aspose.pdf for .NET 8.8.0 and Aspose.Words for .NET 13.12.0

I used your code example with a searchable pdf file ('Convert PDF file to DOC or DOCX format')
I always get a word file with only an image of the pdf file.

Is there a way to get characters instead of an image of the text.?

Thank you for your response

 


Color detection wrong for PDF with track changes text

$
0
0
I have a PDF that was created with Adobe Distiller from a Word document that had track changes enabled.  When viewing this PDF it is clear that there is red text on the page, but Aspose.Pdf reports the page ColorType as BlackAndWhite.

Can you investigate why this is not detected as a color page?

Example attached.

htm to pdf conversion

$
0
0
Hello, I am using aspose.pdf and have successfully converted an htm file to a pdf, however, the dropdowns are not translating properly. Can you please help?
This message was posted using Banckle Live Chat 2 Forum

Discontinuing of Aspose.Pdf.Kit for java

$
0
0
Hi All,

No sure who can answer this question.
I have a question about the discontinuing of Aspose.Pdf.Kit for java. If this is being discontinued, will we need to purchase the Aspose.Pdf for java to continue using the features in Aspose.Pdf.Kit for java or can we continue using Aspose.Pdf for java at the current version without upgrading.

Thanks

Exception "com.aspose.ms.charsets.iso_8859_1.CharsetProvider not found", Tomcat Embed

$
0
0
We're getting below Exception when running aspose.pdf inside "tomcat-embed". This occurs even when there's no specific aspose.pdf processing within the sinlge web request.

It seems that the file aspose.pdf.jar\META-INF\services\java.nio.charset.spi.CharsetProvider references an invalid/unknown charset provider named com.aspose.ms.charsets.iso_8859_1.CharsetProvider. We assume, that this is probably caused by the obfuscation process. The referenced class name is the public one, while the implementation is hidden by obfuscation?

-----------------------------------------

Environment:
- Maven based build/toolchain
- tomcat-embed: 7.0.32
- spring: 3.2.1.RELEASE
- hibernate: 4.1.7.Final
- aspose.pdf: 4.3
- aspose.words: 11.8.0

-----------------------------------------

Exception:

Fatal: Error reading request, ignored
java.util.ServiceConfigurationError: java.nio.charset.spi.CharsetProvider: Provider com.aspose.ms.charsets.iso_8859_1.CharsetProvider not found
at java.util.ServiceLoader.fail(ServiceLoader.java:231)
at java.util.ServiceLoader.access$400(ServiceLoader.java:181)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:367)
at java.util.ServiceLoader$1.next(ServiceLoader.java:438)
at java.nio.charset.Charset$1.getNext(Charset.java:357)
at java.nio.charset.Charset$1.hasNext(Charset.java:370)
at java.nio.charset.Charset$4.run(Charset.java:591)
at java.nio.charset.Charset$4.run(Charset.java:585)
at java.security.AccessController.doPrivileged(Native Method)
at java.nio.charset.Charset.availableCharsets(Charset.java:584)
at org.apache.tomcat.util.buf.B2CConverter.<clinit>(B2CConverter.java:57)
at org.apache.tomcat.util.buf.ByteChunk.<clinit>(ByteChunk.java:102)
at org.apache.tomcat.util.buf.MessageBytes.<init>(MessageBytes.java:58)
at org.apache.tomcat.util.buf.MessageBytes.<init>(MessageBytes.java:36)
at org.apache.tomcat.util.buf.MessageBytes$MessageBytesFactory.newInstance(MessageBytes.java:685)
at org.apache.tomcat.util.buf.MessageBytes.newInstance(MessageBytes.java:78)
at org.apache.coyote.Request.<init>(Request.java:83)
at org.apache.coyote.AbstractProcessor.<init>(AbstractProcessor.java:53)
at org.apache.coyote.http11.AbstractHttp11Processor.<init>(AbstractHttp11Processor.java:265)
at org.apache.coyote.http11.Http11Processor.<init>(Http11Processor.java:55)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.createProcessor(Http11Protocol.java:165)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.createProcessor(Http11Protocol.java:103)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:569)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

-----------------------------------------

There are some other posts describing similar problems in some other execution contexts and with UTF-7 CharsetProvider
- Provider com.aspose.ms.charsets.utf7.UTF7CharsetProvider not found
the cardme is crushed with your library
- Conflict with spring framework

Exception in com.aspose.ms.System.f?

$
0
0
Hello,
i try a small code snipplet from the examples to convert documents from pdf to pdf/a.
The documents  passed the validator, some of them where converted successfully and with others, i get an exception in "com.aspose.ms.System.f". I don't know why and what to do.
This is my code:
        boolean canConvert = pdfDocument.validate("Validation_log.xml", com.aspose.pdf.PdfFormat.PDF_A_1B);
        if (canConvert) {
            pdfDocument.convert("Conversion_log.xml", com.aspose.pdf.PdfFormat.PDF_A_1B, com.aspose.pdf.ConvertErrorAction.Delete);

'canConvert' was 'true' and Validation_log looks fine, but convert() fails:

Exception in thread "main" class com.aspose.ms.System.f: Specified argument was out of the range of valid values.
com.aspose.pdf.a.b.b.a.i.a(Unknown Source)
com.aspose.pdf.a.b.b.a.l.<init>(Unknown Source)
com.aspose.pdf.a.b.e.d.i.g(Unknown Source)
com.aspose.pdf.a.b.e.d.k.a(Unknown Source)
com.aspose.pdf.a.b.e.d.k.a(Unknown Source)
com.aspose.pdf.a.b.e.d.k.<init>(Unknown Source)
com.aspose.pdf.a.i.a.b.i(Unknown Source)
com.aspose.pdf.a.i.a.b.a(Unknown Source)
com.aspose.pdf.a.d.a(Unknown Source)
com.aspose.pdf.ADocument.convert(Unknown Source)
com.aspose.pdf.Document.convert(Unknown Source)
piag.test.ConvertPDFToPDFA.<init>(ConvertPDFToPDFA.java:39)

Any idea?

Thanks
-klaus

Edit: Now i tried with 4.4.0 and get following exception:

Exception in thread "main" class com.aspose.ms.System.e: Key cannot be null
Parameter name: key
com.aspose.ms.System.a.h.get_Item(Unknown Source)
com.aspose.pdf.a.c.e.b.f$a.a(Unknown Source)
com.aspose.pdf.a.f.a.a(Unknown Source) 

PDF Portfolio feature does not work

$
0
0
Hi,
We are evaluating Aspose PDF for Java specifically for the portfolio feature. 

Code used is almost same as the sample code in your web site. Only change is the constructor for the FileSpecification. Instead of using setDescription() method to set the file type, it is done in the FileSpecification constructor itself.

This runs successfully and creates the portfolio document. When I open the portfolio using Adobe Reader, all the files are listed in there with the correct sizes as well. However, I am not able to open some of the files in the portfolio. If I change the order in which files are added to the collection, I am not able to open a different set of files.     

Note that if I use the setDescription() method, I could open none of the files.

Appreciate your response on this issue as soon as possible as we won't be licensing this product if this feature does not work.

Thank you,
Ashok  

Code used:

import com.aspose.pdf.*;
public class PdfPortfolio
{
    public static void main(String[] args) throws Exception
    {
        try
        {
            //read the input file
            String inFile1 = "input1.pdf";
            String inFile2 = "Netsuite licensing breakdown.xls";
            String inFile3 = "IEEE Reference Architecture.doc";
            String inFile4 = "EA Mind Map.jpg";
            
            String outFile = "Portfolio_output.pdf";

//Instantiate Document Object
com.aspose.pdf.Document doc = new com.aspose.pdf.Document();
//Instantiate document Collection object
doc.setCollection(new com.aspose.pdf.Collection());

//Get Files to add to Portfolio
com.aspose.pdf.FileSpecification pdf1 = new com.aspose.pdf.FileSpecification(inFile1, "PDF File");
com.aspose.pdf.FileSpecification pdf2 = new com.aspose.pdf.FileSpecification(inFile2, "Excel File");
com.aspose.pdf.FileSpecification pdf3 = new com.aspose.pdf.FileSpecification(inFile3, "Word File");
com.aspose.pdf.FileSpecification pdf4 = new com.aspose.pdf.FileSpecification(inFile4, "Image File");

//Provide description of the files
//pdf1.setDescription("PDF File");
//pdf2.setDescription("Excel File");
//pdf3.setDescription("Word File");
//pdf4.setDescription("Image File");

//Add files to document collection
doc.getCollection().add(pdf1);
doc.getCollection().add(pdf2);
doc.getCollection().add(pdf3);
doc.getCollection().add(pdf4);
//Save Portfolio document
doc.save(outFile);

            // Display result.
            System.out.println("PDF portfolio created successfully!");
        }
        catch (Exception ex)
        {
            System.out.println(ex.getMessage());
        }
    }
}




PDF to JPEG

$
0
0

Hi,

I'm having this exception using the JPEG device while converting PDF to JPEG images:

com.aspose.ms.System.ab: Object not found
 at com.aspose.pdf.a.a.d.a(Unknown Source)
 at com.aspose.pdf.a.a.d.a(Unknown Source)
 at com.aspose.pdf.a.c.aa.K_(Unknown Source)
 at com.aspose.pdf.a.c.aa.E(Unknown Source)
 at com.aspose.pdf.a.c.aa.U(Unknown Source)
 at com.aspose.pdf.a.b.d.b.c.f.a(Unknown Source)
 at com.aspose.pdf.a.b.d.b.c.f.a(Unknown Source)
 at com.aspose.pdf.az.a(Unknown Source)
 at com.aspose.pdf.ImageDevice.a(Unknown Source)
 at com.aspose.pdf.JpegDevice.processInternal(Unknown Source)
 at com.aspose.pdf.PageDevice.process(Unknown Source)

I'm using the sample code below:

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(pdfFile);for (int pageCount = 1; pageCount <= pdfDocument.getPages().size(); pageCount++)
{
    java.io.OutputStream imageStream = new java.io.FileOutputStream("Converted_Image" + pageCount + ".jpg");


    com.aspose.pdf.Resolution resolution = new com.aspose.pdf.Resolution(300);
    com.aspose.pdf.JpegDevice jpegDevice = new com.aspose.pdf.JpegDevice(resolution, 100);
    jpegDevice.process(pdfDocument.getPages().get_Item(pageCount), imageStream);

    imageStream.close();
}

Please find attached the file that I'm trying to convert.

Thank you in advance.

 


Chinese display incorrectly

$
0
0
Hello,

I created a program which replace some word to Chinese word. It work fine on my desktop (Win 7). But when it run on another computer (Win Server 2003), PDF will display totally different Chinese word (I view both PDF in Win 7). 

Here is my code snippet:

byte[] byteTemplate = File.ReadAllBytes("test.pdf");
MemoryStream ms = new MemoryStream(byteTemplate);
Aspose.Pdf.Document pdfDoc = null;
pdfDoc = new Aspose.Pdf.Document(ms);

string[,] temp = new string[,] { { "[TEMP_ENG]", "Hello!" }, { "[TEMP_CHI]", "你好!" } };

if (pdfDoc != null)
{
for (int i = 0; i <= temp.GetUpperBound(0); i++)
{
Aspose.Pdf.Text.TextFragmentAbsorber textFragmentAbsorber = new Aspose.Pdf.Text.TextFragmentAbsorber(temp[i, 0]);
pdfDoc.Pages.Accept(textFragmentAbsorber);

Aspose.Pdf.Text.TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;
foreach (Aspose.Pdf.Text.TextFragment textFragment in textFragmentCollection)
{
textFragment.Text = temp[i, 1];
}
}
}

pdfDoc.Flatten();

System.IO.MemoryStream pdfStream = new System.IO.MemoryStream();
pdfDoc.Save(pdfStream);
byte[] resultFile = new byte[pdfStream.Length];

pdfStream.Seek(0, System.IO.SeekOrigin.Begin);
pdfStream.Read(resultFile, 0, (int)pdfStream.Length);
pdfStream.Close();

string fileName = DateTime.Now.ToString("hhmmss") + ".pdf";
File.WriteAllBytes(fileName, resultFile);

ms.Close();

If the program is run on Win 7, correct word ("你好!") shows in PDF. But if the program is run on Win Server 2003, correct word ("你好!") displays as other Chinese word ("㬢圄"). The strange thing is if I select wrong Chinese word ("㬢圄") and copy and paste in Notepad, correct Chinese ("你好!") is shown in Notepad.

Is there something wrong in my program? Or some font is missing in Win Server 2003? 

Thanks!

Evaluation watermark with Aspose.Total Enterprise edition license

$
0
0
Hi.

We use Aspose.Total Enterprise edition license for our project.
On a production side all goes well and documents converted as expected. 
But on the test environment and locally the files converted with the watermark "Evaluation only.Created with Aspose.Pdf.Copyrifght 2002-2013 Aspose Pty Ltd.".
I have doublecheck Aspose.lic file and all looks good : 
- the version of Aspose.pdf is released before expiry date; 
- this is the same file that lay on production side.

What could be the problem? 

Thanks in advance, Eugene.

pdf->html without external img/font etc. files

$
0
0
Hi, I'm looking for a way to convert pdf to html with embedded images / fonts / css. My pdfs are rather simplistic, text & tables type of things, where I we use their (x)html representation in web services federation exchanges. Managing cross service file locations and refs is rather impractical. Tried different options in your API, but invariably external files are written. Is there such option? Regards, Gino

System.IO.IOException: Read pdf error:Trailer object is null.: v4.6.0.0

$
0
0
Creating a PDF, I have a function that Adds a Footer below, at the bolded line, I am getting the error:
System.IO.IOException: Read pdf error:Trailer object is null.: v4.6.0.0

Any ideas what can be causing this?  Very time sensitive issue as this is on our production server.  Thank you.

Public Sub AddFooter(ByVal strFileIn As FileStream)
        Dim strFileOut As FileStream = strFileIn ' Output file can't be nothing, so I assign it a value to be overwritten.

        Dim txt As New FormattedText()

        'TODO: If possible, replace text with image to get the superscript "SM" in place.
        ' Footer FormattedText Object
        Dim ft As New FormattedText("AgendaManager – Powered by the CAIU", _
                                    System.Drawing.Color.FromArgb(255, 207, 207, 207), _
                                    Kit.FontStyle.HelveticaBold, _
                                    EncodingType.Winansi, _
                                    True, _
                                    10)

        ' PdfFileStamp type object
        Dim filestamp As New PdfFileStamp(strFileIn, strFileOut)

        filestamp.AddFooter(ft, 44, 0, 72)

        filestamp.Close()
        strFileIn.Close()
        strFileOut.Close()

    End Sub

Font source could not be loaded issue

$
0
0
Hello Aspose Team,
We have been usign the following lines of code,
  if(null==pdf){
               pdf = new Pdf();
            }
            if(null==pageSetUp){
                pageSetUp = new PageSetup();
                pageSetUp.setPageWidth(PDFGenConstants.pageWidth);
                pageSetUp.setPageHeight(PDFGenConstants.pageHeight);
               
            }
            for(int i=1;i<=totalPage;i++){
                pdf.getSections().add().setPageInfo(pageSetUp);
            }
            pdf.save(tempPdfFileName);

When the control comes to the line pdf.save we are gettign the following exception,

Font source could not be opened: /usr/X11R6/lib/X11/fonts/truetype/msttcorefonts/

It was working when we deployed our EAR in windows machine.
But when move to a sever environment in Linux we are getting this exception. Please get this issue resolved.
We have got with a show stopper issue due to this, as pdf could not be generated.

Thanks,
Ashok

Viewing all 3131 articles
Browse latest View live