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

Form data not appearing on image

$
0
0
When using a TiffDevice to process a PDF form, the form data is not copied into the resulting image. I am creating my image in this manner:
Document pdfDocument = new Document(inputPath);
pdfDocument.Form.Type = Aspose.Pdf.InteractiveFeatures.Forms.FormType.Standard;
pdfDocument.Form.Flatten();
pdfDocument.Flatten();
TiffDevice dev = new TiffDevice();
dev.Process(pdfDocument, outputPath);

Is there a step I am missing to have filled form data transferred onto the image? A brief forum search leads me to believe this may be connected to PDFNEWNET-37448 - is this common to all image devices? 

I have attached a sample document that will reproduce the issue.

Thank you for your time!

Superscript

$
0
0
Could you please give me a sample code to create the following inline text in Aspose.Pdf (not generator API)?

XYZOW ®Financial Report

Registered mark should be a superscript.

Thanks,
Anil

Font weight

$
0
0
Is there a way to set font weight for the a text fragment/paragraph in Aspose.Pdf? I am using the newer library 10.3 (not generator). I would like to set something like light, medium, bold etc or font weights on the font 'Helvetica LT Condensed'. 

Any code sample to set font weight for the font 'Helvetica LT Condensed' is appreciated. 

I tried following code but it is not helpful.

        [Test]
        public void ShouldApplyFontWeight()
        {
            Document doc = new Document();
            doc.Pages.Add();
            StringBuilder sb = new StringBuilder();
            sb.Append("<p style=\"font-family: 'Helvetica LT Condensed Medium';font-size:18pt;font-weight: normal;\">TEST (normal)</p>");
            sb.Append("<p style=\"font-family: 'Helvetica LT Condensed Medium';font-size:18pt;font-weight: lighter;\">TEST (lighter)</p>");
            sb.Append("<p style=\"font-family: 'Helvetica LT Condensed Medium';font-size:18pt;font-weight: 100;\">TEST (100)</p>");
            sb.Append("<p style=\"font-family: 'Helvetica LT Condensed Medium';font-size:18pt;font-weight: 400;\">TEST (400)</p>");
            sb.Append("<p style=\"font-family: 'Helvetica LT Condensed Medium';font-size:18pt;font-weight: 900;\">TEST (900)</p>");
            sb.Append("<p style=\"font-family: 'Helvetica LT Condensed Medium';font-size:18pt;font-weight: bold;\">TEST (BOLD)</p>");
            sb.Append("<p style=\"font-family: 'Helvetica LT Condensed Medium';font-size:18pt;font-weight: bolder;\">TEST (BOLDER)</p>");
            //sb.Append("<p></p>");
            //sb.Append("<p style=\"font-family: 'Helvetica LT Condensed';font-size:18pt;font-weight: normal;\">TEST (normal)</p>");
            //sb.Append("<p style=\"font-family: 'Helvetica LT Condensed';font-size:18pt;font-weight: lighter;\">TEST (lighter)</p>");
            //sb.Append("<p style=\"font-family: 'Helvetica LT Condensed';font-size:18pt;font-weight: 100;\">TEST (100)</p>");
            //sb.Append("<p style=\"font-family: 'Helvetica LT Condensed';font-size:18pt;font-weight: 400;\">TEST (400)</p>");
            //sb.Append("<p style=\"font-family: 'Helvetica LT Condensed';font-size:18pt;font-weight: 900;\">TEST (900)</p>");
            //sb.Append("<p style=\"font-family: 'Helvetica LT Condensed';font-size:18pt;font-weight: bold;\">TEST (BOLD)</p>");
            //sb.Append("<p style=\"font-family: 'Helvetica LT Condensed';font-size:18pt;font-weight: bolder;\">TEST (BOLDER)</p>");
            //sb.Append("<p></p>");
            //sb.Append("<p style=\"font-family: 'Helvetica LT Condensed Bold';font-size:18pt;font-weight: normal;\">TEST (normal)</p>");
            //sb.Append("<p style=\"font-family: 'Helvetica LT Condensed Bold';font-size:18pt;font-weight: lighter;\">TEST (lighter)</p>");
            //sb.Append("<p style=\"font-family: 'Helvetica LT Condensed Bold';font-size:18pt;font-weight: 100;\">TEST (100)</p>");
            //sb.Append("<p style=\"font-family: 'Helvetica LT Condensed Bold';font-size:18pt;font-weight: 400;\">TEST (400)</p>");
            //sb.Append("<p style=\"font-family: 'Helvetica LT Condensed Bold';font-size:18pt;font-weight: 900;\">TEST (900)</p>");
            //sb.Append("<p style=\"font-family: 'Helvetica LT Condensed Bold';font-size:18pt;font-weight: bold;\">TEST (BOLD)</p>");
            //sb.Append("<p style=\"font-family: 'Helvetica LT Condensed Bold';font-size:18pt;font-weight: bolder;\">TEST (BOLDER)</p>");

            HtmlFragment html = new HtmlFragment(sb.ToString());
            doc.Pages[1].Paragraphs.Add(html);
            string tmpFolder = Path.GetTempPath();
            string tmpFile = Path.Combine(tmpFolder, "FontWeight.pdf");
            doc.Save(tmpFile);
        }

Regards,
Anil



 

Aspose.PDF 10.3 - Set line height in HtmlFragment

$
0
0
I am trying to use the HtmlFragment class to set the font style for my PDF document.  However, I am having trouble getting the line-height CSS property to work as expected.  I've noticed that if I adjust the line-height, it will only adjust spacing right after a bolded line for some reason.  What is the correct syntax for using the line height value in a way the CSS parser will understand?  The reason I started playing with the line height is because I noticed blank lines in my PDF document were getting squashed to a much shorter height than non-blank lines.

var html = "<font style=\"font-family:courier; font-size:10pt; line-height:20px \">" + htmlBody + "</font>";

using IsVerticalBroken and VerticalTextRotationType.AntiClockWise causes formatting issue

$
0
0

Good Morning,

 

I am creating a set of tables using the PDF Generator whose cells in row1 (the headers) are set as follows:

headerCell.VerticalTextRotationAngle = VerticalTextRotationType.AntiClockWise;

headerCell.VerticalAlignment = VerticalAlignmentType.Center

headerCell.Alignment = AlignmentType.Left;

Some of these are single cells with vertical text, and some are cells with a nested table which display a name displayed vertically (ex. Time in Seat) and a set of periodicity measurements (ex.  30/60/90) displayed horizontally at the bottom.

All of the tables use the same code to generate the tables, and the first set of headers (in white) are common across all tables, with the blue and gray being added on dependent upon the Subject's requirements.  Also, the section holding all of the tables has the isLandscape option set to true.

On occasion, some of the tables extend past the page length, so I set the isVerticalBroken option for the table to true.  However, the combination of Anticlockwise and isVerticalBroken seems to throw off the formatting (see the tables for subject 0 and Subject 1).   If the table fits within the page, the formatting is fine (Subject 1), but if the table extends past the end of the page, triggering a vertical split, the formatting becomes incorrect.

Can you provide me with any advice on how to correct the problem?  Also, is there any way to repeat column1 on vertical split?  

Thank you in advance for your help in this matter.

V/R,

Cunning

 

 

 

 

 

Aspose.Pdf.Text.Position.XIndent and YIndent

$
0
0
Hello can some one tell me what the scale is for the Aspose.Pdf.Text.Position.XIndent and YIndent
Thank you

How to Insert 2D Graph in PDF????

$
0
0
How can I generate a 2D graph in PDF?  We have a MVC razor view that gets converted to PDF using Aspose.PDF but we need to generate a pie chart from ASP.NET cshtml to pdf.  Please advise, thanks!

I'm not sure if this is the right path but I'm not seeing any inclination as to where the dynamic data will be integrated.

http://www.aspose.com/docs/display/pdfnet/Working+with+Graphs+%28Generator%29


HtmlFragment causing errors in multi-threading code

$
0
0
I am running into issues while generating PDFs containing HtmlFragments using multi-threading. I tried to narrow down the problem to html fragment in my code. It would be helpful if you could provide a workaround or a hotfix to solve this problem. Thank you. 

Please uncomment the commented line doc.Pages[1].Paragraphs.Add(htmlFragment); to reproduce the problem. The idea is to generate the files concurrently to save time. I am using the Aspose.Pdf v10.3 (not generator).

Attached the partial stack trace to hide the project code details. 

        [Test]
        public void ShouldTestAsposeThreadSafety()
        {
            License license = new License();
            license.SetLicense("Aspose.Pdf.lic");

            var list = new List<string>();
            for (int i = 0; i < 10; i++)
            {
                list.Add(i.ToString("0000") + ".pdf");
            }

            try
            {
                Parallel.ForEach(list, file =>
                {
                    Document doc = new Document();
                    doc.Pages.Add();
                    TextFragment textFragment = new TextFragment("TEXT Fragment");
                    HtmlFragment htmlFragment = new HtmlFragment("<p>TEST HTML Paragraph</p>");
                    doc.Pages[1].Paragraphs.Add(textFragment);
                    //doc.Pages[1].Paragraphs.Add(htmlFragment); // PROBLEM IS HERE
                    string tmpFolder = @"C:\Users\test\Desktop\Temp";
                    string tmpFile = Path.Combine(tmpFolder, file);
                    doc.Save(tmpFile);
                });
            }
            catch (AggregateException aex)
            {
                foreach (Exception ex in aex.Flatten().InnerExceptions)
                {
                    Console.WriteLine("Exception -->");
                    Console.WriteLine(ex);
                }
            }
        }

Regards,
Anil


PDFNEWNET-38505

Printing pdfs from webpage

$
0
0
Please help us with this requirement.
We have some pdfs present on a remote location.

We need to be able to invoke print command on a set of pdfs which the user selects.
The pdfs are usually not visible on the current page when the command is invoked.

Is this possible? What are the different approaches?

Tables from HTML

$
0
0
Hi,

We are rendering a PDF using HTML stored in a SharePoint list item. But we do notice some issues with table rendering.

The HTML code I used is attached as "HTMLCode.txt" this HTML has two tables in it. The upper table is copied directly from Excel to SharePoint. The second one is the same table but manually modified to remove the <colgroup> tags.

The resulting pdf is also attached as "print.pdf" here you can see the original table falls of the page while the second table is much smaller. It seems when we remove the <colgroup> tag the rendering does not take the table or cell widths in account. While the HTML should be correct as we can see in the "Html Render.png" attachment which is rendered in the browser. (IE11)

This is a big issue for our customer project. At the moment we have to write extra custom code to remove the <colgroup> tags just to make sure the table is always on the page. But losing the formatting in the progress is unacceptable. Because of project deadlines we had to set this solution in production but only as a temporary fix.

Could you provide us with a proper solution? And if this requires a new version an ETA of said new version so we can communicate this with our customer.

We are using the latest version of PDF.NET 10.1.0

Better way to convert pdf to word/html?

$
0
0
Hello,

I have noticed that with many pdf to word/html conversion jobs, the different text blocks often get`s joined together, which makes the resulting document unusable. As a test, i converted this document to .docx now:
http://www.datatilsynet.no/Global/05_hoeringer/2015/14-01359-4-horingsuttalelse-NOU-2014-10.pdf

The resulting document is attached here.

Is there anything that can be done to make the conversion go smoother?

Converting dynamic XFA

$
0
0
Hi, We would like to use Aspose.PDF for our pdf conversion feature in one of our product. We are able to flatten successfully a dynamic arabic XFA document. But the image conversion on the flattened document is failing . Can you confirm whether this is a limitation to your component? Let me know if there is any workaround for this issue? Thanks Biju A

'This file is damaged but is being repaired' after combining files with PdfFileEditor Concatenate

$
0
0
Hello,
I am combining multiple pdf files with the PdfFileEditor Concatenate function (memory stream array to single memory stream). See attached file for cut-down code.

The resulting pdf always brings up a message in Adobe Acrobat (reader or editor) that, 'This file is damaged but is being repaired'.

The file opens ok but there is always a request to save the repaired file on closing Acrobat. I want to avoid this request to save so need to create an 'undamaged' file.

At the moment I am just saving the byte array from PdfFileEditor Concatenate memstream output with a '.pdf' file extension. Do I need to finalize it somehow? I have tried creating a pdf document object from the memstream and then saving that but same problem.

Aspose pdf is version 9.5.0.0.


Thanks!

PdfConverter#getNextImage(OutputStream) never returns (infinite loop?)

$
0
0
The attached PDF causes some internal problem with Aspose. getNextImage() never returns, presumably getting stuck in some sort of infinite loop (StackOverflowException isn't thrown for example).

This is troublesome for us, as we need to trust Aspose to at least eventually return, even if it fails.

Example code:

final byte[] bytes = ... // load file
final PdfConverter converter = new PdfConverter();
converter.bindPdf(new ByteArrayInputStream(bytes));
converter.setStartPage(1);
converter.setEndPage(1);
converter.doConvert();

final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
converter.getNextImage(outputStream);

dynamic xfa

$
0
0
Is it possible to flatten dynamic xfa pdf with aspose pdf.Net
This message was posted using Banckle Live Chat 2 Forum

Evaluation of xps to pdf converter

$
0
0
Hi,

     We are evaluating Aspose pdf for one of our products. Our requirement is to convert wpf xaml to pdf.  We are evaluating the xps to pdf conversion features of  your component.
     We would like to know the following

    . We are unable to completely evaluate the product since in evaluation mode the conversion of pdf from xps is restricted to 4 text fragments (At most 4 text fragments can be added in evaluation mode. ). Is there any other option of evaluating the same , which is not restrictive of the size of file being convereted.

•    Is there any limitation on memory/file size of the xps file being converted to pdf in licensed version. In 64 bit mode, the reading of the xps file which is about 95 Mb approx
    Takes long time and never seems to complete.

•    Also, Do you provide option of converting custom xaml code to pdf without having to parse the xaml code ourselves and write corresponding pdf element to pdf file, i.e pass a xaml ui to sprire.pdf which can do the parsing on its own and convert to pdf (without xps conversion in between)?

Thanks,
Balaji R

Sanitize Document

$
0
0
Hi
In Adobe Acrobat there is an option to sanitize PDF document.

Do you have any option to do it by code or part of the actions?

Thanks

Convert HTML to PDF by java program

$
0
0

Hi,

We have requirement for converting HTML to PDF file based on HTML format in java program.

Currently we are using below jar files for aspose-pdf-2.7.0-jdk15.jar & aspose-pdf-kit-3.7.0.jar for other purpose in production environment.

I am attaching one sample HTML file. rename the TXT to html.

Please check and update me.

If you have any queries then inform  me.

Thanks in Advance.

Regards,

RSY Narayan

 

 

Remove font name in pdf file

$
0
0
How can i remove font names in pdf file ?
Viewing all 3131 articles
Browse latest View live