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

Creating a PDF section using a byte array

$
0
0
Hello,

Im building a big pdf out of multiple sources including other PDFs,  which are retrieved via API in the form of a byte array.  Using Generator.Pdf.Import(streamreader) seems like it is built for that,  but it is giving me a blank section every time.  

Here is my code

                       MemoryStream mstream = new MemoryStream(pdfByteArray);                        Pdf pdf = new Pdf();                        pdf.Import(new StreamReader(mstream));                        Section section = new Section(pdf);
finalPdf.Sections.Insert(finalPdf.Sections.Count, section);

it is blank,  so perhaps this is not the proper way of doing it?
the documentation is light on this subject,  
http://www.aspose.com/docs/display/pdfnet/Import+Overload_1
so I hope you can help.

pdf to excel convert

$
0
0

Hi,

I am trying to convert pdf to excel. using below code. Attached sample files used for my testing. It is generating excel with no content. If  i am trying open excel it isnot opening in office 2013. Also in 2010 it is opening and no content. Please let me know.

Thanks,

-A

Document

pdfDocument = newDocument(@"C:\Users\UC177236\Desktop\Rules\TY2012.pdf");pdfDocument.Save(@"c:\xml\" + "test.xls", SaveFormat.Excel);

ExcelSaveOptions saveExcelOption = newExcelSaveOptions();saveExcelOption.MinimizeTheNumberOfWorksheets = true;

saveExcelOption.InsertBlankColumnAtFirst = false;

saveExcelOption.UniformWorksheets = true;

pdfDocument.Save(@"c:\xml\" + "test1.xls", saveExcelOption);

Re: Export PDF to Excel with Aspose.Pdf

$
0
0
My name is Fabio Rosa.  
I'm the develop manager of Industrial area of Fabril/Forwood System of the Lógica Informática company.
I tested the Aspose.PDF 9.5 to verify the issue correction.
The conversion work is better, but not perfect yet... In some cases, (and I don't know why) the blanks columns didn't respected yet.
Follow one example. Please, pay attention in 'Saldo Inicial' column, where the first value (13,0000) is in the erlier column... and on the ninth value either...

Would you adjust it?

Below is our code

ExcelSaveOptions options = new ExcelSaveOptions();

options.InsertBlankColumnAtFirst = false;

options.UniformWorksheets = true;

//options.MinimizeTheNumberOfWorksheets = true;

Document pdfDoc = new Document(_filePath);

var saveDialog = new SaveFileDialog();

var startIndex = _filePath.LastIndexOf(@"\") + 1;

var endIndex = _filePath.Length - startIndex - (_filePath.Length - _filePath.LastIndexOf('.'));

saveDialog.FileName = _filePath.Substring(startIndex, endIndex) + ".xls";

saveDialog.DefaultExt = ".xls";

saveDialog.Filter = "Pasta de Trabalho do Excel (agrupado)|*.xls|Pasta de Trabalho do Excel (páginas)|*.xls";



var result = saveDialog.ShowDialog();

(...)

pdfDoc.Save(saveDialog.FileName, options);



This message was posted using Email2Forum by Justin Anderson. (attachment)

Stamping image to PDF document at certain position

$
0
0
Hi,

I have a requirement to stamp an image to pdf document. I would like to place the stamp on a certain position in the pdf. The position of the stamp is captured from an image generated from the pdf and stored in our backend. How do I use that information in your Java APIs to exactly stamp at that position?

- Arul


Getting Started?

$
0
0
I've just downloaded the Java Components from the downloads page and got a .ZIP file.

I'm looking to start using the trial to convert text documents to PDFs however there's nothing in that .ZIP that tells me what purpose any of the files have. I see some JARs in there, but I'm not if they're there for developing or as part of the example.

Any help would be greatly appreciated.

Extract Footers/Headers from pdf file

$
0
0
Hi,

I can't find in your API option to extract footers and headers from pdf file.
I have seen it was developed: PDF NEWNET-31086
but i have not seen any example how it can be done.
I am using Aspose.Pdf for .net version 9.5.0.0 

Thanks.
Alex B

extract attachement in a PDF document generated with acrobat XI

$
0
0
Hi,
Is it normal that Java Aspose library can not get attachements from a PDF document generated with Acrobat 11? (pdfDocument.getEmbeddedFiles().size() returns me 0 ). Or do I need an license to do this ? I'haven't got any evaluation License. How can I get one and how should I install It?
Thanks in advance

Richard

P.S. I was sucessfull executing "getAllAttachementsFromPDF.java" example code using your data but not when I replace the input.pdf file by an input.pdf file generated with acrobat XI.

Error on adding TIFF-Image to PDF

$
0
0
I try to add an TIFF Image (attached) to a new created PDF and got an exception!

Here the code

Pdf doc = null;
ByteArrayOutputStream byteArrayOutputStream = null;
               
doc = new Pdf();
doc.setConformance(PdfFormat.PDF_A_1B);

       
aspose.pdf.PageSetup ps = new aspose.pdf.PageSetup();
Section section = null;
RenderedOp image = JAI.create("fileload", new File("/home/mburger/tmp/imageMan/Test.tif").getAbsolutePath());;                   
       
System.out.println("image.getHeader().getHeight() -> " + image.getHeight());
System.out.println("image.getHeader().getWidth() -> " + image.getWidth());
ps.setPageHeight(image.getHeight());
ps.setPageWidth(image.getWidth());
doc.setPageSetup(ps);
           
// image
section = doc.getSections().add();
           
Image pdfImage = new Image(section);

           
BufferedImage bImage = image.getAsBufferedImage();
pdfImage.getImageInfo().setSystemImage(bImage);
       
pdfImage.getImageInfo().setFixHeight(image.getHeight());
pdfImage.getImageInfo().setFixWidth(image.getWidth());
                           
           
section.getParagraphs().add(pdfImage);               

byteArrayOutputStream = new ByteArrayOutputStream();           
doc.save(byteArrayOutputStream);


and here the ERROR
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
    at aspose.pdf.internal.z284.m1(Unknown Source)
    at aspose.pdf.internal.z284.m1(Unknown Source)
    at aspose.pdf.internal.z285.m1(Unknown Source)
    at aspose.pdf.internal.z303.m1(Unknown Source)
    at aspose.pdf.xml.DocumentBase.m1(Unknown Source)
    at aspose.pdf.internal.z277.m1(Unknown Source)
    at aspose.pdf.Pdf.m1(Unknown Source)
    at aspose.pdf.Pdf.save(Unknown Source)
    at

it.siag.imageman.aspose.test.PrintTiffToPDF.main(PrintTiffToPDF.java:53)


I'm using PDF 3.9.1 for JAVA, can you help me?

thx
  Michael

Malware detected

$
0
0
Our McAfee virusscan flagged bmifln.cbs as a Trojan, is it a false alarm? If so, since the file was deleted do we need to re-install aspose? Here are the details from McAfee:

Threat Target File Path:C:\Files\aspose.pdf\bmifln.cbs
Event Category:Malware detected
Event ID:1027
Threat Severity:Alert
Threat Name:Generic.ns
Threat Type:Trojan
Action Taken:Deleted
Threat Handled:true
Analyzer Detection Method:OAS

Thanks,
Ojas

Header in pdf files

$
0
0

Is it possible to add a header with table,text and image in a new header on

a existing pdf files using Aspose.pdf?

All existing text and object must be 'moved' down to make Place for the new header.

Thanks in advance.

Large MultiPage PDF generated using Aspose PDF 7.2

$
0
0
Hi,

I have been using Aspose 7.2 PDF for .Net 4 framework. I have a bunch of images (approx 55 pages) which i will be converting to PDF format. When it gets converted to MultiPage PDF, its file size becomes significantly Large. 

For example : For sample attached image, when the same image used to create 55 MultiPage PDF, it would create larger Multipage PDF.

Please let us know how can we achieve optimum quality along with Minimum size.

FileSpecification from stream - Modified is Unknown

$
0
0
Hi,
We have the issue while adding attachment into a PDF file by using FileSpecification with stream.
using (System.IO.Stream ms = ...)
{
   pdf.EmbeddedFiles.Add(new FileSpecification(ms, file.ID));
}
The Modified date for the attachments added by this way is Unknown. Check attached image.
The problem is that we have this information and willing to update it. But 

FileSpecification->FileParams.ModDate is the ReadOnly property.

How can we specify CreationDate, ModDate if we use FileSpecification stream constructor?

Pdf Open Action default view

$
0
0
Dear Aspose,

I am having trouble specifying the default view for Pdf documents.   I would like them all to open to fit the page width and open at the very start of the document i.e. top edge of first page.
This is the code I am using and while it zooms to the page width it does not start at the top of the document.   Aspose.Pdf version 9.4.0.

Please help!

var pdfDocument = new Aspose.Pdf.Document(pdfDocumentStream);
pdfDocument.OpenAction = new GoToAction(new FitHExplicitDestination(pdfDocument.Pages[1], 0d));
pdfDocument.OptimizeResources(new Aspose.Pdf.Document.OptimizationOptions
{
    LinkDuplcateStreams = true,
    RemoveUnusedObjects = true,
    RemoveUnusedStreams = true,
    CompressImages = true,
    ImageQuality = 90
});
pdfDocument.Optimize();
pdfDocument.Save();

James

PDF header signature not found

$
0
0

We are using another tool that creates an image from a scanner from our web application.  That image is then passed from the client to the server and to our Aspose logic as a stream.  Then we create an Aspose Pdf document from the stream, add a FreeTextAnnotation and save the file to disk.  Out of the 4,000 or so documents we have created, around 10 have been corrupt and we are unable to open with Adobe reader for example.  We did find that Chrome was able to view the documents though.  After some debugging using itextsharp, we see the error PDF Header signature not found.  When we open up the documents in notepad, the first few bytes look off.  Generally the first few characters in the pdf file begin with something like “%PDF-1.6” (without the quotes).  The corrupt files are missing the version number and look something like “%PDF  “.

Just wondering if you have any ideas on why the files would be missing the needed header information.  Aspose pdf was able to open up the corrupt files and then we copied the pages to a new pdf document and saved and everything is good.

Questions about new PDF library

$
0
0
Ok this will work without ERROR!
thx

but now I have some questions how I should to things with this code and the new PDF library

1. How can I set the PDF Conformance to PdfFormat.PDF_A_1B
2. How can I set the PDF to an A4 or an A3 Page size
3. How can I write a text with one or more rows over the picture (like watermarker) on the bottom corner centered or on the right corner centered?
4. How can I set the Font of the new text over my picture
5. I need to insert the picture in the A4 document without margin but also without fitting the image to the page, so if the original sized image fit into the page without resizing is ok, if not I have to resize the Image to 50% if now it fit into the page its OK, if not I have to do this severeal times! I hope I explained it ok!

thx
  Michael

Polish characters with Helvetica font and Italic fontstyle

$
0
0
Hello,

I tried your sample code in C# "Adding Text Stamp in the PDF File":


//open document
Document pdfDocument = new Document("input.pdf");

//create text stamp
TextStamp textStamp = new TextStamp("Sample Stamp Polish Chars ęąśłóńźżć");
//set whether stamp is background
textStamp.Background = true;
//set origin
textStamp.XIndent = 100;
textStamp.YIndent = 100;
//set text properties
textStamp.TextState.Font = FontRepository.FindFont("Helvetica");
textStamp.TextState.FontSize = 14.0F;
textStamp.TextState.FontStyle = FontStyles.Italic;
textStamp.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Aqua);
//add stamp to particular page
pdfDocument.Pages[1].AddStamp(textStamp);

//save output document
pdfDocument.Save("output.pdf");



but with this differrence that I chose Helvetica font (core PDF font) and used Polish Characters in TextStamp. When I use Polish Characters in combination with Helvetica font the feature FontStyles.Italic dosen't work.



How to use Polish Characters or where can I change encoding?


Pdf text extraction failure

$
0
0
Hi

I am using Aspose Java Pdf 9.3.0. In one of our machine, the text extraction from pdf fails. The is the stack trace is at the end of this post.

We are using java version "1.7.0_60" and it runs on ubuntu "Linux xxxx 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux"

But the same code works in Mac OS X and CentOs. How to debug this problem ?

Exception in thread "main" java.lang.NullPointerException

at com.aspose.pdf.internal.p426.z12.m1(Unknown Source)

at com.aspose.pdf.internal.p426.z12.m7(Unknown Source)

at com.aspose.pdf.internal.p426.z14.m1(Unknown Source)

at com.aspose.pdf.internal.p426.z14.m1(Unknown Source)

at com.aspose.pdf.internal.p426.z14.m6(Unknown Source)

at com.aspose.pdf.internal.p426.z14.<init>(Unknown Source)

at com.aspose.pdf.internal.p426.z14.<init>(Unknown Source)

at com.aspose.pdf.TextAbsorber.visit(Unknown Source)

at com.aspose.pdf.facades.PdfExtractor.extractTextInternal(Unknown Source)

at com.aspose.pdf.facades.PdfExtractor.extractText(Unknown Source)

Low speed of PDF parsing with GroupDocs

$
0
0
Hello Dear ASPOSE team,

As we know GroupDocs is your member. So, please, help us to solve the issue in GroupDocs PDF viewer library. GroupDocs memebers said that the issue is in your library.

We are waiting for solving from 22/07/2014.... You can find the original description here: http://groupdocs.com/Community/forums/permalink/1812/1981/showthread.aspx#1981

We have very low speed with some sort of pdf files. We created 3 files with the same contents. We can reproduce the very slow speed with one of them. 2 of  these files have been created using ABBYY FineReader 11, but on different computers. 1 of of  these files have been created using PDF-XChange. Link to files: https://mega.co.nz/#F!T5pQjb7D!-ncWcNYe-uViRuVfi8oTwQ

"TestDocument 5.pdf" - very slow (11 seconds per page) ABBYY FineReader 11 on PC1
"TestDocument 4.pdf" - normal (4 seconds per page) ABBYY FineReader 11 on PC2
"TestDocument 3.pdf" - normal (5 seconds per page) PDF-XChange

Please, look at "TestDocument 5.pdf. In our opinion the problem is in this file...

Please, help us! Thank you!

Empty PDF

$
0
0
Hi,
When I'm using the next code (with Aspose.pdf version 9.5.0.0):

            Pdf pdf = new Pdf();
            Aspose.Pdf.Generator.Section sec1 = pdf.Sections.Add();
            sec1.Paragraphs.Add(new Text("Hello  World..."));
            pdf.Save("Roi.pdf");

I get an empty Pdf file.
(I think that it's because of the font...)
Is there something that I'm doing wrong? Is there a way that would allow me to use some base font (that is being recommended by you)?

Thanks,
Roi

After Save() - "The process cannot access...because it is being used by another process"

$
0
0
Hi,
When I'm usnig the next code (with Aspose.pdf  version 9.5.0.0):

pdf.Save(123.pdf);
        File.ReadAllBytes(123.pdf);

I'm getting exception: "The process cannot access the file '123.pdf' because it is being used by another process."

Is Save() methid is asincorenit (run at background...)?
Is there something I can do for "close" the file?

Please yourt help,
Thanks,
Roi

Viewing all 3131 articles
Browse latest View live