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

Incrementally Saving PDF

$
0
0
Aspose PDF .NET 10.5

When building a large Document, is incremental saving a good idea?  How can I clear up some memory during the build process?  I have a lot of nested tables to get the design I need.  Is there something I should be doing to render these tables more efficiently?  Overall, I'm having some memory problems in IIS and on my local machine running some test PDF creations. Any tips would be very welcome.  Thanks.

HTML to PDF, data truncated after redering

$
0
0
I am generating a PDF using a html (dynamically generated) . 

When pdf is created, content is being truncated when data can't fit in a single page. 
Any body has any clue how to fix it, with out manually breaking the html and rendering in different page?

Can not get temporary license

$
0
0
I wanted to have a temporary license and submitted request with quote number: 150610232812, but it went to blank page "Temporary License Request Information" (see my screenshot), I'm not sure how I can get the license. Please help

When i add a image to a PDF, Doc.save() can't catch the exception and don't run and stop there

$
0
0
We use aspose-pdf-10.3.0.jar in  docker,hope insert a picture into a PDF file.
but when we call pdf.save method,the method has been no response.
please tell me does aspose-pdf whether to support running in docker?


com.aspose.pdf.Document pdfDocument1 = new com.aspose.pdf.Document(pdfUrlAll);
...
byte[] bytes = new BASE64Decoder().decodeBuffer(imgBase64);
...
InputStream imageStream = new ByteArrayInputStream(bytes);
...
page.getContents().add(new com.aspose.pdf.Operator.GSave());
...
pdfDocument1.save("/usr/files/test.pdf");

PDF/A validation fails

$
0
0
Hi.

We use your product for pdf/a files generation.
Some files have validation issues. For example if we convert html to pdf/a we may have such issues:

Validating file "test.html.pdf" for conformance level pdfa-1b
The value of the key N is 4 but must be 3.
A device-specific color space (DeviceRGB) without an appropriate output intent is used.
The document does not conform to the requested standard.
The document doesn't conform to the PDF reference (missing required entries, wrong value types, etc.).
The document contains device-specific color spaces.


PDF-Tools PDF validator is used for validating (http://www.pdf-tools.com/pdf/validate-pdfa-online.aspx).

We use rather simple code for conversion:

var license = new Aspos
e.Pdf.License();
license.SetLicense("Aspose.Total.lic");

Aspose.Pdf.Document pdf = new Document(inputFilePath, new HtmlLoadOptions());

pdf.Convert(new MemoryStream(), Aspose.Pdf.PdfFormat.PDF_A_1B, Aspose.Pdf.ConvertErrorAction.Delete);

pdf.Save(outputFilePath);


PS. XLS, TXT, EMF, WMF files also converted to pdf/a with validation issues.

Com.Aspose.Pdf.Image setBlackWhite also adds an Evaluation mark

$
0
0
Hello,

When adding the following to an image, an evaluation mark is also added to the image while using a valid license file:

com.aspose.pdf.Image image = new com.aspose.pdf.Image();
image.setFile(tempFrameFile);
image.setBlackWhite(true);

I've noticed one post on the forum by an Aspose Staff member mentioning this in January, but no fix has been given in the last updates.

See the mentioning forum post here:
http://www.aspose.com/community/forums/permalink/576952/600526/showthread.aspx#600526

Please let us know when this will be fixed, as saving a black and white image to a color pdf makes the pdf too large. We need the black and white compression in the pdf.

Kind regards,
Cedric

Polygon Annotation with a cloud style

$
0
0
is it possible? if so can someone please provide a code sample?

Getting Out of Memory Exception

$
0
0
Hi Team,

I am using aspose-pdf-10.3.0.jar(Trial version) to add password for PDF files.  But I am getting OUT OF MEMORY Exception when I run the program.  Very few times the program runs successfully and password will be added to the pdf file.  Is this due to limited version which I am using?  Your help in this regard is highly appreciated.  I am pasting the code below for your reference. For small PDF files this works fine but if the pdf file size is more than 2 MB this will give out of memory exception
package com.pdf;

public class AddPassword {

public static void main(String[] args) {
com.aspose.pdf.Document document = new com.aspose.pdf.Document("C:\\Sample.pdf");
//encrypt PDF
document.encrypt("user", "india123", 0, com.aspose.pdf.CryptoAlgorithm.AESx256);
//save updated PDF
document.save("C:\\Sample-pwd.pdf");
System.out.println("password added");
}

}

Regards
Balu

Optimize Fonts when concatenating pdfs

$
0
0
Dear ladies and gentlemen,

In our application we have to combine several (eg 100) PDF files.
To optimize the resulting file we use this code:

pdfFileEditor.Concatenate(pdfStreams.ToArray(), packPdf);

packPdf.Seek(0, SeekOrigin.Begin);
var pdfDocument = new Document(packPdf);
foreach (Page page in pdfDocument.Pages)
{
var idx = 1;
foreach (XImage image in page.Resources.Images)
{
using (var imageStream = new MemoryStream())
{
image.Save(imageStream, ImageFormat.Jpeg);
imageStream.Seek(0, SeekOrigin.Begin);
page.Resources.Images.Replace(idx, imageStream);
}
idx = idx + 1;
}
}

// optimize the file size
pdfDocument.Optimize();
pdfDocument.OptimizeSize = true;
pdfDocument.OptimizeResources(new Document.OptimizationOptions
{
RemoveUnusedStreams = true,
RemoveUnusedObjects = true,
LinkDuplcateStreams = true
});
// save updated File
pdfDocument.Save(newPdfFileName);


After this optimization the size of the created pdf file is still too large. The cause of this is due to the fonts used in the source files.
The font definitions (/font-Dictionary and dependent objects) were taken for each original document into the target file.
If the /FileFonts2 streams are identical, only one stream was saved. If the streams are not identical, no union set of all required characters was formed.
The difference in file size, with an average size of the streams of 18.5 KB, is about 3 MB.

Is there a way to summarize the fonts efficiently?
Is such an implementation planed?

Best regards

Kind Regards,
Oliver

convert Chinese Font using jpegdevice

$
0
0
Hi,
My company Pou Chen have purchased Aspose.Pdf Product Family version 10.5 and we got some problem with Chinese font conversion and I am asking the question for them. The code is as below. We convert a pdf to image using jpegdevice, but the Chinese encoding turns out to be random characters in the image. Is there a way to specify the encoding like for Aspose Txt so the jpegdevice can convert the Chinese font properly?

using (FileStream imageStream = new FileStream(@"C:\Debug\" + filename + ".jpg", FileMode.Create))
                {
                    // Create Resolution object
                    Resolution resolution = new Resolution(200);

                    // Create JPEG device with specified attributes (Width, Height, Resolution, Quality)
                    // where Quality [0-100], 100 is Maximum
                    JpegDevice jpegDevice = new JpegDevice(resolution, 100);
                    jpegDevice.RenderingOptions.BarcodeOptimization = true;
                    //jpegDevice.RenderingOptions.SystemFontsNativeRendering = false;
                    //Aspose.Pdf.LoadOptions option = new Aspose.Pdf.LoadOptions();
                   
                    // Convert a particular page and save the image to stream
                    jpegDevice.Process(pdfDocument.Pages[pageCount], imageStream);

                    // Close stream
                    imageStream.Close();
                }

Aspose Pdf Dll 10.5.0 and Concurrent Reuqest

$
0
0
Hi,

I am using Aspose.PDF to generated statements.

Issue - When we have concurrent request to generate statement, ASPOSE starts failing.

Does ASPOSE supports concurrent requests? If yes what settings will help to achieve this.

If No then do you guys have any plan to support it?

Thanks,
Raj

Pdf printing: Font quality not as expected

$
0
0
Dear Aspose Team,

we are currently in the evaluating the capabilities of Aspose.Pdf for Java compared to the .Net version.

So far, everything looks good.

But when it comes to printing out the PDF, we recognized differences in the quality of the font.

In .Net the font looks fine and as expected, while using the printing in Aspose.Words java, the font letters become pixelated.

Do you have any suggestions, how to improve on that?

Please find attached the pdf file used as well as both resulting Postscript files.

The coding used (similar to .Net):


@Test
    public void TestPdfToPsConversion(){
   
    AsposePdfConverter testAsposePdfConverter = new AsposePdfConverter();
   
    File pdfInput = new File("C:\\testDoc\\pdfPrintJava\\mixedOrientation.pdf");
   
   
    try {
   
     FileInputStream fis = new FileInputStream(pdfInput);
   
     byte[] fileBytes = IOUtils.toByteArray(fis);
     
     fis.close();
   
     byte[] converted = testAsposePdfConverter.convertToPdfPs(fileBytes);
     
     FileOutputStream fileOut = new FileOutputStream(new File("C:\\testDoc\\pdfPrintJava\\mixedOrientationTestOutput.ps"));
     
     fileOut.write(converted);
     
     fileOut.close();
    }
    catch(Exception e) {
    e.printStackTrace();
    }
    finally {
    }
   
    }

public byte[] convertToPdfPs(byte[] content) throws IOException {

        initializeLicense();
        byte[] result = null;
        URI printToFileURI = null;
        SimpleDateFormat relativeSubFolderPath = new SimpleDateFormat("yyyyMMdd");
        SimpleDateFormat id = new SimpleDateFormat("HHmmss");
        String filePath =
                String.format("C:\\testDoc\\pdfPrintJava\\%s.%s", "printPdfPsConversion", "ps");
        String strPrinterName = BdcProperties.PRINTER_NAME;

        InputStream input = new ByteArrayInputStream(content);
        Document pdf = new Document(input);

        RenderingOptions renderOpts = new RenderingOptions();
        renderOpts.setSystemFontsNativeRendering(true);

        PdfPrinterSettings printerSettings = new PdfPrinterSettings();
        printerSettings.setPrinterName(strPrinterName);
        printerSettings.setPrintToFile(true);
        printerSettings.setPrintFileName(filePath);

        PrintPageSettings pageSettings = new PrintPageSettings();
        pageSettings.setMargins(new PrinterMargins(0, 0, 0, 0));
        pageSettings.setPrinterSettings(printerSettings);
        pageSettings.setColor(true);
        pageSettings.setLandscape(false);

        PdfViewer viewer = new PdfViewer();
        viewer.bindPdf(pdf);
        viewer.setPrintPageDialog(false);
        // pageSettings.setPrinterSettings(printerSettings);
        viewer.setAutoResize(true);
        viewer.setAutoRotate(true);
        viewer.setRenderingOptions(renderOpts);

        // viewer.setResolution(600);

        viewer.printDocumentWithSettings(pageSettings, printerSettings);
        

        try {
            result = Files.readAllBytes(Paths.get(filePath));
        } catch (IOException e) {
            logger.error(" : " + e.getMessage(), e);
            throw new BdcException(MessageCodes.ConvertToPdfFormatFailed, StatusInfoSource.General, e);
        } catch (Exception e) {
            logger.error(" : " + e.getMessage(), e);
            throw new BdcException(MessageCodes.ConvertToPdfFormatFailed, StatusInfoSource.Converter, e);
        } finally {
            //Files.delete(Paths.get(filePath)); // change to delete directory also
            input.close();
            viewer.close();
        }

        return result;
    }


Thanks and kind regards
Wolfgang

Need to fill a LiveCycle form from a databse

$
0
0
Hello there,

I have a live cycle PDF that I want to fill from a data source.  I want to produce one pdf for each record in the source and print it.  

Do you have a product that would support that case?

Thanks

Mike Doyle

Getting an Out of Memory error when converting PDF to PNG

$
0
0
When we attempt to convert the attached PDF file into a PNG, the component is throwing an Out of Memory error.

SQL CLR Out of Memory converting certain PDFs to images (Aspose.pdf 10.5, SQL 2012)

$
0
0
We've been using a CLR implementation to convert pdfs to images and for a few of these images, we get the error below. Pdfs of similar size do convert with no error.

Msg 6533, Level 16, State 49, Line 5
AppDomain xxxxx.dbo[runtime].18 was unloaded by escalation policy to ensure the consistency of your application. Out of memory happened while accessing a critical resource. 

I've attached the pdf in question, and the c# code from the clr. 

Please let me know if there is a way to avoid this issue and convert this to an image.

Thanks,
Reuven

Thread Safety on Html To PDF conversion

$
0
0
When attempting to convert HTML to PDF using the Aspose.Pdf.Generator.Pdf object, running two conversions in parallel tasks (each creating their own Pdf object) results in either an 'Object is currently in use elsewhere' or 'key is already present in dictionary'.   

Doing the two conversion synchronously converts correctly.  The same two conversion using a Task.Run wrapper and awaiting each task, also converts correctly.  In both cases, the 1st conversion completes before a new Pdf object is created.  

I went through and reviewed this thread:

http://www.aspose.com/community/forums/thread/492825/object-is-currently-in-use-elsewhere-error.aspx

And it appears that Pdf objects should be thread safe. 

I'm attaching recreation tests written in Nunit (renamed from .cs to .txt) .  I've also gone through and made sure to update Aspose.Pdf to the latest version 10.5.1.0 from the nuget packages.

Mike

Evaluation Version

$
0
0
We are currently using a competitors product and are in the process of evaluating replacements (due their toolkits poor performance). I have downloaded your toolkit (evaluation version) and am trying to test the merging of a couple thousand PDF files (FYI - this would only represent a subset of a nightly run). The issue I am running into is the eval version is responding with the error "At most 4 elements (for any collection) can be viewed in the evaluation mode.". Therefore I cannot test the performance of your product and if you cannot provide an alternative solution (other than buying and hoping it works) you will be excluded from consideration. The only thing I could find in the documentation for merging PDF's is -
http://www.aspose.com/docs/display/pdfnet/Concatenate+PDF+Files (and let's just say that working at the page level to merge documents is kind of a sloppy implementation). Anyway, please tell me how to proceed.

OSGI Bunldes - aspose-pdf-9.3.1

$
0
0
Hi,

We are trying to use the aspose-pdf-9.3.1.jar in an osgi container. Do you have the osgi version of the jar?

Thanks,
Chamal

PCL to PDF conversion

$
0
0

Hi

For our project we are planning to convert PCL file to PDF through Aspose licenced version. But before purchasing the licence we want to check functionality of Aspose PCL to PDF converter. So we have downloaded the evalution version aspose-pdf-10.3.0-java and tried to convert the PCL file to PDF. But we are getting below exception.

Please let us know what is the exact cause for this. The PCL file contains table,images.

The Code we are using for Conevrting PCL to PDF is:


 Pdf pdf = new Pdf();

// bind the source PCL file with Pdf object

pdf.bindPCL("sample.pcl");
// save the resultant PDF document

pdf.save("sample.pdf");

Exception We are getting:

 

Exception in thread "Thread-8" java.lang.NullPointerException

      at java.lang.String.contains(String.java:1881)

      at com.aspose.pdf.internal.p530.z10.m2(Unknown Source)

      at com.aspose.pdf.internal.p530.z10.m1(Unknown Source)

      at com.aspose.pdf.internal.p516.z10.m1(Unknown Source)

      at com.aspose.pcl.composer.PDFComposer.m1(Unknown Source)

      at com.aspose.pcl.composer.PDFComposer.run(Unknown Source)

      at java.lang.Thread.run(Thread.java:736)

Exception in thread "Thread-8" java.lang.NullPointerException

      at java.lang.String.contains(String.java:1881)

      at com.aspose.pdf.internal.p530.z10.m2(Unknown Source)

      at com.aspose.pdf.internal.p530.z10.m1(Unknown Source)

      at com.aspose.pdf.internal.p516.z10.m1(Unknown Source)

      at com.aspose.pcl.composer.PDFComposer.m1(Unknown Source)

      at com.aspose.pcl.composer.PDFComposer.run(Unknown Source)

      at java.lang.Thread.run(Thread.java:736)

Thanks

Agniv Dutta.

Apsose PDF - OSGI Issue

$
0
0
Hello,

We are using the aspose-pdf-10.3.0.jar in Jboss Fuse OSGI container. The way the META-INF has been defined is causing issues in loading of the jar.

Please repackage the Jar with out the following line in the META.INF file.

Export-Package: com.aspose.pdf

The use of this jar is completely limited as we need to use other packages. Or you can export all the packages to avoid this problem.

This for use by Connecture Inc and we are stuck at this moment.

Thanks,
Chamal


Viewing all 1038 articles
Browse latest View live