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

Add Page Number Stamp in a PDF File Out of memory Error

$
0
0
Hi Team,

I am using vb.net code which you have provided on below link and trying to give page number to PDF which has 15000 pages.
But this gives me out of memory error.
please help me to overcome this.
I am using latest aspose.pdf dll.

http://www.aspose.com/docs/display/pdfnet/Add+Page+Number+Stamp+in+a+PDF+File

how can I save the file in incremental mode like after each 1000 page I want to save.

Aspose.Net Trial.

$
0
0
Hello,

Our company is looking for a .Net solution to PDF conversion and found your product.
What we need mainly are conversions from PDF to HTML . 

My question is as follows:  In the trial version of Aspose.PDF is there a cap of how many pages it actually can convert? If so is there a way to bypass this cap?

I'm doing some tests and I got stuck with only 4 pages being converted to HTML.

Time to add 4 text fields to existing PDF

$
0
0
I was adding text to a Federal 941 it took 1.85 secs to add 4 lines.  That is unacceptable when I need to add upwards of 150 fields total.

static void Main(string[] args)
{
            Document doc = new Document("C:\\49411.pdf");

            Page pdfPage = (Page)doc.Pages[1];

            TextBuilder tb = new TextBuilder(pdfPage);

            saveText("770114583",  188, 72, tb);
            saveText("Sample Company",  144, 96, tb);
            saveText("             12.33",  446, 252, tb);
            saveText("           1234.22", 446, 276, tb);
            doc.Save("c:\\temp\\941.pdf");
}
my saveText method:
        static void saveText(string sData, int x, int y, TextBuilder tb)
        {
            TextFragment textFragement = new TextFragment(sData);
            textFragement.Position = new Position(x, getY(y));
            textFragement.TextState.FontSize = nFontSize;
            textFragement.TextState.Font = FontRepository.FindFont(sFont);
            textFragement.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Black);
            //textFragement.TextState.HorizontalAlignment = HorizontalAlignment.Right;

            tb.AppendText(textFragement);

      
        }

Why is it taking so long?

Questions on HTML to PDF conversion using Aspose.PDF

$
0
0
Hi,

We are using aspose html to pdf conversion.

Below are our few requirements, need assistance and way to achieve them.

1. If grid in the body has more records and if data spans across next page, the grid header should repeat on each new page. (Ex: A table has 400 rows spanning 3 pages, then the header row should be repeated on all pages even though it is there in html only once)
2. There is a requirement that first page of headers is in portrait mode and then 2nd page onwards the data is in landscape mode. Is this achievable throgh HTML attributes and/or C# coding.
3. Its not supporting html5 round corners. Is there a  way tp indicated to the library that whatever the HTML we are using is HTML 5 to get the round corners and other features to work?
4. Its not supporting div with float, inline-block properties. We don't want to use tables, is their a way?

Thanks,
Kartheek N

Converting a PDF to HTML removes hyperlinks

$
0
0

Hi!

Whenever I try to convert a PDF all the hyperlinks are removed in the HTML file.

Is there anything I can do to keep the hyperlinks?

 

Aspose.Pdf.Document pdoc = new Aspose.Pdf.Document(filepath);



Aspose.Pdf.HtmlSaveOptions saveOptions = new Aspose.Pdf.HtmlSaveOptions(true);



saveOptions.FixedLayout = true;



saveOptions.SplitIntoPages = false;



saveOptions.SplitCssIntoPages = false;



saveOptions.RasterImagesSavingMode =
Aspose.Pdf.
HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground;



saveOptions.FontSavingMode =
Aspose.Pdf.
HtmlSaveOptions.FontSavingModes.AlwaysSaveAsWOFF;



pdoc.Save(filepath + ".html",
saveOptions);

 

Running version Aspose.Pdf 9.2.1.0.

Thanks in advance

Mattias

 

Conversion PDF with form fields to PDF/A

$
0
0
Hello, we are trying to convert PDF document with AcroForm fields to PDF/A. 
It works great but all form fields are flattned, so can't be any more edited at resulted PDF/A.

Is it posible to convert to PDF/A and preserve form fields?

Aspose perfomance

$
0
0

Hello!

We are using aspose libtrary in our product, that is used for PDF conversion.

We came across one question: we tested the perfo,ance of our product, and it seems that with the latest version of aspose it appears to be twice better if to compare with the aspose version we used half a year ago

Can you confirm that significant changes that could affect the library perfomance were introduced lately?

I will appreciate a propmpt reply.

Thanks!

According to page size how to set the Bookmark parameter value(FitH, X,Y)?

$
0
0
For example: Zoom level: Fit Width,

Document OriginalPDF = new Document();
Page pdfPage = null; 
.....
pdfPage  = OriginalPDF.Pages[3];

        pdfPage.CropBox.Height;
        pdfPage.MediaBox.Height;
        pdfPage.Rect.Height; 
        //How to choose among these?

Bookmark XML file will Import to PDF file.
<?xml version="1.0" encoding="ISO8859-1"?>
<Bookmark>
  <Title Page="3 FitH (??)" Action="GoTo">A</Title>
</Bookmark> 
   How to calculate the 3 FitH   ..[page /FitH top] [page /XYZ left top zoom]?

Image to pdf conversion

$
0
0
How to Convert image files into PDFs using SDK Source in PHP. We are using Aspose.Pdf for Cloud.
.

Unsupported font style when converting HTML to PDF

$
0
0
Hi I am having problem converting HTML string to PDF by using DOM approach.
Here's my sample code snippet.
license.SetLicense(lic_path);
string fullPath = "C:\\OutputFolder\\"
string emailBodyDetails = "<html><body><SPAN style=""FONT-FAMILY: Calibri, 'Segoe UI', Meiryo, 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', sans-serif; FONT-SIZE: 16px"">Content.</SPAN></body><html>";
using (FileStream fs = new FileStream(fullPath + "Output.html", FileMode.Create))
{
using (StreamWriter w = new StreamWriter(fs, Encoding.UTF8))
{
w.WriteLine(emailBodyDetails);
}
fs.Close();
}
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(fullPath + "Output.html", new HtmlLoadOptions() { UseNewConversionEngine = true });
doc.Save(fullPath + "Output.pdf");

I am getting error during conversion, and I found out that the html font style Meiryo is causing it, as when I remove the style from the string, it works fine. May I know how can this font be included in my document conversion?

At the same time, can I know which font are not supported in Aspose and what can I do to ensure all types of fonts are supported because we are not able to control the style usage in html as those contents are coming in from emails.

Convert html to PDF missing image

$
0
0

I have a image with virtual path in html, after I convert the html to PDF,  I can't find the image in generated PDF file. I do need the virtual path for images in html, how can I get it work? Thanks.

Can not get XY Coordinates

$
0
0
I am new to Asopse. I have donwloaded the trial version. As per demo and documentation I would get the following code for extracting XY co-ordinates of text from PDF file.

<code>
//create PdfExtractor object
        PdfExtractor extractor = new PdfExtractor();

        //bind input pDF file
        extractor.bindPdf("input.pdf");

        //set start and end pages
        extractor.setStartPage(1);
        extractor.setEndPage(2);

        //extract text
        extractor.extractText();

        //extract text segments
        TextSegment[] segments = extractor.getFormattedText();

        //get text information
        for(int index = 0; index < segments.length; index++)
        {
              TextSegment text = segments[index];
              System.out.println("Segment #"+index);
              System.out.println(text.getText());
              System.out.println(text.getFontName());
              System.out.println(text.getFontSize());
              System.out.println(text.getTextColor().toString());
              System.out.println(text.getX());
              System.out.println(text.getY());
        }
</code>

I am getting compilation error for line
<code> TextSegment[] segments = extractor.getFormattedText(); </code>
The error shown is: The method getFormattedText() is undefined for the type PdfExtractor

I am using aspose.pdf-new-4.0.0.jar file.
Is this removed from newer version or am I missing something here.

In general how can I get XY coordinate of any text from PDF file?

Thanks in advance.

justify Text

$
0
0

Hi,

I would like to generate rdlc file to PDF in local mode and  using justify alignment for Textbox( this does not works for generating by ms reporting viewer)

does the last version of Aspose.Pdf for Reporting Services Works(2.5.1) with Justify Text alignment on VS 2010 ?

and how to do it ?

Thank you very much.


This message was posted using Email2Forum by Nayyer Shahbaz.

Aspose.pdf PDF to HTML conversion giving error

$
0
0
Hi,

I am trying to convert PDF input stream to HTML and then saving it to ByteArrayOutputStream.
And I am getting following error for above conversion.

Save a document to a html stream is not supported. Please use method save to the file.

My code is as follows,

final ByteArrayOutputStream dstStream = new ByteArrayOutputStream();

// here 'docInputStream' is the InputStream of PDF document.

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(docInputStream);

pdfDocument.save(dstStream, new HtmlSaveOptions());

final ByteArrayInputStream srcStream = new ByteArrayInputStream(dstStream.toString("utf-8").getBytes(Charset.forName("utf-8")));

return srcStream;


Is saving document to HTML stream not supported by Aspose ? If yes, is there any workaround to deal with this ?

Value from Aspose.Pdf.Color.FromRgb does not work with a Color property of an annotation.

$
0
0
Hello,

Could you help with one problem: we are using "Aspose.Pdf.Color.FromRgb" method to get color and set it into annotation. But it is not working. 
We get right Aspose.Pdf.Color object with right value, but after setting that data to the "Color" property of an annotation we get nothing at all. Property value doesn't change. 

It works fine if we use "Color.Blue" or other property to set. 

Example of code we use to get color: 

Color.FromRgb(System.Drawing.Color.FromArgb(16711680));

That should be equal "Color.Red;". 

But "Color.Red" works and "Color.FromRgb(System.Drawing.Color.FromArgb(16711680))" not.

Aspose.Pdf vr. 9.4.0.0

Best regards.

Free hand annotations are invisible after *.xfdf import

$
0
0
Hello to everybody at the support team,

we just noticed some problems with imported annotations. After the import of 3_annotations.xfdf some annotations are invisible  (see attached file 5_merged_with_Aspose.pdf).

The same *.xfdf file produces correct results if merged via Adobe Acrobat (see attached file 4_merged_with_Acrobat.pdf)

Example code:

    [TestMethod]
    public void AnnotationTest()
    {
        string strSourceFN = @"c:\temp\1_blank.pdf";
        string strXfdf = @"c:\temp\3_annotations.xfdf";
        string strDestFN = @"c:\temp\5_merged_with_Aspose.pdf";

        if (File.Exists(strDestFN))
        {
            File.Delete(strDestFN);
        }

        PdfAnnotationEditor editor = new PdfAnnotationEditor();
        editor.BindPdf(strSourceFN);
        editor.ImportAnnotationFromXfdf(strXfdf);
        editor.Save(strDestFN);
    }

Aspose.Pdf.dll 9.4.0.0
.net 4.0 Runtime
bugid#5623


Best regards, Martin Pfeifer

Document class constructor does not take a memorystream any more

$
0
0
Prior to upgrading to version 9.4 I was able to instantiate a Document object using a constructor that takes a memorystream.  Ver. 9.4 introduced a breaking change because now I get an error message that only a FileStream object can be used in the Document constructor. This seems to be to be an arbitrary and unnecessary restriction. It forces me to write the contents to a disk file and then the constructor reads it back.

Apsose PDF html conversion

$
0
0
how can I use aspose pdf to convert pdf document stream to HTML stream
This message was posted using Banckle Live Chat 2 Forum

Removing last page from document results in error

$
0
0
I'm generating pdf files based on database info. I'm not clear why, but currently it appends a single blank page to the end of the completed document. I was hoping to just delete that final blank page, but when I try I get a "stream is not writeable" error.

Here's how it's coded right now:

var pdf = new Pdf();
var section = pdf.Sections.Add();
var marginInfo = new Aspose.Pdf.Generator.MarginInfo();
marginInfo.Top = topMargin;
marginInfo.Bottom =  marginInfo.Left = marginInfo.Right = MarginOneInch;
section.PageInfo.Margin = marginInfo;           
section.TextInfo.FontSize = 12;
section.TextInfo.LineSpacing = 1.5F;           
Aspose.Pdf.Generator.Text t = new Text(stringBuilderContainingInfo.ToString());          
t.IsHtmlTagSupported = true;           
section.Paragraphs.Add(t);
pdf.Save("c:\someFileName.pdf");
Document d = new Document("c:\someFileName.pdf");
d.Pages.Delete(d.Pages.Count);
d.Save();

Why does this not work?

Infopath form to Pdf conversion

$
0
0
We have a requirement to convert Infopath form to Pdf. We are using browser enabled infopaths which are in a sharepoint site. We have to convert these infopaths to PDF and upload it to a document library. We are developing a windows application where we are using sharepoint built in web service to connect to the site. I am using aspose for the first time , please help me.  
Viewing all 3131 articles
Browse latest View live