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

Annotation import bug

$
0
0
Hi,

I'm trying to import the XFDF annotations into a PDF, but the import fails with the exception below. Source files attached. The XFDF file was created using the same PdfAnnotationEditor class with exportAnnotationsXfdf from a different PDF.

PdfAnnotationEditor editor = new PdfAnnotationEditor();
editor.bindPdf("/Users/mpala/Desktop/result.pdf");
editor.importAnnotationFromXfdf(new FileInputStream("/Users/mpala/Desktop/result-1.xfdf"));
editor.save("/Users/mpala/Desktop/result-2.pdf");
class com.aspose.pdf.internal.ms.System.z9: An element with the same key already exists in the dictionary.
com.aspose.pdf.internal.ms.System.Collections.Generic.z2.addItem(Unknown Source)
com.aspose.pdf.XfdfReader.m1(Unknown Source)
com.aspose.pdf.StampAnnotation.m1(Unknown Source)
com.aspose.pdf.XfdfReader.m1(Unknown Source)
com.aspose.pdf.XfdfReader.readAnnotations(Unknown Source)
com.aspose.pdf.facades.PdfAnnotationEditor.m2(Unknown Source)
com.aspose.pdf.facades.PdfAnnotationEditor.importAnnotationFromXfdf(Unknown Source)


Issue with headings

$
0
0
Hi Team,

I am using aspose PDF java api to create PDF. I am trying to create bulleted list. but i am unable to find the option to create the same. Also in my list , i need some part of the text to be in bold and rest to be in normal style. I tried to add userlable to the heading and assignes segmwent to it. but when i assign userlabel , i am not getting the i) or A) whatever style i have selected. Can you help me in achieving this.

TextSegment seg=new TextSegment("9.6 g/dL 12.0-16.0(Lab Results,04/06/2013:04:24:00 AM)");
        seg.getTextState().setFont(FontRepository.findFont("Calibri"));
        seg.getTextState().setFontSize(12);
         seg.getTextState().setForegroundColor(Color.getBlack());

Heading heading4 = new Heading(1);
                heading4.setInList(true);
                heading4.setStartNumber(1);
                heading4.setStyle(NumberingStyle.LettersUppercase);
                heading4.setText("Clinical indicator:");
                heading4.setStyle(NumberingStyle.NumeralsRomanLowercase);
                heading4.setUserLabel(seg);
                heading4.setAutoSequence(true);
                floatBox.getParagraphs().add(heading4);


Aspose PDF for java - method that coverts to ISO format is memory intensive

$
0
0
Hi - 

We are using the below line for making PDF files ISO compliant. We have a batch that runs and picks up each PDF file from a predefined location, formats is as per our formatting requirements and then converts it to an ISO file using:

pdfDocument.convert(baseLocation+"/log.xml", PdfFormat.PDF_A_2A, ConvertErrorAction.None);

This particular line/method at times eats up all the server's JVM memory and after some time throws out of Memory exception. It works "ok" for small files but for some medium to large ones it simply blows up. This is a desired feature for our business. I have tried it on Windows and Linux and have explicitly added 1 GB and 2 GB of memory to this specific process. It appears that pdfDocument object us not cleared or disposed timely. I tried one of your recommendation to force dispose it but without any luck. I am attaching a zip of all the files that I have used for testing. I recommend you iterate over all the files in this directory and test the process

Vertical Text

$
0
0
Hello, Can anybody tell me how to rotate text in new DOM Aspose.pdf I am using following code snippet to rotate text. TextFragment txt = new TextFragment(); txt.Text = "Vertical Text"; txt.Rectangle.Rotate(Rotation.on90); but in resultant pdf it is horizontal only. I dont want to use text stamp here as it cannot be added in Table as paragraph.

Centering Images

$
0
0
I'm attempting to center an image on a page, but as far as I can tell the HorizontalAlignment property is not having any effect.  The following ends up being left-aligned:

   Image image = new Image();
   image.File = @"c:\images\image.png";
   image.HorizontalAlignment = HorizontalAlignment.Center;
   pdf.Pages[1].Paragraphs.Add(image);

Is there anything else I should be doing to ensure the image is centered?

Image alignment does not work aspose pdf 10.3

$
0
0
I am using Aspose.Pdf version 10.3. I have the code snippet below. When the pdf is rendered the image is showing left justified, and not how I have aligned the image. Please help.

var tc = TypeDescriptor.GetConverter(typeof (Bitmap));
var ms = new MemoryStream();
var bitMap = (Bitmap) tc.ConvertFrom(imgStream);
bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
ms.Position = 0;

var img = new Aspose.Pdf.Image();
img.ImageStream = ms; //bitmap memory stream
img.HorizontalAlignment = HorizontalAlignment.Center;
var document = new Aspose.Pdf.Document();
document.Pages.Add();
document.Pages[1].Paragraphs.Add(img);

convert Tif to PDF drops pages

$
0
0
Hi,

I am converting TIF to PDFs in some cases we do not get all the output pages in PDF. These pages show up a little corrupted in the Wang viewer but the content can be seen.

       public void ConvertImage(string sFileIn, string sFileOut)
        {            
            Aspose.Pdf.Document doc = new Aspose.Pdf.Document();

            Aspose.Pdf.Page page = doc.Pages.Add();

            // Set margins so image will fit, etc.
            page.PageInfo.Margin.Bottom = 0;
            page.PageInfo.Margin.Top = 0;
            page.PageInfo.Margin.Left = 0;
            page.PageInfo.Margin.Right = 0;

            page.PageInfo.Height = Aspose.Pdf.PageSize.PageLetter.Height;
            page.PageInfo.Width = Aspose.Pdf.PageSize.PageLetter.Width;

            Aspose.Pdf.Image image1 = new Aspose.Pdf.Image();


            System.Drawing.Bitmap bmImage = new System.Drawing.Bitmap(sFileIn);

            if ( (float)CalculatePageWidth(bmImage.Width, bmImage.HorizontalResolution) > (float)(CalculatePageWidth((float)page.PageInfo.Width, 72.0f) + 0.02f) )
                page.PageInfo.IsLandscape = true;
            else
                page.PageInfo.IsLandscape = false;

            //Add the image into paragraphs collection of the section
            page.Paragraphs.Add(image1);
            image1.File = sFileIn;

            doc.Save(sFileOut);
        }

Invalid fonts rendered (PDF-> TIFF conversion)

$
0
0
Hello,

During conversion from attached pdf to tiff the fonts are incorrectly rendered. The code I use:
Aspose version 9.7.0.
Resolution resolution = new Resolution(300);TiffSettings tiffSettings = new TiffSettings();
tiffSettings.Compression = CompressionType.CCITT4;
tiffSettings.Depth = ColorDepth.Format1bpp;
tiffSettings.Shape = Aspose.Pdf.Devices.ShapeType.None;
tiffSettings.SkipBlankPages = false;
var tiffDevice = new TiffDevice(resolution, tiffSettings);
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document("invalid_font.pdf");
pdfDocument.Form.Type = FormType.Standard;using (var tempStream = new MemoryStream())
{    pdfDocument.Save(tempStream);    var standardPdf = new Aspose.Pdf.Document(tempStream));    tiffDevice.Process(standardPdf, "output.tif");
}


Issues with text replacements (formatting, missing letters,...)

$
0
0
Hi Aspose team, I am currently testing how replacement of text works. Current issues: - original document "Online Payment Processing.pdf" - document with replacements "Online Payment Processing_NEW.pdf" On page 2 you can see that original phrase "Payment Processing" is in italic and in new document you can see that formatting is gone. Probably similar across the document. On page 3 replacement text is with missing characters - full text is "NEW LONGER TEXT TO CHECK" and in document you can see "NEW LONGER TE T TO CHECK". Weird that when I do copy paste of not ok text I see that complete text is there so this is some issue with display. On page 4 tittle is in original document in bold in new document normal. All in all formatting is gone. Text that I wanted to replace is "payment processing" if it is split in 2 rows what would be your recommendation to make replacement in this case. If you change changed document you can see that if this phrase is split in 2 lines now changes are done. To run application just press Start button as everything is hard-coded. P.S. I attached project and test documents (there are in bin/release folder). License file is removed Thanks in advance, Oliver

get table height of already built pdf

$
0
0
Hi ,

I am using PDF 9.1 and i have created a PDF with aspose.pdf.generator. i am having five tables inside the pdf.

Can i get the height of all the tables of an already built pdf saved in local folder?

[PDF2PDFA] Pdf to Pdf_A_1B is OK Pdf to Pdf_A_2B is KO

$
0
0
Hello,

I want change format and version of pdf. I use :
Document.Convert(ms, Aspose.Pdf.PdfFormat.PDF_A_1B, Aspose.Pdf.ConvertErrorAction.Delete);
The result is OK for pdf_A_1b but is KO for Pdf_A_2B.

Could you give me an advice or an explain me why its OK for pdf_A_1b and KO for Pdf_A_2B.

Regards
Viewing all 3131 articles
Browse latest View live


Latest Images