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

Extra font in PDF/A-2b conversion

$
0
0
Dear Aspose Team,

Aspose.Pdf for Java 11.1.0 seems to have introduced a font problem not present in 11.0.0. Converting the attached PDF file (test0018) to PDF/A-2b using

com.aspose.pdf.Document.convert(PdfFormat.PDF_A_2B, ConvertErrorAction.Delete)

seems to introduce a font not present in the original file. The extra font is

TimesNewRoman (Embedded)
Type: TrueType (CID)
Encoding: Identity-H

and it seems to cause problems in e.g. Adobe Reader. The resulting PDF/A-2b document contains at least clear text overlapping and strange spacing at the end of several lines.

Could you please check the behavior of the new Aspose.Pdf release.

Heikki Tuominen


Aspose.Pdf.Document.Flatten() throws "Object reference not set to an instance of an object." exception

$
0
0
When using attached pdf in conjunction with any other pdf file(s), Flatten() throws object reference exception. Why can't Aspose.Pdf handle flattening of that particular pdf?

Please let us know if you can provide a fix for this issue.

For reference, we are using Aspose.Pdf version 10.8 and here is our source code.

                var finalDoc = new Aspose.Pdf.Document();

                foreach (var fileInfo in fileInfos)
                {
                    var file = fileInfo.FullName;
                    if (isEmailSign)
                    {
                        if (File.Exists(file + ".unsecure"))
                        {
                            File.Delete(file);
                            File.Move(file + ".unsecure", file);
                        }
                    }
                        
                    var tmpDoc = new Aspose.Pdf.Document(file);
                    finalDoc.Pages.Add(tmpDoc.Pages);
                        
                }

                finalDoc.Flatten();
                finalDoc.Save(outputFilename);

Merging PDFs if one Secured

$
0
0
We have a process that merges many pdfs. In one case we get an error because one of the pdfs is secured with a password and doesn't allow assembly, copying, or extraction. Is there a way that these pdfs can still be merged into the rest of the pdfs?

Signature invalid after signing a PDF created with Aspose.PDF

$
0
0
After signing a PDF that was created using Aspose.Pdf, it shows that the signature is invalid.

We use the following code to create the pdf (Note: We are rasterizing a PDF document into images and then creating a new PDF with those images).

We have tried using Aspose.Pdf v 10.6, 10.8 and 11. All give the signature invalid when opening the document in adobe reader.

I have attached the documents as well as screenshots.

The code we are using is below (Please use your own .pfx as the one in the sample is for production ): 

static void Main(string[] args)
        {
            try
            {
                string inputDocument = @"E:\Aspose\input.pdf";
                string OutputDirectory = @"E:\Aspose\";
                byte[] licenceBytes = File.ReadAllBytes(@"E:\Aspose\Aspose.Total.lic");
                MemoryStream msPdfLic = new MemoryStream(licenceBytes);
                Aspose.Pdf.License pdfLicense = new Aspose.Pdf.License();
                pdfLicense.SetLicense(msPdfLic);

                //1 - convert to images    
                byte[] inputPdf = File.ReadAllBytes(inputDocument);
                MemoryStream memStr = new MemoryStream(inputPdf);
                Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(memStr);
                List<byte[]> imagesCreated = new List<byte[]>();
                for (int pageCount = 1; pageCount <= pdfDocument.Pages.Count; pageCount++)
                {
                    MemoryStream imageStream = new MemoryStream();
                    Aspose.Pdf.Devices.Resolution resolution = new Aspose.Pdf.Devices.Resolution(150);
                    // where Quality [0-100], 100 is Maximum                       
                    Aspose.Pdf.Devices.JpegDevice jpegDevice = new Aspose.Pdf.Devices.JpegDevice(resolution, 100);
                    jpegDevice.Process(pdfDocument.Pages[pageCount], imageStream);
                    imagesCreated.Add(imageStream.ToArray());
                    imageStream.Close();
                }
                //1 - complete
                //2 - convert images to pdf
                Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
                foreach (byte[] imageBytes in imagesCreated)
                {
                    Page page = doc.Pages.Add();
                    MemoryStream imageStream = new MemoryStream(imageBytes);
                    page.PageInfo.Margin.Bottom = 0;
                    page.PageInfo.Margin.Top = 0;
                    page.PageInfo.Margin.Left = 0;
                    page.PageInfo.Margin.Right = 0;
                    using (System.Drawing.Bitmap myimage = new System.Drawing.Bitmap(imageStream))
                    {
                        page.PageInfo.Height = myimage.Height;
                        page.PageInfo.Width = myimage.Width;
                    }
                    Aspose.Pdf.Image image1 = new Aspose.Pdf.Image();
                    //Global.log.Debug("[ConvertImagesToPdf] - \tAdding image to page");
                    image1.ImageStream = imageStream;
                    page.Paragraphs.Add(image1);
                }
                MemoryStream ms = new MemoryStream();
                byte[] outputDocument = null;
                try
                {
                    doc.Save(ms);
                    outputDocument = ms.ToArray();
                }
                catch (Exception ex)
                {
                    Console.Out.WriteLine("Exception : " + ex.Message);
                }
                ms.Close();
                //saving rasterized Pdf for debug
                File.WriteAllBytes(OutputDirectory + "output_rasterized.pdf", outputDocument);
                //2 - complete

                //3 - sign
                using (Document document = new Document(OutputDirectory + "output_rasterized.pdf"))
                {
                    using (PdfFileSignature signature = new PdfFileSignature(document))
                    {
                        PKCS7 pkcs = new PKCS7(@"C:\certstore\GPAPI.pfx", "PasswordGoesHere"); // Use PKCS7/PKCS7Detached objects
                        DocMDPSignature docMdpSignature = new DocMDPSignature(pkcs, DocMDPAccessPermissions.FillingInForms);
                        System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 200, 100);                        
                        signature.Certify(1, "Signature Reason", "Contact", "Location", true, rect, docMdpSignature);
                        //save output PDF file
                        signature.Save(OutputDirectory + "output_signed.pdf");
                    }
                }
            }
            catch (Exception ex)
            {
                Console.Out.WriteLine("Exception : " + ex.Message);
            }
            Console.ReadLine();
        }



metadata removal on PDF results in blank PDF

$
0
0
Aspose.Pdf for .NET 9.9.0

The attached file, when processed to remove document properties, comes out blank.

If I resave the file as "optimized" using Acrobat Adobe Pro 9 it processes fine.

Can you inspect attached PDF and inform me what is wrong, if this is an issue you can fix, or if this is just a damaged PDF?

Thanks,
Kristen Theologus
Produce Specialist
BigHand Office

ExcelSaveOptions

$
0
0
is ExcelSaveOptions on aspose still exist? if exist what particular version #? 

Extract each field from PDF one by one

$
0
0
Hi team,

Please check the attached document. It contains a lot of information about employees that we would like to extract one by one. For example, I would like to get the Employee's Social Security number, Identification Number (EIN), Name, address and ZIP code, and other fields.

If I convert the document to Excel directly, it is extracting the data in various rows and columns that is not desirable.

Is there any way that I can extract each field from the PDF file one by one and store it in database? A quick response is highly appreciated about this.

Conversion from PDF to HTML using Avenir font returns blank document

$
0
0
Converting a PDF document in an Avenir font to HTML returns a blank document.

Do you have a resolution for this problem?

Regards, Janet


Adding page watermark and border in com.aspose.pdf classes

$
0
0
Hi,

I have the license for Aspose 11 and using com.aspose.pdf classes.

1 - I want to add page border and watermark to the page while creating the PDF and not stamping it later.

The watermark can be either Image or some text. The watermark is to be inserted in the center of page always, irrespective of the width of the image or the length of text.

2 - The PDF document that I am creating has some margin, Now i want to write some text at a absolute position in the margin while creating the PDF document and not stamp it later.

How do I do this ?

Merge fields problem

$
0
0
Hello,

I try to flatten fields from a pdf but all the text disappears. I use the following code :


public static void FlattenAllFields(string pdf) {

         using (Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form()) {

                 pdfForm.BindPdf(pdf);

                 if (pdfForm.FieldNames.Length > 0) {

                         pdfForm.FlattenAllFields();

                         pdfForm.Save(pdf);

                 }

         }

}

Best regards,

Cannot open the pdf using Adobe Reader 9.0.0 after watermarking with Aspose.PDF.Kit

$
0
0

Hi,

 

One of our clients not able to open pdf document using Adobe Reader v9.0.0 after water marking with Aspose.pdf.kit. The same document can be opened in Adobe 11.0.13.

Are there any known issues opening document with previous versions of Adobe Reader?

 

 

 

 

ASPOSE.PDF document printing pixelated

$
0
0
Good day

When printingPDFdocumentsAspose.Pdfoutpixelated.

Code:

com.aspose.pdf.Document docPdf;
docPdf = new Document(inputStream);
PdfViewer pdf;
  pdf = new PdfViewer(docPdf);
  pdf.setAutoRotate(true);
  pdf.setAutoResize(true);
  pdf.setPrintAsImage(true);
  pdf.setUseIntermidiateImage(false);
  pdf.setPrinterJobName(nombreArchivo);
  pdf.setPrintPageDialog(false);
  pdf.printDocument();
                 
  pdf.closePdfFile();
  pdf.close();
  inputStream.close();

Thank you

Textbox with Justify not working when text contains a parameter

$
0
0
Hi

Is it by design or a bug that text justify works fine unless I put a parameter or other expression into the text?

Thanks,
Greg

Extracting a table from a pdf file: an error occured

$
0
0
Hello,

I am using the evaluation version of Java Aspose PDF, trying to deal with it before buying it.

I am trying to read a table from the attached "test.pdf" file.

Here is my try (I took it from your examples):
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("d:\\test.pdf");
com.aspose.pdf.TableAbsorber absorber = new com.aspose.pdf.TableAbsorber();
absorber.visit(pdfDocument.getPages().get_Item(1));
TextFragment fragment = absorber.getTableList().get_Item(0).getRowList().get_Item(0).getCellList().get_Item(0).getTextFragments().get_Item(1);

An error occured: 
 - class com.aspose.pdf.internal.ms.System.z93: Internal error occured during work of TableAbsorber

Thank you for you help

StackOverflow and hang up while converting HTML to PDF

$
0
0
Hi,

we have a problem with converting HTML to PDF.
The attached project converts 3 HTML pages to PDF but only the last actually converts.
Selection 0 causes a StackOverflowException in mscorlib while saving.
Selection 1 seems to hang up while saving. No further output.
Selection 2 converts without any problem.
The HTML looks valid to me. Visual Studio and WebStorm say so, too.

Thanks in advance.

Html to Pdf Problems

$
0
0
Hi
Which rendering engine does Aspose.PDF use for rendering html?
In the attachment you see a screenshot of a generated pdf. The first problem is the bottom border and the second problem is, that there are very fine lines in the grey background.

Can you help, please?
Thank you.

Issue converting the PDF to excel in java

$
0
0
I have downloaded the free trial version of aspose-pdf-11.3.0-java and when i am trying to convert a PDF to excel and the excel is not getting generated properly.i have used the following code

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("E:/test.pdf");
com.aspose.pdf.ExcelSaveOptions excelsave = new com.aspose.pdf.ExcelSaveOptions();
pdfDocument.save("e:/test.xls", excelsave);

Metadata missing in PDF/A-2b conversion result

$
0
0
Dear Aspose Team,

The attached PDF file (test0023) contains a text line in the Batang font. Aspose.Pdf for Java version 10.6.2 converts it properly to PDF/A-2b using

com.aspose.pdf.Document.convert(com.aspose.pdf.PdfFormat.PDF_A_2B,com.aspose.pdf.ConvertErrorAction.Delete)

However, starting with at least version 11.0.0 the proper PDF/A metadata seems to be missing in the resulting document, e.g. Adobe Reader no longer recognized the result as PDF/A-2b.

Could you please check this regression issue.

Heikki Tuominen

Filling fields on multiple signature form invalidates previous signature

$
0
0
Adobe PDF has the functionality to set up forms that have multiple signature fields, with each of those signatures being associated with a specified set of data fields. We have a form like that.

The first user fills out the first set of fields and applies his digital signature. When the first signature is applied, all the fields that go with that signature are locked (i.e. made read-only).
The form is then routed to the next user, who repeats the procedure with the next group of fields, filling them out and then applying his digital signature in their associated digital signature field, which locks that group of fields.

Each digital signature sets up another 'revision' (what Adobe calls it) of the document. As long as no users change any of the fields that are associated with previous digital signatures, the signatures all remain valid.

We are trying to automate part of this process by having Aspose PDF fill out the each group of data fields (the digital signature is applied manually by the signee) before the form is routed to the next signee. It fills out the first group and the first person signs, which locks the first group. Then Aspose PDF fills out the second group, but when it does it invalidates the first signature.

I am attaching a simple demo app. Run fill1.bat to populate Field 1. It will output demoOut1.pdf. Then sign Signature 1. Notice that it locks Field 1. Then run fill2.bat. It will populate Field 2 and output demoOut2.pdf. You will see that now the first signature is invalid. However, you can manually open demoOut1.pdf and populate Field 2 and it does not invalidate the first signature.

I've also noticed that I don't even have to change the PDF. All I have to do is to open it and save it with Aspose and it will invalidate the signature.

All of this with Aspose PDF 9.8

How can I use Aspose PDF to populate fields in the form without invalidating previous signatures?

Thanks

Steve

Image from pdf is corrupted

$
0
0
Hi,

When we convert the page(s) of a PDF document to JPG image(s), in certain cases the generated image is corrupt. A lot of text on the page has been scrambled.

After some investigation, it seems this only occurs when a PDF is "enhanced" using Acrobat Pro DC, applying the OCR option "Editable Text and Images". When choosing either "Searchable Image Exact" or the default "Searchable Image Exact" the problem does not occur.

Could you please investigate?

Thanks!
Maurice
Viewing all 1038 articles
Browse latest View live