Page 3 of 4 FirstFirst 1234 LastLast
Results 81 to 120 of 136

Thread: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

  1. #81

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Quote Originally Posted by GeoCrystal View Post
    Hi Stanav,
    May be a stupid doubt, but.....
    Can I use the same code for a web application? coz, I think iTextSharp does not work on relative paths....
    Yes, you certainly can. You don't use the relative paths. However, you can get the physical path from a relative path using Server.MapPath method in asp.net or something equivalent in other platforms.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  2. #82
    New Member
    Join Date
    Aug 2011
    Posts
    10

    Re: [VB.NET] Pdf Manipulation Class Using iTextSharp

    Quote Originally Posted by stanav View Post
    This thread was originally about extracting and merging pdf files using iTextSharp. However, as time goes by, I have added a lot more code to do other stuff and put them all together into a handy class called PdfManipulation. There are 2 classes as below (choose the one that matches the iTextSharp version you're using):

    1. The original PdfManipulation.vb class is coded based on itextsharp version 4. This class is obsolete and no longer maintained.

    2. The updated PdfManipulation2.vb class is for the newer itextsharp version 5. This class also contains alot more methods than the original one and I highly recommend it over the old one. I will update this class from time to time to fix bugs and/or add more functionality. Consider it's a work in progress

    Please verify the version of iTextSharp you're using and download the correct class.

    Below is the list of public methods in the new PdfManipulation2 class
    vb.net Code:
    1. 'Remove all restrictions from a pdf file
    2.     Public Shared Function RemoveRestrictions(ByVal restrictedPdf As String, Optional ByVal saveABackup As Boolean = True) As Boolean
    3.    
    4.     'Parse text from a specified range of pdf pages    
    5.     Public Shared Function ParsePdfText(ByVal sourcePDF As String, _
    6.                                   Optional ByVal fromPageNum As Integer = 0, _
    7.                                   Optional ByVal toPageNum As Integer = 0) As String
    8.    
    9.     'Parse all text from a pdf
    10.     Public Shared Function ParseAllPdfText(ByVal sourcePDF As String) As Dictionary(Of Integer, String)
    11.    
    12.     'Page to page comparision of 2 pdf files and write the differences to a resulting text file    
    13.     Public Shared Sub ComparePdfs(ByVal pdf1 As String, ByVal pdf2 As String, _
    14.                                   ByVal resultFile As String, _
    15.                                   Optional ByVal fromPageNum As Integer = 0, _
    16.                                   Optional ByVal toPageNum As Integer = 0)
    17.    
    18.     'Extract specified pages from a pdf to create a new pdf
    19.     Public Shared Sub ExtractPdfPages(ByVal sourcePdf As String, ByVal pageNumbersToExtract As Integer(), ByVal outPdf As String)
    20.  
    21.     'Split a pdf into specified number of pdfs
    22.     Public Shared Sub SplitPdfByParts(ByVal sourcePdf As String, ByVal parts As Integer, ByVal baseNameOutPdf As String)
    23.    
    24.     'Split a pdf into multiple pdfs each containing a specified number of pages.  
    25.     Public Shared Sub SplitPdfByPages(ByVal sourcePdf As String, ByVal numOfPages As Integer, ByVal baseNameOutPdf As String)
    26.    
    27.     'Extract pages from multiple source pdfs and merge into a final pdf    
    28.     Public Shared Sub ExtractAndMergePdfPages(ByVal sourceTable As DataTable, ByVal outPdf As String)
    29.      
    30.     'Set security password on an existing pdf file  
    31.     Public Shared Sub SetSecurityPasswords(ByVal sourcePdf As String, ByVal outputPdf As String, ByVal userPassword As String, ByVal ownerPassword As String)
    32.      
    33.     'Add watermark to pdf pages using an image  
    34.     Public Shared Sub AddWatermarkImage(ByVal sourceFile As String, ByVal outputFile As String, ByVal watermarkImage As String)
    35.    
    36.     'Add water mark to all pdf pages using text    
    37.     Public Shared Sub AddWatermarkText(ByVal sourceFile As String, ByVal outputFile As String, ByVal watermarkText() As String, _
    38.                                        Optional ByVal watermarkFont As iTextSharp.text.pdf.BaseFont = Nothing, _
    39.                                        Optional ByVal watermarkFontSize As Single = 48, _
    40.                                        Optional ByVal watermarkFontColor As iTextSharp.text.BaseColor = Nothing, _
    41.                                        Optional ByVal watermarkFontOpacity As Single = 0.3F, _
    42.                                        Optional ByVal watermarkRotation As Single = 45.0F)
    43.  
    44.     'Merge multiple pdfs into a single one.  
    45.     Public Shared Function MergePdfFiles(ByVal pdfFiles() As String, ByVal outputPath As String, _
    46.                                          Optional ByVal authorName As String = "", _
    47.                                          Optional ByVal creatorName As String = "", _
    48.                                          Optional ByVal subject As String = "", _
    49.                                          Optional ByVal title As String = "", _
    50.                                          Optional ByVal keywords As String = "") As Boolean
    51.  
    52.     'Merge multiple pdf's into one with all bookmarks preserved
    53.     Public Shared Function MergePdfFilesWithBookmarks(ByVal sourcePdfs() As String, ByVal outputPdf As String) As Boolean
    54.        
    55.     'Add document outline (bookmarks) to a pdf
    56.     Public Shared Sub AddDocumentOutline(ByVal sourcePdf As String, ByVal outputPdf As String, ByVal outlineTable As System.Data.DataTable)
    57.      
    58.     'Extract urls from a pdf  
    59.     Public Shared Function ExtractURLs(ByVal sourcePdf As String, Optional ByVal pageNumbers() As Integer = Nothing) As System.Data.DataTable
    60.        
    61.     'Extract images from a pdf
    62.     Public Shared Function ExtractImages(ByVal sourcePdf As String) As List(Of Image)
    63.      
    64.     'Fill a form  
    65.     Public Shared Sub FillAcroForm(ByVal sourcePdf As String, ByVal fieldData As DataRow, ByVal outputPdf As String)
    66.  
    67.     Public Shared Sub FillMyForm(ByVal sourcePdf As String, ByVal fieldData As DataRow, ByVal outputPdf As String)
    68.  
    69.     'Add annotatation
    70.     Public Shared Sub AddTextAnnotation(ByVal sourcePdf As String, ByVal outputPdf As String)
    71.  
    72.     Public Shared Function GetAcroFieldData(ByVal sourcePdf As String) As Dictionary(Of String, String)
    73.        
    74.     Public Shared Function GetPdfSummary(ByVal sourcePdf As String) As DataTable
    75.        
    76.     Public Shared Function ReplacePagesWithBlank(ByVal sourcePdf As String, _
    77.                                                  ByVal pagesToReplace As List(Of Integer), _
    78.                                                  ByVal outPdf As String, _
    79.                                                  Optional ByVal templatePdf As String = "") As Boolean
    80.        
    81.     Public Shared Function InsertPages(ByVal sourcePdf As String, _
    82.                                        ByVal pagesToInsert As Dictionary(Of Integer, iTextSharp.text.pdf.PdfImportedPage), _
    83.                                        ByVal outPdf As String) As Boolean
    84.        
    85.     Public Shared Function RemovePages(ByVal sourcePdf As String, ByVal pagesToRemove As List(Of Integer), ByVal outputPdf As String) As Boolean
    86.      
    87.     'A demo on how to draw various shapes in itextsharp  
    88.     Public Shared Sub DrawShapesDemo(ByVal sourcePdf As String, ByVal outputPdf As String)
    89.          
    90.     Public Shared Sub AddImageToPage(ByVal sourcePdf As String, ByVal outputPdf As String, ByVal imgPath As String, ByVal imgLocation As Point, ByVal imgSize As Size, Optional ByVal pages() As Integer = Nothing)


    Any comments are welcomed.
    Happy coding
    Stanav.
    Hello Stanav,

    First of all thanks for your valuable post. It helped me a lot in few fuzzy things.
    I am using the itextsharp 5.1.1.0 dll version along with your PDFManipulation2.vb code.

    I want to remove restrictions of the PDF File which has 128 bit AES encryption. But i only have user password & do not have owner password.

    For that i tried your method named "RemoveRestrictions" but it's throwing exception stating "Bad User Password". So could you please help me in this ?

    Thanks in advance...

  3. #83

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [VB.NET] Pdf Manipulation Class Using iTextSharp

    Quote Originally Posted by rktech View Post
    Hello Stanav,

    First of all thanks for your valuable post. It helped me a lot in few fuzzy things.
    I am using the itextsharp 5.1.1.0 dll version along with your PDFManipulation2.vb code.

    I want to remove restrictions of the PDF File which has 128 bit AES encryption. But i only have user password & do not have owner password.

    For that i tried your method named "RemoveRestrictions" but it's throwing exception stating "Bad User Password". So could you please help me in this ?

    Thanks in advance...
    I've made some changes in the RemoveRestrictions method to allow a password to be passed in if the restricted pdf is password protected. You need to re-download the PdfManipulation2.vb class.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  4. #84
    New Member
    Join Date
    Aug 2011
    Posts
    10

    Re: [VB.NET] Pdf Manipulation Class Using iTextSharp

    Quote Originally Posted by stanav View Post
    I've made some changes in the RemoveRestrictions method to allow a password to be passed in if the restricted pdf is password protected. You need to re-download the PdfManipulation2.vb class.
    ================
    Stanav,

    Thanks for your reply. I tried the same steps mentioned by you. But still its giving "Bad User Password" when i am passing the User password , not the Owner password, as my requirements are to remove restrictions with user password not owner password.

    Your help in achieving same will be great.

    Thanks in advance....

  5. #85

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    It should work with user password. I've tried it myself.
    Can you upload a sample password protected pdf and give me the user password?
    It could be the version of iTextSharp you're using (5.1.1.0). I was testing it using the older version 5.0.2.0.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  6. #86
    New Member
    Join Date
    Aug 2011
    Posts
    10

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Dear Stanav,

    Thanks for your valuable reply.
    Yes i tried & it worked.I was doing some mistake earlier.
    But thanks a ton to you for your valuable support.


    Also i am stuck in some other dot net setup problem as mentioned below. Can you share your update in same if possible ?

    i have 1 .net windows application & same needs to be distributed so for that i had made setup & deployment project that has created 3 files as below.

    a) MSI installer file.
    b) Setup file.
    c) dotnetfx30 file as dotnet is prerequisite & required this application to work so it needs to be installed
    first.

    Target Area is to have single .Exe file instead of above 3 files. How can we accomplish this ?
    Please help...

  7. #87
    New Member
    Join Date
    Nov 2011
    Posts
    1

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Thank you stanav, itextsharp.dll ver. 5.1.2.0 works great with your class PdfManipulation2.vb
    at first atempt without any problem. So, is there any way to donate you?

  8. #88

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Quote Originally Posted by podpolanec View Post
    Thank you stanav, itextsharp.dll ver. 5.1.2.0 works great with your class PdfManipulation2.vb
    at first atempt without any problem. So, is there any way to donate you?
    I'm glad that the code I shared here has helped you. And thank you for your offer but it's my philosophy not to accept any monetary offers for helping others.
    You can rep me though

    Happy coding,
    Stanav.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  9. #89
    New Member
    Join Date
    Aug 2011
    Posts
    10

    Re: [VB.NET] Pdf Manipulation Class Using iTextSharp

    Dear Stanav,

    Thanks for your valuable post that you have shared on this forum.
    I have one scenario where your input is highly required i.e. i have tried your valuable code for removing the PDF restrictions whereas the encryption level were of 128 Bit Aes type with itextsharp dll version 4.0.3 & it worked awesome.

    But when i am trying to remove pdf restrictions where the encryption type is 256 Bit aes then it throwing error & getting failed in removing restrictions.

    Can you please help me in this ?

    Thanks in advance.

    ==================================================
    Quote Originally Posted by stanav View Post
    This thread was originally about extracting and merging pdf files using iTextSharp. However, as time goes by, I have added a lot more code to do other stuff and put them all together into a handy class called PdfManipulation. There are 2 classes as below (choose the one that matches the iTextSharp version you're using):

    1. The original PdfManipulation.vb class is coded based on itextsharp version 4. This class is obsolete and no longer maintained.

    2. The updated PdfManipulation2.vb class is for the newer itextsharp version 5. This class also contains alot more methods than the original one and I highly recommend it over the old one. I will update this class from time to time to fix bugs and/or add more functionality. Consider it's a work in progress

    Please verify the version of iTextSharp you're using and download the correct class.

    Below is the list of public methods in the new PdfManipulation2 class
    vb.net Code:
    1. 'Remove all restrictions from a pdf file
    2.     Public Shared Function RemoveRestrictions(ByVal restrictedPdf As String, Optional ByVal password As String = Nothing, Optional ByVal saveABackup As Boolean = True) As Boolean
    3.    
    4.     'Parse text from a specified range of pdf pages    
    5.     Public Shared Function ParsePdfText(ByVal sourcePDF As String, _
    6.                                   Optional ByVal fromPageNum As Integer = 0, _
    7.                                   Optional ByVal toPageNum As Integer = 0) As String
    8.    
    9.     'Parse all text from a pdf
    10.     Public Shared Function ParseAllPdfText(ByVal sourcePDF As String) As Dictionary(Of Integer, String)
    11.    
    12.     'Page to page comparision of 2 pdf files and write the differences to a resulting text file    
    13.     Public Shared Sub ComparePdfs(ByVal pdf1 As String, ByVal pdf2 As String, _
    14.                                   ByVal resultFile As String, _
    15.                                   Optional ByVal fromPageNum As Integer = 0, _
    16.                                   Optional ByVal toPageNum As Integer = 0)
    17.    
    18.     'Extract specified pages from a pdf to create a new pdf
    19.     Public Shared Sub ExtractPdfPages(ByVal sourcePdf As String, ByVal pageNumbersToExtract As Integer(), ByVal outPdf As String)
    20.  
    21.     'Split a pdf into specified number of pdfs
    22.     Public Shared Sub SplitPdfByParts(ByVal sourcePdf As String, ByVal parts As Integer, ByVal baseNameOutPdf As String)
    23.    
    24.     'Split a pdf into multiple pdfs each containing a specified number of pages.  
    25.     Public Shared Sub SplitPdfByPages(ByVal sourcePdf As String, ByVal numOfPages As Integer, ByVal baseNameOutPdf As String)
    26.    
    27.     'Extract pages from multiple source pdfs and merge into a final pdf    
    28.     Public Shared Sub ExtractAndMergePdfPages(ByVal sourceTable As DataTable, ByVal outPdf As String)
    29.      
    30.     'Set security password on an existing pdf file  
    31.     Public Shared Sub SetSecurityPasswords(ByVal sourcePdf As String, ByVal outputPdf As String, ByVal userPassword As String, ByVal ownerPassword As String)
    32.      
    33.     'Add watermark to pdf pages using an image  
    34.     Public Shared Sub AddWatermarkImage(ByVal sourceFile As String, ByVal outputFile As String, ByVal watermarkImage As String)
    35.    
    36.     'Add water mark to all pdf pages using text    
    37.     Public Shared Sub AddWatermarkText(ByVal sourceFile As String, ByVal outputFile As String, ByVal watermarkText() As String, _
    38.                                        Optional ByVal watermarkFont As iTextSharp.text.pdf.BaseFont = Nothing, _
    39.                                        Optional ByVal watermarkFontSize As Single = 48, _
    40.                                        Optional ByVal watermarkFontColor As iTextSharp.text.BaseColor = Nothing, _
    41.                                        Optional ByVal watermarkFontOpacity As Single = 0.3F, _
    42.                                        Optional ByVal watermarkRotation As Single = 45.0F)
    43.  
    44.     'Merge multiple pdfs into a single one.  
    45.     Public Shared Function MergePdfFiles(ByVal pdfFiles() As String, ByVal outputPath As String, _
    46.                                          Optional ByVal authorName As String = "", _
    47.                                          Optional ByVal creatorName As String = "", _
    48.                                          Optional ByVal subject As String = "", _
    49.                                          Optional ByVal title As String = "", _
    50.                                          Optional ByVal keywords As String = "") As Boolean
    51.  
    52.     'Merge multiple pdf's into one with all bookmarks preserved
    53.     Public Shared Function MergePdfFilesWithBookmarks(ByVal sourcePdfs() As String, ByVal outputPdf As String) As Boolean
    54.        
    55.     'Add document outline (bookmarks) to a pdf
    56.     Public Shared Sub AddDocumentOutline(ByVal sourcePdf As String, ByVal outputPdf As String, ByVal outlineTable As System.Data.DataTable)
    57.      
    58.     'Extract urls from a pdf  
    59.     Public Shared Function ExtractURLs(ByVal sourcePdf As String, Optional ByVal pageNumbers() As Integer = Nothing) As System.Data.DataTable
    60.        
    61.     'Extract images from a pdf
    62.     Public Shared Function ExtractImages(ByVal sourcePdf As String) As List(Of Image)
    63.      
    64.     'Fill a form  
    65.     Public Shared Sub FillAcroForm(ByVal sourcePdf As String, ByVal fieldData As DataRow, ByVal outputPdf As String)
    66.  
    67.     Public Shared Sub FillMyForm(ByVal sourcePdf As String, ByVal fieldData As DataRow, ByVal outputPdf As String)
    68.  
    69.     'Add annotatation
    70.     Public Shared Sub AddTextAnnotation(ByVal sourcePdf As String, ByVal outputPdf As String)
    71.  
    72.     Public Shared Function GetAcroFieldData(ByVal sourcePdf As String) As Dictionary(Of String, String)
    73.        
    74.     Public Shared Function GetPdfSummary(ByVal sourcePdf As String) As DataTable
    75.        
    76.     Public Shared Function ReplacePagesWithBlank(ByVal sourcePdf As String, _
    77.                                                  ByVal pagesToReplace As List(Of Integer), _
    78.                                                  ByVal outPdf As String, _
    79.                                                  Optional ByVal templatePdf As String = "") As Boolean
    80.        
    81.     Public Shared Function InsertPages(ByVal sourcePdf As String, _
    82.                                        ByVal pagesToInsert As Dictionary(Of Integer, iTextSharp.text.pdf.PdfImportedPage), _
    83.                                        ByVal outPdf As String) As Boolean
    84.        
    85.     Public Shared Function RemovePages(ByVal sourcePdf As String, ByVal pagesToRemove As List(Of Integer), ByVal outputPdf As String) As Boolean
    86.      
    87.     'A demo on how to draw various shapes in itextsharp  
    88.     Public Shared Sub DrawShapesDemo(ByVal sourcePdf As String, ByVal outputPdf As String)
    89.          
    90.     Public Shared Sub AddImageToPage(ByVal sourcePdf As String, ByVal outputPdf As String, ByVal imgPath As String, ByVal imgLocation As Point, ByVal imgSize As Size, Optional ByVal pages() As Integer = Nothing)


    Any comments are welcomed.
    Happy coding
    Stanav.

  10. #90
    New Member
    Join Date
    Dec 2011
    Posts
    3

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Hi, Friends

    I am new to this forum please help me with my problem both source and output pdf files are attached please help me producing the output file as i have more than 500 pages in one source file and more than 20 pdf files.

    Its Very urgent


    - Thanks in Advance
    Attached Images Attached Images

  11. #91

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Quote Originally Posted by Skylimitz View Post
    Hi, Friends

    I am new to this forum please help me with my problem both source and output pdf files are attached please help me producing the output file as i have more than 500 pages in one source file and more than 20 pdf files.

    Its Very urgent


    - Thanks in Advance
    Are you asking me to do the work for you? Sorry, but it doesn't work that way. If you have a coding question than I'll be more than happy to try to give you an answer if I can.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  12. #92
    New Member
    Join Date
    Dec 2011
    Posts
    3

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Thanks for reply

    but please let me know about some technique which can help me doing so please.. help me i don't want u to do the coding but u can post some techniques which can help

    thanks in advance

  13. #93

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Based on the sample pdf files you posted, there is no easy way you can split the source file to get the output you want. You are trying to split the data in 1 pdf page into several pages. To do this, you will need to read the source file data (if possible) and the create new output pdf files on the fly.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  14. #94
    New Member
    Join Date
    Aug 2011
    Posts
    10

    Thumbs up Re: [VB.NET] Pdf Manipulation Class Using iTextSharp

    Dear Stanav,

    Thanks for the valuable post that helped me in my projects.

    I need 1 more input from your side i.e. the way out for removing the PDF file
    restrictions which is encrypted with 256 bit encryption with user and/or owner password.

    Really looking for your expert reply on this.

    thanks n regards....
    RkTech
    ==========================================================
    Quote Originally Posted by stanav View Post
    This thread was originally about extracting and merging pdf files using iTextSharp. However, as time goes by, I have added a lot more code to do other stuff and put them all together into a handy class called PdfManipulation. There are 2 classes as below (choose the one that matches the iTextSharp version you're using):

    1. The original PdfManipulation.vb class is coded based on itextsharp version 4. This class is obsolete and no longer maintained.

    2. The updated PdfManipulation2.vb class is for the newer itextsharp version 5. This class also contains alot more methods than the original one and I highly recommend it over the old one. I will update this class from time to time to fix bugs and/or add more functionality. Consider it's a work in progress

    Please verify the version of iTextSharp you're using and download the correct class.

    Below is the list of public methods in the new PdfManipulation2 class
    vb.net Code:
    1. 'Remove all restrictions from a pdf file
    2.     Public Shared Function RemoveRestrictions(ByVal restrictedPdf As String, Optional ByVal password As String = Nothing, Optional ByVal saveABackup As Boolean = True) As Boolean
    3.    
    4.     'Parse text from a specified range of pdf pages    
    5.     Public Shared Function ParsePdfText(ByVal sourcePDF As String, _
    6.                                   Optional ByVal fromPageNum As Integer = 0, _
    7.                                   Optional ByVal toPageNum As Integer = 0) As String
    8.    
    9.     'Parse all text from a pdf
    10.     Public Shared Function ParseAllPdfText(ByVal sourcePDF As String) As Dictionary(Of Integer, String)
    11.    
    12.     'Page to page comparision of 2 pdf files and write the differences to a resulting text file    
    13.     Public Shared Sub ComparePdfs(ByVal pdf1 As String, ByVal pdf2 As String, _
    14.                                   ByVal resultFile As String, _
    15.                                   Optional ByVal fromPageNum As Integer = 0, _
    16.                                   Optional ByVal toPageNum As Integer = 0)
    17.    
    18.     'Extract specified pages from a pdf to create a new pdf
    19.     Public Shared Sub ExtractPdfPages(ByVal sourcePdf As String, ByVal pageNumbersToExtract As Integer(), ByVal outPdf As String)
    20.  
    21.     'Split a pdf into specified number of pdfs
    22.     Public Shared Sub SplitPdfByParts(ByVal sourcePdf As String, ByVal parts As Integer, ByVal baseNameOutPdf As String)
    23.    
    24.     'Split a pdf into multiple pdfs each containing a specified number of pages.  
    25.     Public Shared Sub SplitPdfByPages(ByVal sourcePdf As String, ByVal numOfPages As Integer, ByVal baseNameOutPdf As String)
    26.    
    27.     'Extract pages from multiple source pdfs and merge into a final pdf    
    28.     Public Shared Sub ExtractAndMergePdfPages(ByVal sourceTable As DataTable, ByVal outPdf As String)
    29.      
    30.     'Set security password on an existing pdf file  
    31.     Public Shared Sub SetSecurityPasswords(ByVal sourcePdf As String, ByVal outputPdf As String, ByVal userPassword As String, ByVal ownerPassword As String)
    32.      
    33.     'Add watermark to pdf pages using an image  
    34.     Public Shared Sub AddWatermarkImage(ByVal sourceFile As String, ByVal outputFile As String, ByVal watermarkImage As String)
    35.    
    36.     'Add water mark to all pdf pages using text    
    37.     Public Shared Sub AddWatermarkText(ByVal sourceFile As String, ByVal outputFile As String, ByVal watermarkText() As String, _
    38.                                        Optional ByVal watermarkFont As iTextSharp.text.pdf.BaseFont = Nothing, _
    39.                                        Optional ByVal watermarkFontSize As Single = 48, _
    40.                                        Optional ByVal watermarkFontColor As iTextSharp.text.BaseColor = Nothing, _
    41.                                        Optional ByVal watermarkFontOpacity As Single = 0.3F, _
    42.                                        Optional ByVal watermarkRotation As Single = 45.0F)
    43.  
    44.     'Merge multiple pdfs into a single one.  
    45.     Public Shared Function MergePdfFiles(ByVal pdfFiles() As String, ByVal outputPath As String, _
    46.                                          Optional ByVal authorName As String = "", _
    47.                                          Optional ByVal creatorName As String = "", _
    48.                                          Optional ByVal subject As String = "", _
    49.                                          Optional ByVal title As String = "", _
    50.                                          Optional ByVal keywords As String = "") As Boolean
    51.  
    52.     'Merge multiple pdf's into one with all bookmarks preserved
    53.     Public Shared Function MergePdfFilesWithBookmarks(ByVal sourcePdfs() As String, ByVal outputPdf As String) As Boolean
    54.        
    55.     'Add document outline (bookmarks) to a pdf
    56.     Public Shared Sub AddDocumentOutline(ByVal sourcePdf As String, ByVal outputPdf As String, ByVal outlineTable As System.Data.DataTable)
    57.      
    58.     'Extract urls from a pdf  
    59.     Public Shared Function ExtractURLs(ByVal sourcePdf As String, Optional ByVal pageNumbers() As Integer = Nothing) As System.Data.DataTable
    60.        
    61.     'Extract images from a pdf
    62.     Public Shared Function ExtractImages(ByVal sourcePdf As String) As List(Of Image)
    63.      
    64.     'Fill a form  
    65.     Public Shared Sub FillAcroForm(ByVal sourcePdf As String, ByVal fieldData As DataRow, ByVal outputPdf As String)
    66.  
    67.     Public Shared Sub FillMyForm(ByVal sourcePdf As String, ByVal fieldData As DataRow, ByVal outputPdf As String)
    68.  
    69.     'Add annotatation
    70.     Public Shared Sub AddTextAnnotation(ByVal sourcePdf As String, ByVal outputPdf As String)
    71.  
    72.     Public Shared Function GetAcroFieldData(ByVal sourcePdf As String) As Dictionary(Of String, String)
    73.        
    74.     Public Shared Function GetPdfSummary(ByVal sourcePdf As String) As DataTable
    75.        
    76.     Public Shared Function ReplacePagesWithBlank(ByVal sourcePdf As String, _
    77.                                                  ByVal pagesToReplace As List(Of Integer), _
    78.                                                  ByVal outPdf As String, _
    79.                                                  Optional ByVal templatePdf As String = "") As Boolean
    80.        
    81.     Public Shared Function InsertPages(ByVal sourcePdf As String, _
    82.                                        ByVal pagesToInsert As Dictionary(Of Integer, iTextSharp.text.pdf.PdfImportedPage), _
    83.                                        ByVal outPdf As String) As Boolean
    84.        
    85.     Public Shared Function RemovePages(ByVal sourcePdf As String, ByVal pagesToRemove As List(Of Integer), ByVal outputPdf As String) As Boolean
    86.      
    87.     'A demo on how to draw various shapes in itextsharp  
    88.     Public Shared Sub DrawShapesDemo(ByVal sourcePdf As String, ByVal outputPdf As String)
    89.          
    90.     Public Shared Sub AddImageToPage(ByVal sourcePdf As String, ByVal outputPdf As String, ByVal imgPath As String, ByVal imgLocation As Point, ByVal imgSize As Size, Optional ByVal pages() As Integer = Nothing)


    Any comments are welcomed.
    Happy coding
    Stanav.

  15. #95

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [VB.NET] Pdf Manipulation Class Using iTextSharp

    Quote Originally Posted by rktech View Post
    Dear Stanav,

    Thanks for the valuable post that helped me in my projects.

    I need 1 more input from your side i.e. the way out for removing the PDF file
    restrictions which is encrypted with 256 bit encryption with user and/or owner password.

    Really looking for your expert reply on this.

    thanks n regards....
    RkTech
    ==========================================================
    As far as I know, the current version of iTextSharp doesn't support AES 256 encryption. Hopefully the developers will implement it in the next release of iTextSharp.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  16. #96
    New Member
    Join Date
    Aug 2011
    Posts
    10

    Re: [VB.NET] Pdf Manipulation Class Using iTextSharp

    thanx 4 ur reply stanav. itext 5.1.1 supports 256 bit encryption.

    Quote Originally Posted by stanav View Post
    As far as I know, the current version of iTextSharp doesn't support AES 256 encryption. Hopefully the developers will implement it in the next release of iTextSharp.

  17. #97

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [VB.NET] Pdf Manipulation Class Using iTextSharp

    Quote Originally Posted by rktech View Post
    thanx 4 ur reply stanav. itext 5.1.1 supports 256 bit encryption.
    Oh, really? I didn't know that. I'm still on 5.0.2 (no immediate need to upgrade yet).
    I still wonder though, if that is the case as you said 5.1.1 supports 256 AES then why wouldn't it work? Have you tried using UTF-8 encoder to convert the password to bytes array and then passing it to the constructor of the pdfreader class? In my code, I was using the system default encoder, which might not be UTF8 in other regions.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  18. #98
    New Member
    Join Date
    Dec 2011
    Posts
    4

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Hi stanav,

    Thank you for this information. It has been very helpful.

    Can the SplitPdfByParts method split a single sheet into 4 seperate sheets by dividing the original sheet into 4 equal quadrants? What I mean by this is down the middle horizontally and vertically.

    Thanks.

  19. #99

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Quote Originally Posted by FullQuiver View Post
    Hi stanav,

    Thank you for this information. It has been very helpful.

    Can the SplitPdfByParts method split a single sheet into 4 seperate sheets by dividing the original sheet into 4 equal quadrants? What I mean by this is down the middle horizontally and vertically.

    Thanks.
    It's much easier to do it the other way around (merging 4 pages into 1 page)
    As for your question, it depends on what kind of data you have in the source pdf page. If you can somehow extract the data from the page, you can then can use that data to create 4 new pages in a new pdf document.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  20. #100
    New Member
    Join Date
    Dec 2011
    Posts
    4

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Thank you for your quick reply. I have multi page pdf's where some of the pages look like the example provided. I need to split those 4 blocks off into individual sheets.

    Thanks for the help.
    Last edited by FullQuiver; Dec 21st, 2011 at 04:32 PM. Reason: Removed Attachment

  21. #101
    New Member
    Join Date
    Aug 2011
    Posts
    10

    Re: [VB.NET] Pdf Manipulation Class Using iTextSharp

    Yes Stanav 5.1.1 supports 256 bit AES. As i treat you as an expert in this PDF subject so it would be great if you try your encoding permutation & combinations in same, as i do have less knowledge in same area.

    Also please lemme know in case of any input or discussion.

    Thanks....
    Take Care..
    ============
    Quote Originally Posted by stanav View Post
    Oh, really? I didn't know that. I'm still on 5.0.2 (no immediate need to upgrade yet).
    I still wonder though, if that is the case as you said 5.1.1 supports 256 AES then why wouldn't it work? Have you tried using UTF-8 encoder to convert the password to bytes array and then passing it to the constructor of the pdfreader class? In my code, I was using the system default encoder, which might not be UTF8 in other regions.

  22. #102

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [VB.NET] Pdf Manipulation Class Using iTextSharp

    Quote Originally Posted by rktech View Post
    Yes Stanav 5.1.1 supports 256 bit AES. As i treat you as an expert in this PDF subject so it would be great if you try your encoding permutation & combinations in same, as i do have less knowledge in same area.

    Also please lemme know in case of any input or discussion.

    Thanks....
    Take Care..
    ============
    I downloaded the newest version of itextsharp 5.1.3 to try out and I can't seem to find any evidence of it supporting AES_256 encryption. If you look at all the encryption constants in the PdfEncryption class, there are only 3: standard_encryption_40, standard_encryption_128 and aes_128. If it supported aes 256, I should've seen the declaration of aes_256 constant.
    Can you provide some links/source where it is confirmed that aes_256 is supported?
    Last edited by stanav; Dec 15th, 2011 at 12:51 PM.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  23. #103
    New Member
    Join Date
    Aug 2011
    Posts
    10

    Re: [VB.NET] Pdf Manipulation Class Using iTextSharp

    Dear Stanav,

    I have checked same in itext 5.1.1 & found PdfWriter.ENCRYPTION_AES_256 in the PdfWriter class.

    Please lemme know for any additional information.

    thanks,
    RkTech

    ===============
    Quote Originally Posted by stanav View Post
    I downloaded the newest version of itextsharp 5.1.3 to try out and I can't seem to find any evidence of it supporting AES_256 encryption. If you look at all the encryption constants in the PdfEncryption class, there are only 3: standard_encryption_40, standard_encryption_128 and aes_128. If it supported aes 256, I should've seen the declaration of aes_256 constant.
    Can you provide some links/source where it is confirmed that aes_256 is supported?

  24. #104

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [VB.NET] Pdf Manipulation Class Using iTextSharp

    Quote Originally Posted by rktech View Post
    Dear Stanav,

    I have checked same in itext 5.1.1 & found PdfWriter.ENCRYPTION_AES_256 in the PdfWriter class.

    Please lemme know for any additional information.

    thanks,
    RkTech

    ===============
    Dear RkTech,
    After I saw your mentioning of PdfWriter.ENCRYPTION_AES_256 constant, I took a closer look at the PdfReader class source code and you're right, it does support AES256. According to Adobe's PDF specification, it uses a new algorithm, 3.2a, to compute the encryption key. This algorithm uses the 1st 127 bytes from an utf-8 password (anything longer gets truncated) + 8 bytes salt + 48 bytes U string and then computes the aes-256 hash of the result to be used as the password bytes array...
    Anyway, I'd give it a try if you can provide me a sample aes-256 password protected pdf.
    Happy Holidays.....
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  25. #105

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Dear RkTech,
    I've made some changes to the PdfManipulation2 class and it now supports opening pdf files with AES-256 password protection. Please download the new version and try it out.

    Happy Holidays.
    Stanav.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  26. #106
    New Member
    Join Date
    Dec 2011
    Posts
    3

    Help! Help! Help! with Windows Registry

    Hi, every one i want to write a program in VB .NET for find the invalid / unreferenced Keys in Registry and fix them please any one tell me the technique by which i can do this stuff or any one can feel free to provide me the Little code

    Thanks in Advance

  27. #107
    New Member
    Join Date
    Feb 2012
    Posts
    1

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Hey Stan,

    I have an access database that creates a PDF report. In this report each page is a separate invoice. Each invoice is the same layout only the data on the pages differ. What i'd like to do is take this PDF report and split each invoice into it's own separate pdf file. Is this something i can use what you have provided us with to do? If so do you have any suggestions on what i can use to complete this.

    Thanks very much for you time!

  28. #108

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Quote Originally Posted by jjsaw5 View Post
    Hey Stan,

    I have an access database that creates a PDF report. In this report each page is a separate invoice. Each invoice is the same layout only the data on the pages differ. What i'd like to do is take this PDF report and split each invoice into it's own separate pdf file. Is this something i can use what you have provided us with to do? If so do you have any suggestions on what i can use to complete this.

    Thanks very much for you time!
    If all the invoices are in the same format (same number of pages) and you know before hand how many pages each individual rinvoice should have, you can use the PdfManipulation2.SplitPdfByPages method which can be found in the PdfManipulation2 class. On the other hand, if the number of pages in each invoice differs, as long as you know the number of pages for each of them, you can modify the above mentioned method a little to have it split the pdf the way you want (it tough to find out how many pages each invoice has though).
    Best luck.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  29. #109
    New Member
    Join Date
    Feb 2012
    Posts
    2

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Hi stanav and thank you for your work
    I want to connect to an encrypted pdf (with digital certificate).
    Can you post a sample of how to do it?

    Thank you!

  30. #110
    New Member
    Join Date
    Mar 2012
    Posts
    2

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Hi All,

    I was wondering if any of you can help me out with my problem - I am calling iTextSharp from VB .Net windows form to create PDF report.

    Ho can I -

    1. Create multiple headers(header1, header 2 etc, logo)
    2. Multiple footers - Page X of Y, some other text etc.
    3. Positioning data on PDF from SQL Server.

    I would really appreciate if any kind soul can give me some direction or code sample.

    Thanks in advance.

    StanMan

  31. #111
    New Member
    Join Date
    Mar 2012
    Posts
    1

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    I'm using PdfManipulation2 with iTextSharp 5.2 and it appears that ExtractPdfPage() may have a significant bug.

    When I perform the following operations on a 3 page document with each page containing a single TIF image (such as a 3-page fax converted to PDF):

    PdfManipulation2.ExtractPdfPage("c:\temp\test.pdf", 1, "c:\temp\test1.pdf")
    PdfManipulation2.ExtractPdfPage("c:\temp\test.pdf", 2, "c:\temp\test2.pdf")
    PdfManipulation2.ExtractPdfPage("c:\temp\test.pdf", 3, "c:\temp\test3.pdf")

    then...
    test1.pdf will be approx 1/3 the size of test.pdf
    test2.pdf will be approx 2/3 the size of test.pdf
    test3.pdf will be just shy of the full size of test.pdf

    When viewed in a PDF viewer, each extracted document will show the proper single page and nothing else. Everything looks fine.

    If i open up test3.pdf and look for the /CCITTFAXDECODE entries, I find 3 of them, one for each page of the original PDF.

    Based on these results, it appears that the ExtractPdfPage function (or the iTextSharp code that it uses) is failing to remove vestiges of the pages which precede the extracted page -- specifically the images they contain.

    Is this bug happening for anyone else? If so, does anyone know how to fix it?

  32. #112

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Quote Originally Posted by jptillman View Post
    I'm using PdfManipulation2 with iTextSharp 5.2 and it appears that ExtractPdfPage() may have a significant bug.

    When I perform the following operations on a 3 page document with each page containing a single TIF image (such as a 3-page fax converted to PDF):

    PdfManipulation2.ExtractPdfPage("c:\temp\test.pdf", 1, "c:\temp\test1.pdf")
    PdfManipulation2.ExtractPdfPage("c:\temp\test.pdf", 2, "c:\temp\test2.pdf")
    PdfManipulation2.ExtractPdfPage("c:\temp\test.pdf", 3, "c:\temp\test3.pdf")

    then...
    test1.pdf will be approx 1/3 the size of test.pdf
    test2.pdf will be approx 2/3 the size of test.pdf
    test3.pdf will be just shy of the full size of test.pdf

    When viewed in a PDF viewer, each extracted document will show the proper single page and nothing else. Everything looks fine.

    If i open up test3.pdf and look for the /CCITTFAXDECODE entries, I find 3 of them, one for each page of the original PDF.

    Based on these results, it appears that the ExtractPdfPage function (or the iTextSharp code that it uses) is failing to remove vestiges of the pages which precede the extracted page -- specifically the images they contain.

    Is this bug happening for anyone else? If so, does anyone know how to fix it?
    Thanks for raising up the issue. Currently, I don't have much free time to investigate the bug. I'll look into it when I have a chance.

    Happy coding.
    Stanav.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  33. #113
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,684

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Just used the code for a post over at the MS Social Forums, works like a charm.

  34. #114
    New Member
    Join Date
    May 2012
    Posts
    11

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Hey Stanav

    I am first time working on PDF documents.I was searching on Rotation of a PDF page. I got some code samples regarding rotations by 90,180,270,360 degrees.

    But my problem is that if there is a very small rotation required of the order of few degrees .....
    Is there any way that we can specify an angle using a slider bar or use the mouse to click and rotate the PDF page...

    Thanks in Advance

    Regards
    Aryan

  35. #115
    New Member
    Join Date
    May 2012
    Posts
    1

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    PDF Manipulation2 is a nice bundle Class, Kindly include the PFX signing function which could add one more feather to the class.

    SunilMogan

  36. #116
    Hyperactive Member
    Join Date
    Mar 2012
    Posts
    281

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    I'm getting confused really bad on this :
    All i need to do is get the bookmarks and the pdf file names they point to.
    all of the bookmarks point to other pdf files which should be on the HD.however i've noticed that at the time i downloaded these files some of the files they were supposed have were not on the server..or i didn't download em or something..

    so now i have 100's of files with missing pdf's..too many to go thru and correct manually.
    So i thought that i could extract the bookmarks and the files they point to..then take those file names add the web address for each one(all located on the same server) and make a download list.
    So i did this
    Code:
    Option Explicit On
    
    Public Class Form1
        'Specified the path to the source pdf file
        Dim sourcePdf As String = "E:\pdfs\1.pdf"
    
      'save as XML file
        Dim outputXML As String = "E:\1.xml"
    
    
        Public Shared Function ExportBookmarksToXML(ByVal sourcePdf As String, ByVal outputXML As String) As Boolean
            Dim result As Boolean = False
            Try
                Dim reader As New iTextSharp.text.pdf.PdfReader(sourcePdf)
                Dim bookmarks As System.Collections.Generic.List(Of System.Collections.Generic.Dictionary(Of String, Object)) = SimpleBookmark.GetBookmark(reader)
                Using outFile As New IO.StreamWriter(outputXML)
                    SimpleBookmark.ExportToXML(bookmarks, outFile, "ISO8859-1", True)
                End Using
                reader.Close()
                result = True
            Catch ex As Exception
                Throw New ApplicationException(ex.Message, ex)
            End Try
            Return result
        End Function
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            ExportBookmarksToXML(sourcePdf, outputXML)
        End Sub
    End Class
    i get errors saying this is not declared so i searched thru the itextSharp zip file and found the ones that were missing..and those started saying this was missing ,that was missing ,this wasn't declared,,it never ended..
    it was like i needed to have every single one of those class files in my project??

    I had to convert those to vb.net tho..luckily i found a bulk converter which worked online.

    So i'm gonna have to ask if someone could PLEASE tell me how i can fix this so i can get it to do what i need it to..i'm going around in circles here,,, or even better still, put all the subs that i need into one module file for me.

    Thanks
    Last edited by M@dH@tter; Jun 2nd, 2012 at 07:52 AM. Reason: found problemo

  37. #117
    Hyperactive Member
    Join Date
    Mar 2012
    Posts
    281

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    well at the time i posted this i didnt know there was a dll hehe i was trying to add all the source code into the project..but now that i've added the .dll it's working good..how can i export to a txt file tho..not xml?

  38. #118
    Hyperactive Member
    Join Date
    Mar 2012
    Posts
    281

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Different question about this ..
    is it possible to use this to edit bookmarks..
    so if my main pdf file has bookmarks to say \1.pdf, \2.pdf. \3.pdf etc,..
    and i wanted to put the bookmarked files into a separate folder instead of having them in with the main pdf file..can i alter the bookmarks to reflect the new directory where they can be found.
    like \temp\1.pdf

    ????

  39. #119

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,289

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    Quote Originally Posted by M@dH@tter View Post
    Different question about this ..
    is it possible to use this to edit bookmarks..
    so if my main pdf file has bookmarks to say \1.pdf, \2.pdf. \3.pdf etc,..
    and i wanted to put the bookmarked files into a separate folder instead of having them in with the main pdf file..can i alter the bookmarks to reflect the new directory where they can be found.
    like \temp\1.pdf

    ????
    Yes, you can do that with iTextSharp. Bookmarks in pdf's are actually annotations, so you might want to look for examples of creating/editing annotations. I'm very busy at the moment and will not have time to write any example code for you. Sorry for that.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  40. #120
    Hyperactive Member
    Join Date
    Mar 2012
    Posts
    281

    Re: [VB.NET] Extract Pages and Split Pdf Files Using iTextSharp

    thanks for the info,,,I'll check into that

Page 3 of 4 FirstFirst 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width