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

Convert PDF to HTML: hyperlinks

$
0
0
Hi,
Is it possible to keep the hyperlinks (in a toc for example) during the converting pdf to HTML?
Thanks,
Alex

PDF file fields are not editable after adding watermark

$
0
0
Hi Team,

I am using Aspose PDF API  code to add watermark to an PDF file.
This PDF file has few fields and we can provide our input for these fields.
I filled in few fields in first page of PDF file and I want to fill remaining remaining fields after some time.  But after adding watermark to this file I am not able to edit those fields.
Please find two PDF's attached. I am pasting the code below.
Your help in this regard will be highly appreciated.  Once we find that this works fine we are planning to purchase full verison of aspose.

Regards
Balu

public class AsposeWaterMarkTest {

public static void main(String[] args) {
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("C:/demo/Affidavit.pdf");
//create text stamp
com.aspose.pdf.TextStamp textStamp = new com.aspose.pdf.TextStamp("Insurance Form");
//set whether stamp is background
textStamp.setBackground(true);
//set origin
textStamp.setXIndent(100);
textStamp.setYIndent(100);
//rotate stamp
textStamp.setRotate(com.aspose.pdf.Rotation.on90);
//set text properties
textStamp.getTextState().setFont(new com.aspose.pdf.FontRepository().findFont("Arial"));
textStamp.getTextState().setFontSize(14.0F);
textStamp.getTextState().setFontStyle(com.aspose.pdf.FontStyles.Bold);
textStamp.getTextState().setFontStyle(com.aspose.pdf.FontStyles.Italic);
//textStamp.getTextState().setForegroundColor(java.awt.Color.GREEN);
//add stamp to particular page
//pdfDocument.getPages().get_Item(1).addStamp(textStamp);
// iterate through all pages of PDF file
for (int Page_counter =1; Page_counter<=pdfDocument.getPages().size();Page_counter++)
{
   //add stamp to all pages of PDF file
   pdfDocument.getPages().get_Item(Page_counter).addStamp(textStamp);
}
//save output document
pdfDocument.save("C:/demo/Affidavit-wm-added.pdf");
System.out.println("end");
}

}

PDF looses styling when overwriting font

$
0
0
When we create a PDF file from a HTML string variabele we receive and we change the font to "calibri' at the end of the pdf creation, styling like bold or cursive does not display in the pdf. If we do not set the font ourselfs, the styling does display correctly in the PDF.

In the attachment I added our code file and an example of html.

It's this part which is the cause of the issue:
////Set Calibri font
//foreach (TextFragment frag in textFragmentCollection)
//{
// frag.TextState.Font = FontRepository.FindFont("Calibri");
//}

PDF with JPEG 2000

$
0
0
We have a PDF with a background image in JPEG 2000 format. When converting the PDF into a JPG with the JpegDevice.Process method the resulting JPEG is not as expected and the background is totally unusable.

Is JPEG 2000 supported as an image in a PDF for the JpegDevice?

Regards,
Sven

Merge With Blank Document

$
0
0

Hi all

I have a requirement to merge two pdf documents with a blank page in between. As per API I should be able to achieve this using the following:

pdfEditor.Concatenate(fs1, fs2, fsBlank,  outStream)

where pdfEditor is a instance of PdfFileEditor

fs1 and fs2 are the file streams to merge and fsBlank is the blank page separator. However when executed, I get 0 byte file created.

If on the other hand I use 2 instead of 3 streams (i.e. fs1 and fsBlank or fs1 and fs2) then I get the desired result.

To be clear my requirement is (assuming  p => page)

Pdf1 = p1,p2,p3,p4,p5

Pdf2 = p1,p2,p5

Desired result = new PDF = {Pdf1 + pdf blank + pdf2} = p1,p2,p3,p4,p5,pblank,p7,p8,p9

Any help greatly appreciated.

 

Extended Features lost

$
0
0
I'm trying to open a PDF, replace some text and then save the document. The problem is that when I do this the extended features are disabled.

public static void CreateProfile(SurveyProfile userProfile, string userProfilePath, string templatePath)
    {
        using (FileStream fileStream = new FileStream(templatePath, FileMode.Open, FileAccess.ReadWrite))
        {
            Document profileDocument = new Document(fileStream);
            ReplaceTokens(profileDocument, userProfile.FirstName, userProfile.LastName);
            profileDocument.Save(userProfilePath,SaveFormat.Pdf);
        }
    }

    public static void ReplaceTokens(Document profileDocument, string firstName, string lastName)
    {
        Aspose.Pdf.Facades.PdfContentEditor pdfContentEditor = new Aspose.Pdf.Facades.PdfContentEditor();
        pdfContentEditor.BindPdf(profileDocument);
        pdfContentEditor.ReplaceTextStrategy.ReplaceScope = Aspose.Pdf.Facades.ReplaceTextStrategy.Scope.REPLACE_ALL;

        pdfContentEditor.ReplaceText("FirstName", firstName);
        pdfContentEditor.ReplaceText("LastName", lastName);
    }

The error I get when I open the document is attached.

Aspose Hyperlinks are not working

$
0
0
Aspose Hyperlinks are not working Windows 2012 server created PDF files
This message was posted using Banckle Live Chat 2 Forum

Center Text in a Table Cell with Colspan

$
0
0
How do you center text in a table cell with a colspan on it?

Here is the code:

Document doc = new Document();
doc.getPageInfo().setLandscape(false);
DecimalFormat df = new DecimalFormat("0.##");

doc.getPageInfo().getMargin().setBottom(36d);
doc.getPageInfo().getMargin().setLeft(30d);
doc.getPageInfo().getMargin().setRight(30d);
double width = doc.getPageInfo().getWidth()-doc.getPageInfo().getMargin().getLeft()-doc.getPageInfo().getMargin().getRight();
double col1Width = width*32/100;
String col1w = df.format(col1Width);
double col2Width = width*32/100;
String col2w = df.format(col2Width);
double col3Width = width*12/100;
String col3w = df.format(col3Width);
double col4Width = width*12/100;
String col4w = df.format(col4Width);
double col5Width = width*12/100;
String col5w = df.format(col5Width);

Page page = doc.getPages().add();

Table table = new Table();
table.setColumnWidths(col1w+" "+col2w+" "+col3w+" "+col4w+" "+col5w);

doc.getPages().get_Item(1).getParagraphs().add(table);
table.setDefaultCellBorder(new BorderInfo(BorderSide.All, 0.1F));
table.setBorder(new BorderInfo(BorderSide.All, .1F));
MarginInfo margin = new MarginInfo();
margin.setLeft(5f);
margin.setRight(5f);
margin.setTop(5f);
margin.setBottom(5f);
table.setDefaultCellPadding(margin);

// Main Title Row
TextFragment frag = new TextFragment("Title to Center");
frag.getTextState().setFontSize(14);
frag.getTextState().setFontStyle(FontStyles.Bold);
frag.getTextState().setHorizontalAlignment(TextAlignment.Center);
Cell cell = new Cell();
cell.setColSpan(5);
cell.getDefaultCellTextState().setHorizontalAlignment(TextAlignment.Center);
cell.getParagraphs().add(frag);

Row mainHeading = table.getRows().add();
mainHeading.getCells().add(cell);

doc.save("test.pdf");

aspose pdf word wrap function missing!

$
0
0
I want to do wordwraping according to this post:
http://www.aspose.com/docs/display/pdfkit_removed/Setting+Wordwrap+while+replacing+text+and+using+ReplaceTextStrategy+class

The code:
pdfEditor.getReplaceTextStrategy().setTextNotFitAction(ReplaceTextStrategy.Action.WORDWRAP);

BUT, when coding I can't find ReplaceTextStrategy.Action.WORDWRAP anywhere! 

I've tried both java/net version, from current 10.3 version to older pdf.kit in 2012. Just can't find WORDWRAP.

Is it missing or deprecated? Or I didn't do it right?

All I want is to replace the orginal PDF text with the new one, and meantime make the new PDF similar to the old one without breaking the lines. I'm evaluating ASPOSE PDF for future produciton ,and I feel wordwrap should be a guaranteed feature.

If you have any solution or alternative ways, please reply ASAP. Thank you!

Adding selections to combo box

$
0
0
I have 8 existing combo boxes on an existing form. I am trying to add (dynamically) to these fields.

I have used several things
using 
Aspose.Pdf.Kit.Form form
We Tried 
FillField (dropDownName.Selections[].ToArray)
Each drop down had one selection - we verified 20 were sent

and we tried 

    FormEditor cboReference = new FormEditor();
                    cboReference.BindPdf(form.SrcFileName);
                                        
                    ddMaster.Dropdowns.ResetIterator();                     //Set to the begining of the display criteria
                    List<String> lstValues = new List<string>();            //Create Listto hold names
                    
                    while (ddMaster.Dropdowns.IterateNext())                                   //Itterate trough till last item (false)
                    {
                        if (ddMaster.Dropdowns.getDropdownList.DropDownName == fieldName)   //Get the values for this object
                        {   cboReference.AddListItem(fieldName, ddMaster.Dropdowns.getDropdownList.Display);    }   //Add the selection choice
                    }   

I'm not getting anywhere

Reading TOC from a pdf in Java

$
0
0
I am trying to read the TOC from a pdf and create bookmarks based on it. I was not able to find any example on how to read the TOC, the examples mentioned in this forum use classes which are no longer there.

Any suggestions on how to read TOC from an input pdf file.

Thanks

TextFragmentAbsorber for exact words or phrase's

$
0
0
Hi team I have a project where i am using AsposePdf.Text. I am using the TextFragmentAbsorber class to find S/N: and another TextFragmentAbsorber class to find S/N with out the colon. The issue I am having is when the second class is implemented it will find all of the items of the first instance (S/N:) as well as  all the items of the second instance (S/N). Is there a way to do a" match whole word" or exact search?
Thanks in advance.

SVG to PDF Issue

$
0
0
Hi,
Any idea why the attached SVG is not getting converted to PDF properly?

Thanks,
Sampath

Opening and resaving exisiting PDF removes all content and produces a file Acrobat can't open

$
0
0
I've attached two files to this message. The first, sample.pdf, is a PDF from one of our clients. The second, resaved sample.pdf, is the result of opening the file using Aspose.PDF and immediately saving the file without any changes. The resaved file has no content, and it causes an error when loaded into Acrobat. Is there something that can be done to allow opening and resaving this file?

Thanks,
Michael Whalen

Fixed Pdf Cut Off

$
0
0
Was wondering if Aspose pdf .net could fix our issue.  We currently have some bad PDF's where the right side is sometimes getting cut off.  We believe that our current pdf writing software is rendering the text region to small and the text gets partially cut off sometimes.  I have included the bad pdf.  Is there a way to fix this and and there a way to detect that the text would be cut off thru code?

com.aspose.pdf Row Splitting

$
0
0
the link below is associated with legacy code, is there a similar mechanism associated with com.aspose.pdf? specifically the 'IsFirstRowRepeated' method?
http://www.aspose.com/docs/display/pdfjava/Control+Table+and+Row+Splitting 

A generic error occurred in GDI+

$
0
0

Hello,


I've got this error when running the attached project on a Windows Server 2003


Data:12/05/2015 14:30:25.75060
Mensagem:Solicitacao:201505120010008029_088_201505121434218535.txt
Mensagem:---->ERRO: A generic error occurred in GDI+.
---->STACK:    at System.Drawing.Image.SaveAdd(EncoderParameters encoderParams)
   at  .  .??()
   at Aspose.Pdf.Devices.TiffDevice.Process(Document document, Int32 fromPage, Int32 toPage, Stream output)
   at Aspose.Pdf.Devices.DocumentDevice.Process(Document document, String outputFileName)
   at Itau.UC.Service.MonitorUpload.Validacao.SepararPDF(String arquivoLocal_, List`1 arquivos)
   at Itau.UC.Service.MonitorUpload.Validacao.SepararArquivos(String arquivoLocal_)

I’m using APOSE.pdf 10.2.0 and Framework 3.5.

Thanks.

Ricardo

 

Squares instead of text when Converting PDF to HTML

$
0
0
when using Aspose.PDF version 10.3.0.0,
after converting PDF to HTML, I get Squares instead of the text.
in version 9.9.0.0 , the converted file was with mix of text and Squares.
attached the PDF Document.
attached print screen of the result.
attached the C# code.

.net PDF to Word

$
0
0
Hi ,does Aspose have a .net implementation to convert PDF to word document (asp.net)
This message was posted using Banckle Live Chat 2 Forum

Images flipped on document conversion

$
0
0
Hi,

I have noticed one issue while using Aspose.PDF to convert a PDF to a word document.
The input PDF contained a scanned document with multiple images, but in the converted word document, all of the images have been reversed.

The output document is basically a mirror image of the input PDF.
I have attached the input and output documents here.
Viewing all 1038 articles
Browse latest View live


Latest Images