نمایش نتایج 1 تا 11 از 11

نام تاپیک: خواندن فایل epub

  1. #1

    خواندن فایل epub

    با سلام
    دوستان من میخوام توی C#‎ یک epub ریدر بسازم. کسی نمونه یا سورسی که بتونه راهنماییم کنه داره ؟

    ممنونم

  2. #2

    نقل قول: خواندن فایل epub

    سلام
    احتمالا این کمکتون میکنه
    https://github.com/vers-one/EpubReader
    قوانین سایت برنامه نویس [ به سوالات از طریق پیام خصوصی پاسخ داده نمی شود ]

  3. #3

    نقل قول: خواندن فایل epub

    نقل قول نوشته شده توسط محمد آشتیانی مشاهده تاپیک
    سلام
    احتمالا این کمکتون میکنه
    https://github.com/vers-one/EpubReader
    ممنون مهندس عزیز
    اینا رو همه دیدم. اما اجرا نمیشن متاسفانه

  4. #4

    نقل قول: خواندن فایل epub

    سلام
    به درستی کار میکنه ، اگر سخته براتون از گیت هاب گرفتنش ، از طریق نوگت پکیجش رو نصب کنید ، مثالش هم توی همون لینک پست قبل نوشته

    Install-Package VersOne.Epub -Version 2.0.2



    این هم نمونه مثال که عرض کردم در گیت هاب نوشته

    // Opens a book and reads all of its content into memory
    EpubBook epubBook = EpubReader.ReadBook("alice_in_wonderland.epub");



    // COMMON PROPERTIES


    // Book's title
    string title = epubBook.Title;


    // Book's authors (comma separated list)
    string author = epubBook.Author;


    // Book's authors (list of authors names)
    List<string> authors = epubBook.AuthorList;


    // Book's cover image (null if there is no cover)
    byte[] coverImageContent = epubBook.CoverImage;
    if (coverImageContent != null)
    {
    using (MemoryStream coverImageStream = new MemoryStream(coverImageContent))
    {
    Image coverImage = Image.FromStream(coverImageStream);
    }
    }

    // CHAPTERS


    // Enumerating chapters
    foreach (EpubChapter chapter in epubBook.Chapters)
    {
    // Title of chapter
    string chapterTitle = chapter.Title;

    // HTML content of current chapter
    string chapterHtmlContent = chapter.HtmlContent;


    // Nested chapters
    List<EpubChapter> subChapters = chapter.SubChapters;
    }



    // CONTENT


    // Book's content (HTML files, stlylesheets, images, fonts, etc.)
    EpubContent bookContent = epubBook.Content;



    // IMAGES


    // All images in the book (file name is the key)
    Dictionary<string, EpubByteContentFile> images = bookContent.Images;


    EpubByteContentFile firstImage = images.Values.First();


    // Content type (e.g. EpubContentType.IMAGE_JPEG, EpubContentType.IMAGE_PNG)
    EpubContentType contentType = firstImage.ContentType;


    // MIME type (e.g. "image/jpeg", "image/png")
    string mimeContentType = firstImage.ContentMimeType;


    // Creating Image class instance from the content
    using (MemoryStream imageStream = new MemoryStream(firstImage.Content))
    {
    Image image = Image.FromStream(imageStream);
    }




    // HTML & CSS


    // All XHTML files in the book (file name is the key)
    Dictionary<string, EpubTextContentFile> htmlFiles = bookContent.Html;


    // All CSS files in the book (file name is the key)
    Dictionary<string, EpubTextContentFile> cssFiles = bookContent.Css;


    // Entire HTML content of the book
    foreach (EpubTextContentFile htmlFile in htmlFiles.Values)
    {
    string htmlContent = htmlFile.Content;
    }


    // All CSS content in the book
    foreach (EpubTextContentFile cssFile in cssFiles.Values)
    {
    string cssContent = cssFile.Content;
    }




    // OTHER CONTENT


    // All fonts in the book (file name is the key)
    Dictionary<string, EpubByteContentFile> fonts = bookContent.Fonts;


    // All files in the book (including HTML, CSS, images, fonts, and other types of files)
    Dictionary<string, EpubContentFile> allFiles = bookContent.AllFiles;




    // ACCESSING RAW SCHEMA INFORMATION


    // EPUB OPF data
    EpubPackage package = epubBook.Schema.Package;


    // Enumerating book's contributors
    foreach (EpubMetadataContributor contributor in package.Metadata.Contributors)
    {
    string contributorName = contributor.Contributor;
    string contributorRole = contributor.Role;
    }


    // EPUB NCX data
    EpubNavigation navigation = epubBook.Schema.Navigation;


    // Enumerating NCX metadata
    foreach (EpubNavigationHeadMeta meta in navigation.Head)
    {
    string metadataItemName = meta.Name;
    string metadataItemContent = meta.Content;
    }




    بنده خودم تست کردم و به درستی کار کرد
    قوانین سایت برنامه نویس [ به سوالات از طریق پیام خصوصی پاسخ داده نمی شود ]

  5. #5

    نقل قول: خواندن فایل epub

    ممنونم مهندس عزیز. این سورسی که فرمودید رو زدن داخل C#‎ از EpubBook epubBook خطا میگیره . رفرنس خاصی باید اضافه کنم ؟

  6. #6

    نقل قول: خواندن فایل epub

    من اینو وارد کردم اما گیر میده نیست.
    using VersOne.Epub;

  7. #7
    کاربر دائمی آواتار رامین مرادی
    تاریخ عضویت
    اردیبهشت 1389
    محل زندگی
    آذربایجان
    پست
    1,961

    نقل قول: خواندن فایل epub

    نقل قول نوشته شده توسط spsgorgan مشاهده تاپیک
    من اینو وارد کردم اما گیر میده نیست.
    using VersOne.Epub;
    اینو نصب کردید؟
    Install-Package VersOne.Epub -Version 2.0.2
    ابتدا اینو نصب کنید سپس در رفرنسها اددش کنید.متن خطا رو هم بزارید تا بدونیم به چی گیر میده

  8. #8

    نقل قول: خواندن فایل epub

    نقل قول نوشته شده توسط رامین مرادی مشاهده تاپیک
    اینو نصب کردید؟
    Install-Package VersOne.Epub -Version 2.0.2
    ابتدا اینو نصب کنید سپس در رفرنسها اددش کنید.متن خطا رو هم بزارید تا بدونیم به چی گیر میده
    ممنونم عزیز. من همه رفرنسها رو چک کردم. توی ناگت هم نصب کردم . اما خطاهای پیوست رو میده متاسفانه.
    من فایل اصلی رو پیوست کردم . ممنون میشم اگر زحمتی نیست شما هم اجرا بفرمایید . سپاس
    عکس های ضمیمه عکس های ضمیمه
    • نوع فایل: jpg 2.jpg‏ (58.5 کیلوبایت, 19 دیدار)
    • نوع فایل: jpg 1.jpg‏ (25.1 کیلوبایت, 19 دیدار)
    فایل های ضمیمه فایل های ضمیمه

  9. #9

    نقل قول: خواندن فایل epub

    بعد این سورس باwpf هست که من آشنا نیستم . واسه ویندوز فرم معمولی میخوام و توی سورسهاشم نوشته Download .NET Core console demo app که اصلا لود نمیشه و این خطا رو میده :

    C:\Users\SPSDEV\Desktop\EpubReader-master\EpubReader-master\Source\VersOne.Epub\VersOne.Epub.csproj : error : The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. C:\Users\SPSDEV\Desktop\EpubReader-master\EpubReader-master\Source\VersOne.Epub\VersOne.Epub.csproj

    C:\Users\SPSDEV\Desktop\EpubReader-master\EpubReader-master\Source\VersOne.Epub.NetCoreDemo\VersOne.Epu b.NetCoreDemo.csproj : error : The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. C:\Users\SPSDEV\Desktop\EpubReader-master\EpubReader-master\Source\VersOne.Epub.NetCoreDemo\VersOne.Epu b.NetCoreDemo.csproj

    C:\Users\SPSDEV\Desktop\EpubReader-master\EpubReader-master\Source\VersOne.Epub.NetCoreDemo\VersOne.Epu b.NetCoreDemo.csproj : error : The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. C:\Users\SPSDEV\Desktop\EpubReader-master\EpubReader-master\Source\VersOne.Epub.NetCoreDemo\VersOne.Epu b.NetCoreDemo.csproj

  10. #10

    نقل قول: خواندن فایل epub

    نقل قول نوشته شده توسط محمد آشتیانی مشاهده تاپیک
    سلام
    به درستی کار میکنه ، اگر سخته براتون از گیت هاب گرفتنش ، از طریق نوگت پکیجش رو نصب کنید ، مثالش هم توی همون لینک پست قبل نوشته

    Install-Package VersOne.Epub -Version 2.0.2



    این هم نمونه مثال که عرض کردم در گیت هاب نوشته

    // Opens a book and reads all of its content into memory
    EpubBook epubBook = EpubReader.ReadBook("alice_in_wonderland.epub");



    // COMMON PROPERTIES


    // Book's title
    string title = epubBook.Title;


    // Book's authors (comma separated list)
    string author = epubBook.Author;


    // Book's authors (list of authors names)
    List<string> authors = epubBook.AuthorList;


    // Book's cover image (null if there is no cover)
    byte[] coverImageContent = epubBook.CoverImage;
    if (coverImageContent != null)
    {
    using (MemoryStream coverImageStream = new MemoryStream(coverImageContent))
    {
    Image coverImage = Image.FromStream(coverImageStream);
    }
    }

    // CHAPTERS


    // Enumerating chapters
    foreach (EpubChapter chapter in epubBook.Chapters)
    {
    // Title of chapter
    string chapterTitle = chapter.Title;

    // HTML content of current chapter
    string chapterHtmlContent = chapter.HtmlContent;


    // Nested chapters
    List<EpubChapter> subChapters = chapter.SubChapters;
    }



    // CONTENT


    // Book's content (HTML files, stlylesheets, images, fonts, etc.)
    EpubContent bookContent = epubBook.Content;



    // IMAGES


    // All images in the book (file name is the key)
    Dictionary<string, EpubByteContentFile> images = bookContent.Images;


    EpubByteContentFile firstImage = images.Values.First();


    // Content type (e.g. EpubContentType.IMAGE_JPEG, EpubContentType.IMAGE_PNG)
    EpubContentType contentType = firstImage.ContentType;


    // MIME type (e.g. "image/jpeg", "image/png")
    string mimeContentType = firstImage.ContentMimeType;


    // Creating Image class instance from the content
    using (MemoryStream imageStream = new MemoryStream(firstImage.Content))
    {
    Image image = Image.FromStream(imageStream);
    }




    // HTML & CSS


    // All XHTML files in the book (file name is the key)
    Dictionary<string, EpubTextContentFile> htmlFiles = bookContent.Html;


    // All CSS files in the book (file name is the key)
    Dictionary<string, EpubTextContentFile> cssFiles = bookContent.Css;


    // Entire HTML content of the book
    foreach (EpubTextContentFile htmlFile in htmlFiles.Values)
    {
    string htmlContent = htmlFile.Content;
    }


    // All CSS content in the book
    foreach (EpubTextContentFile cssFile in cssFiles.Values)
    {
    string cssContent = cssFile.Content;
    }




    // OTHER CONTENT


    // All fonts in the book (file name is the key)
    Dictionary<string, EpubByteContentFile> fonts = bookContent.Fonts;


    // All files in the book (including HTML, CSS, images, fonts, and other types of files)
    Dictionary<string, EpubContentFile> allFiles = bookContent.AllFiles;




    // ACCESSING RAW SCHEMA INFORMATION


    // EPUB OPF data
    EpubPackage package = epubBook.Schema.Package;


    // Enumerating book's contributors
    foreach (EpubMetadataContributor contributor in package.Metadata.Contributors)
    {
    string contributorName = contributor.Contributor;
    string contributorRole = contributor.Role;
    }


    // EPUB NCX data
    EpubNavigation navigation = epubBook.Schema.Navigation;


    // Enumerating NCX metadata
    foreach (EpubNavigationHeadMeta meta in navigation.Head)
    {
    string metadataItemName = meta.Name;
    string metadataItemContent = meta.Content;
    }




    بنده خودم تست کردم و به درستی کار کرد
    مهندس جان من تونستم لود کنم. میشه راهنمایی کنید من چطوری محتوای epub رو نشون بدم ؟
    // CONTENT


    // Book's content (HTML files, stlylesheets, images, fonts, etc.)
    EpubContent bookContent = epubBook.Content;

    اینجا محتوا میره تو متغییر. حالا من اینو تو چی لود کنم که بتونم مثل epub reader ها تغییر سایز و ... بنویسم ؟

  11. #11

    نقل قول: خواندن فایل epub

    up.........

تاپیک های مشابه

  1. خواندن فایل txt . در ویژوال بیسیک و ریختن آن در یک text box
    نوشته شده توسط احمد حسین بنا در بخش برنامه نویسی در 6 VB
    پاسخ: 5
    آخرین پست: یک شنبه 15 مرداد 1391, 13:42 عصر
  2. خواندن فایل و چگونگی نمایش آن
    نوشته شده توسط golpoo در بخش برنامه نویسی در Delphi
    پاسخ: 5
    آخرین پست: چهارشنبه 20 خرداد 1383, 16:52 عصر
  3. خواندن فایل xml
    نوشته شده توسط zehs_sha در بخش برنامه نویسی در Delphi
    پاسخ: 3
    آخرین پست: پنج شنبه 30 بهمن 1382, 13:17 عصر
  4. خواندن فایل xml
    نوشته شده توسط zehs_sha در بخش برنامه نویسی در 6 VB
    پاسخ: 3
    آخرین پست: دوشنبه 13 بهمن 1382, 11:43 صبح
  5. خواندن فایل unicode
    نوشته شده توسط zehs_sha در بخش برنامه نویسی در 6 VB
    پاسخ: 3
    آخرین پست: شنبه 08 آذر 1382, 20:11 عصر

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •