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

Problem searching and extracting text

$
0
0
I have a document where this example does not work ... //open document Document pdfDocument = new Document("input.pdf"); //create TextAbsorber object to extract text TextAbsorber textAbsorber = new TextAbsorber(); //accept the absorber for all the pages pdfDocument.Pages.Accept(textAbsorber); //get the extracted text string extractedText = textAbsorber.Text; // create a writer and open the file TextWriter tw = new StreamWriter("extracted-text.txt"); // write a line of text to the file tw.WriteLine(extractedText); // close the stream tw.Close(); It crashes on the Accept() function. Please advise.
This message was posted using Banckle Live Chat 2 Forum

Concat PDF files not working and unable to flatten image field.

$
0
0
Hello,

On Oct 13, 2010 I entered a case "concatinating xfa forms is not allowed" and I finally received notice on June 5, 2014 that the issue was resolved. I was able to download the latest version and test and so far it appears that I can add pages from one PDF document to another, but the actual Concatenate method while passing in the path to two PDF files is not working. I believe the add pages option will work for our needs, but I would like to understand why such a simple process of Concatenate is not working.

Also, another issue I am having with this new version is trying to fill in the form fields and flattening the fields. Flattening a textbox seems to work fine, but I receive the message "Some fields are malformed, and may not work as expected. Please contact the author for a fix" when I try to flatten an image field. We are using the barcode assembly to create a barcode as a stream then using that stream to populate the image field.

I have a sample vb.net app that is showing the problems I am having.

Thanks!

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.

Losing content when adding pages from one document to another

$
0
0
I've only just started evaluating Aspose.pdf  so might be missing something obvious.

When I add an HTML fragment in a paragraph to a document and save that document it works fine.

However, when I add the pages of that document to another document the new document is blank:

        'add HTML as per ASPOSE EXAMPLE
        Dim doc As Document = New Document()
        Dim page As Page = doc.Pages.Add()
        Dim h As HtmlFragment = New HtmlFragment("<b>TEST</i></b>")
        page.Paragraphs.Add(h)

        'this works as expected
        'doc.save("output.pdf")


        'create a new document and add the pages
        Dim pd As New Aspose.Pdf.Document()
        pd.Pages.Add(doc.Pages)

        'doesn't display HTML fragment
        pd.Save("output.pdf")


PDF to DOCX font name generation

$
0
0
Greetings,

When doing PDF to DOCX conversion with Aspose, if some font is not presented in the current system, Aspose generates a new name on a template "Fontname"=>"WYDFYJ+Fontname". So, extends real fontname with additionally generated random prefix.
Is is on purpose? Can this be switched off?

Thanks!


"OutOfMemoryException" while converting large PDF-files

$
0
0
Hi, while converting large PDF-files into PDF/A-Format an "OutOfMemory"-Exception is thrown. The source-file has a filesize of about 30 MB and consists of 3800+ pages (e.g. reference manual of mySQL). We also encountered the same problem with smaller PDF-files of 20 MB with about 700 pages.

Aspose.Pdf.Generator.Paragraph.IsKeptWithNext Property not working

$
0
0
Hi,

I have the following problem:

I generate a Aspose.Pdf.Generator.Heading object an set the IsKeptWithNext property. The is add this object as a new paragraph to an exisiting section.

After that I add an Table as a new paragraph to the section and normaly the heading an the table should stay together because of the IsKeptWithNext property of the first paragraph.

But they don't stick together. It also does not work if the first paragraph is a simple text or if the second paragraph is an image. It simply works never.

Did I understand anything wrong at this property?

I simply need a function to keep a headline and the following paragraph connected on the same page because it looks ugly if the headline is on the bottom of one page an the table on the next page.

Hope you have some hints for me.

Best regards,

Andrei

Aspose.Pdf.Devices for .net compact framework

$
0
0
Hello! I try the tiral version of Aspose.Pdf for .NET 9.7.0 for use it with VS2088 and compact framework 2.0 , but when i used some devices to  convert one pdf to them, it dose not compile.
System.Drawing.Graphics .
Were can i get a trial version of aspose.pdf.devices for compact framework?

Size not decreasing after splitting a document

$
0
0

Hi,

I am trying to split a pdf document using the below code. where wipDocument is a java bean holding split document information.

for

(WipDocumentPage wipDocumentPage : wipDocument

.getDocumentPages()) {

if (wipDocumentPage.getPageActions().contains("split")) {

Page page = pdfDocument.getPages().get_Item(

wipDocumentPage.getPageNumber());

splitPdfDocument.getPages().add(page);

}

}

wipDocument.getDocumentPages().orderByPageNumberDescending();

for (WipDocumentPage wipDocumentPage : wipDocument

.getDocumentPages()) {

if ( wipDocumentPage.getPageActions().contains("split")) {

log.debug("delete page number " + wipDocumentPage.getPageNumber());

pageCollection.delete(wipDocumentPage.getPageNumber());

}

}

 

Document gets splitted properly using this code the only issue is size of files does not increase. attached is the test  document.

 

Can you please help.

Loading the attached PDF into the Document constructor raises an error

$
0
0
When loading the attached document with the following code:

Aspose.Pdf.Document doc = new Aspose.Pdf.Document([path to file]);
 
the following error is raised:

"Value cannot be null.\r\nParameter name: trailerable"

Add a border to page with Aspose.pdf?

$
0
0
Is it possible to add a border around the entire page with Aspose.pdf?

The only examples/documentation I can find all refer to Generator

Resize to Letter creating Blank pages

$
0
0
Hi,

When i Tried to Resize theLegal size pdf to Letter size it is creating Blank Pages in the out put.
I am attaching both the pdf's. I am using Apose 9.7.0.0 to do this.

But if I use 8.8.0.0 version which is previous version in our system its working.

Could you please help me out

Thanks,


Add TOC in Existing PDF

$
0
0

Hello,

 

My team and I areattempting to add a TOC page to a merged PDF document using the example code that you posted here:

http://www.aspose.com/docs/display/pdfnet/Add+TOC+in+existing+PDF

 

While the TOC page is being generated, we believe there is an issue when the TOC page grows to be greater than 1 page. For example, we are merging many documents that can easily exceed 100 PDF pages and easily be more than 1 page of TOC. In these cases (TOC pages > 1) the linkage to the documents is not correct.

 

Some background. In our code we calculate the # of TOC pages and create a dictionary of the 1) document and the 2) respective page# that on the merged PDF. Calculating the # of TOC pages ahead of time allows us to know the exact page of a certain pdf document in the merged file. For bookmarks this is a sample of our code:

            foreach (File file in FileList)

            {

                OutlineItemCollection pdfChildOutline = new OutlineItemCollection(_doc.Outlines);

 

                // use the file name if no bookmark name is supplied

                pdfChildOutline.Title = file.fileName;               

 

                // Page # for this bookmark.

                // *** pageDictionary returns the exact page of the final merged PDF document

                pdfChildOutline.Destination = new GoToAction(pageDictionary[file.fileName]);

 

                pdfParentOutline.Add(pdfChildOutline);

            }

 

Bookmarks work just fine.  As for the TOC, the linkage is broken when TOC Pages > 1 and we cannot determine why. Can you please shed some light on how we can generate the TOC page to link them to page number AND show the page # provided inheading2.DestinationPage. Thanks, here is a snippet of the code we have for our TOC, which does not work when TOC pages > 1.

 

            for (int i = 0; i < FileList.Count; i++)

            {

                // Create Heading object

                Aspose.Pdf.Heading heading2 = new Aspose.Pdf.Heading(1);

                TextSegment segment2 = new TextSegment();

                heading2.TocPage = tocPage;

                heading2.Segments.Add(segment2);

 

                // Specify the destination page for heading object (front page of the current document)

                heading2.DestinationPage = _doc.Pages[pageDictionary[FileList[i].fileName]];

 

                segment2.Text = TGFileList[i].fileName;

 

                // Add heading to page containing TOC

                tocPage.Paragraphs.Add(heading2);

            }

 

Thanks,

Ricky Lew


This message was posted using Email2Forum by Nayyer Shahbaz.

PDF from ASPOSE in multiple languages

$
0
0

We have HTML text in following languages, do you know that Aspose.pdf product supports different languages.

List of languages are :

German
Dutch
Spanish
Korean
Japanese
Traditional Chinese
Simple Chinese
Spanish
Portugese

 

 

Convert HTML to PDF in Classic ASP using Aspose.PDF

$
0
0
Hello, I am working on converting a html file to PDF and I am wondering what the best route to take would be. I have been able to produce a PDF from the HTML document, but it is not rendering anywhere near where I would like it. What process do you recommend for taking an html file and converting it to PDF while rendering the html within the document? I have searched through the forums and support links, but unsure how to go about incorporating some of the recommendations with Classic ASP. Any help on the best route to take would be greatly appreciated.

Thank you,
Brett

remove LaunchAction java pdf

$
0
0
Hi,
I am trying to remove LaunchAction from a pdf file. I am able to get it:
IAppointment act = document.getOpenAction();
but not delete it.
Thanks,

Extract text from the header, footer and body

$
0
0
Hello,

We are using aspose-pdf-9.5.2.jar with the below code to extract the text of a pdf file:

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(this.path); com.aspose.pdf.TextAbsorber textAbsorber = new com.aspose.pdf.TextAbsorber();
pdfDocument.getPages().accept(textAbsorber);
String extractedText = textAbsorber.getText();

But i am not finding how i can extract the text from the header of the first page, the footer in the last page and the body of the file.
Can you advise please,

Upgrade Aspose.pdf from 7.5.0 to 9.6.0 break exe's built with 7.5.0

$
0
0
Hello,

We have been using aspose.pdf.dll version 7.5.0, Recently we updated aspose.pdf.dll to 9.6.0.
If we replace aspose.pdf.dll 7.5.0 with the 9.6.0 ones in our software install directory our previously built exe with 7.5.0 are not working any more.
Did we lost backward comptability?

add header/footer while concatenating PDF files..

$
0
0
Hi,

New to this PDF control.  I would like to be able to add headers/footers to the resultant pdf when providing an array of pdfs to the PdfFileEditor Concatenate routine.   Is this at all possible?  or the only real way to do this is to Concatenate, then open resultant file, and add what i need?

tx.

issue with deleting form fields

$
0
0
Dear Support,

I want to scan the document and obtain all the adobe fillable fields (step 1), get their information and then remove them from the document (step 2) as seen below:

            //Step 1: Get all Adobe fields.
            Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form(copy_filename);

            //get all field names
            String[] allfields = form.FieldNames;
            Aspose.Pdf.Facades.FormFieldFacade fieldfacade = null;

            foreach (string mFieldName in allfields)
            {

                fieldfacade = form.GetFieldFacade(mFieldName);
              
                //Step 2: remove the Adobe fields.
                Aspose.Pdf.Facades.FormEditor formEditor = new Aspose.Pdf.Facades.FormEditor();
                formEditor.BindPdf(root + "/" + id + ".pdf");

                //delete field

                formEditor.RemoveField(mFieldName);
                formEditor.Save(filename); // save this to filename which is original.
                formEditor.Close();
            }

For the attached example documents, Paycheck.pdf seems to work fine with no problem or errors.

However, for the document AdobeApplication2014.pdf, I get an error at the following line:
 formEditor.RemoveField(mFieldName);

Message:
{"Message":"An error has occurred.","ExceptionMessage":"Object reference not set to an instance of an object.","ExceptionType":"System.NullReferenceException","StackTrace":"   at Aspose.Pdf.InteractiveFeatures.Forms.Field.\u0019\u0003(String )\r\n   at Aspose.Pdf.InteractiveFeatures.Forms.Form.\u0019\u0003(String )\r\n   at Aspose.Pdf.InteractiveFeatures.Forms.Form.Delete(String fieldName)\r\n   at Aspose.Pdf.InteractiveFeatures.Forms.Form.Delete(Field field)\r\n   at Aspose.Pdf.Facades.FormEditor.RemoveField(String fieldName)\r\n   at FieldGeneratorSystem.Controllers.DocumentController.GetAdobeFields() in c:\\Users\\Jonathan\\Documents\\GitHub\\SNAsposeNet\\FieldGeneratorSystem\\Controllers\\DocumentController.cs:line 203\r\n   at FieldGeneratorSystem.Controllers.DocumentController.GetDocumentFields(String filename, String userDefinedTags) in c:\\Users\\Jonathan\\Documents\\GitHub\\SNAsposeNet\\FieldGeneratorSystem\\Controllers\\DocumentController.cs:line 132\r\n   at FieldGeneratorSystem.Controllers.DocumentController.<>c__DisplayClass37.<PostDocument>b__36(Task`1 t) in c:\\Users\\Jonathan\\Documents\\GitHub\\SNAsposeNet\\FieldGeneratorSystem\\Controllers\\DocumentController.cs:line 348\r\n   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()\r\n   at System.Threading.Tasks.Task.Execute()"}

What could be the problem with the second document? Is the formEditor null? If yes, why? How can I solve it?

Thank you,
Sireesha

Viewing all 3131 articles
Browse latest View live