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

Aspose Pdf - Table inside FloatingBox

$
0
0
Hi, Could you please look into problem this and provide a solution? Forum link has been included below. Thanks in advance. - Dhivya Forum Thread URL: http://www.aspose.com/community/forums/thread/638508/table-inside-floating-box-isbroken-not-working-which-exceeds-page-height.aspx
This message was posted using Banckle Live Chat 2 Forum

Saving pdf document to doc(x) causes NullPointerException

$
0
0
Hello,

When trying to save the attached pdf file as doc(x), a NullPointerException is thrown back.

Version: 10.2.0 for Java.
Error reproduced on: Ubuntu and Red Hat Linux.
Example code:
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("<full path>/emd-2009-043098.pdf");
pdfDocument.save("/tmp/tempname.doc", SaveFormat.DocX);

Unable to extract attachments from pdf document.

$
0
0
Dear Aspose Team,

Please find attached pdf file. I am using the below code to extract the attachments from a pdf document. But it is showing the embedded files count as 0.

var attachments =  pdfDocument.EmbeddedFiles;

Please let me know whether this is an issue inside Aspose.Pdf or not.

Thanks & Regards,
N.Murali Krishna.

PDFViewer in Aspose.Pdf.Kit

$
0
0
I am using version 3.3.0.0 of Aspose.Pdf.Kit and in our development environment (Windows 2008 R2 Standard 64 bit) it works fine. When attempting to deploy to our production environment (Windows Server Enterprise SP2 64 bit) I get an error "pages are corrupt or too many pages" when invoking the OpenPdfFile method. In both cases we are running version 2.2.50727 of the .Net Framework. Thanks for your help.

NullReferenceException when setting the license

$
0
0

I recently purchased Aspose.Pdf for .Net component.

From time to time, I'm getting NullReferenceException in the following line:

license.SetLicense("Aspose.Pdf.lic");

Please advise.

 

Thanks,

 

Ofer.

 

 

 

 

 

 

Images converted from PDF-&gt;TIFF are having black background color instead of white in mspaint and microsoftoffice image tools

$
0
0

 Hi,

 

We recently purchased Aspose PDF component, by using below code snippet PDF files are converted to TIFF image.

 

Converted Tiff images –

1)      Images are legitimate when it opens by using “IrfanImage”, “Microsoft office Document Imaging” tools. (Background color is : white and Text color is Black)

2)      Same images when it opens by using “mspaint”, “Windows picture & Fax Viewer” tool – Image background coming in Black and Text in White color. Actually images suppose to be having white background and black text.

 

We would need a quick solution to view converted images uniformly in all image viewing tools.  We appreciate quick response and solution.

 

Attached are:

1)      Original PDF file.( 4831 EBDRTransactionAmountDiffersForm.pdf)

2)      4831 EBDRTransactionAmountDiffersForm_AsposeConverted.tif converted one.

 

Environment: JRE 7, OS: Linux and Windows.

 

Thanks

Raghu

 

Code Snippet:

 

SimpleDateFormat dateForamt=new SimpleDateFormat("dd-MM-yy:HH:mm:ss");

            System.out.println("Image Conversion Start"+ dateForamt.format(System.currentTimeMillis()));

            //Open document

            com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("C:\\ImageConversion\\Pdf\\ImageConversionNewtry\\EBDResolutionProcessForm(8).pdf");

            //Create stream object to save the output image

java.io.OutputStream imageStream = new java.io.FileOutputStream("C:\\ImageConversion\\Pdf\\ImageConversionNewtry\\EBDResolutionProcessForm(8)_Converted.tif");

            //Create Resolution object

            com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(200);

            // instantiate TiffSettings object

            com.aspose.pdf.devices.TiffSettings tiffSettings  = new com.aspose.pdf.devices.TiffSettings();

            // set the compression of resultant TIFF image

            tiffSettings.setCompression(com.aspose.pdf.devices.CompressionType.CCITT4);

            // set the color depth for resultant image

            tiffSettings.setDepth(com.aspose.pdf.devices.ColorDepth.Format1bpp);         

            // skip blank pages while rendering PDF to TIFF

            tiffSettings.setSkipBlankPages(false);

            //Create TiffDevice object with particular resolution

            com.aspose.pdf.devices.TiffDevice   tiffDevice = new com.aspose.pdf.devices.TiffDevice(resolution,tiffSettings);

            //Convert a particular page (Page 1) and save the image to stream

            tiffDevice.process(pdfDocument,1,1, imageStream);

            //Close the stream

            imageStream.close();

            dateForamt=new SimpleDateFormat("dd-MM-yy:HH:mm:ss");

            System.out.println("After Save IMAGE"+ dateForamt.format(System.currentTimeMillis()));

 

 

font corrupted in converted image

$
0
0
Hello, I am using Aspose in android environment. There are some font corrupted in converted image(attached pdf2image.PNG), how to fix it? Thanks in advanced. Sample code: 

java.io.OutputStream imageStream = null;
try {
    imageStream = new java.io.FileOutputStream(Environment.getExternalStorageDirectory().getPath()+"/my_Converted_Image_" + pageCount + ".jpg");
} catch (FileNotFoundException e) {
    e.printStackTrace();
}
// Create Resolution object
com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(250);
// 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(pdfDocument1.getPages().get_Item(pageCount), imageStream);

// Close the stream
try {
    imageStream.close();
} catch (IOException e) {
    e.printStackTrace();
}


khmer unicode is not shown in PDF doc

$
0
0
I want to create a pdf doc which can display khmer language (Unicode font).Here is my code

 String fontPath = Environment.getExternalStorageDirectory()
    + File.separator
    + "FontsTest"
    + File.separator
    + "khmerOS.ttf";
textFragment.getTextState().setFont(com.aspose.pdf.FontRepository.openFont(fontPath, ""));

But is does't show anything. How to use custom font in android project?

Here I have attached the fonts.

Thanks.
      

Inserting an image - no transparency?

Layers/OCG visiblity

$
0
0
Does Aspose PDF support functionality to set the default visibility of OCG layers in a PDF?

Also, do you support flattening of transparencies/overprint?

Thanks

XPS to PDF Conversion taking 15-20 secs and 50% CPU Utilization

$
0
0
Hi

I am using the Aspose.Pdf  product for converting the XPS to PDFs, the files conversion time is 15-20 secs per file depending upon the size(max being 400Kb). 

In our application we need to process nearly 2000 XPS files in an hour and the product is taking about 3 hrs to complete the conversion that is not exceptable.

I have two questions :
1.  For converting Word to PDF with Aspose.Word the conversion was pretty fast i.e. 2000 files in couple of minutes, why is it taking so long for XPS to PDF conversion with Aspose.Pdf.

2. While converting XPS to PDF I can see a warning :
 "
Warning: Could not find any font that contains the needed symbol: "?" . Used standard font.
"
How can we know the missing fonts from the com.aspose.pdf.Document object?

Please note I am using aspose-pdf-10.2.0.jar for the conversion.

I request you to look into the issue as early as possible as the code needs to be deployed for users in few days

Regards,
Roshni


How to add table of content in ASPOSE PDF with custom paging

$
0
0
Hi i am bharath, 

I want to know how to add custom page number in the table of content. I am able to add Table of Content but its auto generated for all the page, i want to know how to add custom table of content.
Please help me and explain the program...

PDFFileSecurity/DocumentPrivilege does not work to set AllowDegradedPrinting

$
0
0
Using Aspose.PDF 9.6.0.0, our code is having issues setting the Degraded Printing property for the PDFFileSecurity. Looking for guidance on the best way to do this. Sample code below:


var docPrivilege = Aspose.Pdf.Facades.DocumentPrivilege.ForbidAll;
docPrivilege.AllowDegradedPrinting = true;

var fileSecurity = new Aspose.Pdf.Facades.PdfFileSecurity();
fileSecurity.BindPdf(@"C:\temp\test.pdf");
              fileSecurity.EncryptFile("test","test",docPrivilege,Aspose.Pdf.Facades.KeySize.x128,Aspose.Pdf.Facades.Algorithm.AES);
fileSecurity.Save(@"C:\temp\tbdSec.pdf");

Textbox with Justify not working when text contains a parameter

$
0
0
Hi

Is it by design or a bug that text justify works fine unless I put a parameter or other expression into the text?

Thanks,
Greg

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

Bug: PDF/a conversion fails with 10.5.0.0 (works with 10.4.0.0)

$
0
0

Aspose.PDF .Net 10.5.0.0 fails to convert the attached PDF to PDF/a. It works with 10.4.0.0 and also with other documents.

The PDF was generated by Microsoft OneNote from a mail.

The Aspose error message is:

ExtGState 'ca' value shall be 1.0

PDF to JPEG conversion, size of result

$
0
0
Hello,
I'm writing you because today we tested new release and I found one thing that confuses me a little.
The deal is that during file conversion I've get files of different sizes just using different methods:
1)
ByteArrayOutputStream imageStream = new ByteArrayOutputStream();
com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(dpi_Resolution);
com.aspose.pdf.devices.JpegDevice jpegDevice = new com.aspose.pdf.devices.JpegDevice(resolution, 90);
jpegDevice.process(converter.getDocument().getPages().get_Item(imageCount), imageStream);
imageStream.close();
byte[] jpgImageInBytes = imageStream.toByteArray();
Debug.print("jpegDevice: ----> \n" + jpgImageInBytes.length ); //here 176866
2)
ByteArrayOutputStream  imageStream = new ByteArrayOutputStream();
converter.setResolution(new Resolution(dpi_Resolution));
 converter.getNextImage(baos, ImageFormatInternal.getJpeg(), 90);
baos.close();
 byte[] jpgImageInBytes = baos.toByteArray();
Debug.print("jpegDevice: ----> \n" + jpgImageInBytes.length ); //here 375842

Could you be so kind to explain what wrong I do? Is it problem of quality?
Thank you in advance

Problem converting html and css to pdf

$
0
0
Hi,

The goal: To convert a html file with an image and css to a pdf file using Java.
The problem:
When the html file that I convert has no css it works fine. But when I add css, the resultant pdf is a bit messed up. The page size is different and the result is not similar to the the html page.

I've used inline css as I thought this might solve the problem originally.

Here is a sketch of the Java code I use to perform the conversion:

private void generatePDF(String html, String name){

        String htmlPath = "my/path";
        String pdfPath = "my/other/path";

        HtmlLoadOptions htmlOptions = new HtmlLoadOptions(htmlpath);
        htmlOptions.getPageInfo().setHeight(841.89);//A4 size
        htmlOptions.getPageInfo().setWidth(595.276);

        com.aspose.pdf.Document pdf = new com.aspose.pdf.Document(htmlPath+File.separator+name, htmlOptions);

        pdf.save(pdfPath + File.separator + name + ".pdf");

    }

And I have attached the html file which I use to generate the pdf.

Looking forward hearing from you.

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

Creating a PDF from PRN PCL Format file. Handling of Fonts and special characters is not working

$
0
0
Hi,

We have access to a PRN file from a proprietary print driver and want to convert it to a PDF. It looks like the PRN is a PCL format, so we used the following approach to convert the file to PDF. In the 9.6.0 version of the Aspose.Pdf.dll it takes a long time (over 30 seconds to convert only one page.

Here is the Syntax we used:

var loadOpt = new Aspose.Pdf.PclLoadOptions();
var loadFormat = loadOpt.LoadFormat;
var doc = new Aspose.Pdf.Document(pclPrnFile, loadOpt);

doc.Save(saveName);


Attached is a before and after screenshot and the actual PRN File.

(It didn't matter if we renamed the .PRN to .PCL.)
Viewing all 1038 articles
Browse latest View live