Is it possible to keep the hyperlinks (in a toc for example) during the converting pdf to HTML?
Thanks,
Alex
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.
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");
pdfEditor.getReplaceTextStrategy().setTextNotFitAction(ReplaceTextStrategy.Action.WORDWRAP);
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