Comments (5)
Added it via#e8e5637
from itextsharp.lgplv2.core.
thanks for fast reaction and update
in 1.6.6 no exception was throwed, but link inside document not working...
from itextsharp.lgplv2.core.
Sorry I can't help you. Because I don't know how to reproduce your problem, even I couldn't test it.
from itextsharp.lgplv2.core.
using (var sourceStream = File.Open("input.pdf", FileMode.Open))
{
using (var documentStream = File.Create("output.pdf"))
{
var document = new Document();
var writer = PdfWriter.GetInstance(document, documentStream);
writer.PageEmpty = false;
var reader = new PdfReader(sourceStream);
reader.ConsolidateNamedDestinations();
PdfContentByte contentByte = null;
writer.Outlines = SimpleBookmark.GetBookmark(reader);
for (int page = 0; page < reader.NumberOfPages; page++)
{
document.SetPageSize(reader.GetPageSizeWithRotation(page + 1));
if (page > 0)
document.NewPage();
else
{
document.Open();
contentByte = writer.DirectContent;
}
var pageData = writer.GetImportedPage(reader, page + 1);
contentByte.AddTemplate(pageData, 1, 0, 0, 1, 0, 0);
var links = reader.GetLinks(page + 1);
foreach (PdfAnnotation.PdfImportedLink link in links)
{
var annotation = link.CreateAnnotation(writer);
writer.AddAnnotation(annotation);
}
}
document.Close();
documentStream.Seek(0, SeekOrigin.Begin);
}
}
put attached pdf in same folder and execute this code. it will produce output.pdf wich contains copy of input.pdf, but all links not works (it still hoverable, but not redirect will performed then user click on it). in input.pdf all links works fine
from itextsharp.lgplv2.core.
ok... i think that you could ignore my question -i rewrite my code with pdfstamper and all work fine
from itextsharp.lgplv2.core.
Related Issues (20)
- PDF Reader does not read the text from pdf. unit test case is also failing. HOT 1
- `System.Drawing.Common` no longer supported for non-Windows
- AES encryption | Don't Encrypt Meta Data fails to encrypt the pdf document HOT 6
- Strong naming the library HOT 1
- The PdfWriter ExtraCatalog property doesn't seem to work as expected
- Is there a easy way to convert from iTextSharp Image to SKBitmap?
- Wrong page split on nested PdfPTable HOT 2
- Add Font Location for Windows HOT 1
- Endless loop HOT 2
- Specified cast is not valid while reading a TIFF file
- Is there a way to insert svg as a background to PDF ? HOT 1
- Adding a scaled an image to a document produces PDF with the same size as not-scaled image. HOT 1
- Error when reading a large PDF file
- itextsharp.lgplv2.core is missing NuGet package README file HOT 1
- Open encrypted pdf issue
- System.MissingMethodException when migrate from 1.9.4 to 3.4.17 HOT 2
- The strange issue of deleting images from a PDF using iTextSharp HOT 1
- Error when extracting images from some tif files HOT 1
- Manipulating many large files use a large amount of memory
- Updating from 1.7.5 seems to have broken reading converted PDFs from LibreOffice HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from itextsharp.lgplv2.core.