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

Exception on Flattening PDF

$
0
0
Hi,

We are currently using Aspose PDF for .Net Version 7.2.0.0. For a specific PDF , we are getting the following stack overflow exception when we try to flatten an Aspose.Pdf.Document object derived from this PDF. Attached are the PDF and the exception message.

Kindly let us know what might be the reason for this exception and a possible workaround for this problem.

Thanks!



Attached document does not raise "Invalid Password" when Document object is constructed

$
0
0
With the attached document, if I run the following code:
            
            string filePath = @"[PATH]\test.pdf";
            Aspose.Pdf.Document doc = new Aspose.Pdf.Document(filePath);

no "Invalid password" exception is raised. However, if I open this file in Adobe Acrobat or Reader I am prompted with an Open password.

PngDevice.Process cutting off image

$
0
0

We are converting PDF files to PNG files using PngDevice.Process.  For most documents, it works fine, but we have a few where the process is cutting off the right side of the drawing.  A few notes:

  • If we use a resolution of 100 DPI, it works fine
  • If we use a resolution of 200 DPI, it cuts off more than at 300 DPI
  • JpegDevice.Process gives the same results

I have attached a copy of the original PDF as well as 100, 200, and 300 DPI converted copies.  Does anyone have any ideas?  The code being used is below:

Aspose.Pdf.

License license = new Aspose.Pdf.License();

license.Embedded =

true;

license.SetLicense(

"Aspose.Total.lic");

Aspose.Pdf.

Document asposeDoc = null;

string fileName = @"C:\Users\q41775\Desktop\Aspose Test Docs\71154001.pdf";

string exportFileName = @"C:\Users\q41775\Desktop\Aspose Test Docs\exported\71154001_" + txtResolution.Text + ".png";

if (System.IO.File.Exists(exportFileName))

{

System.IO.

File.Delete(exportFileName);

}

asposeDoc =

new Aspose.Pdf.Document(fileName);

Resolution resolution = newResolution(Convert.ToInt32(txtResolution.Text));

PngDevice pngDevice = newPngDevice(resolution);

pngDevice.Process(asposeDoc.Pages[1], exportFileName);

Image to pdf conversion not work when using Aspose.Pdf

$
0
0
Hi
  I am try to convert images to pdf in asp.net (Aspose.Pdf),only jpg to pdf convert and see data in pdf files.but others file can't see data in pdf,just it show watermark in pdf.

only get conversion in pdf for jpg

jpg to pdf -----can get pdf with data
png to pdf---cant get
bmp to pdf ---cant get
gif to pdf---cant get
tiff to pdf---cant get

pls see the zip files in that all format images and also converted pdf also available,
in imagwtopdf i write code for conversion.

note:if i try one by one also not get correct pdf conversion.

and i get code form 

Add HTML Code/File to Footer?

$
0
0
Hi all,

it is possible to add formatted Text as HTML in a footer? I need some text in Bold and some Text underlined.

How can i do this?

Thanks in advance.

Winfried

Aspose.pdf for .net 9.1.0.0.

How to read PDF with multiple columns

$
0
0
Hello, 
I'm using Aspose.Pdf (v9.3.0.0) and need to read a pdf file that has two columns. I know the dimensions of the columns (top, left, width, heght). 

But the PDF header and footer has 100% width (attached image)

Can you help me with the coding, I do not know where to start. 

Att

Can't open password encrypted PDF's created with Foxit PhantomPDF Printer

$
0
0
Steps
- Create a PDF with Foxit PhantomPDF Printer V 3.1.0.0815 
- Set Security 
   - Open Password 
   - 128-bit AES 
   - Metadata Not Encrypted 
- See attachment "Created with Foxit - Password is xxx.pdf"

- Open with Aspose.PDF 7.6, 7.9  will throw exception 

Aspose.Pdf.Facades.PdfFileInfo fileInfo = new Aspose.Pdf.Facades.PdfFileInfo(file); fileInfo.HasOpenPassword; 
 
Throws "PdfFileInfo is not initialized. Use constructors with parameters or properties for initialization." Reason "Object reference not set to an instance of an object." new 

AsposePdf.Document(file, password); 
 
Throws "Object reference not set to an instance of an object."v

PDF security permissions

$
0
0
Hi,

I'm trying to set the permissions for a PDF document with aspose.Pdf.
I'd like to allow the end user to have all permissions.

Here's my code:
Permissions Permission = (Permissions.PrintingQuality | Permissions.PrintDocument | Permissions.ModifyTextAnnotations | Permissions.FillForm | Permissions.ModifyContent | Permissions.ExtractContentWithDisabilities | Permissions.ExtractContent | Permissions.AssembleDocument);

doc.Encrypt("UserPassword", null, Permission, CryptoAlgorithm.RC4x128);

doc.Save(Path);

I get the same result if I do:
doc.Encrypt("UserPassword", null, DocumentPrivilege.AllowAll, CryptoAlgorithm.RC4x128,true);

If I open the document with my pdf reader, I see that the "Page Extraction" permission is not allowed.
Is there any way to set it?

Thanks,
Devid.

PDF Javascript at TextFragment or TextSegment level??

$
0
0
Background
We are currently evaluating Aspose.Pdf for .Net as a replacement for iTextSharp.   I am using the new Aspose.Pdf API (i.e., not the Generator) 

So far, I believe Aspose.Pdf can do everything that we currently do with iTextSharp, with one possible exception involving javascript.  

What I Need to Do
Please let me know how I can accomplish the following:
Add some javascript that will be invoked when a reader clicks on a word or other section of text.

I have found the Actions allowing me to invoke javascript when the document is opened/closed/printed, and when a page is opened/closed, but nothing resembling Actions on a TextFragment or TextSegment (where I would expect to be able to do what I'm trying to do.)

To illustrate, I would like to be able to do something similar to this...

    var fragment = new TextFragment("hello, World!");
    fragment.Actions.OnClick = 
new JavascriptAction("app.alert('fragment clicked')");

or this...

    var segment = new TextSegment("hello, World!");
    segment.Actions.OnClick = 
new JavascriptAction("app.alert('segment clicked')");


Is there any way to achieve something like this.  Some kind of workaround?

Please reply at your earliest convenience, as we will be making our decision regarding the use of Aspose.Pdf in our product.   If I unable to accomplish this javascript functionality, it will mean that we cannot use Aspose.Pdf.

Thank you,
R. Ernst


Link Border and Alignment Errors

$
0
0
Hello,

My company has purchased an Aspose Java licence which is valid for  Aspose 4.3 but not for the latest Version.

I noticed two bug with our purchased version while trying to create a table of content using XSL/FO syntax. The main bug concern the creation of annotation link over text.

1 - Border is persistent on Links ( Page 3)

This code is not working for the old version!

              LinkAnnotation link2 = new LinkAnnotation(pdf.getPages().get_Item(pageNumber), link.getRect());
              Border myBorder = new Border(link2);
              myBorder.setWidth(0);
              link2.setBorder(myBorder);

Border is still here after this code

2 - Page numbers text has a large space between characters (Page 4-..)

See the attached PDF document

As we purchased only the older version, is it possible to have the bug correction for this two points?

You'll find the generated PDF documents in this thread.


Regards,

Mohammad

Aspose pdf rectangle bug

$
0
0
I am currently evaluating Aspose pdf but the textfragmentabsorber class is not working properly. In the last page of the attached document the textfragments have the wrong top rectangle. All the textframents returned from row within: Marc-Antoine, Soucy to Nicolas, Ducharme have the same top rectangle. 

I would seriously consider buying aspose pdf if this bug could be fixed

i am using the latest version 8.6.0 for .net 4.0

also i have found in the previous release a bug that was supposed to be fixed similar to the one i have:
PDFNEWNET-35800Incorrect coordinates of text Segment are being returned

But coordinates are still wrong in my pdf document.

Thank you

pdf.save() keeps working inflating the size upto 1G and works forever

$
0
0
Hello, In some cases where we add word documents, using the following code ByteArrayInputStream bais = new ByteArrayInputStream(docToString(fo).getBytes("UTF-8")); Pdf pdf = new Pdf(); pdf.bindFO(bais); pdf.save(out); save hangs and keep downloading to OutputStream out for ever, ending with corrupted pdf. Actually the file is 42kb, but why we end up 500MB or 1G and end up corrupted pdf? We don't have source code, may be you have some suggestions. Thanks. Selim.

Object reference not set to an instance of an object opening PDF file

$
0
0

We are doing PDF to XPS and JPG conversions.  On a few PDF files, we get an 'Object reference not set to an instance of an object' NullReferenceException when opening the PDF.  Below is the code (the paste didn't take well, but you get the idea).  The last line is where it throws the exception, and taking out the licensing portion doesn't matter.  I have attached one of the failing PDF files.  We are using version 8.7.0.0.

 

We are a paying customer and this is production code and is a high-priority issue.  Can you help?

 

Aspose.Pdf.

 

License license = new Aspose.Pdf.License();

 

license.Embedded =

 

true;

 

 

license.SetLicense(

 

"Aspose.Total.lic");

 

 

Aspose.Pdf.

 

Document asposeDoc = null;

 

 

 

string fileName = @"C:\Users\q41775\Downloads\EC_8303-X-26238-001[1].pdf";

 

 

asposeDoc =

new Aspose.Pdf.Document(fileName);

 

 

 

 

Tiny Fonts on fillField

$
0
0
With our latest Aspose license purchase, the Aspose.Pdf.Kit is no longer supported and the recommendation is to switch to Aspose.Pdf.Facades where the Kit items are now available. We followed the instructions provided as the applied and now most of the font in the pdfs we are backfilling are tiny, they show as shadows unless you zoom in 500%. Within the PDF the fonts are 9 or 12pt. Auto produces a readable, but small font. We are using Text fields in the pdf files and using the fillField method to load their content. What is the fix for this, in other words how do we get the font to display in the sizes we defined when the pdf was created.

Text flowing around images

$
0
0
Hi,

I am currently evaluating your Java offering for use with our software.

One of the main requirements we have is for flexible and easy to use page layout.

Within this we we like to be be able to position components on a PDF page e.g. images, tables and we would then like to add text content to the page that would "flow" nicely round the other components irrespective of their position on the page.

Is this something that can be achieved by your software, I have read your online documentation but see not obvious solution.

Thanks

Martin Knox
Futrix Ltd 

   

Microsoft office files to PDF

$
0
0
Any one suggest, tool / API to convert any type of ( Microsoft office ) files to PDF along with merge multiple PDFs in to one.

TextAbsorber - How to parse \r\n ?

$
0
0
Hello, 
I'm using Aspose.Pdf (version 9.3.0.0) to read a PDF file and examine its contents. But get the text through TextAbsorber method, it is unclear when it is a single line break '\r\n' or when it is a breach of several lines '\r\n\r\n' or worse .... when is a line break '\r\n' due to a column that has reached its limit of characters (in this case I should replace with space). 

Is there a pattern I can replace these '\r\n' ? 

Following sample text:
"Tribunal Regional \r\n\r\n\r\n\r\n   Severino Rodrigues dos Santos\r\n\r\n Presidente \r\n\r\n    João Leite de Arruda Alencar \r\n                            Vice-Presidente \r\n\r\n                         Avenida da Paz, 2076 \r\n\r\n                                 Centro\r\n                               Maceió/AL                                                 \r\n                                                                                         \r\n                            CEP: 57020440 \r\n                                                                                         \r\n                      Telefone(s) : (82) 2121 8299                                             \r\n\r\n\r\n\r\n                                                                                          \r\n                       Secretaria Judiciária \r\n                                                           
                                    \r\n                               Acórdão                                                    \r\n                     Publicação de Acórdão \r\n             Processo Nº MS-0000300-89.2012.5.19.0000                                         \r\n                  Processo Nº MS-00300/2012-000-19-00.7                                   \r\n\r\n    Relator                    ANNE INOJOSA\r\n    Revisor                    ANTÔNIO CATÃO \r\n    Redator                    ANNE INOJOSA \r\n    Impetrante(s)              J. A. J. MOTEIS LTDA. - EPP \r\n    Advogado                   FABRICIO SIQUEIRA DE \r\n                               MIRANDA(OAB: 8278AL) \r\n    Impetrado(s)               JUIZ DAS EXECUCOES DAS VARAS \r\n                               DO TRABALHO DE MACEIO\r\n\r\n    Litisconsorte(s)           ANTONIO JOSE BARROS\r\n\r\n    Litisconsorte(s)           MARCOS ANTONIO DE CARVALHO\r\n                               RIBEIRO \r\n    Litisconsorte(s)           MARIA NAILCE
 TENORIO RIBEIRO \r\n\r\n  Procedência: Trt 19ª Região - Maceió/Al\r\n\r\n  EMENTA:\r\n\r\n  PEDIDO DE SUBSTITUIÇÃO DE BENS. INDEFERIMENTO. Tendo\r\n\r\n  em vista que o impetrante expandiu seu negócio, utilizando-se das\r\n\r\n  dependências em que antes se encontrava estabelecido o Motel\r\n\r\n  L´amore (Hotéis Rotativos de Maceió Ltda.), atuando no mesmo\r\n\r\n  ramo de atividade deste, não há como fazer cair por terra o\r\n\r\n  entendimento abraçado pelo Juízo das execuções, no sentido de\r\n\r\n  que houve sucessão de empregadores, cabendo-se inclusive\r\n\r\n  registrar que tal entendimento não foi modificado por esta Corte,\r\n\r\n  quando do pronunciamento referente ao agravo de petição outrora\r\n\r\n  interposto pelo ora impertrante. Registre-se ainda que cabe ao\r\n\r\n  Judiciário ingressar no patrimônio do sucessor, a fim de conseguir\r\n\r\n  recursos para findar a execução e, desta forma, entregar a\r\n\r\n  prestação jurisdicional em sua integralidade, em obediência ao\r\n\r\n  disposto no a
rt. 5º, inc. LXXVIII, da CRFB/88. Logo, restando\r\n\r\n correta a constrição judicial sobre bens do impetrante, através da\r\n\r\nCódigo para aferir autenticidade deste caderno: 73552"



ThreadAbortException on call to Aspose.Pdf.Generator.Pdf.Save(String fileName, SaveType saveType, HttpResponse response)

$
0
0
Hi,

I have a user control (.NET 4.0 using Aspose.Pdf for .NET v9.4.0) which attempts to convert the current rendered html to a pdf file.
Works on local dev machine but not on the server as it throws a ThreadAbortException.
The user control is placed on a page in the CMS (Umbraco v6)
I have deployed the dll file "Aspose.Pdf.dll" to the bin folder on the server, any other files require deployment to the server? (Sorry new user of Aspose.Pdf so not sure if I have missed anything)

Any ideas what is causing this error?

Exception & code below ...

Thanks,
Chris.

An exception occurred in  .

 Action: CreateCurrentPageAsPDF

 Exception: System.Threading.ThreadAbortException: Thread was being aborted.

   at System.Threading.Thread.AbortInternal()

   at System.Threading.Thread.Abort(Object stateInfo)

   at System.Web.HttpResponse.AbortCurrentThread()

   at Aspose.Pdf.Generator.Pdf.Save(String fileName, SaveType saveType, HttpResponse response)

   at CreateCurrentPageAsPDF()


Code ...

      protected override void Render(HtmlTextWriter writer)
      {
         // setup a TextWriter to capture the markup
         TextWriter tw = new StringWriter();
         HtmlTextWriter htw = new HtmlTextWriter(tw);

         // render the markup into our surrogate TextWriter
         base.Render(htw);

         // get the captured markup as a string
         string pageSource = tw.ToString();

         // render the markup into the output stream verbatim
         writer.Write(pageSource);

         Session[SESSION_NAMEKEY_PDF_CONTENT] = pageSource;
      }

      private void CreateCurrentPageAsPDF()
      {
         if(null != Session[SESSION_NAMEKEY_PDF_CONTENT])
         {
            try
            {
               string pageSource = Session[SESSION_NAMEKEY_PDF_CONTENT].ToString();

               Aspose.Pdf.License license = new Aspose.Pdf.License();
               license.SetLicense(Server.MapPath("/AsposeLicense/Aspose.Pdf.lic"));

               //Instantiate an object PDF class
               Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
               //Add the section to PDF document sections collection
               Aspose.Pdf.Generator.Section section = pdf.Sections.Add();

               Aspose.Pdf.Generator.Text pdfText = new Aspose.Pdf.Generator.Text(pageSource);
               pdfText.IsHtmlTagSupported = true;
               section.Paragraphs.Add(pdfText);

               pdf.Save("Results.pdf", Aspose.Pdf.Generator.SaveType.OpenInBrowser, this.Response);
            }
            catch(System.Exception ex)
            {
               if(true == WriteExceptionsToEventLog)
               {
                  WriteToEventLog(ex, "CreateCurrentPageAsPDF");
               }
               else
               {
                  throw;
               }
            }
         }
      }

Pdf.net TextFragment properties

$
0
0
Hi

In aspose words the paragraph class has SpaceBefore and SpaceAfter Properties.

I don't see these Properties in Pdf.net. Please advise how Space Before and Space after can be set for Pdf.net.


Also Aspose Words has a property for ParagraphFormat style - is there an equivalent in Aspose .et.

Regards
Edward

Images conversion without borders

$
0
0
Hello, when i try to convert images (Photoshop, tiff, jpg, bmp, etc) into PDF, i obtain some black borders in pdf pages.
How can i use all pdf page to occupy entire page space for image?
(see attached image originale and pdf resulting - password for pdf is "master")

i use this code:

                        MemoryStream oMTempStream = new MemoryStream();
                        Aspose.Imaging.ImageOptions.PngOptions OptionsI = new Aspose.Imaging.ImageOptions.PngOptions();
                        ((Aspose.Imaging.Image)m_oDocument).Save(oMTempStream, OptionsI);
                                        
                        Aspose.Pdf.Generator.Pdf oPdf = new Aspose.Pdf.Generator.Pdf();
                        Aspose.Pdf.Generator.Section oSection = new Aspose.Pdf.Generator.Section();
                        oSection.PageInfo.Margin.Bottom = 0;
                        oSection.PageInfo.PageBorderMargin.Bottom = 0;
                           
                        if (((Aspose.Imaging.Image)m_oDocument).Width > ((Aspose.Imaging.Image)m_oDocument).Height)
                        {
                            oPdf.IsLandscape = true;
                            float iW =oSection.PageInfo.PageWidth;
                            float iH = oSection.PageInfo.PageHeight;
                            oSection.PageInfo.PageWidth = iH;
                            oSection.PageInfo.PageHeight = iW;
                        }

                        oPdf.Sections.Add(oSection);
                        Aspose.Pdf.Generator.Image image1 = new Aspose.Pdf.Generator.Image(oPdf.Sections[0]);

                        image1.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Png;
                        oPdf.Sections[0].Paragraphs.Add(image1);
                        image1.ImageInfo.ImageStream = oMTempStream;
                        oPdf.Save(_oOutputStream);
                        oMTempStream.Dispose();

Viewing all 3131 articles
Browse latest View live