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

Aspose PDF not printing correctly

$
0
0
I have several Word documents that I need to print using Aspose WORDS or Aspose PDF. I have tried the following methods.
Method 1. Print from Aspose WORDS.  Prints OK. I can set duplex, color,  but the paper size and orientation are ignored. It always prints A4 and Portrait, even though all the PrinterSettings values seem to be OK.
Method 2. Convert to PDF and print using Aspose PDF. I can set page size, orientation, duplex,color. If I set AutoResize=true the printed page is re-sized much too small. When AutoResize=false the printing  overflows the page. Left margin is large and the right side is missing.

If I print the same converted PDF from MS Word or from Adobe Reader it prints fine, no problems.

I need a solution using either Aspose WORDS or Aspose PDF that
1. Prints the file correctly on the page
2. Allows me to set page size (A4, A3 etc), Orientation, Duplex, color 
Any suggestions?
The two files are attached. SampleDoc1W.doc is the original Word Document. SampleDoc1.PDF is the same document converted to PDF by Aspose Words

PdfConverter.getNextImage

$
0
0
Hi,

I want to create a thumbnail of a page using Apose.Pdf 9.1.0. For that, I think I have to use PdfConverter.getNextImage. However, I'd like to get my thumbnail in Jpg and Png. Checking the .NET documentation (as I cannot find the Java one) shows that one of the overloads of the getNextImage method should have a ImageFormat parameter, but I don't see anything like that in Java. There are some overloads that look like it, but instead of ImageFormat, the expected parameter class is named "ag" due to obfuscation.

If that's indeed the class that I should be using, can that be fixed?

Thank you.

pdf to Word conversion

$
0
0
Hello,
I would like to know if your library can convert a pdf Stream to a MS Word Stream in C#.
Thank you,
Tom

Print Range of pages in aspose pdf for Java

$
0
0
Hello

I need to print a range of pages in Aspose Pdf for Java.  Unfortunately, I didn't find any way to specify the page range using aspose sdk.

I couldn't really figure out how to use printDocumentWithSettings in PdfViewer! is it supported in current aspose java pdf ? no sdk doc, no examples and seems not yet implemented!

I really need to print range of pages for a close deadline in September, in case of not implemented feature, could you tell me the approximate date of release?

Thanks for your support.

Mohammad

Need Aspose.PDF 7.2.0

$
0
0
Hi,

I need to download Aspose.PDF version 7.2.0 for .Net platform. I went through the download section, but there I could not get a download link for this version.

Could you please let me know from where to download Aspose.PDF 7.2.0 for .Net platform?

This code produces no compilation errors

$
0
0
 Aspose.Pdf.Facades.PdfFileEditor pdfEditor = new Aspose.Pdf.Facades.PdfFileEditor();  
 pdfEditor.Append("input.pdf", "port.pdf", 1, 1, "output.pdf");

---------------------------------------------------------------------------------------
Error 1 The type 'System.Web.HttpResponse' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.C:\Program Files\Aspose\Aspose.Pdf for .NET\Examples\ProgrammersGuide\WorkingWithAsposePDF\WorkingWithPages\InsertEmptyPageInPDFFile\CSharp\Program.cs33InsertEmptyPageInPDFFile

VS2008 NET3.5
Aspose.Pdf 9.2.0.0

Adding a Background Image to a PDF, using BackgroundArtifact, examples don't work.

$
0
0
Hi,

The Aspose example code showing how to add a background image to a PDF doesn't appear to work

I've tried the main web page example and the code from the GitHub repositories. 

http://www.aspose.com/docs/display/pdfnet/Add+image+as+page+background 
https://github.com/asposepdf/Aspose_Pdf_NET

Both produce a blank pdf (except for the eval message). 

The code from git hub example
 // The path to the documents directory.
            string dataDir = Path.GetFullPath("../../../Data/");            // create a new Document object            Document doc = new Document();            // add a new page to document object            Page page = doc.Pages.Add();            // create BackgroundArtifact object            BackgroundArtifact background = new BackgroundArtifact();            // specify the image for backgroundartifact object            background.BackgroundImage = File.OpenRead(dataDir + "aspose-total-for-net.jpg");            // add backgroundartifact to artifacts collection of page            page.Artifacts.Add(background);            // save the document            doc.Save(dataDir + "output.pdf");

I'm currently using the eval version of Aspose.pdf , but this is a key requirement for us and is stopping my company from purchasing. Please can you advise how to get this working.

Many Thanks.



Checkboxes in PDF are getting checked incorrectly.

$
0
0

Hi,

 

We are using Aspose for on the fly PDF generation. The PDF files we generate are to be prefilled with ceratin values( and check boxes are also to be ticked based on values we pass). We use XFDF for populating the pdf fileds. When we render the XFDF in the browser, the checkboxes are getting ticked(selected) correctly. But when we render the PDF after prefilling it with XFDF data using Aspose, the checkboxes are are not getting ticked (selected) properly. We are using Aspose 8.3.3 version. Kindly let us know whether this issue has already been addressed. If yes let us know the solution for this issue.

 

EDIT :

Also tried using Aspose 8.9.0.0 version. Still the issue persists. Kindly help us in resolving this issue.

 

Kindly reply to us asap. We are in urgent need of solution for this issue.

 

Regards,

kishorekumar.


Convert HTML to PDF Aspose.Pdf 9.1 Excepton

$
0
0
We are currently using the version 9.1 to convert HTML to PDF. However there is an error in which we couldn't understand because it is an error thrown by aspose itself. 

Here's the code:
// Specify the The base path/url for the html file which serves as  images database
String basePath = "C:/Users/Documents/AsposeTest";
com.aspose.pdf.HtmlLoadOptions htmloptions = new
com.aspose.pdf.HtmlLoadOptions(basePath);
 
// use the new conversion engine
htmloptions.setUseNewConversionEngine(true);
// load HTML file
com.aspose.pdf.Document doc = new
com.aspose.pdf.Document(basePath+"NewFile.html", htmloptions);
// Save HTML file
doc.save("Web+URL_output.pdf");

Actually, this is almost exactly the copy and paste code mentioned on this website on how to convert HTML file to PDF however and Exception error is thrown. Here's the error:

Exception in thread "main" class com.aspose.pdf.internal.hv.g: Value cannot be null.
Parameter name: stream
com.aspose.pdf.internal.ii.am.b(Unknown Source)
com.aspose.pdf.internal.ii.am.<init>(Unknown Source)
com.aspose.pdf.internal.ii.am.<init>(Unknown Source)
com.aspose.pdf.bn.a(Unknown Source)
com.aspose.pdf.ADocument.a(Unknown Source)
com.aspose.pdf.ADocument.<init>(Unknown Source)
com.aspose.pdf.Document.<init>(Unknown Source)
com.aspose.main.AsposePdfTest.main(AsposePdfTest.java:22)
at com.aspose.pdf.internal.ii.am.b(Unknown Source)
at com.aspose.pdf.internal.ii.am.<init>(Unknown Source)
at com.aspose.pdf.internal.ii.am.<init>(Unknown Source)
at com.aspose.pdf.bn.a(Unknown Source)
at com.aspose.pdf.ADocument.a(Unknown Source)
at com.aspose.pdf.ADocument.<init>(Unknown Source)
at com.aspose.pdf.Document.<init>(Unknown Source)
at com.aspose.main.AsposePdfTest.main(AsposePdfTest.java:22)

Can you please let us know what seems to be the problem? We are considering purchasing Aspose. Please reply to us the soonest. Thank you. 

Extract text from PDF - Issues

$
0
0

Hi Team,

 

I use Aspose.Pdf version 6.9.0.0. And when you try to get the text from the PDF document gets an exception.

 

Here is the code snippet,

 using (var ms = newMemoryStream(data))

{

   var pdfDocument = new Aspose.Pdf.Document(ms);

   //create TextAbsorber object to extract text

   TextAbsorber textAbsorber;

    textAbsorber = newTextAbsorber();

   pdfDocument.Pages.Accept(textAbsorber);

}

Exception message: 

Item has already been added. Key in dictionary: "61.68" key is added: '61, 68 '


Stack trace:

   в System.Collections.SortedList.Add(Object key, Object value)

   в  . .  (ArrayList )

   в  . ..ctor(ArrayList )

   в  . .  ()

   в Aspose.Pdf.Text.TextAbsorber.  (  , Boolean )

   в Aspose.Pdf.Text.TextAbsorber.Visit(Page page)

   в Aspose.Pdf.Page.Accept(TextAbsorber visitor)

   в Star.Salut.DataStruct.ModelEntityManager.LargeObjectManager.UpdateFilesTextData() в 

Facades Creates a Hidden Radio Button

$
0
0
I am running into similar problem as:
http://www.aspose.com/community/forums/thread/247866/radio-button-hidden-item.aspx

I tried running a slightly modified version of:
http://www.aspose.com/docs/display/pdfnet/Add+Form+Field+in+an+Existing+PDF+file+(Facades)
to generate the pdf.  I opened up the pdf using the Adobe acrobat and went to edit the fields in the pdf.
Trying to do so made the acrobat crash, and when it didn't crash, it didn't show the field list that I normally see. It also generated an extra field.

How do I go about not generating this extra field?

I have also included a sample C# file I wrote using Window Forms Application.
I am using .net 3.5 and Aspose.Pdf 9.2.1.0

PDF document to a TIFF image file produces an output with a color depth of 1 bit

$
0
0
Converting a PDF document to a TIFF image file produces an output with a color depth of 1 bit even though the TiffSettings is set to use the default which is 32 bit. This issue occurs when the TiffCompression is set to RLE. However, if the TiffCompression is LZW, the output color depth is 32 bit

How to merge PDF Files with Complete the bookmark

$
0
0
I want to merge some PDF files with nested bookmarks. The goal is to preserve the existing bookmark structure after the merge.
For example:
Merge PDF1.pdf and PDF2.pdf to Merge.pdf
(The original file may contain multiple nested bookmarks)
PDF1.pdf Contain bookmarks
bookmark A from Page 1 
bookmark B from Page 3
     child bookmarks B-Chart from Page 4
bookmark C from Page 5

PDF2.pdf Contain bookmarks
bookmark D from Page 1
bookmark E from Page 3
      child bookmarks E-Chart from Page 4
bookmark F from Page 5

Merge PDF1.pdf and PDF2.pdf to Merge.pdf:
PDF.pdf Contain bookmarks
--bookmark PDF1 from Page 1 
       bookmark A from Page 1
       bookmark B from Page 3
            child bookmarks B-Chart from Page 4
       bookmark C from Page 5
--bookmark PDF2 from Page 6
       bookmark D from Page 6
       bookmark E from Page 8
           child bookmarks E-Chart from Page 9
       bookmark F from Page 10
For more details see the attached.
How to ..?
Thank!

Cannot compile example

$
0
0
I cannot compile this example: http://www.aspose.com/docs/display/pdfjava/Convert%20PDF%20pages%20to%20JPEG%20Image

The error message is:
  ConvertPdf.java:18: <identifier> expected                                      
  jpegDevice.process(pdfDocument.getPages().get_Item(1), imageStream);           
                    ^                               
   ConvertPdf.java:20: <identifier> expected                                       
   imageStream.close();                                                            
                    ^                                                                                          

I set the classpath as follows: 
export -s CLASSPATH=/home/hp/java/aspose-pdf-jdk14.jar         

This is my sourcecode:
import java.io.*;

class ConvertPdf {

//open document
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("input.pdf");
// create stream object to save the output image
java.io.OutputStream imageStream = new java.io.FileOutputStream("Converted_Image.jpg");

//create JPEG device with specified attributes
//Quality [0-100], 100 is Maximum
//create Resolution object
com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(300);
//create JpegDevice object where second argument indicates the quality of resultant image
com.aspose.pdf.devices.JpegDevice jpegDevice = new com.aspose.pdf.devices.JpegDevice(resolution, 100);
//convert a particular page and save the image to stream
jpegDevice.process(pdfDocument.getPages().get_Item(1), imageStream);

//close the stream
imageStream.close();
}

Unexpected font parsing exception in HTML conversion

$
0
0
Hello, Aspose,

I have a problem with Html conversion with some files (examples attached). When I try to convert file an exception occurs such as "Unexpected font parsing". I use following code:

Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
                        Aspose.Pdf.Generator.Section section = pdf.Sections.Add();

                        using (var streamReader = File.OpenText(inputFilePath))
                        {
                            Aspose.Pdf.Generator.Text text = new Aspose.Pdf.Generator.Text(section, streamReader.ReadToEnd());

                            text.IsHtmlTagSupported = true;

                            section.Paragraphs.Add(text);

                            using (var outputDocument = new Aspose.Pdf.Document(pdf))
                            {
                                outputDocument.Convert(
                                    logFileName,
                                    Aspose.Pdf.PdfFormat.v_1_5,
                                    Aspose.Pdf.ConvertErrorAction.Delete);
                                outputDocument.Save(outputFilePath);
                            }
                        }

I also have tried this code from your samples:
Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();Aspose.Pdf.Generator.Section section = pdf.Sections.Add();StreamReader r = File.OpenText(inputFilePath);Aspose.Pdf.Generator.Text text2 = new Aspose.Pdf.Generator.Text(section, r.ReadToEnd());text2.IsHtmlTagSupported = true;section.Paragraphs.Add(text2);pdf.Save(outputFilePath);

Could you please help me with this issue.
Thanks in advance.

Best Regards,
Mike

Unable to save document: receive error &quot;Invalid xref type&quot;

$
0
0
Opening and then saving the attached PDF documents raises an error of "Invalid xref type" at the save moment. Below is the sample code:

System.Windows.Forms.DialogResult dlgResult =openFileDialog1.ShowDialog();
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(openFileDialog1.FileName);
doc.Save(@"c:\temp\output.pdf");

Unable to convert to PDF/A

$
0
0
Hi there,

When I'm converting the attached file (admin.pdf) to PDF/A using Aspose.PDF 9.3, the resulting PDF file (_out_admin.pdf) is totally unreadable.

Thanks

pdf to html converter

$
0
0
Hi 
We are using aspose.pdf to convert pdf to html
But it is taking a lot of time to convert.Can u say why it is taking much time.We are using a free trai version with temporary license, is this the reason to take time?? For 100 pages of pdf it is taking 30 minutes and and for 400 pages it is taking nearly 1 hour.Please help out in resolving this issue.
Reply asap.

Thanks & Regards
Vasavi

Aspose 9.0.0 and 9.1.0 gets stuck in an infinite loop

$
0
0
Hi,

we are trying to convert the first and only page if this PDF to an image, but Aspose gets stuck in an infinite loop.

Stack trace:
at java.awt.geom.Path2D$Float.moveTo(Path2D.java:338)
- locked <0x00000000a23af9d8> (a java.awt.geom.GeneralPath)
at com.aspose.ms.core.c.b.j.a(Unknown Source)
at com.aspose.ms.core.c.c.c.c(Unknown Source)
at com.aspose.ms.core.c.b.f.W(Unknown Source)
at com.aspose.ms.core.c.b.f.a(Unknown Source)
at com.aspose.ms.core.c.b.f.b(Unknown Source)
at com.aspose.ms.core.c.b.b.g(Unknown Source)
at com.aspose.ms.core.c.b.b.h(Unknown Source)
at com.aspose.ms.core.c.b.b.b(Unknown Source)
at com.aspose.ms.core.c.b.h.a(Unknown Source)
at com.aspose.ms.core.c.b.h.b(Unknown Source)
at com.aspose.ms.core.c.b.h.a(Unknown Source)
at com.aspose.ms.core.c.b.h.a(Unknown Source)
at com.aspose.ms.core.c.b.a.createStrokedShape(Unknown Source)
at com.aspose.ms.System.d.af.c(Unknown Source)
at com.aspose.ms.System.d.b.x.a(Unknown Source)
at com.aspose.ms.System.d.b.x.a(Unknown Source)
at com.aspose.ms.System.d.b.x.a(Unknown Source)
at com.aspose.ms.System.d.b.x.b(Unknown Source)
at com.aspose.ms.System.d.u.b(Unknown Source)
at com.aspose.pdf.b.k.b.h.a(Unknown Source)
at com.aspose.pdf.b.k.l.b(Unknown Source)
at com.aspose.pdf.b.k.l.dmv(Unknown Source)
at com.aspose.pdf.b.c.e.b.i.j.a(Unknown Source)
at com.aspose.pdf.b.c.e.b.c.ai.g(Unknown Source)
at com.aspose.pdf.b.c.e.b.c.ai.f(Unknown Source)
at com.aspose.pdf.b.c.e.b.c.k.b(Unknown Source)
at com.aspose.pdf.b.c.e.b.c.k.a(Unknown Source)
at com.aspose.pdf.devices.d.a(Unknown Source)
- locked <0x00000000a23be438> (a com.aspose.pdf.Document)
at com.aspose.pdf.devices.d.cTE(Unknown Source)
at com.aspose.pdf.devices.ImageDevice.p(Unknown Source)
at com.aspose.pdf.devices.JpegDevice.processInternal(Unknown Source)
at com.aspose.pdf.facades.PdfConverter.getNextImage(Unknown Source)
at com.aspose.pdf.facades.PdfConverter.getNextImage(Unknown Source)

With the following code:

final PdfConverter converter = new PdfConverter();
converter.bindPdf(new ByteArrayInputStream(bytes));
converter.setStartPage(1);
converter.setEndPage(1);
converter.doConvert();

final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
converter.getNextImage(outputStream);

Any advice? getNextImage() never seems to return, at least not within 20-30 minutes.

Searchable pdf convertion using ASPOSE

$
0
0
Hi Team,

We purchased the licence for ASPOSE java api.
Using ASPOSE api we are unable to convert non searchable pdf into searchable pdf.
After goggling we came to know that ASPOSE did not support to convert the non searchable pdf into searchable pdf.
Please refer the link.

The above link it is mentioned that we can convert the non searchable pdf into image and image to searchable pdf. We are able to convert non searchable pdf into image but while converting that image into searchable pdf we are facing the following error

"data.xml file is not available in resources".

Viewing all 3131 articles
Browse latest View live