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

Appending a text the Keyword property with existing text adds the double-quotation marks.

$
0
0

Hi,

When I add a text (keyword) in the Keyword property of the PDF that already has an existing keyword(s) it will automatically displays the double-quotation marks (").

However, using the same program statements above to add the text but in a PDF that does NOT have any text in the Keywords property yet, there are no double-quotes.

As an example, here are the lines to insert the text:

var pdfDocument = new Document(filename);

//specify document information

var docInfo = new DocumentInfo(pdfDocument);

var sbUpdatedKeywords = docInfo.Keywords;

sbUpdatedKeywords += !string.IsNullOrEmpty(sbUpdatedKeywords) ? cKeywordsConcat + keywords : keywords;  

docInfo.Keywords = sbUpdatedKeywords;  

//save output document

pdfDocument.Save(filename);

Also, when I view the raw PDF content using a hex or text editor, the Keywords does NOT have quotation marks even if it displays otherwise.

So, what can I do to "specify" don't show the quotation marks in any way (if that is possible)?

 


Extremely large Postscript files with semitransparent areas

$
0
0
Hi!

While testing Aspose.PDF 8.3.1.0 for a reprint scenario, I encountered the following problem: When converting a pdf, which was created from a Postscript document with semitransparent areas, back to Postscript, the resulting file becomes extremely large. In my test case, a pdf with 68 KB (containing a single shape and one line of text) resulted in a Postscript file with about 146 MB(!).

As a comparison, when I print the very same PDF to a file using Adobe Acrobat, the resulting file is about 6 MB in size. Although this is still significantly larger than the PDF, the Postscript can at least be printed or viewed in acceptable time.

I have attached an example pdf file used in the test case described. The following code is used for the conversion:

      using (var viewer = new PdfViewer())
      {
        viewer.BindPdf (pdfStream);

        viewer.PrintPageDialog = false;
        viewer.AutoResize = true;

        var printerSettings = new PrinterSettings { PrintFileName = postscriptOutputFilePath, PrintToFile = true, PrinterName = PrinterName };

        var pageSettings = GetPageSettings (pageSize);

        viewer.PrintDocumentWithSettings (pageSettings, printerSettings);
        viewer.Close();
      }

    private static PageSettings GetPageSettings (PageSize pageSize)
    {
      var width = UnitUtility.GetHundrithOfInchFromTenthOfMillimeter (pageSize.WidthInTenthOfAMillimeter);
      var height = UnitUtility.GetHundrithOfInchFromTenthOfMillimeter (pageSize.HeightInTenthOfAMillimeter);

      return new PageSettings
             {
                 PaperSize = new PaperSize ("PaperSize", (int) Math.Round (width), (int) Math.Round (height)),
                 Margins = new Margins (0, 0, 0, 0)
             };
    }

Best regards,
  Thomas

Exception while converting PDF to PNG/JPG using Aspose.Pdf for Java 4.4.0 libs

$
0
0
Get an exception on this specific PDF document while conversion. 

  class com.aspose.ms.System.d: Corrupt content.
  com.aspose.pdf.a.c.d.b.c.f.a(Unknown Source)
  com.aspose.pdf.a.c.d.b.c.f.a(Unknown Source)
  com.aspose.pdf.bf.a(Unknown Source)
  com.aspose.pdf.ImageDevice.a(Unknown Source)
  com.aspose.pdf.PngDevice.processInternal(Unknown Source)
  com.aspose.pdf.facades.PdfConverter.getNextImage(Unknown Source)
  com.aspose.pdf.facades.PdfConverter.getNextImage(Unknown Source)
  com.aspose.pdf.facades.PdfConverter.getNextImage(Unknown Source)
  com.********.PDFToPNGConverter.convert(PDFToPNGConverter.java:100)
  com.********.ConversionTask.call(CXXXTask.java:49)
  com.********.ConversionTask.call(CXXXTask.java:16)
  java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
  java.util.concurrent.FutureTask.run(Unknown Source)
  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
  java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  java.lang.Thread.run(Unknown Source)
        at com.aspose.pdf.a.c.d.b.c.f.a(Unknown Source)
        at com.aspose.pdf.a.c.d.b.c.f.a(Unknown Source)
        at com.aspose.pdf.bf.a(Unknown Source)
        at com.aspose.pdf.ImageDevice.a(Unknown Source)
        at com.aspose.pdf.PngDevice.processInternal(Unknown Source)
        at com.aspose.pdf.facades.PdfConverter.getNextImage(Unknown Source)
        at com.aspose.pdf.facades.PdfConverter.getNextImage(Unknown Source)
        at com.aspose.pdf.facades.PdfConverter.getNextImage(Unknown Source)
        at com.********.*.PDFToPNGConverter.convert(PDFToPNGConverter.java:100)
        at com.********.ConversionTask.call(CXXXTask.java:49)
        at com.********.ConversionTask.call(CXXXTask.java:16)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

Is it safe to access a Document using multi threads?

$
0
0
Is it safe to access a Document using multi threads?  Specifically once multiple Page objects are obtained via the PageCollection is it safe to have multiple threads working on the extracted individual Page objects?

Performance Test

$
0
0

Hi,

i've tested Aspose.Pdf with a huge amount of pages and contents. The contents consists of many small bitmaps and text elements.

While my program works for the pdf file i am wondering that there is no file created on my file storage. Only of my program gets terminated, the file is written to my storage. Attached to this post is a picture of my task manager. You can see that much memory is occupied.

 

Is there any possibility that Aspose.Pdf writes the file to disk while i am creating it?

Kind regards

Sebastian

 

pdf TextBoxField line break

$
0
0
how do i force a line break in the InteractiveFeatures.Forms.TextBoxField?

set license

$
0
0
I am using java 1.6, Aspsoe-pdf-4.50, Aspose-pd-kit-4.7.0, etc ( Java Total ) and Junit.
I got these error message in Window Only:
ex=java.lang.SecurityException: class "com.aspose.a.a.a"'s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(Unknown Source)
    at java.lang.ClassLoader.preDefineClass(Unknown Source)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at internal.ak.a(Unknown Source)
    at aspose.pdf.a.a(Unknown Source)
    at com.aspose.pdf.License.setLicense(Unknown Source)

Here is the set license code:

String rootFolder = generalService.getSystemRootFolder();
            
            
            if  ( !rootFolder.endsWith("/") ) {
                rootFolder += "/";
            }
            String licFile = rootFolder + "Aspose.Total.Java.lic";
            log.info("licFile="+licFile);
            com.aspose.pdf.License licensePDF = new com.aspose.pdf.License();
            licensePDF.setLicense(licFile);
            
            com.aspose.pdf.kit.License licenseKit = new com.aspose.pdf.kit.License();
            licenseKit.setLicense(licFile);
            
            com.aspose.email.License licenseEmail = new com.aspose.email.License();
            licenseEmail.setLicense(licFile);

            com.aspose.words.License licenseWords = new com.aspose.words.License();
            licenseWords.setLicense(licFile);

            com.aspose.slides.License licensePPT = new com.aspose.slides.License();
            licensePPT.setLicense(licFile);
            
            com.aspose.cells.License licenseExcel = new com.aspose.cells.License();
            licenseExcel.setLicense(licFile);

Thanks,
Chang Shin

Text disappearance when converting pdf into html

$
0
0

Good evening, dear aspose developers.

I need your help with a pesky issue concerning pdf into html convertion.

Locally (windows/glassfish) the application works perfectly fine, but when deployed to weblogic on our linux machine, it fails to convert a simple one-paged pdf-file into html. Namely, all the text-content of a file gets skipped as it is converted — we get an html-page with all the images but with no text whatsoever and no exception is thrown.


So, for example, on windows machine we get this:


<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8" />

<title>

</title>

<link rel="stylesheet" type="text/css" href="converted_files/style.css" />

</head>

<body>

<object data="converted_files/img_01.svg" type="image/svg+xml" class="stl_01">

<embed src="converted_files/img_01.svg" type="image/svg+xml" class="stl_01" />

</object>

<div class="stl_02"><span class="stl_03">This is a test pdf file</span></div>

<div class="stl_04"><span class="stl_03">Converted from pdf into html</span></div>

</body>

</html>



As opposed to what we get on our linux machine (all the text content disappears, and this happens to every pdf file we try to convert):


<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8" />

<title>

</title>

<link rel="stylesheet" type="text/css" href="converted_files/style.css" />

</head>

<body>

<object data="converted_files/img_01.svg" type="image/svg+xml" class="stl_01">

<embed src="converted_files/img_01.svg" type="image/svg+xml" class="stl_01" />

</object>

</body>

</html>



The details:

  1. First — we create a Document and embed fonts into it as it is recommended here: http://www.aspose.com/docs/display/pdfjava/Embedding+Fonts+in+an+existing+PDF+file
  2. Second — we optimize the document and convert it into html saving the result into a temporary file.

Thanks in advance for your help.


Purchased license acts as trial and created PDFs are blank.

$
0
0
Greetings,

I am writing this post to address three problems.

Issue #1
The first issue is that our license that was purchased today is acting as if it were a trial and is still watermarking our images. After following documentation as well as forum posts about including the license via embedding as well as streaming, we have found no resolution to this problem. After perusing the forums it appears that many people have issues where the license end date is incorrect. The date is as follows:

    <SubscriptionExpiry>20150115</SubscriptionExpiry>

We have included the license in the following manners before using any of the Aspose API calls. We have moved the license to various directories (including the directory with the DLLs, the root of the project directory, the bin directory, etc) that have been suggested by staff on these forums and the documentation:

Aspose.Pdf.License license = new Aspose.Pdf.License();
            var file = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Aspose.Pdf.lic");
            FileStream myStream = new FileStream(file, FileMode.Open);
            license.SetLicense(myStream);
            license.Embedded = true;


As well as:

var lic = new Aspose.Pdf.License { Embedded = true };
            lic.SetLicense("Aspose.Pdf.lic");


We would be grateful for any assistance with this issue that is possible. Preferably if there is a sample project or class that can be shown to demonstrate how the license should be called and when/how often it should be.

Issue #2
We assume that this issue is caused (after speaking with technical support and prior forum posts) due to the license issue mentioned above. However, we would like to have it addressed regardless in case they are unrelated. When we are creating a PDF file out of images it appears that the the PDF itself is blank. Note that we have tried this with 1 image, 2 images, 3, and 4 (from what I've read the trial limits you to 4). This problem occurs with any number of images. However, when we write annotations to it they are saved and the appropriate pages are created. The image files that are sent to it are not rendered, though. We are not sure if this stems from the license problem (listed above) or not. Any assistance would be appreciated. Our code is as follows (the problematic function is CreateAndSavePDFFromImages) .

namespace Application.Service.Implementations
{
    public class AsposeService : IPDFService
    {
        const int ASPOSE_RESOLUTION = 200;
        const int ASPOSE_QUALITY = 30; // [0-100], 100 is Maximum

        //Aspose.Pdf.License license;

        public AsposeService()
        {
            //lic = new Aspose.Pdf.License { Embedded = true };
            //lic.SetLicense("Aspose.Pdf.lic");
        }

        public void CreateAndSavePDFFromImages(string fileName, List<Image> images)
        {
            //var lic = new Aspose.Pdf.License { Embedded = true };
            //lic.SetLicense("Aspose.Pdf.lic");

            var doc = new Aspose.Pdf.Document();
            foreach (var image in images) {
                var page = doc.Pages.Add();
                page.Resources.Images.Add(new MemoryStream(image.Data));

                double lowerLeftX = 0;
                double lowerLeftY = 0;
                double upperRightX = doc.PageInfo.Width;
                double upperRightY = doc.PageInfo.Height;
                if (!image.Width.HasValue) image.Width = (float)upperRightX;
                if (!image.Height.HasValue) image.Height = (float)upperRightY;
                double xFactor = (double)(upperRightX / image.Width);
                double yFactor = (double)(upperRightY / image.Height);

                page.Contents.Add(new Aspose.Pdf.Operator.GRestore());
                var rectangle = new Aspose.Pdf.Rectangle(lowerLeftX, lowerLeftY, upperRightX, upperRightY);
                var matrix = new Aspose.Pdf.DOM.Matrix(new double[] { rectangle.URX - rectangle.LLX, 0, 0, rectangle.URY - rectangle.LLY, rectangle.LLX, rectangle.LLY });
                page.Contents.Add(new Aspose.Pdf.Operator.ConcatenateMatrix(matrix));
                Aspose.Pdf.XImage ximage = page.Resources.Images[page.Resources.Images.Count];
                page.Contents.Add(new Aspose.Pdf.Operator.Do(ximage.Name));
                page.Contents.Add(new Aspose.Pdf.Operator.GRestore());

                foreach (var dataPoint in image.DataPoints) {
                    if (dataPoint.XCoor.HasValue && dataPoint.YCoor.HasValue) {
                        var x = (double)dataPoint.XCoor * xFactor;
                        var y = doc.PageInfo.Height - (double)dataPoint.YCoor * yFactor;
                        var rect = new Aspose.Pdf.Rectangle(x, y, x, y);
                        var ann = new Aspose.Pdf.InteractiveFeatures.Annotations.TextAnnotation(page, rect);
                        ann.Title = dataPoint.UserName;
                        ann.Subject = dataPoint.DataPointType.Name;
                        ann.Contents = dataPoint.DataPointType.Name;
                        //ann.Contents = dataPoint.Value;
                        ann.Open = true;
                        ann.State = Aspose.Pdf.InteractiveFeatures.Annotations.AnnotationState.Accepted;
                        ann.Icon = Aspose.Pdf.InteractiveFeatures.Annotations.TextIcon.Comment;
                        page.Annotations.Add(ann);
                    }
                }
                doc.Save(fileName);
            }
        }

        public List<Image> ConvertPDFToImages(byte[] pdf)
        {
            Aspose.Pdf.License license = new Aspose.Pdf.License();
            var file = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Aspose.Pdf.lic");
            FileStream myStream = new FileStream(file, FileMode.Open);
            license.SetLicense(myStream);
            license.Embedded = true;
            //var lic = new Aspose.Pdf.License { Embedded = true };
            //lic.SetLicense("Aspose.Pdf.lic");

            var doc = new Aspose.Pdf.Document(new MemoryStream(pdf));
            var images = new List<Image>();
            for (int pageCount = 1; pageCount <= doc.Pages.Count; pageCount++) {
                var image = new Image();
                image.FileName = "image" + pageCount + ".jpg";
                image.FileType = "image/jpeg";

                var resolution = new Aspose.Pdf.Devices.Resolution(ASPOSE_RESOLUTION);
                //Aspose.Pdf.Devices.JpegDevice jpegDevice = new Aspose.Pdf.Devices.JpegDevice(500, 700, resolution, 100);
                Aspose.Pdf.Devices.JpegDevice jpegDevice = new Aspose.Pdf.Devices.JpegDevice(resolution, ASPOSE_QUALITY);

                using (var stream = new FileStream("C:\\temp\\image" + pageCount + ".jpg", FileMode.Create)) {
                    jpegDevice.Process(doc.Pages[pageCount], stream);
                }
                using (var stream = new MemoryStream()) {
                    jpegDevice.Process(doc.Pages[pageCount], stream);
                    image.Data = stream.ToArray();
                }
                images.Add(image);
            }
            return images;
        }
    }
}


Issue #3
In the above code, ConvertPDFToImages places watermarks on the images (sometimes just the first). We believe this stems from the license issue.

How to create the PDF FIle Without Allo w to Copy OR Edit

$
0
0
Hi,
I want to create the PDF FIle in asp.net using VB code. That file should not allow to edit or copy the content. kindly help me to do that.

Thanks

create pdf from image setting dpi

$
0
0
Hi,

I try to generate a pdf from a jpg-file that is scanned with 200dpi.
The jpg-file has a resolution of 1653 * 2338 Pixel. That is 210 * 297mm in pagesize.
My resulting pdf-file has 583 * 824mm in pagesize. What am I doing wrong?
This is the code I use: (the value for dpi and imagesize is hardcoded for my tests, I want to use them dynamically later on)

string strFile = @"C:\Temp\image2Pdf_1.JPG";

 

            Aspose.Pdf.Generator.Pdf objPdf =new Aspose.Pdf.Generator.Pdf();

            Aspose.Pdf.Generator.Section sec2 = objPdf.Sections.Add();

 

            sec2.PageInfo.Margin.Left = 0;

            sec2.PageInfo.Margin.Right = 0;

            sec2.PageInfo.Margin.Top = 0;

            sec2.PageInfo.Margin.Bottom = 0;

 

           FileStream fs = File.OpenRead(strFile);

           float fWidth;

           float fHeight;

 

           byte[] data = newbyte[fs.Length];

            fs.Read(data, 0, data.Length);

           MemoryStream ms = newMemoryStream(data);

 

            fs.Close();

            Aspose.Pdf.Generator.Image img2 =new Aspose.Pdf.Generator.Image(sec2);

 

            fWidth = 1653.0f;

            fHeight = 2338.0f;

 

            sec2.PageInfo.PageWidth = fWidth;

            sec2.PageInfo.PageHeight = fHeight;

 

            img2.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Jpeg;

            img2.ImageInfo.FixWidth = sec2.PageInfo.PageWidth;

            img2.ImageInfo.FixHeight = sec2.PageInfo.PageHeight;

 

            img2.VectorGraphicsRenderingDPI = 200;

 

           img2.ImageInfo.ImageStream = ms;

 

            sec2.Paragraphs.Add(img2);

 

           objPdf.Save(strFile +".pdf");

Kind regards,
Oliver

Cell formatting issue when PDF table extends beyond one page

$
0
0
To start off, we are a licensed user. I am having an issue with the cell formatting of a pdf table when using padding on the cells and the table extends to more than one page. The first row of any page after the first one doesn't display the cells correctly. Here is code to reproduce the issue. I've also attached a screen shot of the pdf. This issue occurs with the newest pdf version 4.5 jar.

Thanks,
Frank

  public static void c() throws Exception
  {
    final Pdf pdf = new Pdf();
    final Section section = pdf.getSections().add();
    final Paragraphs paragraphs = section.getParagraphs();
    section.getPageInfo().setMargin(new MarginInfo(50.0f));
    final Table table = new Table();
    final Rows rows = table.getRows();
    table.setColumnWidths("380 80");
    paragraphs.add(table);   
    final MarginInfo mi = new MarginInfo(3.0f);
    for (int j=0; j<60; j++)
    {
      final Row row = rows.add();
      final Cells cells = row.getCells();
      Cell cell = cells.add("Row->" + (j + 1) + ":This should be CENTERED for both alignment types");
      cell.getDefaultCellTextInfo().setFontName("Arial");
      cell.isWordWrapped(true);
      cell.setBackgroundColor(new aspose.pdf.Color("#CCCCCC"));
      cell.setBorder(new BorderInfo(BorderSide.All, new aspose.pdf.Color("#000000")));
      cell.setVerticalAlignment(VerticalAlignmentType.Center);
      cell.setAlignment(AlignmentType.Center);
      cell = cells.add("Column 2");
      cell.setPadding(mi);
      cell.getDefaultCellTextInfo().setFontName("Arial");
      cell.isWordWrapped(true);
      cell.setBackgroundColor(new aspose.pdf.Color("#CCCCCC"));
      cell.setBorder(new BorderInfo(BorderSide.All, new aspose.pdf.Color("#000000")));
      cell.setVerticalAlignment(VerticalAlignmentType.Center);
      cell.setAlignment(AlignmentType.Center);
      cell.setPadding(mi);
    }
   
    pdf.save("test_font.pdf");
  }

Cannot Open PDF document

$
0
0

Hi,

We have a lot of pdf document like the one in attachment, and we try to open them with aspose.pdf

but we get an exception with message: Startxref not found.

Acrobat Reader has no problem to read it.

Code:

 m_pdf = new Document(".....pdf");

Could you please fix it?

 

Thanks

Black rectangle in image from PDF

$
0
0
Attached is a PDF that, when converted to an image, displays a large black rectangle in that image instead of the gradient used in the PDF. The image is also attached.

PDFileEditor.concatenate() produces zero byte output PDF.

$
0
0

I am trying the sample code to merge PDFs using PDFFileEditor.concatenate() method. Below is the sample code I have and i always get the return code as false.  I tried almost all overloaded methods of concatenate() and same result.  I am 100% sure that the soruce pdfs (PDF1.pdf and PDF2.pdf) are in the correct locations as I don't get any exceptions when I use the FileInputStreams.

I do have the eval license for ASPose.PDF library.

Is there anything that I am doing wrong.  I am using the latest versions of ASPose.PDF library on JDK1.6.

Rgds,

Raj.

 

 

public

class MergePDFs

{

/**

* @param args

*/

publicstaticvoid main( String[] args )

{

OutputStream output =

null ;

InputStream inStream1 =

null ;

InputStream inStream2 =

null ;

try

{

// // initialize ASPose.pdf license.

// License pdfLicense = new License() ;

// pdfLicense.setLicense( "C:\\Temp\\TestPDFs\\Aspose.Pdf.lic" ) ;

// List<InputStream> inStreams = new ArrayList<InputStream>() ;

//

// inStream1 = getFileInputStream( "C:\\Temp\\TestPDFs\\PDF1.pdf" ) ;

// inStream2 = getFileInputStream( "C:\\Temp\\TestPDFs\\PDF2.pdf" ) ;

//

// inStreams.add( inStream1 ) ;

// inStreams.add( inStream2 ) ;

// Concatenate two files

PdfFileEditor editor =

new PdfFileEditor();

// output = new BufferedOutputStream(

// getFileOutputStream( "C:\\Temp\\TestPDFs\\MergedPDF.pdf" ) );

// editor.concatenate( inStream1, inStream2, output);

// boolean code = editor.concatenate( inStreams.toArray( new InputStream[0] ), output ) ;

// boolean code = editor.concatenate(

// new String[] {

// "C:\\Temp\\TestPDFs\\PDF1.pdf",

// "C:\\Temp\\TestPDFs\\PDF2.pdf"

// } ,

// "C:\\Temp\\TestPDFs\\MergedPDF.pdf"

// ) ;

boolean code = editor.concatenate(

"C:\\Temp\\TestPDFs\\PDF1.pdf",

"C:\\Temp\\TestPDFs\\PDF2.pdf",

"C:\\Temp\\TestPDFs\\MergedPDF.pdf"

);

System.

out.println( code ) ;

}

catch(Throwable ex)

{

ex.printStackTrace();

}

finally

{

try { output.close() ; } catch (Throwable t) { ; } ;

try { inStream2.close() ; } catch (Throwable t) { ; } ;

try { inStream1.close() ; } catch (Throwable t) { ; } ;

}

return ;

}

privatestatic InputStream getFileInputStream( String filePath ) throws Exception

{

returnnew FileInputStream( filePath ) ;

}

privatestatic OutputStream getFileOutputStream( String filePath ) throws Exception

{

returnnew FileOutputStream( filePath ) ;

}

}


Save DOC to PDF converts Arial to ArialMT

$
0
0
Dear Aspose-Team,

we have a font problem converting a DOC to a PDF. We're using this function with formatPDFA=false:

<code>
    private synchronized boolean createPDFByAspose(Document doc, String target, boolean formatPDFA)
    {
        try
        {
            PdfSaveOptions options = new PdfSaveOptions();
            if (formatPDFA)
                options.setCompliance(PdfCompliance.PDF_A_1_B);

            doc.save(target, options);

            return true;
        }
        catch (Exception ex)
        {
            logger.logError(ex,
                    getName() + ": createPDFByAspose() failed! " + doc.getOriginalFileName() + "->"
                            + target + " (" + formatPDFA + ")");
            return false;
        }
    }
</code>

When you open the PDF, mark some text and take a look to the font properties you see, that there is used ArialMT instead of Arial (Font_Property_in_PDF.png). The conversion was done on an Windows Server 2003 and Aspose.Words 13.9 for Java.
When saving the document in Word 2010 as pdf, the font properties says, that the pdf uses Arial, like the original word document.

What do I have to do, that Aspose.Words uses Arial in the pdf and not ArialMT?

Kind reagrds,
Frank

PDF to other format conversion problem

$
0
0

Hi,

I have these issue with the pdf.save function and the document attached:

Codes:

Document m_pdf = new Document(m_strFileName);
 
m_pdf.Save("test.xls", SaveFormat.Excel);
--> when excel open it we got a message file "corrupted"
 
m_pdf.Save("test.doc", SaveFormat.Doc);
m_pdf.Save("test.docx", SaveFormat.DocX);
--> Same type of message but the word version
 
m_pdf.Save(strDestination, SaveFormat.Html);
--> out of memory exception
 
Could you please have a look?
 
Thanks
Best regards

Appending a text the Keyword property with existing text adds the double-quotation marks.

$
0
0

Hi,

When I add a text (keyword) in the Keyword property of the PDF that already has an existing keyword(s) it will automatically displays the double-quotation marks (").

However, using the same program statements above to add the text but in a PDF that does NOT have any text in the Keywords property yet, there are no double-quotes.

As an example, here are the lines to insert the text:

var pdfDocument = new Document(filename);

//specify document information

var docInfo = new DocumentInfo(pdfDocument);

var sbUpdatedKeywords = docInfo.Keywords;

sbUpdatedKeywords += !string.IsNullOrEmpty(sbUpdatedKeywords) ? cKeywordsConcat + keywords : keywords;  

docInfo.Keywords = sbUpdatedKeywords;  

//save output document

pdfDocument.Save(filename);

Also, when I view the raw PDF content using a hex or text editor, the Keywords does NOT have quotation marks even if it displays otherwise.

So, what can I do to "specify" don't show the quotation marks in any way (if that is possible)?

 

add new page with full size image to the Encrypted pdf

$
0
0
I have existing PDF which is Encrypted. 
following your instructions here I was able to create new page and insert image but I have to pass 
lowerLeftX,lowerLeftY,upperRightX and upperRightY. my image is the whole page image.

How can I do this?
 Aspose.Pdf.Generator.Pdf and created from Stream and add section containing image?
or there is a more simple way 

PDF to PDF/A format

$
0
0

Hi Please let me know whether there is any update on PDF to PDF/A format convertion.

 

Thanks

Viewing all 3131 articles
Browse latest View live