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

Export Html to Pdf : Text Align-Center not maintained if Background color is specified

$
0
0
We used below html as input to generate the pdf :

<html>
<head>
    <title>Test for Inline style and CSS support </title>
</head>

<body>
    <p style="text-align: center; font-size: 20pt;">
        <span style="background-color:yellow;">Your Name</span>
        <span>Your Area</span>
    </p>
</body>
</html>

The pdf that is generated failed to maintain the center alignment of 1st span. The second span was correctly center aligned.

Please find attached pdf for the same.

Regards,
Saurabh


Add text with small caps

$
0
0
License version: 2.2
ASP.Net 4.0

I'm trying to add small-caps to an aspose.pdf.generator.Text item. I'm successfully able to modify the font size, name, bold, etc either directly or via it's TextInfo object. I can't find a small-caps property anywhere. 

I've searched your site but all I can find are examples relating to Aspose.words.

Support creation of named destinations in existing PDF file

How to set printer driver settings

$
0
0
Hi,

I have to set parameters (select type : bond, plain..., select staple or not, select output media) for printing.

I have found how to set this parameters with .NET but not with Aspose.PDF printing.

How can I do that ?

Thank you.

Fabien.

HTML to Pdf conversion issue using Aspose PDF

$
0
0
I am evaluating Aspose PDF. when i use the trial version, for converting HTML file to a pdf file. The pdf file is empty

It is not showing the text i have in the html file

Code is :
var htmloptions = new HtmlLoadOptions(Server.MapPath("."));
 
htmloptions.UseNewConversionEngine = true;
 
Document pdf = new Document(Server.MapPath("~/Docs/Test.html"), htmloptions);
pdf.Save(Server.MapPath("~/Docs/Test.pdf"));
 
I am getting the images correctly if i insert image in the html file

This message was posted using Email2Forum by Tahir Manzoor.

PageHeight is: 33482.0 PageWidth is: 2490.0. The minimum allowed page size is 3 by 3 units (approximately 0.04 by 0.04 inch); the maximum is 14,400 by 14,400 units (200 by 200 inches)

$
0
0
I have a print lib which prints images to DOC files and PDF files!!!

For several reasons I passed from "Aspse Words 10.x.x" to "Aspose Words 15.5.0" and from "Aspose Pdf 3.0.1" to "Aspose  Pdf. 9.1.0"


In the old versions I was able to create very very very big PDF files from BIG images! But on the new libs I get this error



16:03:52,745 ERROR [STDERR] java.lang.IllegalStateException: PageHeight is: 33482.0 PageWidth is: 2490.0. The minimum allowed page size is 3 by 3 units (approximately 0.04 by 0.04 inch); the maximum is 14,400 by 14,400 units (200 by 200 inches).
16:03:52,745 ERROR [STDERR]     at aspose.pdf.internal.kx.a(Unknown Source)
16:03:52,746 ERROR [STDERR]     at aspose.pdf.internal.ky.a(Unknown Source)
16:03:52,746 ERROR [STDERR]     at aspose.pdf.xml.DocumentBase.a(Unknown Source)
16:03:52,746 ERROR [STDERR]     at aspose.pdf.internal.jy.a(Unknown Source)
16:03:52,746 ERROR [STDERR]     at aspose.pdf.Pdf.a(Unknown Source)
16:03:52,746 ERROR [STDERR]     at aspose.pdf.Pdf.save(Unknown Source)
16:03:52,746 ERROR [STDERR]     at it.siag.imageManipulation.ImageManipulationImp.printOriginalImage(ImageManipulationImp.java:2015)
16:03:52,746 ERROR [STDERR]     at it.siag.imageManipulation.ImageManipulationImp.printOriginalImage(ImageManipulationImp.java:1945)
16:03:52,746 ERROR [STDERR]     at it.siag.imageManipulation.servlet.GetImage.executePrintOperation(GetImage.java:666)
16:03:52,746 ERROR [STDERR]     at it.siag.imageManipulation.servlet.GetImage.doGet(GetImage.java:472)
16:03:52,746 ERROR [STDERR]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
16:03:52,746 ERROR [STDERR]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
16:03:52,746 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
16:03:52,746 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
16:03:52,746 ERROR [STDERR]     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
16:03:52,746 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
16:03:52,747 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
16:03:52,747 ERROR [STDERR]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
16:03:52,747 ERROR [STDERR]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
16:03:52,747 ERROR [STDERR]     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
16:03:52,747 ERROR [STDERR]     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
16:03:52,747 ERROR [STDERR]     at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
16:03:52,747 ERROR [STDERR]     at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
16:03:52,747 ERROR [STDERR]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
16:03:52,747 ERROR [STDERR]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
16:03:52,747 ERROR [STDERR]     at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
16:03:52,747 ERROR [STDERR]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
16:03:52,747 ERROR [STDERR]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
16:03:52,747 ERROR [STDERR]     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
16:03:52,747 ERROR [STDERR]     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
16:03:52,747 ERROR [STDERR]     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
16:03:52,747 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:662)


this the code involving the problem:


Pdf doc = null;
ByteArrayOutputStream byteArrayOutputStream = null;
try {

doc = new Pdf();
doc.setConformance(PdfFormat.PDF_A_1B);
//doc.setConformance(PdfConformance.PdfA1B);
aspose.pdf.PageSetup ps = new aspose.pdf.PageSetup();
Section section = null;
SiagRenderedOp image;
for (int i = 0; i < images.length; i++) {

image = images[i];

// pagesize
/* ps.setPageWidth((float) ConvertUtil.pixelToPoint(image
.getHeader().getWidth(), image.getHeader()
.getDensityX()));
ps.setPageHeight((float) ConvertUtil.pixelToPoint(image
.getHeader().getHeight(), image.getHeader()
.getDensityY()));
*/
logger.debug("image.getHeader().getHeight() -> " + image.getHeader().getHeight());
logger.debug("image.getHeader().getWidth() -> " + image.getHeader().getWidth());
ps.setPageHeight(image.getHeader().getHeight());
ps.setPageWidth(image.getHeader().getWidth());
doc.setPageSetup(ps);
// image
section = doc.getSections().add();
Image pdfImage = new Image(section);

//File file = new File("C://temp/test.jpg");
//   ImageIO.write(image.getImage().getAsBufferedImage(), "jpg",file);
BufferedImage bImage = image.getImage().getAsBufferedImage();
pdfImage.getImageInfo().setSystemImage(bImage);
pdfImage.getImageInfo().setImageFileType(getAsposeImageType(image.getHeader()));
/*pdfImage.getImageInfo().setFixWidth(
(float) ConvertUtil.pixelToPoint(image.getHeader()
.getWidth(), image.getHeader().getDensityX()));
pdfImage.getImageInfo().setFixHeight(
(float) ConvertUtil.pixelToPoint(image.getHeader()
.getHeight(), image.getHeader().getDensityY()));
*/
pdfImage.getImageInfo().setFixHeight(image.getHeader().getHeight());
pdfImage.getImageInfo().setFixWidth(image.getHeader().getWidth());
section.getParagraphs().add(pdfImage);
}

//System.out.println("Start save document !");
//long start = System.currentTimeMillis();
byteArrayOutputStream = new ByteArrayOutputStream();
doc.save(byteArrayOutputStream);
//doc.save("C:\\temp\\test.pdf");
//long elapsed = System.currentTimeMillis() - start;
//System.out.println("End save document time elapsed: " + elapsed + "ms");
//header
if (template != null)
byteArrayOutputStream = setTemplate(template, images[0], byteArrayOutputStream,images.length);
return byteArrayOutputStream.toByteArray();

} catch (Exception e) {
e.printStackTrace();
logger.fatal(e.getMessage());
}


can you help me?

thx
  Michael




HTML to Pdf conversion issue

$
0
0
I am working on conversion of pdf to html using aspose.pdf for java
 
here the text and images are getting separated

but the images which are converted are with background page
 
the image is not displaying separately
 
with back ground page itself it is displaying as image
 
the ouptput is html web page and folder having images of pdf
 
and also if i am having table it is considering it as image
 
can u help me in resolving this issue

This message was posted using Email2Forum by Tahir Manzoor.

pdf to html conversion

$
0
0
Hi,

I am working on pdf to html conversion using aspose pdf for java. Here the output of the conversion is html web page and the images that are present in pdf. But the problem is with images. The image is including the actual image and the background page (i mean only text is getting separated and the image is coming with background page). Also what ever i am converting it is treating as image only, whether it is a table or chart or whatever it is converting it as a image(image+background(original-text)).
Please resolve this issue asap.

Below I have attached the images in zipped folder.

Thanks & Regards
Vasavi

Bug: PDF is not rendered correctly to image

$
0
0
The attached PDF is nog correctly rendered to an image.
I tested with Aspose.Pdf 9.4.0.0

Code I used:

var resolution = new Resolution(150);
var pngDevice = new PngDevice(resolution);var doc = new Document(source);var pageCount = doc.Pages.Count;for (var i = 0; i < pageCount; i++) {using (var imageStream = new FileStream(outputPath + "_" + i + ".png"FileMode.Create)) { pngDevice.Process(doc.Pages[i + 1], imageStream); imageStream.Close(); } }

Can you please take a look?

Thanks, Corne


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

 

Bookmark text corrupted with Japanees/Chineese characters for Security enabled PDF's

$
0
0
Hi Team,

Bookmark text corrupted with Japanees/Chineese characters for Security enabled PDF's.
PFA - PDF having corrupted bookmark texts. Open Password: test123, security password: test456
        - Output PDF
Code:
public static void main(String args[]) {
        String inFile = "C:\\satyendra\\test\\SecurityPDF.pdf";
        com.aspose.pdf.Document document = new com.aspose.pdf.Document(inFile, "test123");
        document.optimize();
        document.save(inFile);
        document.dispose();
    }

After running this code, open the source pdf and find that the bookmarks are corrupted.
Please let me know if you need anymore details.

Thanks,
Satyendra

Get FieldLimit

$
0
0
I understand how to SetFieldLimit, but I would like to get the value before I change it.
Is this possible?

Particular PDF causes runaway memory usage

$
0
0
A customer of ours has a PDF which is a single page PDF but where that single page contains a fairly large drawing.   The PDF itself is a fairly modest 15MB in size.

When a TextAbsorber is used to try to extract text from this PDF the call does not return, CPU usage goes to max and memory is increasingly used until eventually an OutOfMemoryException is thrown.

The code being used to extract the text is:

  Aspose.Pdf.Document doc = new Aspose.Pdf.Document(path);

  TextAbsorber textAbsorber = new TextAbsorber();

  for (int i = 1; i <= doc.Pages.Count; i++)
    textAbsorber.Visit(doc.Pages[i]);  // call does not return - causes eventual OutOfMemoryException

We are currently using Aspose.PDF.dll version 7.9, but I did try a test with the current version 9.4 and got the same behaviour.

Can I supply you with the PDF through a private channel for the problem to be investigated please.

Aspose PDF.. Anchor Tag issue " <a href= "

$
0
0
Hi

I am having an issue with the Aspose PDF convertion.. Aspose PDF is failing to load the anchor tag in the last pages..

For example : If there are 3 pages and all 3 are containing different different Hyperlinks in each pages, then when i export the Aspose PDF, i am unable to view the last pages Hyper links..i.e., on page 3..

If i reduce pages to 2 then problem is occurring in page 2... i.e., all times My aspose pdf is failing to load the hyperlink / Anchor tag "<a href = " in the last pages.. How can I resolve this..

Regards,

Aravind

Html to PDF, strange result

$
0
0
Why is my html label being rendered 2 characters wide? I tried setting the div width to 100% and the span width to 100% still same result. See attachment

Please add <pre> tag support ASAP

$
0
0
Since using IsHtmlTagSupported strips text formatting,  it is imperative that the <pre> tag is added to supported HTML tags so that basic text formatting can be preserved.
The lack of this tag prevents basic and common usage of this tool,  and prevents us from using it for the only reason we purchased this library in the first place.

HTML Text with background-color set has unwanted linebreaks

$
0
0

Hi everybody,

I have an issue with the output of HTML text in PDF documents. Once the HTML code includes a background-color style there's a linebreak before and after that part (see sample code).

The intended result is a single line without the linebreaks.

As-Is:

Normal test, and
deleted text
as well as
text with background colors
shouldn't have any linebreaks in it

Intended:

Normal test, and deleted text as well as text with background colors shouldn't have any linebreaks in it

publicvoid StyleAddedLineBreaks()

{

LicenseSetter.LicensePath = ConfigurationManager.AppSettings["Aspose.LicensePath"];

LicenseSetter.SetLicense();

Pdf pdf1 = newPdf();

Section sec1 = pdf1.Sections.Add();

Text desc;

desc = newText("Normal text, and <del style=\"background-color:#FFCC99;\">deleted text</del> as well as <ins style=\"background-color:#FFFF99;\">text with background colors</ins> shouldn't have any linebreaks in it");

desc.IsHtmlTagSupported = true;

sec1.Paragraphs.Add(desc);       

// Save the resultant PDF document

pdf1.Save(@"C:/temp/StyleAddedLineBreaks.pdf");

}

Checkboxes in PDF are getting checked incorrectly.

$
0
0

Hi,

 

We are using Aspose for on the fly PDF generation. The PDF files we generate are to be prefilled with ceratin values( and check boxes are also to be ticked based on values we pass). We use XFDF for populating the pdf fileds. When we render the XFDF in the browser, the checkboxes are getting ticked(selected) correctly. But when we render the PDF after prefilling it with XFDF data using Aspose, the checkboxes are are not getting ticked (selected) properly. We are using Aspose 8.3.3 version. Kindly let us know whether this issue has already been addressed. If yes let us know the solution for this issue.

 

EDIT :

Also tried using Aspose 8.9.0.0 version. Still the issue persists. Kindly help us in resolving this issue.

 

Kindly reply to us asap. We are in urgent need of solution for this issue.

 

Regards,

kishorekumar.

To Add text into PDF file

$
0
0

Hi Team,

Below is the code snippet wrote to add a simple text to PDF file using Aspose.Pdf contained classes. Though the file is created in the location, there is no content(i.e) assigned text in the output pdf file.


                            Pdf m_pdf = new Pdf();
                            Section section = m_pdf.Sections.Add();
                            Aspose.Pdf.Table pdfTable = new Aspose.Pdf.Table(section);
                            Aspose.Pdf.Row pdfRow = pdfTable.Rows.Add();
                            pdfRow.Cells.Add(); 
                            Aspose.Pdf.Cell pdfCell = new Aspose.Pdf.Cell(pdfTable);

                            Text pdfText = new Text();
                            TextInfo textInfo = pdfText.TextInfo;
                            Segment segment = pdfText.Segments.Add();
                            string tempString = "some text";
                            segment.Content = tempString;
                            textInfo = segment.TextInfo;                           
                            if (pdfText != null) pdfCell.Paragraphs.Add(pdfText);
                            section.Paragraphs.Add(pdfTable);
                            MemoryStream stream = new MemoryStream();                             
                            m_pdf.Save(@"c:\temp\test.pdf");

Please correct if i am missing any thing here.


Thanks,
Divya 

Poor performance converting PDF pages to image

$
0
0
Hi,

We are looking for a toolkit that can convert PDF pages to an image.
So we did some tests with different toolkits including Aspose.Pdf (we have an Aspose.Total license)

We looked at the performance and quality of the conversion (if the resulting image was correct).
These are the results:

Toolkit      Time        Correct (of 30 documents)
Aspose       109s        27
PDF4Net      81s         21
Atalasoft    55s         27
GdPicture    61s         27
Gnostice     248s        16
ceTeSoftware 29s         30
PDF Tron     48s         27

As you can see the quality of the Aspose conversion is good (good enough for us): only 3 of 30 documents were converted incorrectly of which 2 were only small color errors.

The performance of Aspose.Pdf is however poor. It also seems to use a lot of memory during conversion; much more than the other toolkits.

Questions:

1. do you think it is possible to improve the speed of the conversion or is there no room for improvement due to the way the toolkit was build?
2. do you have plans to improve the speed and memory consumption in the near future?

Thank you and best regards,

Corné
Viewing all 3131 articles
Browse latest View live