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

Cross reference table or cross reference stream not found

$
0
0
I am facing an issue (Cross reference table or cross reference stream not found) while loading the .PDF file which has Russian characters as a file name. We are using the latest version of Aspose (v10.3.0)

Please help me to resolve this issue.



PDF containing tables to HTML

$
0
0
We are evaluating Aspose.PDF for a specific use case - PDFs that contain tables that we would have thought would result in HTML that has actual HTML tables instead of a bunch of flat divs.  Can anyone comment on whether or not this is a bug or working as designed?  See attached with an original PDF file and the html we got by using Aspose.PDF.  Conversion on a similar RTF file results in html that has actual tables.  The output is important for what we want to do with the HTML after the conversion.

Index was outside the bounds of the array exception and CSS not being applied

$
0
0
I have put together a simple example to illustrate that the CSS is never applied to the PDF file.  But before I could get that issue resolved, I've encountered an exception.  Can you let me know if it is something I'm doing or is something wrong with ASPOSE.PDF. This example expects to be extracted to the C:\TEMP folder.

Generating a PDF

$
0
0
Hi,

I have added reference of following DLL's
APToolkitNET.dll
Aspose.Pdf.dll
Aspose.Words.dll

By this I am able to create a pdf from word Document
then, I am trying to Create PDF from HTMl string. There I am getting error in the first line itself 

"  Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();  "

as Unable to find class Generator

Do i need to add any more reference files ?

Please Let me know your Comments on this.

FreeTextAnnotation does not appear until it is resized

$
0
0
I am attempting to add a a FreeTextAnnotation to an existing PDF that will only show on the PDF when printing, following the example at the bottom of the page here: http://www.aspose.com/docs/display/pdfnet/Add+Annotation+in+an+Existing+PDF+File

When I printed the PDF, the annotation did not show up, so I removed the AnnotationFlags.NoView flag. After that, the annotation did not show up when opening the file in Acrobat, but if I clicked around where the annotation should have been, a box would be highlighted. If I resized the box, the annotation would then appear.

To make sure this wasn't an issue with my code, I checked the annotation examples in the Aspose Examples Dashboard to see if I experienced the same issue. I ran the example Aspose.Pdf/Programmers Guide/Working with Annotations/Set Formatting of FreeTextAnnotation. The exact same issue occurred. See attachments for pictures of the issue on the file generated by the Aspose example.

I am running Windows Server 2012 and the latest version of Adobe Acrobat XI. Others in my office tried the same file and experienced the same issue. All of them are using Acrobat XI and Server 2012/ Windows 8.1/ Server 2008 R2.

What we need is for a) the FreeTextAnnotation to show up without resizing the box if the NoView flag is not set, and b) the FreeTextAnnotation to show up on printed paper if the Print flag is set.

convert pdf to html

$
0
0
When i convert pdf to html, i found the html file size is too larger than the original pdf file.The attachment is the pdf and html file.
The pdf file size is 60kb, and the html file size is 800kb.

convert pdf to html, pictures in pdf caused some file content missed

$
0
0
when i convert pdf to html, there have some pictures in pdf, and i found it caused some file content missed.The attachment is the file i used.

How to Convert pdf to HTML to use public void save(OutputStream outputStream, SaveOptions options)

$
0
0
How to Convert pdf to HTML to use public void save(OutputStream outputStream, SaveOptions options)

This html embedded all resources!

Determine coordinate for extracting text from pdf

$
0
0
I am trying to extract certain text from pdf file. I need to know the lower and upper x and y coordinates of the text on the pdf file using Aspose.Pdf.Rectange. But how do I determine the lower and upper x and y coordinates of the text on the pdf file?

Adding headers and footers to existing pdf

$
0
0
Hi,

Is it possible to add headers and footers to existing pdf?
I have yet to see an option to rearange the document to allow place for new headers and footers.
It is also related to another issue I'm researching as to inlarge font size and rotating the page in an existing pdf in order to make it more readable to people with impard eye sight

D'vir

converting .jpg files to PDF

$
0
0
Hi Good day,
How are you?
We are having some production issue while converting certain .jpg files to PDF.
Following is the error that we are getting in our Service logs.

Error message: Image top or bottom margin is too large 0,0 image file:/var/spool/pdfconvert/aspose/1427704633078_1_3.JPG. Error cause: null


try {Pdf pdf1 = new Pdf();
// Create a section in the Pdf object
Section sec1 = pdf1.getSections().add();
// Create an image object in the section
aspose.pdf.Image img1 = new aspose.pdf.Image(sec1);
// Add image object into the Paragraphs collection of the section
sec1.isLandscape(true);//added to resolve some formatting issue
sec1.getParagraphs().add(img1);
// Set the path of image file
img1.getImageInfo().setFile(inFilepath);
// Save the Pdf
pdf1.save(pdfFilepath);
LOG.info(" Converted Image To Pdf by ASPOSE Successfully " );
 }catch (Exception e) {
 LOG.error("Failed to convert Image to PDF... Error message: "+e.getMessage()+". Error cause: "+e.getCause());
throw new XPdfConvert(String.format(
"message=\"Failed to convert Image file To PDF '%s'\"", inFilepath),e);
  } 
       }

Pls find the samples attached  which are failed.

Currently we are using 
'aspose.pdf-9.1.0.jar'

as we are having some formatting issues with old version "aspose.pdf-3.0.1.jdk16.jar" few months
so we have deployed new version of 'aspose.pdf-9.1.0.jar' with some extra logic added to code.

sec1.isLandscape(true);//added to resolve some formatting issue.
which means,while converting bigger images the result pdf is coming in two or more pages for one image and which is not really looking good.
After deploying new version and above logic highlighted solved the issue,
but we are getting new issue, with certain jpg files as per attached samples with the following 
Error:
Error message: Image top or bottom margin is too large 0,0 image 

Your response,will be appreciated,

Regards,
Prasad




Tables from HTML

$
0
0
Hi,

We are rendering a PDF using HTML stored in a SharePoint list item. But we do notice some issues with table rendering.

The HTML code I used is attached as "HTMLCode.txt" this HTML has two tables in it. The upper table is copied directly from Excel to SharePoint. The second one is the same table but manually modified to remove the <colgroup> tags.

The resulting pdf is also attached as "print.pdf" here you can see the original table falls of the page while the second table is much smaller. It seems when we remove the <colgroup> tag the rendering does not take the table or cell widths in account. While the HTML should be correct as we can see in the "Html Render.png" attachment which is rendered in the browser. (IE11)

This is a big issue for our customer project. At the moment we have to write extra custom code to remove the <colgroup> tags just to make sure the table is always on the page. But losing the formatting in the progress is unacceptable. Because of project deadlines we had to set this solution in production but only as a temporary fix.

Could you provide us with a proper solution? And if this requires a new version an ETA of said new version so we can communicate this with our customer.

We are using the latest version of PDF.NET 10.1.0

HTML results in Object Ref Not Set when saving to PDF

$
0
0
Hi

We are using Aspose.PDF.dll version 10.3.0.0.
If we convert a string variable with HTML into a PDF, we get a "object ref not set" on the document.save() command.

You can find the html and the code in the attachment.

We had problems with "bad" html before, but we can't quit figure out which html piece is wrong in this one, so we could use you're help.

Aspose .net PDF shapes from slide became one image

$
0
0
Hello, I am using Aspose .net PDF to convert pdf to pptx.
I use code from example
// Load PDF document
var pdfDoc = new Document("D:/test2.pdf");
// Instantiate PptxSaveOptions instance
var pptx_save = new PptxSaveOptions();
// Save the output in PPTX format
pdfDoc.Save("D:/test.pptx", pptx_save);

But shapes on pptx became as one big image. Shapes are not separate from each other.
How can I resolve this issue?

Pdf file that I use is in attach. (test2.pdf)
Pptx - the result of converting also in attach.(test.pptx)

Thanks in advance!


Aspose.PDF falls into some infinite loop when processing certain tables and images

$
0
0
Hello!

I'm having some strange problems with Aspose.PDF. It seems to deadlock/hang and after few hours it either crashes, with OutOfMemory or tries to write to an output file infinitely.

Overview: I have some code that fetches data from external system, then saves it as data XML file. Then some XSLT tranform is invoked on that file to generate a report XML file structured according to AsposePDF XML API, and finally the latter XML file is fed to BindXML method and a PDF should be generated.

All bits work fine for most reports, but for some input data, the last step (BindXML+Save when using DOM, or BindXML+Close when using DirectWrite) hangs with no apparent reason.

It does not seem to be related to size of the data. I have tested many cases and the final XML file may be 1, 10, 100kb, 1000kb in size and it works fine, yet some 3kb input file may cause a problem.

I managed to observe that this problem occurs mostly when the report contains a Table that contains at least one Image and the Image has some FixHeight or FixWidth option set. I have tested many combinations of image resolutions and FixHeights/Widths and table layouts, but at this this point it seems very random: for some combinations of image input resolutions it always works, for some not, for some resolutions it stops working with specific FixHeight ranges, etc.

I have managed to prepare a series of almost-minimal tests that present the issue. I have attached the code samples and a problematic image and the related XML report template. All of them use default MSTest testing framework, after replacing some paths they should be easy to run directly under VisualStudio.

Please note that the attached XML report file is a TEMPLATE. It contains a placeholder/marker so the test code can easily change the target FixHeight for each testcase. If you'd like to check this template manually, please remember to remove the placeholder and to put there a read FixHeight value.

In the attached code you will find two code files with various tests, please note the difference between them and you will probably want to run them separately, in this order:

1) Simple tests, minimal proof of the problem

That's 4 test cases which show:
- that DOM-method works with some good FixHeight value 
- that DirectWrite-method works with some good FixHeight value (same value as above) 
- that DOM-method doesn't work for some unlucky FixHeight value
- that DirectWrite-method doesn't work for (the same) unlucky FixHeight value

When the target Height value is lucky
1a,1b) everything works fine, and reports are properly generated both in DOM and DirectWrite way.

When the target Height is unlucky:
1c) the DOM-way starts writing to the output file, creates the file, then internally enters some infitite loop and hangs and eats memory until a OutOfMemory is internally thrown, and then all file handles are closed and we're left with a 0kB PDF file.
1d) The DirectWrite-way starts writing to the output file, creates the file, then internally enters some infinite loop and hangs and constantly writes similar contents to the output file, until we manually kill the task or until it reaches end of disk space. In either way, the resulting PDF is huge and damaged/unreadable.

2) Scanning tests
This series of tests (~1000 actually) that try to run the same specific report as above, but with different FixHeight values (for example from 0px up to 999px), to see how the target size affects the problem. This test suite is mostly automated - it runs each case with different target image size and a watchdog thread guards it so that neither reasonable time nor reasonable filesize are exceeded. Test then reports whether there was some problem or not.

For the provided example XML report template and for given example input image, I observed something results similar to that:
- FixHeights from 0px upto and including 429px are OK and report is generated fine
- FixHeights from 430px and upwards are BAD and Aspose.PDF hangs

Also, when I modified the testcase a little so it was scanning FixWidth instead, it gave different values:
- FixWidths from 0px upto and including 494px are OK and report is generated fine
- FixWidths from 495px and upwards are BAD and Aspose.PDF hangs

But I checked the dimensions and it turns out that when using FixWidth=494px (or 495px), the target Height would be ~429px (or ~430px), so it seems like it's all actually about final Height here, not Width.

Also, I have run similar test for input images of different sizes and with several input images together in one table. Those tests have shown that the threshold value of 430px is not constant. When using an input image(s) of different resultion:
- the library may not hang at all and everything may work fine
- the library may hang only at specific ranges like 300px-600px and work fine outside of it
- the library may hang for files A+B, but would work for A+C, A+D, B+C, B+D, and still fine for combinations like A+B+C, A+B+C+D

Therefore, please do not consider the attached example to be a singular case with these strict causes/constraints. The attached examples are as minimal as I was able to narrow the problem, but the problem itself seems to be larger. It seems like the library is unable to properly calculate table's layout due to some (maybe rounding?) problems with image scaling. I don't see why would it eat up resources/write infinite file though. But it does.

I think it's some problem with Tables and calculating layout, because I have tried changing/removing paddings/margins/columnwidths from the Table, and the Height threshold were changing a bit and for some combinations even sometimes the problem disappeared (but was back when I changed the source image).

I/We are currently working with Aspose.PDF v9.6 and we noticed this problem in this version, and I researched the problem and prepared testcases for this version.

However, I have also tried Aspose.PDF v10.3 (the one which currently available on NuGet) and sadly I have to say that the problem still occurs. The v10.3 presents the same behavior as 9.6 in this testcases - still hangs and OOMs or stucks at infinite-write, depending on the DOM/DirectWrite choice.

Please advise on this case.

regards,
t.p.

PS. Oh, and removing Tables from the report doesn't seem to fully solve the problem, I have tried that, it somewhat helped, but it generated some other problems. Anyways, having a scaled image inside a table is quite .. basic thing. We'd like to be able to put an image into some grid or table.

using IsVerticalBroken and VerticalTextRotationType.AntiClockWise causes formatting issue

$
0
0

Good Morning,

 

I am creating a set of tables using the PDF Generator whose cells in row1 (the headers) are set as follows:

headerCell.VerticalTextRotationAngle = VerticalTextRotationType.AntiClockWise;

headerCell.VerticalAlignment = VerticalAlignmentType.Center

headerCell.Alignment = AlignmentType.Left;

Some of these are single cells with vertical text, and some are cells with a nested table which display a name displayed vertically (ex. Time in Seat) and a set of periodicity measurements (ex.  30/60/90) displayed horizontally at the bottom.

All of the tables use the same code to generate the tables, and the first set of headers (in white) are common across all tables, with the blue and gray being added on dependent upon the Subject's requirements.  Also, the section holding all of the tables has the isLandscape option set to true.

On occasion, some of the tables extend past the page length, so I set the isVerticalBroken option for the table to true.  However, the combination of Anticlockwise and isVerticalBroken seems to throw off the formatting (see the tables for subject 0 and Subject 1).   If the table fits within the page, the formatting is fine (Subject 1), but if the table extends past the end of the page, triggering a vertical split, the formatting becomes incorrect.

Can you provide me with any advice on how to correct the problem?  Also, is there any way to repeat column1 on vertical split?  

Thank you in advance for your help in this matter.

V/R,

Cunning

 

 

 

 

 

Create calculated pdf form with encryption and validation.

$
0
0

I have created a pdf form in itextsharp without calculated fields. According to my search and development as well as expert advice calculated fields are not possible in itextsharp open source. 

Is It possible to do with aspose.pdf.

My basic requirement listed as,

1. Create pdf form programmatically in asp.net.

2. Provide calculated fields and validation on editable fields.

3. Provide encryption.

4. Feature to read fdf fields.

Calculated fields means i have 3 fields in pdf like Quantity, Rate and amount. quantity come from database at the time of pdf creation on that time Rate and amount column will be blank.

When user enter rate on rate column, amount column will be auto calculated(Quantity * Rate).

Validation: Rate column accept only integer value. 


If it is possible, then HOW?


Thanks


Generating a PDF

$
0
0
Hi,

I have added reference of following DLL's
APToolkitNET.dll
Aspose.Pdf.dll
Aspose.Words.dll

By this I am able to create a pdf from word Document
then, I am trying to Create PDF from HTMl string. There I am getting error in the first line itself 

"  Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();  "

as Unable to find class Generator

Do i need to add any more reference files ?

Please Let me know your Comments on this.

Pdf to pptx

UnitTesting comparison between two pdf streams

$
0
0
Hi,

I wanted to build a unit test that generates a pdf and compares it to a previously generated and approved pdf, but comparing two streams of the same exact process shows that the files are not the same (probably because of file info differences?)
Do you have any idea how to succesfully compare the two memory streams that where created by the same exact process?

Hope I was able to explain my self.

D'vir
Viewing all 3131 articles
Browse latest View live