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

[PDF .Net] Startxref not found

$
0
0
Hello,

I am trying to extract the Html and the preview of many documents and often, 
I get an error saying :
"Startxref not found" comming from the exception "InvalidPdfFileFormatException".

My document is perfectly readable from Acrobat Reader.
I ma using the latest version of the Aspose.Net Pdf (10.5.1)

Thank you in advance,
Lenny

Several questions about SignatureField and Signature

$
0
0
Hi,

I have several questions in the process of learning Aspose Library. 

First is, in a PDF, we would probably have a certificate chain, that means we can have more than one certificate. But our SignatureField.ExtractCertificate() can only have one stream as return value. so how can we got multiple certificates from it?

Second is, is the return value Signature.Verify() Method verify all the certificates  is correct?

Thanks a lot 

add text stamp crashing program getting error program stopped working

$
0
0
Hi team I have a requirement to run PDF add text stamp as a separate exe so that it will run in the back ground when called. I am running it as a win form with the form deleted. My project has a reference to Aspose.Pdf.dll. When the exe is called it crashes with the message program stopped working. I've determined that it is something in the code that I am using to add the text stamp. when I comment the code out it works. I've attached the code file. Please tell me what I am doing wrong.
Thanks.
Bill  

How do you find determine of a Field is hidden or not?

$
0
0

Both Hidden and Visible fields always show as Default


if (field.Flags == Aspose.Pdf.InteractiveFeatures.Annotations.AnnotationFlags.Hidden)


This condition never is never true even is the field is Hidden when you check the PDF.


I have attached the PDF I'm using to test with.  It has several "Hidden" fields but they all show up as Default - even when I try the myForm.GetFieldAppearance("Principal_Name_1") method.

How to get all fields when there might be multiple instances of a field?

$
0
0
How can I get the values, coordinates, and dimensions of all fields in a PDF file INCLUDING multiple instances of fields that have the same name?  The code below errors out when I hit a field that is a second instance of a field.

public List<PdfFieldDisplayModel> GetFieldPlacements(string docPath)
        {
            var fields = new List<PdfFieldDisplayModel>();
            var doc = new Document(docPath);
            var pdfForm = new Aspose.Pdf.Facades.Form(docPath);

            foreach (Aspose.Pdf.InteractiveFeatures.Forms.Field formField in doc.Form)
            {
                //get field value
                Console.WriteLine("PartialName : {0} ", formField.PartialName);
                Console.WriteLine("Value : {0} ", formField.Value);
                Console.WriteLine("PageNumber : {0} ", formField.PageIndex);
            }

            foreach (Field ff in doc.Form)
            {
                var txt = doc.Form[ff.Name] as TextBoxField;
                var f = new PdfFieldDisplayModel();
                f.Name = ff.Name;
                f.PartialName = ff.PartialName;
                f.Value = ff.Value;
                f.Width = txt.Rect.Width;
                f.Height = txt.Rect.Height;
                f.Left = txt.Rect.LLX;
                f.Bottom = txt.Rect.LLY;
                fields.Add(f);
            }
            return fields;
        }

Aspose XFDF to PDF conversion

$
0
0
Hello,

We are using Aspose to convert XFDF file to PDF file. In the XFDF file, we are setting a value of 1 or 0 to indicate the check box selection (1 = checked, 0 = unchecked) for the check box fields; this is causing an issue while converting the PDF file from the XFDF as the Aspose is treating 1 or 0 as a value and checking (selecting) all the check boxes (including unchecked ones) in the PDF after conversion.

The default values in XFDF for check boxes are On and Off for check and un-check respectively, is it possible to configure Aspose to accept 1 or 0 instead of On or Off?

I appreciate your help on this.

Error in PDF compliance conversion

$
0
0
Hi,

I am converting a PDF document to PDFA using the following APIs

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

pdfDocument.convert("Conversion_log.xml", com.aspose.pdf.PdfFormat.PDF_A_1A, com.aspose.pdf.ConvertErrorAction.Delete);
pdfDocument.save("Output.pdf");

There is Apose.Toal license installed on the server where the conversion is happening.

But I am getting the following exception:

class com.aspose.pdf.internal.p348.z87: At most 4 elements (for any collection) can be viewed in evaluation mode.
com.aspose.pdf.ADocument.m1(Unknown Source)
com.aspose.pdf.PageCollection.m1(Unknown Source)
com.aspose.pdf.PageCollection.get_Item(Unknown Source)
com.aspose.pdf.internal.p626.z2.m1(Unknown Source)
com.aspose.pdf.internal.p626.z2.m1(Unknown Source)
com.aspose.pdf.ADocument.convert(Unknown Source)
com.aspose.pdf.Document.convert(Unknown Source)
com.aspose.pdf.ADocument.convert(Unknown Source)
com.aspose.pdf.Document.convert(Unknown Source)

I have checked the license path and the code to get the license through which I am able to generate DOCX file also.

Kindly help.

Regards,
Prabhaker Kr.

Saving PDF as Doc error

$
0
0
hi,

I am evaluating aspose.pdf. When trying to convert the attached pdf the  ms word will not open it as it is corrupted.

Can you help?

How to tell if a PDF is PDF/A

$
0
0
Hello,

How can we tell if a PDF file is PDF/A or any other standard? Is there a property that tells it?

Regards,

Kees de Wit

Convert Error in Aspose.pdf For java

$
0
0
Convert Error in Aspose.pdf For java

null pointer error convert pdf page to image

$
0
0
Hi
just testing aspose.pdf.10.4.1.jar for converting pdf. to images.

I always get null pointer error in the xxxDevice.process() function.

(using the same code as on your tutorial: http://www.aspose.com/docs/display/pdfjava/Convert+PDF+Pages+to+JPEG+Image)

The same does happen with all ImageDevices.

I see stackTrace is referenced from those:
org.apache.naming.resources.ImmutableNameNotFoundException (id=487)
org.apache.naming.resources.ImmutableNameNotFoundException (id=6126)
java.lang.NullPointerException (id=6125)
com.aspose.pdf.internal.p348.z72 (id=6121)
...

any idea?


I am successfully using aspose.slides to put together images to a ppt and i wanted also to use aspose to generate those images from pdf...


regards

reto



PDF to PPTX text as images -- PDF for .NET 10.5.1.0

$
0
0
We're using Aspose.Pdf.Generator to create custom PDFs with rectangles and text among other things. This works fine.
When I save the PDF as PPTX, the output looks OK, but the rectangles are output as a single image, while the text is maintained in text format.
I imagine some may prefer this, but we have an issue with this.
We need to be able to stretch and move the output on the slides such that the text transforms with the same proportions as the rectangles.
Currently, while re-sizing the rectangles, the text will attempt to word-wrap, maintains font-size, etc (see attached "ppt_test.pptx").
Is there any way to control how text is converted as part of the PPTX conversion?
Is there anything I can do different in the PDF.Generator code to make sure the text will convert differently?

I have tried saving the pages of the PDF as images, and then adding them back in, but something is not working right (see attached "ppt-test-image.pptx").

This is the code with commented attempts I've tried:
var doc = new Document(sourcePath);var doc = new Document(fileStream);//convert page to an image and add back to help with PPT conversionvar jpegDevice = new JpegDevice(new Resolution(300), 100);foreach (Page page in doc.Pages)
			{//				var page = doc.Pages[1];	var imageStream = new MemoryStream();//				var imageStream = new FileStream(@"C:\Development\Practice\AsposePDF\AsposePdfPractice\page.jpg", FileMode.Create);jpegDevice.Process(pageimageStream);//				imageStream.Close();//				var image = new Image();//				page.Paragraphs.Add(image);//				image.ImageStream = imageStream;page.AddImage(imageStreampage.CropBox);//				page.AddImage(@"C:\Development\Practice\AsposePDF\AsposePdfPractice\page.jpg", page.CropBox);imageStream.Close();
			}doc.Save(filePathnew PptxSaveOptions());//				imageStream.Close();

Also, since some pages in our final PDF will have pages with just text (that we don't want to convert to images), it might be easier to handle this issue in the PDF generation code, rather than trying to extract out certain pages from the PDF to create images (unless there's an easy way to check for IDs or elements to filter out the pages we need).

Recap:
We're creating the PDF.
We want to convert the PDF into PPTX.
We want the PPTX to have a single image per slide so it can be stretched.
We want to be able to select identifiable Pages from PDF to convert into images in PPTX.
We want to be able to use streams as much as possible since we're running in a web context.

Do you have any suggestions?

Thanks,
Joey

Saving PDF to HTML using memory stream

$
0
0
Dear Aspose Team,

I'm trying to convert PDF to HTML without saving it to local drive. As far as I see there is an option to save in memory stream.
Is there any examples how to do this with examples of  implementation for:
CustomStrategyOfCssUrlCreation
CustomCssSavingStrategy
CustomResourceSavingStrategy
?
I saw some examples for C# but not for Java.

Thanks,
Andrei

Sign converted docx to pdf

$
0
0
I am trying to sing a pdf obtained from converted docx document.

The sample code is this:

const string Sid = "sid";
const string Key = "key";
var destinationFileExtension = WordOutputFormat.Pdf;
var inputFilePath = @"C:\document.docx";
var destinationFileName = "document-signed.pdf";
var folder = "Conversions";
new WordsService(Sid, Key).ConvertDocument(destinationFileExtension, Path.Combine(folder, destinationFileName), inputFilePath);
var signature = new PDFSignature { Date = DateTime.Now.ToString() };
new PDFService(Sid, Key).SignDocument(destinationFileName, folder, signature);

I get always the same error:

"Invalid Amazon S3 file path..."

Where is the error?

Thank you in advance

Watermark Positioning

$
0
0
Hi
I am currently using PDF generator version 9.7 (usnig the XML method), Visual Studio 2010, .NET 4.0.

I am having some trouble positioning a watermark in a PDF document. Basically, what I want to do is position some text (user-supplied, limited to 20 characters) diagonally from bottom left to top right of the page, centred both horizontally and vertically. I have attached a sample that I generated using Adobe for reference.
I can add the text, rotate it, and sort of position it, but I can't get it into exactly the right position without a lot of tweaking of margins and paddings, that would change for different page sizes, and different text lengths.
I was wondering if you could provide some guidance as to how to achieve my goal. I have attached a sample XML file, in which I have added borders around the watermark floating box, and the text within it for reference only - the borders would not be in the finished product.

A couple of additional points that would be helpful if you could address:
  • The "TextVerticalAlignment" attribute of the Watermark seems to have no discernible effect. No matter what you set it to, the text doesn't move.
  • There is no equivalent horizontal alignment for the text in the Watermark.
  • It would be helpful if the rotation point of the text could be set. It currently only rotates from the bottom left hand corner of the text. It would go a long way to fixing my problem if the text could be rotated around its centre.
  • Text wrapping around to the next line is also a problem in this situation. If the text in the stand horizontal position would have wrapped (for example, use "Draft Copy" instead of "Draft"), then it appears wrapped in the rotated version, even though it would have fit in that position. I have worked around this problem by setting the right padding of the watermark to a large negative value (-15cm), allowing extra room for the horizontal text to expand.
I have searched your site, and Googled this problem as well, but have been unable to find a suitable solution.
Could you please advise a way I could achieve this?

Thanks
Chris.


Count pdf document pages on client side

$
0
0
Hi,
I have a ASP.NET project where I am required to validate a pdf (and also word if possible) page count before uploading to server.
Is it possible to get an Aspose object for an existing file client side and check the number of pages?
Thanks!!

Aspose PDF rendering using Word template having italic and normal Tele-GroteskNor font

$
0
0
I am trying to render MS word template having a paragraph having normal + italic text (using font Tele-GroteskNor). The text in italic has bookmark set on it which replaces text with dynamic value. The outcome of rendered document is fine. However, when I further create PDF document out of this rendered document, all the text preceding italics in that paragraph changes from normal text to italics. Ideally, it should not change font style from normal to italic for preceding text after bookmark.

Template text: This is a <BookmarkText> line
MS Word text: This a Sample Value Of Bookmark line.
PDF text: This is Sample Value Of Bookmark line.

Note, word line changed from normal to italic in case of PDF rendering.

One observation, when I change the font from Tele-GroteskNor to Arial in the work template document then, it work as expected i.e preceding text remains in normal format.

Currently we are using Aspose 9.1 version.

Appreciate any help in the matter.

Thank you!

Get some checkbox field properties from a Dynamic PDF file

$
0
0
Hi,

I am working on a dynamic XFA PDF file with checkbox fields. I know I cannot get their properties like positions, checkedValue, FullName using Aspose.PDF.InteractiveFeatures.Forms.CheckboxField.Rect, Aspose.PDF.InteractiveFeatures.Forms.CheckboxField.States and Aspose.PDF.InteractiveFeatures.Forms.CheckboxField.FullName because they are only valid for static fields. So is there any example or idea how to get those properties straightly from an XFA field? Thanks in advance!

Printint PDF using Aspose

$
0
0

Hi

Can you please let me know that While printing PDF:

1. Is there any scaling done

2. Are PDF printed fit to Page


Thanks

Rao.

Cell formatting does not appear correctly if rowspan too large

$
0
0
Hi,

If I have a table cell, which has a rowspan longer than the rows underneath, the background color and borders do not span the entire cell.  I have recently upgraded from a much older version of Aspose and this use to work.

I understand the workaround is to fix the tables I have, I am working on this.

Table table = new Table(section);
section.Paragraphs.Add(table);

table.DefaultCellBorder = new BorderInfo((int)BorderSide.All, new Color("black"));

Row row1 = table.Rows.Add();

Cell cellRow1Col1 = row1.Cells.Add();
cellRow1Col1.BackgroundColor = new Color("lightSteelBlue");
cellRow1Col1.RowSpan = 2; // toggle this from 2 (correct) to 3 or more (too many)
cellRow1Col1.Paragraphs.Add(new Text("x"));

Cell cellRow1Col2 = row1.Cells.Add();
cellRow1Col2.BackgroundColor = new Color("lightSteelBlue");
cellRow1Col2.Paragraphs.Add(new Text("x"));

Row row2 = table.Rows.Add();

Cell row2Col2 = row2.Cells.Add();
row2Col2.BackgroundColor = new Color("lightSteelBlue");
row2Col2.Paragraphs.Add(new Text("x"));

Viewing all 1038 articles
Browse latest View live