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

Migration from obsolete Aspose.Pdf.Generator namespace, XSL-FO binding

$
0
0
Hi,

We're migrating from the obsolete Aspose.Pdf.Generator namespace to Aspose.Pdf. The main problem is that I could not find any dedicated documentation reference for this, so the the migration is being implemented intuitively.

But as for now, my only problem is how to get away from Aspose.Pdf.Generator.Pdf.BindFO method. I could not find an alternative on the Aspose.Pdf.Document type. Document.BindXml method is supposed to be used with xsl not with xslt. 

So, is there an existing new API or should I use Aspose.Pdf.Generator.Pdf.BindFO for now?

Thanks

Save changes after close of files customized with Aspose lib

$
0
0
Hi,

I have noticed something strange with files that have been customized with aspose pdf library.

After opening a file (for our example, watermark added by aspose), and changing zoom or hovering over the inner attachment in the pdf, once you try to close the file Adobe reader alert pop
"Do you want to save changes to 'example.pdf'' before closing?

This is reproducing in Adobe reader only and with files that aspose customized...

In foxit reader it doesn't happen....

Attaching the example.pdf file

Thanks

foreground colour triggers a carriage return

$
0
0
When I create a PDF,  HTML segments styled with foreground are not displayed as expected

The segment is defined as :


IsHtmlTagSupported = true;
IfHtmlTagSupportedOverwriteHtmlFontNames = true;
IfHtmlTagSupportedOverwriteHtmlFontSizes = true;
IfHtmlTagSupportedCssWinsOnFirstLevelChildren = true;

The HTML I'm setting in the segment is defined in the attached file.

The output is also attached. See the new line created after the text with yellow foreground colour. This should not happen. Could you look into it ? 



How To Set Dictionary To Annotation

$
0
0
Not sure if i missed it but looking at the api the only available related to dictionary is an appearance dictionary and this is not what i need.

Does aspose.PDF support setting dictionaries where a lower level of code blocks are needed?

Missing assemblies

$
0
0
Like many others we are having trouble making use of your product because of the assembly problems, getting errors like this: Could not load file or assembly 'Aspose.Font

There are several ways that this could be resolved.

If you provided an assembly resolver that could be added to AppDomain.CurrentDomain.AssemblyResolve, this should solve the problem.

If you provided the full Aspose.Font and other assemblies, that would solve the problem.

If you provided only a stub version of Aspose.Font and other assemblies, that might solve the problem.


This problem makes this product very hard to integrate into certain systems. Please let us know when a fix will be available. Thank you.

Protected pdf

$
0
0

Hello,

 

I have a problem about disable the "Save as"(Ctrl+S) and "Print"(Ctrl+P) when right clicked on pdf web page.(for protect it not share with anyone,means only show it for information).

I have wrote a code as below. 

 

        [HttpGet]

        public HttpResponse GetPdf(int id)

        {

            MyContext.File I = null;

 

            if (id > 0)

             I = (from p in File where p.ID == id select p).SingleOrDefault();

 

            HttpResponseMessage R = null;

            var context = HttpContext.Current;

 

            if (I != null)

            {

                context.Response.Buffer = true;

        context.Response.Charset = "";

                context.Response.Cache.SetCacheability(HttpCacheability.NoCache);

context.Response.ContentType = "application/pdf";

context.Response.AppendHeader("Content-Disposition", "inline; filename=" + I.NAME+ ";");

context.Response.BinaryWrite(I.DATA);

context.Response.Flush();

context.Response.End();

            }

            else

                R = Request.CreateResponse(HttpStatusCode.BadRequest);

                return context.Response;

          }

 

If your tool can provide, could you please help us?

 

Thanks,

Regards.

stamped pdf is large

$
0
0
Hello,

I have an issue with the TextStamp class generating a file that is sometimes 2MB larger than the original. We are making a searchable pdf by stamping the text back in the original pdf. What we do is for every word we stamp it in the pdf. This results in a file size that is significantly larger by about .5 to 3 MB whereas I would expect the increase in size to be more of the order of 20 - 100 KB. To minimize the size I did call OptimizeResources(). Additionally, I did try to use the TextFragment class based on the example in [1], however even when setting all colors to transparent you could still see the text on top of the image in the pdf. This is why we decided to use the TextStamp class.

Could you tell me how we can minimize the size increase even further? We plan to process millions of documents and saving some bytes here will really help.

Thanks in advance,
Phil

[1] http://www.aspose.com/docs/display/pdfnet/Add+Text+in+an+Existing+PDF+File

Code
    public class Test
    {   
public static void Main(string[] args)
   {
            var doc =
                new Document(
                    @"stampedPdfTooLarge_before.pdf");
            int nrOfWords = 1000;
            var page = doc.Pages[1];
            float increment = ((float)page.PageInfo.Height) / nrOfWords / 2;
            for (int i = 0; i < nrOfWords; i++)
            {
                string text = $"word_{i}";
                TextStamp textStamp = new TextStamp(text)
                {
                    Background = true,
                    XIndent = 0,
                    YIndent = increment * 2 * i,
                    Width = 4.5* text.Length,
                    Height = increment,
                };
                textStamp.TextState.ForegroundColor = Aspose.Pdf.Color.Transparent;
                page.AddStamp(textStamp);
            }
            doc.OptimizeResources();
            doc.Save(@"stampedPdfTooLarge_after.pdf");
}
}

JpegDevice.Process Sometimes Garbles Text

$
0
0
We have begun experiencing cases in which some of the text on a page of a PDF has its text garbled when we use JpegDevice.Process to convert it to an image.  I have attached an example of a document for which most of the text on page 7 experiences the issue.  The method which is called for each page of the document is provided below.  In case it matters, we are always passing in a "scalePercent" of 70.  Also, in case it matters, we are calling this method from within a Parallel.ForEach(...).

If you experience the same issue, perhaps you could suggest a change to my code that would address the issue such that all the text on all the page images would be correct?

Thank you very much.

(here's my code)

public byte[] ProcessJPG(Aspose.Pdf.Page page, int scalePercent)
{
var imageConverter = new JpegDevice(new Resolution(200), 60);
using (var ms = new MemoryStream())
{
imageConverter.Process(page, ms);
var resized = new Bitmap(ms).ScaleByPercent(scalePercent);
return ImageToByteArray(resized, System.Drawing.Imaging.ImageFormat.Jpeg);
}
}


PDF to PDF/A-1b conversion issue

$
0
0
Dear All,

While converting a PDF to a PDF/A-1b with Aspose.Pdf, we run into an issue. The code is trying to embed fonts as per Aspose DEV guide,

https://docs.aspose.com/display/pdfjava/Formatting+PDF+Document#FormattingPDFDocument-EmbeddingFontsinanExistingPDFFile
 
but fails to do so. The server log indicates that the code trying to embed the fonts does run and does not throw any exception.

The code runs on JBoss 7.1 application server residing on Red Hat Linux 6.x with Java 1.7.

Please advise how to ensure that the listed fonts are successfully embedded into the generated PDF/A.  Where does Aspose look for these fonts?

Additionally, there is a non-blocking error reported in the conversion log.
<Problem Severity="Error" Clause="6.7.7" Convertable="True">The instanceID field shall not be specified</Problem></Metadata>

Please also advise how to overcome that error.

Many thanks!

Java code, conversion log, and original PDF attached.

add review status on comments and to review history

$
0
0
Hi,

Does aspose support review status for comments where STATE is equal to Reviewed  and state model values are Accepted, Rejected, Completed, Cancelled, None ?

If so, would like to request a sample code set by a different user (not the same user who created the comment/reply).

Also, an addition to the sample code to add review status to the history. I see in Acrobat when you right click the comment > properties, there is a review history on the various status set by users on specific dates.

Thank you

Extract table data from PDF

$
0
0
Hi Team,
I have a requirement to extract table data as a table from PDF.Can you please help us in achieving this.

Problem in adding Burmese text to PDF

$
0
0
Hi,

I am using Aspose.pdf and adding Burmese Text to my pdf and Bureme Text is broken into consonants and vowels. Please refer to attached screenshot Capture.png. I found that you have recently fixed something similar for Aspose.word, hope this also can be fixed. 

Code I am using is :
        Aspose.Pdf.Document document = new Aspose.Pdf.Document();
        Aspose.Pdf.Page pdf = document.Pages.Add();
        FloatingBox titles = new FloatingBox();
        var newText = new TextFragment("");
        var segment = new TextSegment(Burmese_Text);
        Aspose.Pdf.Text.Font myanmarFont = FontRepository.FindFont("Myanmar3");
        myanmarFont.IsEmbedded = true;
        segment.TextState.Font = myanmarFont;
        newText.Segments.Add(segment);
        titles.Paragraphs.Add(newText);
        pdf.Paragraphs.Add(newText);
        document.Save(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "HelloWorld1234.pdf"));

Regards,
Ankit Singhal

Out of memory exception

$
0
0
Hello, I am trying to create large document with around 200-300 pages having 20-40 bit map images(From steema tee chart). It gives out of memory exception while creating document and sometimes while saving the document. Could you please tell me does Aspose have any memory leak issues, and if yes how to resolve them, this is urgent and could you please provide me some solutions , at this moment I am not able to provide you any code. I am using VS2015, windows 7 os with 8 GB ram and 64 bit os,

Page numbers are not showing in footer - PDF

$
0
0
Hi,

Issue here is:
When I convert document from HTML to PDF (using download option), page numbers are not showing.

I don't create page numbers in footer, just converting from HTML to PDF.

Html for footer is:
<div style="-aw-headerfooter-type:footer-primary"> 
 <div style="-aw-sdt-tag:''"> 
  <p style="margin-top:0pt; margin-bottom:0pt; text-align:right; font-size:11pt"><span style="-aw-field-start:true"></span><span style="-aw-field-code:' PAGE   \\* MERGEFORMAT '"></span><span style="-aw-field-separator:true"></span><span style="font-family:Calibri">1</span><span style="-aw-field-end:true"></span></p> 
 </div> 
 <p style="margin-top:0pt; margin-bottom:0pt; font-size:11pt"><span style="font-family:Calibri">&nbsp;</span></p> 
</div>

Code for converting HTML to PDF:
input = new ByteArrayInputStream(documentDomain.getHtmlContent().getBytes("UTF-8"));
com.aspose.pdf.Document doc = new com.aspose.pdf.Document(input);
out = new ByteArrayOutputStream();
doc.save(out, com.aspose.words.SaveFormat.PDF);

If I create page numbers everything works fine, but I don't want to create page numbers in footer if it already exists.

Do you know what is a problem here?

This is working for Word but for PDF not.
I attached both Word and PDF.

Regards

ASPOSE.PDF HtmlFragment Size Limit Issue

$
0
0

Hi,

We are getting SystemOutOfMemory exception when we are trying to create PDF from Html content, and the content size exceeds more than(250-300 kb). We are using Aspose PDF HtmlFragment for rendering html content in PDF.

Also here we are  attaching the sample code to understand our scenario better.

Please  suggest/provide  any alternative or work around for this issue.

Thanks


Missing Assembly error (Aspose.Font and Aspose.HTML) and table formatting error

$
0
0
Hello,



as in Thread https://www.aspose.com/community/forums/thread/835575.aspx mentioned does Aspose.Pdf 17.1 and newer throw the Assemly Aspose.Font missing error.



We updated all the dll's to the newest version (see below), but due to the problem mentioned above, we have to use an older version of Aspose.Pdf.

Unfortunytely, from version 16.10 on, a FileNotFoundException is thrown, because the Aspose.HTML assemly is missing, when we load an HTML document into an Aspose.Pdf document, including an HTMLLoadOption to define a CustomLoaderOfExternalResources:



Aspose.Pdf.HtmlLoadOptions htmlOptions = new Aspose.Pdf.HtmlLoadOptions(folderUrl);

htmlOptions.CustomLoaderOfExternalResources = uri => { //handling of referenced files };

Aspose.Pdf.Document htmlDocument = new Aspose.Pdf.Document(memoryStream, htmlOptions) { IgnoreCorruptedObjects = true };




I tested ALL versions starting from 11.2.0 to 16.12.0 regarding both missing assembly errors - the result:
we have to use the Aspose.Pdf 12.0.0 version, but this version does not render tables correctly (see attachment - the blackening in the screenshot is due to data protection).




So, right now, our only possibility to convert an HTML file into PDF is to use Aspose.PDF version 12.0.0, including the table rendering issue...that is really, really frustrating!





.Net 3.5, SharePoint 2010, Windows Server 2008 R2

Aspose.Pdf 12.0.0.0

Aspose.Cells 17.5.0.0

Aspose.Email 17.4.0.0

Aspose.Imaging 17.4.0.0

Aspose.Slides 17.4.0.0

Aspose.Words 17.5.0.0

PDF Split Sample Source code based on the PDF file Size

$
0
0
Hello PDF Product Team, We have folder with 1000 Color Images. We need to create PDF files with 50MB or Configured MB file size. Please can you share some Source code for this PDFs Creation. Can we find out how many PDFs can be created with each PDF size of 50MB for 1000 Color images? This information we need to get before saving or Creating the actual PDFs. Thanks, P. Saravanan.

HTML table border style shows in bold.

$
0
0
Hi Support,

When we generated a pdf from Word template. The below content generated html table as expected. But displaying the border in bold. Please find attached screenshot for the same.
























Level LoA Triggers Approval Request Justification/Mitigations
46.4 Limit of Liabilitytest
36.5 Indirect and Consequential Damages4test


Could you please help us to resolve this issue. We will definitely appreciate your help.

Thanks & Regards,
Faisal. N

Extract table from pdf

$
0
0
Hi team,
I'm trying to extract table from pdf file but it is not working with TableAbsorber .Tables are identified but data is not coming.Please Tell me something

Is it possible to have TextAnnotation in XML

$
0
0
Hi,
is it possible to use a TextAnnotation in XML format like how we would use Segment or Attachment?

Thank you
pranusha
Viewing all 3131 articles
Browse latest View live